@wix/ditto-codegen-public 1.0.390 → 1.0.392

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.
package/dist/out.js CHANGED
@@ -10861,7 +10861,7 @@ var require_CodeGenService = __commonJS({
10861
10861
  };
10862
10862
  }
10863
10863
  function toJobOutput(payload) {
10864
- const { requiredPermissions, files, extensions, error, agentMessage, userActions, ...rest } = payload;
10864
+ const { requiredPermissions, files, extensions, error, agentMessage, ...rest } = payload;
10865
10865
  return {
10866
10866
  requiredPermissions,
10867
10867
  files: files?.map((file) => ({
@@ -10880,7 +10880,6 @@ var require_CodeGenService = __commonJS({
10880
10880
  })),
10881
10881
  error: toApiError(error),
10882
10882
  agentMessage,
10883
- userActions,
10884
10883
  agentOutput: Object.keys(rest).length > 0 ? rest : void 0
10885
10884
  };
10886
10885
  }
@@ -12180,6 +12179,7 @@ var require_http_impl3 = __commonJS({
12180
12179
  exports2.getCodeGenerationJobStatus = getCodeGenerationJobStatus;
12181
12180
  exports2.generateCode = generateCode;
12182
12181
  exports2.askCodegen = askCodegen;
12182
+ exports2.reportCodeDiagnostic = reportCodeDiagnostic;
12183
12183
  var metro_runtime_1 = require_build();
12184
12184
  var ambassador_1 = require_ambassador_index();
12185
12185
  var metro_runtime_2 = require_build();
@@ -12207,6 +12207,8 @@ var require_http_impl3 = __commonJS({
12207
12207
  var _getDevSessionStatusResponse = { tasks: "_task" };
12208
12208
  var _initializeRequest = {};
12209
12209
  var _initializeResponse = {};
12210
+ var _reportCodeDiagnosticRequest = {};
12211
+ var _reportCodeDiagnosticResponse = {};
12210
12212
  var _restoreRevisionRequest = {};
12211
12213
  var _restoreRevisionResponse = {};
12212
12214
  var _startDevSessionRequest = {};
@@ -12546,6 +12548,29 @@ var require_http_impl3 = __commonJS({
12546
12548
  __askCodegen.__isAmbassador = true;
12547
12549
  return __askCodegen;
12548
12550
  }
12551
+ function reportCodeDiagnostic(payload) {
12552
+ var _a = (0, ambassador_1.serializer)(_reportCodeDiagnosticRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
12553
+ var fromRes = (0, ambassador_1.serializer)(_reportCodeDiagnosticResponse, {}).fromJSON;
12554
+ function __reportCodeDiagnostic(_a2) {
12555
+ var host = _a2.host;
12556
+ var serializedData = toReq(payload);
12557
+ var metadata = {
12558
+ entityFqdn: "wix.code_project.orchestrator.v1.code_project",
12559
+ method: "POST",
12560
+ methodFqn: "com.wixpress.code_project.orchestrator.api.CodeProjectOrchestratorService.ReportCodeDiagnostic",
12561
+ migrationOptions: {
12562
+ optInTransformResponse: true
12563
+ },
12564
+ url: resolveComWixpressCodeProjectOrchestratorApiCodeProjectOrchestratorServiceUrl({ protoPath: "/v1/report-code-diagnostic", data: serializedData, host }),
12565
+ data: serializedData,
12566
+ transformResponse: fromRes
12567
+ };
12568
+ return metadata;
12569
+ }
12570
+ __reportCodeDiagnostic.fromReq = fromReq;
12571
+ __reportCodeDiagnostic.__isAmbassador = true;
12572
+ return __reportCodeDiagnostic;
12573
+ }
12549
12574
  }
12550
12575
  });
12551
12576
 
@@ -14355,7 +14380,6 @@ TOOL USAGE:
14355
14380
  - \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
14356
14381
  - \`wix-generate\` to scaffold extensions non-interactively \u2014 prefer over hand-writing boilerplate; pass an array to scaffold several at once. It RETURNS every created file's contents, so trust that and do NOT \`read\`/\`batch-read\` them afterward. On a \`FAILED\` block, fix the params per the error and retry.
14357
14382
  - \`required-permissions\` \u2014 declare the Wix app permissions the generated code needs (when/whether to call: workflow step 6 + PERMISSIONS).
14358
- - \`user-actions\` \u2014 declare manual setup steps the user must perform (when/whether to call: workflow step 7 + USER ACTIONS).
14359
14383
  - Package dependencies \u2014 \`npm install <pkg>\` any package not already in \`package.json\` BEFORE the first \`validate\` (do NOT wait for \`TS2307\`); install all needed packages in ONE command. Do NOT hand-edit \`package.json\` for deps unless npm cannot be used.
14360
14384
  - File operations \u2014 pick the BATCH tool whenever you have 2+ files; the single-file variants are 5\u201310\xD7 slower:
14361
14385
  - \`batch-write\` to create N new files in one call. NEVER call \`write\` more than once per turn \u2014 use batch-write instead. \`write\` is reserved for single-file creation.
@@ -14377,7 +14401,7 @@ IMPLEMENTATION WORKFLOW:
14377
14401
  4. **Register**: Register all extensions in \`src/extensions.ts\`. Include a \`progress\` call (e.g. "Registering extensions").
14378
14402
  5. **Validate**: Run \`validate\` (typecheck only). Fix any errors and re-validate until tsc passes. Include a \`progress\` call (e.g. "Running type checks"). Then run \`validate({ runBuild: true })\` ONCE to verify the build. Pass \`installDeps: true\` ONLY when \`package.json\` changed without already running \`npm install <package-name>\` in this iteration; otherwise omit it (node_modules is pre-installed). Include a \`progress\` call (e.g. "Building project").
14379
14403
  6. **Declare permissions**: If the generated code requires Wix app permissions, call \`required-permissions\` ONCE with their SCOPE IDs (see PERMISSIONS below). Skip this step entirely if no permissions are needed.
14380
- 7. **Declare user actions**: If the user must perform manual steps for the app to work, call \`user-actions\` ONCE with them (see USER ACTIONS below). Skip this step entirely if there are none.
14404
+ 7. **Final message**: Your last message is returned to the user as the codegen output \u2014 keep it short and plain (a sentence or two on what the app now does).
14381
14405
  8. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
14382
14406
 
14383
14407
  FILE CREATION:
@@ -14394,25 +14418,7 @@ When you call \`required-permissions\` (see workflow step 6 for when), use SCOPE
14394
14418
  - Embedded scripts \u2192 "SCOPE.DC-APPS.MANAGE-EMBEDDED-SCRIPTS"
14395
14419
 
14396
14420
  CRITICAL: Only include permissions you have explicitly seen in the Wix SDK documentation (via MCP or loaded skills) \u2014 NEVER guess or infer a scope ID. If you cannot point to where you saw it, do NOT include it. When in doubt, skip the call entirely. A fabricated scope ID will show an error to the user and confuse them; a missing permission is just a warning the user can fix.
14397
-
14398
- USER ACTIONS:
14399
- A user action is manual setup the app needs to ACTUALLY WORK \u2014 either OUTSIDE Wix (third-party API keys, connecting an external account, registering a webhook elsewhere) or INSIDE Wix that you could not do in code (e.g. creating a Wix Triggered Email template, configuring a Wix Automation, adding a value in Secrets Manager). (When/whether to call: workflow step 7.)
14400
- \`output\` is a single markdown string rendered directly to the user: a short intro line + a bulleted/numbered list. FORMAT TIGHTLY \u2014 a SINGLE \`\\n\` between every line (intro\u2192first item AND between items); NEVER blank lines (\`\\n\\n\`), which make the client render each item with extra spacing. Example:
14401
- "After installing the app, complete these steps:\\n1. **Add your Stripe secret key** \u2014 open the app's settings and paste your Stripe secret key.\\n2. **Create the stock-alert email template** \u2014 in your Wix dashboard, create a Triggered Email template so subscribers receive the alert email."
14402
-
14403
- AUDIENCE \u2014 say WHO performs each step. Most third-party credentials and dashboard setup (their API key, creating a Triggered Email template, configuring an automation) are done by the SITE OWNER who installs the app, NOT the developer \u2014 phrase those as "After installing the app, \u2026" or "The site owner must \u2026". Use developer-facing phrasing only for steps the developer genuinely performs (in Dev Center / the app's own settings).
14404
-
14405
- CRITICAL \u2014 a user action is something the USER does in a dashboard, UI, or external system. It is NEVER a coding task. Do NOT ask the user to write, add, or modify code, call an API from the codebase, wire up logic, or "finish" an implementation \u2014 that is YOUR job. If a step can be done in code, you MUST do it now, not declare it. (E.g. if a feature needs to send an email, write the sending code yourself; only the dashboard email-template setup is a user action.)
14406
-
14407
- CRITICAL \u2014 declare ONLY steps the app REQUIRES to function as built. Do NOT include optional customizations, "for future" tweaks, nice-to-haves, or steps for an alternative path you did not implement. Every action must be mandatory for the app to work.
14408
-
14409
- If a feature only works once the user does required manual setup (e.g. you logged a notification intent because the actual email needs a Triggered Email template), you MUST declare that step here \u2014 do NOT bury it in prose or leave it unsaid.
14410
-
14411
- Do NOT include the steps Wix already handles through its own flows:
14412
- - ANYTHING about permissions or scopes \u2014 adding, granting, enabling, or configuring a permission/scope, whether in Dev Center or the dashboard. These are declared EXCLUSIVELY via the \`required-permissions\` tool.
14413
- - Releasing a new app version.
14414
- - Publishing the site.
14415
- Also do NOT include things you already did in code (created files, registered extensions) or things the app does automatically on install. In particular, a site plugin configured with \`installation: { autoAdd: true }\` is placed on its slot automatically \u2014 NEVER tell the user to add it in the Editor. Only declare manual placement for slots that don't support auto-add (e.g. the checkout page).`;
14421
+ `;
14416
14422
  }
14417
14423
  });
14418
14424
 
@@ -14767,10 +14773,6 @@ var require_config = __commonJS({
14767
14773
  [
14768
14774
  "required-permissions"
14769
14775
  /* OpenCodeTool.RequiredPermissions */
14770
- ]: "deny",
14771
- [
14772
- "user-actions"
14773
- /* OpenCodeTool.UserActions */
14774
14776
  ]: "deny"
14775
14777
  };
14776
14778
  var ASK_PERMISSIONS = {
@@ -14874,38 +14876,12 @@ var require_types4 = __commonJS({
14874
14876
  }
14875
14877
  });
14876
14878
 
14877
- // dist/opencode-integration/normalize-tool-string.js
14878
- var require_normalize_tool_string = __commonJS({
14879
- "dist/opencode-integration/normalize-tool-string.js"(exports2) {
14880
- "use strict";
14881
- Object.defineProperty(exports2, "__esModule", { value: true });
14882
- exports2.normalizeToolString = normalizeToolString;
14883
- function unescapeString(str) {
14884
- return str.replace(/\\(n|t|r|"|\\)/g, (_, c) => {
14885
- if (c === "n")
14886
- return "\n";
14887
- if (c === "t")
14888
- return " ";
14889
- if (c === "r")
14890
- return "\r";
14891
- if (c === '"')
14892
- return '"';
14893
- return "\\";
14894
- });
14895
- }
14896
- function normalizeToolString(text) {
14897
- return unescapeString(text).replace(/\r\n/g, "\n");
14898
- }
14899
- }
14900
- });
14901
-
14902
14879
  // dist/opencode-integration/parser.js
14903
14880
  var require_parser = __commonJS({
14904
14881
  "dist/opencode-integration/parser.js"(exports2) {
14905
14882
  "use strict";
14906
14883
  Object.defineProperty(exports2, "__esModule", { value: true });
14907
14884
  exports2.parseRequiredPermissions = parseRequiredPermissions;
14908
- exports2.parseUserActions = parseUserActions;
14909
14885
  exports2.parseAnswerText = parseAnswerText;
14910
14886
  exports2.createEmptyUsageStats = createEmptyUsageStats;
14911
14887
  exports2.parseUsageStats = parseUsageStats;
@@ -14913,10 +14889,6 @@ var require_parser = __commonJS({
14913
14889
  exports2.hasSessionError = hasSessionError;
14914
14890
  exports2.summarizeOpenCodeLine = summarizeOpenCodeLine;
14915
14891
  var types_1 = require_types4();
14916
- var normalize_tool_string_1 = require_normalize_tool_string();
14917
- function parseEvents(output, type) {
14918
- return output.split("\n").filter((line) => line.trim()).map((line) => (0, types_1.tryParseJson)(line)).filter((event) => event !== null && event.type === type);
14919
- }
14920
14892
  function parseRequiredPermissions(output) {
14921
14893
  let permissions = [];
14922
14894
  const lines = output.split("\n");
@@ -14934,25 +14906,9 @@ var require_parser = __commonJS({
14934
14906
  }
14935
14907
  return permissions;
14936
14908
  }
14937
- function parseUserActions(output) {
14938
- let markdown = "";
14939
- const lines = output.split("\n");
14940
- for (const line of lines) {
14941
- if (!line.trim())
14942
- continue;
14943
- const event = (0, types_1.tryParseJson)(line);
14944
- if (!event || event.type !== "tool_use" || event.part?.tool !== "user-actions" || event.part.state?.status !== "completed") {
14945
- continue;
14946
- }
14947
- const declared = event.part.state.input?.output;
14948
- if (typeof declared !== "string")
14949
- continue;
14950
- markdown = (0, normalize_tool_string_1.normalizeToolString)(declared);
14951
- }
14952
- return markdown;
14953
- }
14954
14909
  function parseAnswerText(output) {
14955
- return parseEvents(output, "text").map((event) => event.part?.text).filter(Boolean).join("").trim();
14910
+ const messages = output.split("\n").map((line) => (0, types_1.tryParseJson)(line)).filter((event) => event?.type === "text").map((event) => event.part?.text ?? "");
14911
+ return (messages[messages.length - 1] ?? "").trim();
14956
14912
  }
14957
14913
  function createEmptyUsageStats() {
14958
14914
  return {
@@ -15461,7 +15417,7 @@ var require_result_builder = __commonJS({
15461
15417
  exitCode: null,
15462
15418
  stdout,
15463
15419
  stderr,
15464
- userActions: (0, parser_1.parseUserActions)(stdout),
15420
+ agentMessage: (0, parser_1.parseAnswerText)(stdout),
15465
15421
  error: new ditto_codegen_types_12.TimeoutError(message),
15466
15422
  durationMs: Date.now() - startTime,
15467
15423
  requiredPermissions: [],
@@ -15475,7 +15431,7 @@ var require_result_builder = __commonJS({
15475
15431
  exitCode: code,
15476
15432
  stdout,
15477
15433
  stderr,
15478
- userActions: (0, parser_1.parseUserActions)(stdout),
15434
+ agentMessage: (0, parser_1.parseAnswerText)(stdout),
15479
15435
  error: code !== 0 ? new ditto_codegen_types_12.ProcessExecutionError(`Code generation process exited unexpectedly (exit code ${code})`, {
15480
15436
  processType: ditto_codegen_types_12.ProcessType.EXECUTION,
15481
15437
  exitCode: code ?? void 0,
@@ -15493,7 +15449,7 @@ var require_result_builder = __commonJS({
15493
15449
  exitCode: null,
15494
15450
  stdout,
15495
15451
  stderr,
15496
- userActions: (0, parser_1.parseUserActions)(stdout),
15452
+ agentMessage: (0, parser_1.parseAnswerText)(stdout),
15497
15453
  error: new ditto_codegen_types_12.ProcessExecutionError(`Failed to start code generation process: ${errorMessage}`, {
15498
15454
  processType: ditto_codegen_types_12.ProcessType.SPAWN,
15499
15455
  stderr
@@ -15618,7 +15574,6 @@ var require_executor = __commonJS({
15618
15574
  var MAX_RETRIES = 5;
15619
15575
  async function executeOpenCode(options) {
15620
15576
  let lastResult = null;
15621
- let accumulatedStdout = "";
15622
15577
  let accumulatedUsage = (0, parser_1.createEmptyUsageStats)();
15623
15578
  const accumulatedSkills = [];
15624
15579
  let currentPrompt = options.prompt;
@@ -15631,7 +15586,6 @@ var require_executor = __commonJS({
15631
15586
  continueSession = false;
15632
15587
  }
15633
15588
  const result = await executeOpenCodeOnce({ ...options, prompt: currentPrompt, continueSession }, attempt);
15634
- accumulatedStdout += result.stdout;
15635
15589
  accumulatedUsage = (0, parser_1.mergeUsageStats)(accumulatedUsage, result.usage);
15636
15590
  accumulatedSkills.push(...result.skillsUsed);
15637
15591
  const errorMsg = result.error?.message.toLowerCase() ?? "";
@@ -15641,7 +15595,7 @@ var require_executor = __commonJS({
15641
15595
  if (!isRetryableFailure) {
15642
15596
  const finalResult2 = {
15643
15597
  ...result,
15644
- userActions: (0, parser_1.parseUserActions)(accumulatedStdout),
15598
+ agentMessage: (0, parser_1.parseAnswerText)(result.stdout),
15645
15599
  usage: accumulatedUsage,
15646
15600
  skillsUsed: accumulatedSkills
15647
15601
  };
@@ -15661,7 +15615,7 @@ var require_executor = __commonJS({
15661
15615
  });
15662
15616
  const finalResult = {
15663
15617
  ...lastResult,
15664
- userActions: (0, parser_1.parseUserActions)(accumulatedStdout),
15618
+ agentMessage: (0, parser_1.parseAnswerText)(lastResult.stdout),
15665
15619
  usage: accumulatedUsage,
15666
15620
  skillsUsed: Array.from(accumulatedSkills)
15667
15621
  };
@@ -15741,7 +15695,7 @@ var require_executor = __commonJS({
15741
15695
  exitCode: null,
15742
15696
  stdout: state.stdout,
15743
15697
  stderr: state.stderr,
15744
- userActions: (0, parser_1.parseUserActions)(state.stdout),
15698
+ agentMessage: (0, parser_1.parseAnswerText)(state.stdout),
15745
15699
  error: new ditto_codegen_types_12.ProcessExecutionError(`Code generation process failed to run: ${error instanceof Error ? error.message : String(error)}`, {
15746
15700
  processType: ditto_codegen_types_12.ProcessType.EXECUTION,
15747
15701
  cause: error
@@ -21258,7 +21212,7 @@ var require_opencode_init = __commonJS({
21258
21212
  await (0, inject_created_by_1.injectCreatedByIntoExtensionFiles)(outputPath, extensions.created);
21259
21213
  await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
21260
21214
  requiredPermissions: result.requiredPermissions,
21261
- userActions: result.userActions,
21215
+ agentMessage: result.agentMessage,
21262
21216
  files,
21263
21217
  ...agentOutput,
21264
21218
  extensions
@@ -21448,7 +21402,7 @@ var require_opencode_iterate = __commonJS({
21448
21402
  await (0, inject_created_by_1.injectCreatedByIntoExtensionFiles)(outputPath, extensions.created);
21449
21403
  await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
21450
21404
  requiredPermissions: result.requiredPermissions,
21451
- userActions: result.userActions,
21405
+ agentMessage: result.agentMessage,
21452
21406
  files,
21453
21407
  ...agentOutput,
21454
21408
  extensions
@@ -21809,6 +21763,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
21809
21763
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
21810
21764
  await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
21811
21765
  requiredPermissions: result.requiredPermissions,
21766
+ agentMessage: result.agentMessage,
21812
21767
  files,
21813
21768
  extensions
21814
21769
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.390",
3
+ "version": "1.0.392",
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": "9b45bb2de4fcb1d63f7931a7b9b7c5dddc0550f7215b0e50ae0cb030"
32
+ "falconPackageHash": "21cc8ff8d30c29e8c863a93537348123a515d8b91e3688664ccb0e14"
33
33
  }
@@ -1,19 +0,0 @@
1
- import { tool } from "@opencode-ai/plugin";
2
-
3
- export default tool({
4
- description:
5
- "Declare the manual setup steps the user must perform for the generated app to " +
6
- "work, as a single markdown string. Call once at the end, only if such setup is " +
7
- "required.",
8
- args: {
9
- output: tool.schema
10
- .string()
11
- .describe(
12
- "The setup steps, as markdown (a short intro line followed by a bulleted or " +
13
- "numbered list). Rendered directly to the user.",
14
- ),
15
- },
16
- async execute(args) {
17
- return `✓ recorded user actions (${args.output.length} chars)`;
18
- },
19
- });