@wix/ditto-codegen-public 1.0.295 → 1.0.296

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 +47 -11
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -18038,21 +18038,30 @@ var require_opencode_ask = __commonJS({
18038
18038
  var ditto_codegen_types_2 = require_dist4();
18039
18039
  var context_12 = require_context();
18040
18040
  var logger_12 = require_logger();
18041
+ var config_1 = require_config();
18042
+ var biEvents_1 = require_biEvents();
18041
18043
  var runOpencodeAskFlow = async (chatHistory) => {
18042
18044
  const store = job_context_storage_12.jobContextStorage.getStore();
18043
18045
  if (!store?.jobId || !store?.taskId) {
18044
18046
  throw new Error("Job context not available - jobId and taskId are required");
18045
18047
  }
18046
- const localJobContext = {
18047
- jobId: store.jobId,
18048
- taskId: store.taskId
18048
+ const { jobId, taskId, kind } = store;
18049
+ const localJobContext = { jobId, taskId };
18050
+ const biBaseParams = {
18051
+ Job_id: jobId,
18052
+ Task_id: taskId,
18053
+ app_id: context_12.ctx.projectId,
18054
+ Dev_machine_session_id: process.env.CODEGEN_SESSION_ID,
18055
+ run_kind: kind,
18056
+ job_input: JSON.stringify(chatHistory)
18049
18057
  };
18050
- logger_12.logger.info("[OpenCode Ask] Starting task", {
18051
- taskId: localJobContext.taskId
18052
- });
18053
- await codeGenerationService_12.codeGenerationService.updateTask(localJobContext.jobId, localJobContext.taskId, ditto_codegen_types_12.Status.RUNNING, {});
18054
- logger_12.logger.info("[OpenCode Ask] Marked task RUNNING", {
18055
- taskId: localJobContext.taskId
18058
+ logger_12.logger.info("[OpenCode Ask] Starting task", { taskId });
18059
+ await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.RUNNING, {});
18060
+ logger_12.logger.info("[OpenCode Ask] Marked task RUNNING", { taskId });
18061
+ (0, biEvents_1.reportSessionStart)({
18062
+ ...biBaseParams,
18063
+ Task_model: config_1.DEFAULT_MODEL,
18064
+ Task_type: kind
18056
18065
  });
18057
18066
  try {
18058
18067
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
@@ -18063,16 +18072,43 @@ var require_opencode_ask = __commonJS({
18063
18072
  projectId: context_12.ctx.projectId,
18064
18073
  chatHistory
18065
18074
  });
18066
- await codeGenerationService_12.codeGenerationService.updateTask(localJobContext.jobId, localJobContext.taskId, ditto_codegen_types_12.Status.COMPLETED, {
18075
+ await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
18067
18076
  taskOutput: {
18068
18077
  answer: result.answer
18069
18078
  }
18070
18079
  });
18071
- logger_12.logger.info("[OpenCode Ask] Completed task");
18080
+ (0, biEvents_1.reportSessionEnd)({
18081
+ ...biBaseParams,
18082
+ Task_model: config_1.DEFAULT_MODEL,
18083
+ Task_type: kind,
18084
+ Task_cost: Math.round(result.usage.cost * 1e6),
18085
+ Task_status: ditto_codegen_types_12.Status.COMPLETED,
18086
+ Agent_output: JSON.stringify({ answer: result.answer })
18087
+ });
18088
+ logger_12.logger.info("[OpenCode Ask] Completed task", { taskId });
18072
18089
  } catch (error) {
18073
18090
  const codegenError = (0, ditto_codegen_types_2.toCodegenError)(error);
18074
18091
  await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
18092
+ (0, biEvents_1.reportSessionEnd)({
18093
+ ...biBaseParams,
18094
+ Task_model: config_1.DEFAULT_MODEL,
18095
+ Task_type: kind,
18096
+ Task_status: ditto_codegen_types_12.Status.FAILED
18097
+ });
18098
+ (0, biEvents_1.reportSessionError)({
18099
+ ...biBaseParams,
18100
+ task_model: config_1.DEFAULT_MODEL,
18101
+ task_type: kind,
18102
+ Agent_output: JSON.stringify(codegenError),
18103
+ Error_desc: codegenError.errorType,
18104
+ error_massage: codegenError.message,
18105
+ error_json: JSON.stringify(codegenError),
18106
+ is_retryable: codegenError.retryable,
18107
+ is_expected: codegenError.expected,
18108
+ validation_type: codegenError.validationType
18109
+ });
18075
18110
  logger_12.logger.error("[OpenCode Ask] Failed task", {
18111
+ taskId,
18076
18112
  error: error instanceof Error ? error.message : String(error)
18077
18113
  });
18078
18114
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.295",
3
+ "version": "1.0.296",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -27,5 +27,5 @@
27
27
  "@wix/ditto-codegen": "1.0.0",
28
28
  "esbuild": "^0.27.2"
29
29
  },
30
- "falconPackageHash": "573c9d342dec6ea685b4bc2443eadc778217c63ed0bfb2289d23f8a8"
30
+ "falconPackageHash": "70e4d2ee1d465a2ed6701d8d2d7f58175b84d7b45e3afe4c4b7cd351"
31
31
  }