@wix/ditto-codegen-public 1.0.431 → 1.0.432

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 +23 -10
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -22133,11 +22133,19 @@ var require_biEvents = __commonJS({
22133
22133
  var types_1 = require_types_impl();
22134
22134
  var biLogger_1 = require_biLogger();
22135
22135
  var logger_12 = require_logger();
22136
+ var MAX_JOB_INPUT_LENGTH = 3e4;
22137
+ var TRUNCATION_SUFFIX = "\u2026";
22136
22138
  var JOB_STATUS_MAP = {
22137
22139
  COMPLETED: "successful",
22138
22140
  FAILED: "error",
22139
22141
  CANCELLED: "stopped"
22140
22142
  };
22143
+ function truncateJobInput(jobInput) {
22144
+ if (!jobInput || jobInput.length <= MAX_JOB_INPUT_LENGTH) {
22145
+ return jobInput;
22146
+ }
22147
+ return jobInput.slice(0, MAX_JOB_INPUT_LENGTH - TRUNCATION_SUFFIX.length) + TRUNCATION_SUFFIX;
22148
+ }
22141
22149
  function skillsArrayToMap(skills) {
22142
22150
  const map = {};
22143
22151
  for (const skill of skills) {
@@ -22168,6 +22176,7 @@ var require_biEvents = __commonJS({
22168
22176
  }
22169
22177
  const codegenAgentParams = {
22170
22178
  job_id: report.jobId,
22179
+ job_input: truncateJobInput(report.jobInput),
22171
22180
  extra_data: report.extraData,
22172
22181
  Job_cost: report.jobCost,
22173
22182
  dev_machine_session_id: report.devMachineSessionId,
@@ -22377,7 +22386,7 @@ var require_opencode_init = __commonJS({
22377
22386
  if (!store?.jobId || !store?.taskId) {
22378
22387
  throw new Error("Job context not available - jobId and taskId are required");
22379
22388
  }
22380
- const { jobId, taskId, kind } = store;
22389
+ const { jobId, taskId, kind, userInput } = store;
22381
22390
  const localJobContext = { jobId, taskId };
22382
22391
  const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
22383
22392
  const flowStartTime = Date.now();
@@ -22397,7 +22406,8 @@ var require_opencode_init = __commonJS({
22397
22406
  await (0, biEvents_1.reportSessionStart)({
22398
22407
  ...biBase,
22399
22408
  taskModel: config_12.DEFAULT_MODEL,
22400
- taskType: kind
22409
+ taskType: kind,
22410
+ jobInput: userInput
22401
22411
  });
22402
22412
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
22403
22413
  const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
@@ -22590,7 +22600,7 @@ var require_opencode_iterate = __commonJS({
22590
22600
  if (!store?.jobId || !store?.taskId) {
22591
22601
  throw new Error("Job context not available - jobId and taskId are required");
22592
22602
  }
22593
- const { jobId, taskId, kind } = store;
22603
+ const { jobId, taskId, kind, userInput } = store;
22594
22604
  const localJobContext = { jobId, taskId };
22595
22605
  const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
22596
22606
  const flowStartTime = Date.now();
@@ -22610,7 +22620,8 @@ var require_opencode_iterate = __commonJS({
22610
22620
  await (0, biEvents_1.reportSessionStart)({
22611
22621
  ...biBase,
22612
22622
  taskModel: config_12.DEFAULT_MODEL,
22613
- taskType: kind
22623
+ taskType: kind,
22624
+ jobInput: userInput
22614
22625
  });
22615
22626
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
22616
22627
  const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
@@ -22787,7 +22798,7 @@ var require_opencode_ask = __commonJS({
22787
22798
  if (!store?.jobId || !store?.taskId) {
22788
22799
  throw new Error("Job context not available - jobId and taskId are required");
22789
22800
  }
22790
- const { jobId, taskId, kind } = store;
22801
+ const { jobId, taskId, kind, userInput } = store;
22791
22802
  const localJobContext = { jobId, taskId };
22792
22803
  const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
22793
22804
  const flowStartTime = Date.now();
@@ -22807,7 +22818,8 @@ var require_opencode_ask = __commonJS({
22807
22818
  await (0, biEvents_1.reportSessionStart)({
22808
22819
  ...biBase,
22809
22820
  taskModel: config_12.DEFAULT_MODEL,
22810
- taskType: kind
22821
+ taskType: kind,
22822
+ jobInput: userInput
22811
22823
  });
22812
22824
  const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
22813
22825
  const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
@@ -23637,11 +23649,10 @@ async function main(ctx) {
23637
23649
  var getFirstTask = (job) => {
23638
23650
  return job.tasks?.[0];
23639
23651
  };
23640
- function buildPluginsForTask(jobId, taskId, kind, payload) {
23652
+ function buildPluginsForTask(jobId, taskId, kind, userInput) {
23641
23653
  if (kind !== CodeGenService_1.TaskKind.INIT_CODEGEN && kind !== CodeGenService_1.TaskKind.ITERATE_CODEGEN && kind !== CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS) {
23642
23654
  return void 0;
23643
23655
  }
23644
- const userInput = extractUserInput(kind, payload);
23645
23656
  const host = (0, plugin_host_1.buildPluginHost)();
23646
23657
  return (0, environments_1.getCodegenEnvironmentConfig)().plugins.map((factory) => factory({
23647
23658
  host,
@@ -23659,7 +23670,7 @@ function extractUserInput(kind, payload) {
23659
23670
  if (kind === CodeGenService_1.TaskKind.INIT_CODEGEN) {
23660
23671
  return payload.blueprint?.summary?.trim() || void 0;
23661
23672
  }
23662
- if (kind === CodeGenService_1.TaskKind.ITERATE_CODEGEN || kind === CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS) {
23673
+ if (kind === CodeGenService_1.TaskKind.ITERATE_CODEGEN || kind === CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS || kind === CodeGenService_1.TaskKind.ASK_CODEGEN) {
23663
23674
  const history = payload.history ?? [];
23664
23675
  for (let i = history.length - 1; i >= 0; i--) {
23665
23676
  if (history[i].role === "USER") {
@@ -23680,12 +23691,14 @@ async function processJob(job) {
23680
23691
  return;
23681
23692
  }
23682
23693
  const payload = task.input ?? task.payload ?? {};
23683
- const plugins = buildPluginsForTask(jobId, task.id, task.kind, payload);
23694
+ const userInput = extractUserInput(task.kind, payload);
23695
+ const plugins = buildPluginsForTask(jobId, task.id, task.kind, userInput);
23684
23696
  await job_context_storage_1.jobContextStorage.run({
23685
23697
  jobId,
23686
23698
  taskId: task.id,
23687
23699
  kind: task.kind,
23688
23700
  plugins,
23701
+ userInput,
23689
23702
  metasiteId: context_1.ctx.metasiteId
23690
23703
  }, async () => {
23691
23704
  logger_1.logger.info("[Job] Start processing", { taskKind: task.kind });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.431",
3
+ "version": "1.0.432",
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": "85a0210cddb251eaf19067e588dd30dc2a73f6bb94352b5b386068d3"
32
+ "falconPackageHash": "138387ddb94767f45627512cde3a8a5d6dd67ce1200ce29873f584f9"
33
33
  }