@wix/ditto-codegen-public 1.0.294 → 1.0.295
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 +75 -21
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -12321,31 +12321,66 @@ var require_category_handler = __commonJS({
|
|
|
12321
12321
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
12322
12322
|
var logger_12 = require_logger();
|
|
12323
12323
|
var constants_1 = require_constants5();
|
|
12324
|
+
var CategoryKey;
|
|
12325
|
+
(function(CategoryKey2) {
|
|
12326
|
+
CategoryKey2["CodeSearch"] = "code-search";
|
|
12327
|
+
CategoryKey2["DocSearch"] = "doc-search";
|
|
12328
|
+
CategoryKey2["LoadSkill"] = "load-skill";
|
|
12329
|
+
CategoryKey2["RunCommands"] = "run-commands";
|
|
12330
|
+
CategoryKey2["WriteCode"] = "write-code";
|
|
12331
|
+
CategoryKey2["Validate"] = "validate";
|
|
12332
|
+
})(CategoryKey || (CategoryKey = {}));
|
|
12333
|
+
var CATEGORY_DESCRIPTIONS = {
|
|
12334
|
+
[CategoryKey.CodeSearch]: "Searching in code",
|
|
12335
|
+
[CategoryKey.DocSearch]: "Searching in docs",
|
|
12336
|
+
[CategoryKey.LoadSkill]: "Loading agent skills",
|
|
12337
|
+
[CategoryKey.RunCommands]: "Executing commands",
|
|
12338
|
+
[CategoryKey.WriteCode]: "Writing code",
|
|
12339
|
+
[CategoryKey.Validate]: "Validating code"
|
|
12340
|
+
};
|
|
12324
12341
|
var CategoryTaskHandler = class {
|
|
12325
12342
|
constructor() {
|
|
12326
|
-
this.
|
|
12327
|
-
this.
|
|
12343
|
+
this.created = /* @__PURE__ */ new Set();
|
|
12344
|
+
this.completed = /* @__PURE__ */ new Set();
|
|
12328
12345
|
}
|
|
12329
|
-
|
|
12330
|
-
|
|
12331
|
-
const jobContext = ctx.getJobContext();
|
|
12332
|
-
if (!jobContext)
|
|
12346
|
+
async handle(tool, ctx, state) {
|
|
12347
|
+
if (!ctx.getJobContext())
|
|
12333
12348
|
return;
|
|
12334
|
-
if (constants_1.
|
|
12335
|
-
this.
|
|
12336
|
-
|
|
12349
|
+
if ((0, constants_1.isMcpTool)(tool)) {
|
|
12350
|
+
await this.track(CategoryKey.DocSearch, ctx, state);
|
|
12351
|
+
}
|
|
12352
|
+
if (constants_1.CODE_SEARCH_TOOLS.has(tool)) {
|
|
12353
|
+
await this.track(CategoryKey.CodeSearch, ctx, state);
|
|
12337
12354
|
}
|
|
12338
|
-
if (
|
|
12339
|
-
this.
|
|
12340
|
-
|
|
12355
|
+
if (tool === "bash") {
|
|
12356
|
+
await this.track(CategoryKey.RunCommands, ctx, state);
|
|
12357
|
+
}
|
|
12358
|
+
if (tool === "validate") {
|
|
12359
|
+
await this.track(CategoryKey.Validate, ctx, state);
|
|
12360
|
+
}
|
|
12361
|
+
if (constants_1.WRITE_TOOLS.has(tool)) {
|
|
12362
|
+
await this.track(CategoryKey.WriteCode, ctx);
|
|
12341
12363
|
}
|
|
12342
12364
|
}
|
|
12343
|
-
async
|
|
12365
|
+
async trackLoadSkill(ctx, state) {
|
|
12366
|
+
await this.track(CategoryKey.LoadSkill, ctx, state);
|
|
12367
|
+
}
|
|
12368
|
+
async track(key, ctx, state) {
|
|
12369
|
+
if (!this.created.has(key)) {
|
|
12370
|
+
await this.createTask(key, ctx);
|
|
12371
|
+
}
|
|
12372
|
+
if (state?.status === "completed" && !this.completed.has(key)) {
|
|
12373
|
+
await this.completeTask(key, ctx);
|
|
12374
|
+
}
|
|
12375
|
+
}
|
|
12376
|
+
async createTask(key, ctx) {
|
|
12377
|
+
this.created.add(key);
|
|
12344
12378
|
const jobContext = ctx.getJobContext();
|
|
12345
12379
|
if (!jobContext)
|
|
12346
12380
|
return;
|
|
12347
|
-
const
|
|
12348
|
-
|
|
12381
|
+
const description = CATEGORY_DESCRIPTIONS[key];
|
|
12382
|
+
const taskId = `${jobContext.taskId}-${key}`;
|
|
12383
|
+
ctx.trackedTasks.set(key, {
|
|
12349
12384
|
taskId,
|
|
12350
12385
|
description,
|
|
12351
12386
|
status: ditto_codegen_types_12.Status.RUNNING
|
|
@@ -12366,6 +12401,26 @@ var require_category_handler = __commonJS({
|
|
|
12366
12401
|
});
|
|
12367
12402
|
}
|
|
12368
12403
|
}
|
|
12404
|
+
async completeTask(key, ctx) {
|
|
12405
|
+
this.completed.add(key);
|
|
12406
|
+
const jobContext = ctx.getJobContext();
|
|
12407
|
+
if (!jobContext)
|
|
12408
|
+
return;
|
|
12409
|
+
const tracked = ctx.trackedTasks.get(key);
|
|
12410
|
+
if (!tracked)
|
|
12411
|
+
return;
|
|
12412
|
+
tracked.status = ditto_codegen_types_12.Status.COMPLETED;
|
|
12413
|
+
try {
|
|
12414
|
+
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, tracked.taskId, ditto_codegen_types_12.Status.COMPLETED, {});
|
|
12415
|
+
logger_12.logger.info("[OpenCode] Completed category task", {
|
|
12416
|
+
description: tracked.description
|
|
12417
|
+
});
|
|
12418
|
+
} catch (error) {
|
|
12419
|
+
logger_12.logger.error("[OpenCode] Failed to mark category task as completed", {
|
|
12420
|
+
error: error instanceof Error ? error.message : String(error)
|
|
12421
|
+
});
|
|
12422
|
+
}
|
|
12423
|
+
}
|
|
12369
12424
|
};
|
|
12370
12425
|
exports2.CategoryTaskHandler = CategoryTaskHandler;
|
|
12371
12426
|
}
|
|
@@ -12436,13 +12491,11 @@ var require_task_tracker = __commonJS({
|
|
|
12436
12491
|
await this.handleWriteEvent(tool, state);
|
|
12437
12492
|
}
|
|
12438
12493
|
if (tool === "skill" && state.status === "completed") {
|
|
12439
|
-
this.handleSkillEvent(state);
|
|
12440
|
-
}
|
|
12441
|
-
if (this.store?.kind === ditto_codegen_types_12.TaskKind.ASK_CODEGEN) {
|
|
12442
|
-
const ctx = this.handlerContext;
|
|
12443
|
-
await this.categoryHandler.handle(tool, ctx);
|
|
12444
|
-
this.taskCounter = ctx.taskCounter;
|
|
12494
|
+
await this.handleSkillEvent(state);
|
|
12445
12495
|
}
|
|
12496
|
+
const ctx = this.handlerContext;
|
|
12497
|
+
await this.categoryHandler.handle(tool, ctx, state);
|
|
12498
|
+
this.taskCounter = ctx.taskCounter;
|
|
12446
12499
|
}
|
|
12447
12500
|
async handleWriteEvent(tool, state) {
|
|
12448
12501
|
if (state.status !== "completed")
|
|
@@ -12477,6 +12530,7 @@ var require_task_tracker = __commonJS({
|
|
|
12477
12530
|
const skillName = state.title?.replace("Loaded skill: ", "") || "unknown";
|
|
12478
12531
|
this.skillsUsed.add(skillName);
|
|
12479
12532
|
logger_12.logger.info("[OpenCode] Loaded skill", { skillName });
|
|
12533
|
+
await this.categoryHandler.trackLoadSkill(this.handlerContext, state);
|
|
12480
12534
|
}
|
|
12481
12535
|
/** Builds the task completion payload — includes file list for extension tasks. */
|
|
12482
12536
|
buildTaskPayload(tracked) {
|
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.295",
|
|
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": "
|
|
30
|
+
"falconPackageHash": "573c9d342dec6ea685b4bc2443eadc778217c63ed0bfb2289d23f8a8"
|
|
31
31
|
}
|