@wix/ditto-codegen-public 1.0.379 → 1.0.381
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 +38 -72
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -14273,36 +14273,25 @@ var require_codegen_rules = __commonJS({
|
|
|
14273
14273
|
- Do NOT create test files or test code. Tests are out of scope for code generation.
|
|
14274
14274
|
|
|
14275
14275
|
MINIMIZE TEXT OUTPUT \u2014 CRITICAL:
|
|
14276
|
-
- Do NOT narrate your actions
|
|
14277
|
-
- Do NOT explain what you just did. The tool output speaks for itself.
|
|
14276
|
+
- Do NOT narrate or explain your actions \u2014 no "Let me now...", "Perfect!", "Now I'll...", "Excellent!", "Great!". The tool output speaks for itself.
|
|
14278
14277
|
- Do NOT read back files you just wrote. Trust the write succeeded.
|
|
14279
14278
|
- Every text token costs money. Use tools, not words.
|
|
14280
14279
|
|
|
14281
14280
|
TOOL USAGE:
|
|
14282
|
-
- \`progress\` to mark a step done. Call it ONCE per completed step, in the SAME response as the tool calls that did the work \u2014 never dedicate a separate turn to it. Report progress at EVERY meaningful milestone. Keep descriptions SHORT \u2014 mention the extension type but no file names, counts, namespaces, or other specifics.
|
|
14283
|
-
- "Planning extensions"
|
|
14284
|
-
- "Reading documentation"
|
|
14285
|
-
- "Creating dashboard page"
|
|
14286
|
-
- "Creating service plugin"
|
|
14287
|
-
- "Creating data collection"
|
|
14288
|
-
- "Registering extensions"
|
|
14289
|
-
- "Running type checks"
|
|
14290
|
-
- "Building project"
|
|
14281
|
+
- \`progress\` to mark a step done. Call it ONCE per completed step, in the SAME response as the tool calls that did the work \u2014 never dedicate a separate turn to it. Report progress at EVERY meaningful milestone (the IMPLEMENTATION WORKFLOW steps below give the exact wording to use). Keep descriptions SHORT \u2014 mention the extension type but no file names, counts, namespaces, or other specifics.
|
|
14291
14282
|
- \`validate\` for all validation (tsc + build).
|
|
14292
14283
|
- \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
|
|
14293
|
-
- \`wix-generate\` to scaffold extensions non-interactively
|
|
14294
|
-
- \`required-permissions\`
|
|
14295
|
-
- \`user-actions\`
|
|
14296
|
-
- Package dependencies \u2014
|
|
14284
|
+
- \`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.
|
|
14285
|
+
- \`required-permissions\` \u2014 declare the Wix app permissions the generated code needs (when/whether to call: workflow step 6 + PERMISSIONS).
|
|
14286
|
+
- \`user-actions\` \u2014 declare manual setup steps the user must perform (when/whether to call: workflow step 7 + USER ACTIONS).
|
|
14287
|
+
- 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.
|
|
14297
14288
|
- File operations \u2014 pick the BATCH tool whenever you have 2+ files; the single-file variants are 5\u201310\xD7 slower:
|
|
14298
14289
|
- \`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.
|
|
14299
14290
|
- \`batch-read\` to read N files in one call. NEVER call \`read\` more than once per turn \u2014 use batch-read instead.
|
|
14300
|
-
- \`multi-edit\` to apply N find-and-replace edits across one or more files in one call. NEVER call \`edit\` more than once per turn \u2014 use multi-edit instead. \`edit\` is reserved for a single edit to one file.
|
|
14291
|
+
- \`multi-edit\` to apply N find-and-replace edits across one or more files in one call. NEVER call \`edit\` more than once per turn \u2014 use multi-edit instead. \`edit\` is reserved for a single edit to one file. When fixing type errors across N files, use ONE \`multi-edit\` with all N edits.
|
|
14301
14292
|
- Tool arguments are strict JSON. For multiline strings in \`write\`, \`edit\`, \`batch-write\`, and \`multi-edit\`, use JSON escape sequences (\`\\n\`, \`\\t\`, \`\\"\`) \u2014 do NOT put raw (unescaped) newlines inside JSON string values (that breaks parsing). \`batch-write\` and \`multi-edit\` also normalize literal two-character escape sequences before writing; prefer proper JSON escapes.
|
|
14302
14293
|
- For tools where no batch variant exists (e.g. \`grep\`, \`glob\`), still emit MULTIPLE \`tool_use\` blocks in a SINGLE response when the calls are independent. Sequential turns waste a model round-trip per call.
|
|
14303
|
-
-
|
|
14304
|
-
- When using MCP to look up a Wix SDK method, ALWAYS call \`ReadFullDocsMethodSchema\` (not just \`ReadFullDocsArticle\`). The schema is the source of truth for parameter shapes. Code examples in docs may use incorrect call signatures.
|
|
14305
|
-
- To discover API shapes, method signatures, or type definitions: ALWAYS try \`SearchWixSDKDocumentation\` or \`ReadFullDocsMethodSchema\` via wix-mcp first. ONLY fall back to grepping \`node_modules\` if the MCP tools return no useful results. Grepping \`node_modules\` as a first resort wastes turns, inflates context, and produces unreliable results \u2014 SDK internals are not a documentation source. ENFORCED: after 2 such lookups, further bash inspection of \`node_modules\` Wix/vite/astro internals is rejected.
|
|
14294
|
+
- API discovery (shapes, method signatures, types) \u2014 in this order: (1) loaded skills, if they already cover the API; (2) wix-mcp docs \u2014 \`SearchWixSDKDocumentation\` and \`ReadFullDocsMethodSchema\` (ALWAYS read the schema, not just \`ReadFullDocsArticle\`: it is the source of truth for parameter shapes, since doc code examples may use incorrect call signatures); (3) grepping \`node_modules\` ONLY as a last resort if the above return nothing \u2014 SDK internals are not a documentation source, and doing it first wastes turns, inflates context, and is unreliable. ENFORCED: after 2 such lookups, further bash inspection of \`node_modules\` Wix/vite/astro internals is rejected.
|
|
14306
14295
|
- NEVER run preview, dev, release, or promote commands.
|
|
14307
14296
|
|
|
14308
14297
|
KNOWN WIX APIS (already documented \u2014 do NOT rediscover these from node_modules; for full detail consult the \`wix-app\` skill's references or \`ReadFullDocsMethodSchema\`):
|
|
@@ -14312,17 +14301,13 @@ KNOWN WIX APIS (already documented \u2014 do NOT rediscover these from node_modu
|
|
|
14312
14301
|
IMPLEMENTATION WORKFLOW:
|
|
14313
14302
|
1. **Plan**: Determine extension types using the \`wix-app\` skill. Generate ALL UUIDs upfront. Include a \`progress\` call (e.g. "Planning extensions").
|
|
14314
14303
|
2. **Research**: Load relevant SDK docs and skills for each extension type. Include a \`progress\` call (e.g. "Reading documentation").
|
|
14315
|
-
3. **Build**: Write files incrementally \u2014 group by logical section, NOT all at once. For complex tasks (300+ total lines across files), split into multiple \`batch-write\` calls. NEVER hold back writing until all code is planned \u2014 write each logical piece as soon as it is ready. Build all extensions before registering. Include one \`progress\` call per extension type (e.g. "Creating dashboard page", "Creating service plugin").
|
|
14304
|
+
3. **Build**: Write files incrementally \u2014 group by logical section, NOT all at once. For complex tasks (300+ total lines across files), split into multiple \`batch-write\` calls. NEVER hold back writing until all code is planned \u2014 write each logical piece as soon as it is ready. Build all extensions before registering. Include one \`progress\` call per extension type (e.g. "Creating dashboard page", "Creating service plugin", "Creating data collection").
|
|
14316
14305
|
4. **Register**: Register all extensions in \`src/extensions.ts\`. Include a \`progress\` call (e.g. "Registering extensions").
|
|
14317
14306
|
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").
|
|
14318
14307
|
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.
|
|
14319
14308
|
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.
|
|
14320
14309
|
8. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
|
|
14321
14310
|
|
|
14322
|
-
EFFICIENCY:
|
|
14323
|
-
- Always prefer the BATCH variant: \`batch-write\` over multiple \`write\`s, \`batch-read\` over multiple \`read\`s, \`multi-edit\` over multiple \`edit\`s.
|
|
14324
|
-
- When fixing type errors across N files, use ONE \`multi-edit\` call with all N edits.
|
|
14325
|
-
|
|
14326
14311
|
FILE CREATION:
|
|
14327
14312
|
- NEVER rewrite the same file twice. Once written, move on.
|
|
14328
14313
|
- Keep each file under 200 lines. Split into types.ts, utils.ts if needed.
|
|
@@ -14332,37 +14317,30 @@ TYPESCRIPT:
|
|
|
14332
14317
|
- The project enables \`verbatimModuleSyntax\`. Type-only imports MUST use \`import type\`.
|
|
14333
14318
|
|
|
14334
14319
|
PERMISSIONS:
|
|
14335
|
-
|
|
14336
|
-
Use SCOPE ID format (not human-readable names). Examples:
|
|
14320
|
+
When you call \`required-permissions\` (see workflow step 6 for when), use SCOPE ID format (not human-readable names). Examples:
|
|
14337
14321
|
- \`@wix/data\` read \u2192 "SCOPE.DC-DATA.READ", write \u2192 "SCOPE.DC-DATA.WRITE"
|
|
14338
14322
|
- Embedded scripts \u2192 "SCOPE.DC-APPS.MANAGE-EMBEDDED-SCRIPTS"
|
|
14339
14323
|
|
|
14340
14324
|
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.
|
|
14341
14325
|
|
|
14342
|
-
Example: \`required-permissions({ permissions: ["SCOPE.DC-DATA.READ", "SCOPE.DC-DATA.WRITE"] })\`
|
|
14343
|
-
|
|
14344
14326
|
USER ACTIONS:
|
|
14345
|
-
|
|
14346
|
-
|
|
14327
|
+
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.)
|
|
14328
|
+
\`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:
|
|
14347
14329
|
"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."
|
|
14348
14330
|
|
|
14349
|
-
AUDIENCE \u2014
|
|
14331
|
+
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).
|
|
14350
14332
|
|
|
14351
14333
|
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.)
|
|
14352
14334
|
|
|
14353
14335
|
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.
|
|
14354
14336
|
|
|
14355
|
-
CRITICAL \u2014 NEVER declare anything about permissions or scopes as a user action (e.g. "add SCOPE.DC-STORES.READ-PRODUCTS in Dev Center", "grant the X permission"). Permissions are declared ONLY through the \`required-permissions\` tool and handled by Wix's own flows. A permission/scope step must never appear in user-actions, no matter where it's performed.
|
|
14356
|
-
|
|
14357
14337
|
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.
|
|
14358
14338
|
|
|
14359
14339
|
Do NOT include the steps Wix already handles through its own flows:
|
|
14360
14340
|
- 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.
|
|
14361
14341
|
- Releasing a new app version.
|
|
14362
14342
|
- Publishing the site.
|
|
14363
|
-
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)
|
|
14364
|
-
|
|
14365
|
-
Example: \`user-actions({ output: "To finish setting up your app:\\n1. **Add your Stripe secret key** \u2014 open the app settings and paste it." })\``;
|
|
14343
|
+
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).`;
|
|
14366
14344
|
}
|
|
14367
14345
|
});
|
|
14368
14346
|
|
|
@@ -20877,7 +20855,7 @@ var require_biEvents = __commonJS({
|
|
|
20877
20855
|
}
|
|
20878
20856
|
return JSON.stringify(map);
|
|
20879
20857
|
}
|
|
20880
|
-
function reportSessionStart(report) {
|
|
20858
|
+
async function reportSessionStart(report) {
|
|
20881
20859
|
const devibeParams = {
|
|
20882
20860
|
Job_id: report.jobId,
|
|
20883
20861
|
Task_id: report.taskId,
|
|
@@ -20893,9 +20871,7 @@ var require_biEvents = __commonJS({
|
|
|
20893
20871
|
if (report.environment === types_1.Environment.APP_BUILDER) {
|
|
20894
20872
|
logger_12.logger.info("Reporting BI event 200 (session start)", devibeParams);
|
|
20895
20873
|
try {
|
|
20896
|
-
biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionStartSrc196Evid200)(devibeParams))
|
|
20897
|
-
logger_12.logger.warn("BI event 200 report failed", { error: err });
|
|
20898
|
-
});
|
|
20874
|
+
await biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionStartSrc196Evid200)(devibeParams));
|
|
20899
20875
|
} catch (err) {
|
|
20900
20876
|
logger_12.logger.warn("BI event 200 report failed", { error: err });
|
|
20901
20877
|
}
|
|
@@ -20911,14 +20887,12 @@ var require_biEvents = __commonJS({
|
|
|
20911
20887
|
};
|
|
20912
20888
|
logger_12.logger.info("Reporting BI event 299 (generic session start)", codegenAgentParams);
|
|
20913
20889
|
try {
|
|
20914
|
-
biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionStartSrc11Evid299)(codegenAgentParams))
|
|
20915
|
-
logger_12.logger.warn("BI event 299 report failed", { error: err });
|
|
20916
|
-
});
|
|
20890
|
+
await biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionStartSrc11Evid299)(codegenAgentParams));
|
|
20917
20891
|
} catch (err) {
|
|
20918
20892
|
logger_12.logger.warn("BI event 299 report failed", { error: err });
|
|
20919
20893
|
}
|
|
20920
20894
|
}
|
|
20921
|
-
function reportSessionEnd(report) {
|
|
20895
|
+
async function reportSessionEnd(report) {
|
|
20922
20896
|
const jobCost = report.jobCost ?? report.taskCost;
|
|
20923
20897
|
const devibeParams = {
|
|
20924
20898
|
Job_id: report.jobId,
|
|
@@ -20940,9 +20914,7 @@ var require_biEvents = __commonJS({
|
|
|
20940
20914
|
if (report.environment === types_1.Environment.APP_BUILDER) {
|
|
20941
20915
|
logger_12.logger.info("Reporting BI event 201 (session end)", devibeParams);
|
|
20942
20916
|
try {
|
|
20943
|
-
biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionEndSrc196Evid201)(devibeParams))
|
|
20944
|
-
logger_12.logger.warn("BI event 201 report failed", { error: err });
|
|
20945
|
-
});
|
|
20917
|
+
await biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionEndSrc196Evid201)(devibeParams));
|
|
20946
20918
|
} catch (err) {
|
|
20947
20919
|
logger_12.logger.warn("BI event 201 report failed", { error: err });
|
|
20948
20920
|
}
|
|
@@ -20962,14 +20934,12 @@ var require_biEvents = __commonJS({
|
|
|
20962
20934
|
};
|
|
20963
20935
|
logger_12.logger.info("Reporting BI event 304 (generic session end)", codegenAgentParams);
|
|
20964
20936
|
try {
|
|
20965
|
-
biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionEndSrc11Evid304)(codegenAgentParams))
|
|
20966
|
-
logger_12.logger.warn("BI event 304 report failed", { error: err });
|
|
20967
|
-
});
|
|
20937
|
+
await biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionEndSrc11Evid304)(codegenAgentParams));
|
|
20968
20938
|
} catch (err) {
|
|
20969
20939
|
logger_12.logger.warn("BI event 304 report failed", { error: err });
|
|
20970
20940
|
}
|
|
20971
20941
|
}
|
|
20972
|
-
function reportSessionError(report) {
|
|
20942
|
+
async function reportSessionError(report) {
|
|
20973
20943
|
const devibeParams = {
|
|
20974
20944
|
Job_id: report.jobId,
|
|
20975
20945
|
Task_id: report.taskId,
|
|
@@ -20990,9 +20960,7 @@ var require_biEvents = __commonJS({
|
|
|
20990
20960
|
if (report.environment === types_1.Environment.APP_BUILDER) {
|
|
20991
20961
|
logger_12.logger.info("Reporting BI event 202 (session error)", devibeParams);
|
|
20992
20962
|
try {
|
|
20993
|
-
biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionErrorSrc196Evid202)(devibeParams))
|
|
20994
|
-
logger_12.logger.warn("BI event 202 report failed", { error: err });
|
|
20995
|
-
});
|
|
20963
|
+
await biLogger_1.biLogger.report((0, v2_1.devibeCodegenAgentSessionErrorSrc196Evid202)(devibeParams));
|
|
20996
20964
|
} catch (err) {
|
|
20997
20965
|
logger_12.logger.warn("BI event 202 report failed", { error: err });
|
|
20998
20966
|
}
|
|
@@ -21013,9 +20981,7 @@ var require_biEvents = __commonJS({
|
|
|
21013
20981
|
};
|
|
21014
20982
|
logger_12.logger.info("Reporting BI event 305 (generic session error)", codegenAgentParams);
|
|
21015
20983
|
try {
|
|
21016
|
-
biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionErrorSrc11Evid305)(codegenAgentParams))
|
|
21017
|
-
logger_12.logger.warn("BI event 305 report failed", { error: err });
|
|
21018
|
-
});
|
|
20984
|
+
await biLogger_1.biLogger.report((0, v2_2.codegenAgentSessionErrorSrc11Evid305)(codegenAgentParams));
|
|
21019
20985
|
} catch (err) {
|
|
21020
20986
|
logger_12.logger.warn("BI event 305 report failed", { error: err });
|
|
21021
20987
|
}
|
|
@@ -21093,7 +21059,7 @@ var require_opencode_init = __commonJS({
|
|
|
21093
21059
|
logger_12.logger.info("[OpenCode Init] Starting task", { taskId });
|
|
21094
21060
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.RUNNING, {});
|
|
21095
21061
|
logger_12.logger.info("[OpenCode Init] Marked task RUNNING", { taskId });
|
|
21096
|
-
(0, biEvents_1.reportSessionStart)({
|
|
21062
|
+
void (0, biEvents_1.reportSessionStart)({
|
|
21097
21063
|
...biBase,
|
|
21098
21064
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21099
21065
|
taskType: kind
|
|
@@ -21135,7 +21101,7 @@ var require_opencode_init = __commonJS({
|
|
|
21135
21101
|
if (!store.isCompleted) {
|
|
21136
21102
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {});
|
|
21137
21103
|
}
|
|
21138
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21104
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21139
21105
|
...biBase,
|
|
21140
21106
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21141
21107
|
taskType: kind,
|
|
@@ -21162,7 +21128,7 @@ var require_opencode_init = __commonJS({
|
|
|
21162
21128
|
});
|
|
21163
21129
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
21164
21130
|
const taskCost = orchestrator.lastUsage ? Math.round(orchestrator.lastUsage.cost * 1e6) : void 0;
|
|
21165
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21131
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21166
21132
|
...biBase,
|
|
21167
21133
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21168
21134
|
taskType: kind,
|
|
@@ -21171,7 +21137,7 @@ var require_opencode_init = __commonJS({
|
|
|
21171
21137
|
agentOutput: JSON.stringify({ files }),
|
|
21172
21138
|
jobDuration: String(Date.now() - flowStartTime)
|
|
21173
21139
|
});
|
|
21174
|
-
(0, biEvents_1.reportSessionError)({
|
|
21140
|
+
await (0, biEvents_1.reportSessionError)({
|
|
21175
21141
|
...biBase,
|
|
21176
21142
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21177
21143
|
taskType: kind,
|
|
@@ -21293,7 +21259,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
21293
21259
|
logger_12.logger.info("[OpenCode Iterate] Starting task", { taskId });
|
|
21294
21260
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.RUNNING, {});
|
|
21295
21261
|
logger_12.logger.info("[OpenCode Iterate] Marked task RUNNING", { taskId });
|
|
21296
|
-
(0, biEvents_1.reportSessionStart)({
|
|
21262
|
+
void (0, biEvents_1.reportSessionStart)({
|
|
21297
21263
|
...biBase,
|
|
21298
21264
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21299
21265
|
taskType: kind
|
|
@@ -21325,7 +21291,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
21325
21291
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.COMPLETED, {
|
|
21326
21292
|
taskOutput: { files }
|
|
21327
21293
|
});
|
|
21328
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21294
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21329
21295
|
...biBase,
|
|
21330
21296
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21331
21297
|
taskType: kind,
|
|
@@ -21352,7 +21318,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
21352
21318
|
});
|
|
21353
21319
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
21354
21320
|
const taskCost = iterationOrchestrator.lastUsage ? Math.round(iterationOrchestrator.lastUsage.cost * 1e6) : void 0;
|
|
21355
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21321
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21356
21322
|
...biBase,
|
|
21357
21323
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21358
21324
|
taskType: kind,
|
|
@@ -21361,7 +21327,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
21361
21327
|
agentOutput: JSON.stringify({ files }),
|
|
21362
21328
|
jobDuration: String(Date.now() - flowStartTime)
|
|
21363
21329
|
});
|
|
21364
|
-
(0, biEvents_1.reportSessionError)({
|
|
21330
|
+
await (0, biEvents_1.reportSessionError)({
|
|
21365
21331
|
...biBase,
|
|
21366
21332
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21367
21333
|
taskType: kind,
|
|
@@ -21480,7 +21446,7 @@ var require_opencode_ask = __commonJS({
|
|
|
21480
21446
|
logger_12.logger.info("[OpenCode Ask] Starting task", { taskId });
|
|
21481
21447
|
await codeGenerationService_12.codeGenerationService.updateTask(jobId, taskId, ditto_codegen_types_12.Status.RUNNING, {});
|
|
21482
21448
|
logger_12.logger.info("[OpenCode Ask] Marked task RUNNING", { taskId });
|
|
21483
|
-
(0, biEvents_1.reportSessionStart)({
|
|
21449
|
+
void (0, biEvents_1.reportSessionStart)({
|
|
21484
21450
|
...biBase,
|
|
21485
21451
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21486
21452
|
taskType: kind
|
|
@@ -21509,7 +21475,7 @@ var require_opencode_ask = __commonJS({
|
|
|
21509
21475
|
answer: result.answer
|
|
21510
21476
|
}
|
|
21511
21477
|
});
|
|
21512
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21478
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21513
21479
|
...biBase,
|
|
21514
21480
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21515
21481
|
taskType: kind,
|
|
@@ -21531,7 +21497,7 @@ var require_opencode_ask = __commonJS({
|
|
|
21531
21497
|
});
|
|
21532
21498
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
21533
21499
|
const taskCost = askOrchestrator.lastUsage ? Math.round(askOrchestrator.lastUsage.cost * 1e6) : void 0;
|
|
21534
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21500
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21535
21501
|
...biBase,
|
|
21536
21502
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21537
21503
|
taskType: kind,
|
|
@@ -21540,7 +21506,7 @@ var require_opencode_ask = __commonJS({
|
|
|
21540
21506
|
agentOutput: JSON.stringify({ files }),
|
|
21541
21507
|
jobDuration: String(Date.now() - flowStartTime)
|
|
21542
21508
|
});
|
|
21543
|
-
(0, biEvents_1.reportSessionError)({
|
|
21509
|
+
await (0, biEvents_1.reportSessionError)({
|
|
21544
21510
|
...biBase,
|
|
21545
21511
|
taskModel: config_12.DEFAULT_MODEL,
|
|
21546
21512
|
taskType: kind,
|
|
@@ -21602,7 +21568,7 @@ var require_job_cancellation_monitor = __commonJS({
|
|
|
21602
21568
|
}
|
|
21603
21569
|
if (job.status === ditto_codegen_types_12.Status.PENDING_CANCEL) {
|
|
21604
21570
|
logger_12.logger.info("[Job] Detected cancellation request, exiting");
|
|
21605
|
-
this.reportCancellationBi(jobId);
|
|
21571
|
+
await this.reportCancellationBi(jobId);
|
|
21606
21572
|
await this.codeGenerationService.markJobAsCancelled(jobId);
|
|
21607
21573
|
await (0, utils_1.updateAllRunningTasks)(jobId, ditto_codegen_types_12.Status.CANCELLED);
|
|
21608
21574
|
logger_12.logger.info("[Job] Marked job as CANCELLED");
|
|
@@ -21616,12 +21582,12 @@ var require_job_cancellation_monitor = __commonJS({
|
|
|
21616
21582
|
this.start(jobId);
|
|
21617
21583
|
}
|
|
21618
21584
|
}
|
|
21619
|
-
reportCancellationBi(jobId) {
|
|
21585
|
+
async reportCancellationBi(jobId) {
|
|
21620
21586
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
21621
21587
|
if (!store)
|
|
21622
21588
|
return;
|
|
21623
21589
|
const jobDuration = store.flowStartTime ? String(Date.now() - store.flowStartTime) : void 0;
|
|
21624
|
-
(0, biEvents_1.reportSessionEnd)({
|
|
21590
|
+
await (0, biEvents_1.reportSessionEnd)({
|
|
21625
21591
|
jobId,
|
|
21626
21592
|
taskId: store.taskId,
|
|
21627
21593
|
appId: this.projectId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.381",
|
|
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": "
|
|
32
|
+
"falconPackageHash": "d5e90bd2cbde413c081967aceef2ed40d218b954329616e6b904e8a9"
|
|
33
33
|
}
|