@wix/ditto-codegen-public 1.0.334 → 1.0.335
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/opencode-tools/progress.ts +17 -0
- package/dist/out.js +102 -401
- package/package.json +2 -2
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { tool } from "@opencode-ai/plugin";
|
|
2
|
+
|
|
3
|
+
export default tool({
|
|
4
|
+
description:
|
|
5
|
+
"Mark a completed step. Call once per step AFTER it is done. " +
|
|
6
|
+
"Emit alongside other tool calls in the same response — do not dedicate a turn to it.",
|
|
7
|
+
args: {
|
|
8
|
+
step: tool.schema
|
|
9
|
+
.string()
|
|
10
|
+
.describe(
|
|
11
|
+
"Short label in present progressive, e.g. 'Planning extensions', 'Creating dashboard page'. No file names, counts, or specifics.",
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
async execute(args) {
|
|
15
|
+
return `✓ ${args.step}`;
|
|
16
|
+
},
|
|
17
|
+
});
|
package/dist/out.js
CHANGED
|
@@ -11677,9 +11677,8 @@ var require_constants5 = __commonJS({
|
|
|
11677
11677
|
"dist/opencode-integration/task-tracker/constants.js"(exports2) {
|
|
11678
11678
|
"use strict";
|
|
11679
11679
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
11680
|
-
exports2.BUILDER_TO_EXTENSION_LABEL = exports2.
|
|
11680
|
+
exports2.BUILDER_TO_EXTENSION_LABEL = exports2.WIX_MCP_SERVER_NAME = exports2.CONTAINER_ROOT_PREFIX = void 0;
|
|
11681
11681
|
exports2.resolveFileOperation = resolveFileOperation;
|
|
11682
|
-
exports2.isMcpTool = isMcpTool;
|
|
11683
11682
|
exports2.normalizeFilePath = normalizeFilePath;
|
|
11684
11683
|
exports2.isExtensionsFile = isExtensionsFile;
|
|
11685
11684
|
exports2.detectExtension = detectExtension;
|
|
@@ -11687,7 +11686,6 @@ var require_constants5 = __commonJS({
|
|
|
11687
11686
|
exports2.extractExtensionName = extractExtensionName;
|
|
11688
11687
|
exports2.extractExtensionDisplayTitle = extractExtensionDisplayTitle;
|
|
11689
11688
|
exports2.injectCreatedBy = injectCreatedBy;
|
|
11690
|
-
exports2.getWrittenContent = getWrittenContent;
|
|
11691
11689
|
var ditto_codegen_types_12 = require_dist4();
|
|
11692
11690
|
exports2.CONTAINER_ROOT_PREFIX = /^\/user-code\//;
|
|
11693
11691
|
exports2.WIX_MCP_SERVER_NAME = "wix-mcp";
|
|
@@ -11701,19 +11699,6 @@ var require_constants5 = __commonJS({
|
|
|
11701
11699
|
}
|
|
11702
11700
|
return null;
|
|
11703
11701
|
}
|
|
11704
|
-
exports2.CODE_SEARCH_TOOLS = /* @__PURE__ */ new Set([
|
|
11705
|
-
"read",
|
|
11706
|
-
"grep",
|
|
11707
|
-
"glob",
|
|
11708
|
-
"list",
|
|
11709
|
-
"batch-read"
|
|
11710
|
-
]);
|
|
11711
|
-
exports2.WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
11712
|
-
"write",
|
|
11713
|
-
"edit",
|
|
11714
|
-
"batch-write",
|
|
11715
|
-
"multi-edit"
|
|
11716
|
-
]);
|
|
11717
11702
|
exports2.BUILDER_TO_EXTENSION_LABEL = {
|
|
11718
11703
|
dashboardPage: "dashboard page",
|
|
11719
11704
|
dashboardModal: "dashboard modal",
|
|
@@ -11736,9 +11721,6 @@ var require_constants5 = __commonJS({
|
|
|
11736
11721
|
contextProvider: "context provider",
|
|
11737
11722
|
functionLibrary: "function library"
|
|
11738
11723
|
};
|
|
11739
|
-
function isMcpTool(tool) {
|
|
11740
|
-
return tool.startsWith(exports2.WIX_MCP_SERVER_NAME);
|
|
11741
|
-
}
|
|
11742
11724
|
function normalizeFilePath(filePath) {
|
|
11743
11725
|
return filePath.replace(exports2.CONTAINER_ROOT_PREFIX, "");
|
|
11744
11726
|
}
|
|
@@ -11803,15 +11785,6 @@ var require_constants5 = __commonJS({
|
|
|
11803
11785
|
${closeBrace}${tail}`;
|
|
11804
11786
|
});
|
|
11805
11787
|
}
|
|
11806
|
-
function getWrittenContent(tool, state) {
|
|
11807
|
-
if (!state.input)
|
|
11808
|
-
return null;
|
|
11809
|
-
if (tool === "write" && state.input.content)
|
|
11810
|
-
return state.input.content;
|
|
11811
|
-
if (tool === "edit" && state.input.new_string)
|
|
11812
|
-
return state.input.new_string;
|
|
11813
|
-
return null;
|
|
11814
|
-
}
|
|
11815
11788
|
}
|
|
11816
11789
|
});
|
|
11817
11790
|
|
|
@@ -11899,6 +11872,15 @@ MINIMIZE TEXT OUTPUT \u2014 CRITICAL:
|
|
|
11899
11872
|
- Every text token costs money. Use tools, not words.
|
|
11900
11873
|
|
|
11901
11874
|
TOOL USAGE:
|
|
11875
|
+
- \`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. Examples:
|
|
11876
|
+
- "Planning extensions"
|
|
11877
|
+
- "Reading documentation"
|
|
11878
|
+
- "Creating dashboard page"
|
|
11879
|
+
- "Creating service plugin"
|
|
11880
|
+
- "Creating data collection"
|
|
11881
|
+
- "Registering extensions"
|
|
11882
|
+
- "Running type checks"
|
|
11883
|
+
- "Building project"
|
|
11902
11884
|
- \`validate\` for all validation (tsc + build).
|
|
11903
11885
|
- \`uuid\` to generate UUIDs (supports count param for multiple). Do NOT use bash.
|
|
11904
11886
|
- File operations \u2014 pick the BATCH tool whenever you have 2+ files; the single-file variants are 5\u201310\xD7 slower:
|
|
@@ -11911,11 +11893,12 @@ TOOL USAGE:
|
|
|
11911
11893
|
- NEVER run preview, dev, release, or promote commands.
|
|
11912
11894
|
|
|
11913
11895
|
IMPLEMENTATION WORKFLOW:
|
|
11914
|
-
1. **Plan**: Determine extension types using the \`wix-app\` skill. Generate ALL UUIDs upfront.
|
|
11915
|
-
2. **
|
|
11916
|
-
3. **
|
|
11917
|
-
4. **
|
|
11918
|
-
5. **
|
|
11896
|
+
1. **Plan**: Determine extension types using the \`wix-app\` skill. Generate ALL UUIDs upfront. Include a \`progress\` call (e.g. "Planning extensions").
|
|
11897
|
+
2. **Research**: Load relevant SDK docs and skills for each extension type. Include a \`progress\` call (e.g. "Reading documentation").
|
|
11898
|
+
3. **Build**: Create every extension file in a SINGLE \`batch-write\` call. Build all extensions before registering. Include one \`progress\` call per extension type (e.g. "Creating dashboard page", "Creating service plugin").
|
|
11899
|
+
4. **Register**: Register all extensions in \`src/extensions.ts\`. Include a \`progress\` call (e.g. "Registering extensions").
|
|
11900
|
+
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 you added a new dependency to package.json in this iteration; otherwise omit it (node_modules is pre-installed). Include a \`progress\` call (e.g. "Building project").
|
|
11901
|
+
6. **Stop**: STOP immediately. Do NOT refactor, clean up, or verify.
|
|
11919
11902
|
|
|
11920
11903
|
EFFICIENCY:
|
|
11921
11904
|
- Always prefer the BATCH variant: \`batch-write\` over multiple \`write\`s, \`batch-read\` over multiple \`read\`s, \`multi-edit\` over multiple \`edit\`s.
|
|
@@ -11961,6 +11944,12 @@ var require_ask_rules = __commonJS({
|
|
|
11961
11944
|
- Use the wix-mcp tools to fetch Wix SDK/API documentation when needed.
|
|
11962
11945
|
- Provide clear, accurate, and well-structured answers.
|
|
11963
11946
|
|
|
11947
|
+
TOOL USAGE:
|
|
11948
|
+
- \`progress\` to mark a step done. Call it ONCE per completed step, in the SAME response as the tool calls that did the work. Examples:
|
|
11949
|
+
- "Reading codebase"
|
|
11950
|
+
- "Looking up documentation"
|
|
11951
|
+
- "Analyzing code"
|
|
11952
|
+
|
|
11964
11953
|
IMPORTANT INSTRUCTIONS:
|
|
11965
11954
|
1. Do NOT edit, write, or create any files.
|
|
11966
11955
|
2. Do NOT run any bash commands.
|
|
@@ -13059,6 +13048,14 @@ var require_config = __commonJS({
|
|
|
13059
13048
|
/* OpenCodeTool.Bash */
|
|
13060
13049
|
]: "deny",
|
|
13061
13050
|
task: "deny",
|
|
13051
|
+
[
|
|
13052
|
+
"todowrite"
|
|
13053
|
+
/* OpenCodeTool.TodoWrite */
|
|
13054
|
+
]: "deny",
|
|
13055
|
+
[
|
|
13056
|
+
"todoread"
|
|
13057
|
+
/* OpenCodeTool.TodoRead */
|
|
13058
|
+
]: "deny",
|
|
13062
13059
|
[
|
|
13063
13060
|
"batch-write"
|
|
13064
13061
|
/* OpenCodeTool.BatchWrite */
|
|
@@ -13398,263 +13395,48 @@ var require_init_task = __commonJS({
|
|
|
13398
13395
|
}
|
|
13399
13396
|
});
|
|
13400
13397
|
|
|
13401
|
-
// dist/opencode-integration/task-tracker/
|
|
13402
|
-
var
|
|
13403
|
-
"dist/opencode-integration/task-tracker/
|
|
13398
|
+
// dist/opencode-integration/task-tracker/progress-handler.js
|
|
13399
|
+
var require_progress_handler = __commonJS({
|
|
13400
|
+
"dist/opencode-integration/task-tracker/progress-handler.js"(exports2) {
|
|
13404
13401
|
"use strict";
|
|
13405
13402
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
13406
|
-
exports2.
|
|
13407
|
-
exports2.buildExtensionTaskPayload = buildExtensionTaskPayload;
|
|
13403
|
+
exports2.ProgressTaskHandler = void 0;
|
|
13408
13404
|
var crypto_12 = require("crypto");
|
|
13409
|
-
var promises_1 = require("fs/promises");
|
|
13410
|
-
var path_1 = require("path");
|
|
13411
13405
|
var ditto_codegen_types_12 = require_dist4();
|
|
13412
13406
|
var codeGenerationService_12 = require_codeGenerationService();
|
|
13413
13407
|
var logger_12 = require_logger();
|
|
13414
|
-
var constants_1 = require_constants5();
|
|
13415
13408
|
var init_task_1 = require_init_task();
|
|
13416
|
-
|
|
13417
|
-
|
|
13418
|
-
|
|
13419
|
-
const extensionFiles = collectedFiles.filter((f) => f.path.startsWith(tracked.extensionFolder));
|
|
13420
|
-
return {
|
|
13421
|
-
taskOutput: {
|
|
13422
|
-
files: extensionFiles.map((f) => ({
|
|
13423
|
-
path: f.path,
|
|
13424
|
-
operation: f.operation
|
|
13425
|
-
})),
|
|
13426
|
-
extensionType: tracked.extensionType
|
|
13427
|
-
}
|
|
13428
|
-
};
|
|
13429
|
-
}
|
|
13430
|
-
var ExtensionTaskHandler = class {
|
|
13431
|
-
constructor() {
|
|
13432
|
-
this.extensionTypesByPath = /* @__PURE__ */ new Map();
|
|
13433
|
-
}
|
|
13434
|
-
getExtensionTypesCreated() {
|
|
13435
|
-
return Array.from(this.extensionTypesByPath.values());
|
|
13436
|
-
}
|
|
13437
|
-
/** Inspects a write/edit event; creates a RUNNING sub-task on first sight, completes on the completed event. */
|
|
13438
|
-
async handle(tool, state, ctx) {
|
|
13439
|
-
const filePath = state.input?.filePath || state.title || "";
|
|
13440
|
-
if (!(0, constants_1.isExtensionsFile)(filePath))
|
|
13441
|
-
return;
|
|
13442
|
-
const content = (0, constants_1.getWrittenContent)(tool, state);
|
|
13443
|
-
if (!content)
|
|
13444
|
-
return;
|
|
13445
|
-
const extension = (0, constants_1.detectExtension)(content);
|
|
13446
|
-
if (!extension)
|
|
13447
|
-
return;
|
|
13448
|
-
const normalizedPath = (0, constants_1.normalizeFilePath)(filePath);
|
|
13449
|
-
const isCompleted = state.status === "completed";
|
|
13450
|
-
if (isCompleted) {
|
|
13451
|
-
await this.ensureCreatedBy(filePath, ctx.workingDirectory);
|
|
13452
|
-
}
|
|
13453
|
-
if (!this.extensionTypesByPath.has(normalizedPath)) {
|
|
13454
|
-
this.extensionTypesByPath.set(normalizedPath, extension.extensionType);
|
|
13455
|
-
await (0, init_task_1.completeInitTask)(ctx);
|
|
13456
|
-
await this.createExtensionTask(normalizedPath, extension.label, extension.extensionType, filePath, ctx);
|
|
13457
|
-
}
|
|
13458
|
-
if (!isCompleted)
|
|
13459
|
-
return;
|
|
13460
|
-
const tracked = ctx.trackedTasks.get(`ext-${normalizedPath}`);
|
|
13461
|
-
if (!tracked || tracked.status !== ditto_codegen_types_12.Status.RUNNING)
|
|
13409
|
+
var ProgressTaskHandler = class {
|
|
13410
|
+
async handle(state, ctx) {
|
|
13411
|
+
if (state.status !== "completed")
|
|
13462
13412
|
return;
|
|
13463
13413
|
const jobContext = ctx.getJobContext();
|
|
13464
13414
|
if (!jobContext)
|
|
13465
13415
|
return;
|
|
13466
|
-
|
|
13467
|
-
|
|
13468
|
-
/** Reads an extension file from disk and injects createdBy if missing. */
|
|
13469
|
-
async ensureCreatedBy(filePath, workingDirectory) {
|
|
13470
|
-
const fullPath = (0, path_1.isAbsolute)(filePath) ? filePath : (0, path_1.join)(workingDirectory, filePath);
|
|
13471
|
-
try {
|
|
13472
|
-
const original = await (0, promises_1.readFile)(fullPath, "utf-8");
|
|
13473
|
-
const updated = (0, constants_1.injectCreatedBy)(original);
|
|
13474
|
-
if (updated !== original) {
|
|
13475
|
-
await (0, promises_1.writeFile)(fullPath, updated, "utf-8");
|
|
13476
|
-
const format = original.includes("genericExtension(") ? "string" : "object";
|
|
13477
|
-
logger_12.logger.info("[OpenCode] Injected createdBy into extension file", {
|
|
13478
|
-
filePath,
|
|
13479
|
-
format
|
|
13480
|
-
});
|
|
13481
|
-
}
|
|
13482
|
-
} catch (error) {
|
|
13483
|
-
logger_12.logger.error("[OpenCode] Failed to inject createdBy", {
|
|
13484
|
-
filePath,
|
|
13485
|
-
error: error instanceof Error ? error.message : String(error)
|
|
13486
|
-
});
|
|
13487
|
-
}
|
|
13488
|
-
}
|
|
13489
|
-
/** Registers a RUNNING sub-task in the job service for a detected extension. */
|
|
13490
|
-
async createExtensionTask(normalizedPath, extensionLabel, extensionType, originalPath, ctx) {
|
|
13491
|
-
const jobContext = ctx.getJobContext();
|
|
13492
|
-
if (!jobContext)
|
|
13493
|
-
return;
|
|
13494
|
-
const extensionName = (0, constants_1.extractExtensionName)(originalPath);
|
|
13495
|
-
const description = `Creating ${extensionName} ${extensionLabel}`;
|
|
13496
|
-
const extensionKey = `ext-${normalizedPath}`;
|
|
13497
|
-
const taskId = (0, crypto_12.randomUUID)();
|
|
13498
|
-
const extensionFolder = normalizedPath.substring(0, normalizedPath.lastIndexOf("/") + 1);
|
|
13499
|
-
const tracked = {
|
|
13500
|
-
taskId,
|
|
13501
|
-
description,
|
|
13502
|
-
status: ditto_codegen_types_12.Status.RUNNING,
|
|
13503
|
-
extensionFolder,
|
|
13504
|
-
extensionType
|
|
13505
|
-
};
|
|
13506
|
-
ctx.trackedTasks.set(extensionKey, tracked);
|
|
13507
|
-
try {
|
|
13508
|
-
await codeGenerationService_12.codeGenerationService.addTask(jobContext.jobId, {
|
|
13509
|
-
id: taskId,
|
|
13510
|
-
kind: ditto_codegen_types_12.TaskKind.RUN_AGENT,
|
|
13511
|
-
status: ditto_codegen_types_12.Status.RUNNING,
|
|
13512
|
-
name: "create_extension",
|
|
13513
|
-
description,
|
|
13514
|
-
agentName: ""
|
|
13515
|
-
});
|
|
13516
|
-
logger_12.logger.info("[OpenCode] Created extension task", { description });
|
|
13517
|
-
} catch (error) {
|
|
13518
|
-
logger_12.logger.error("[OpenCode] Failed to create extension task", {
|
|
13519
|
-
error: error instanceof Error ? error.message : String(error)
|
|
13520
|
-
});
|
|
13521
|
-
}
|
|
13522
|
-
}
|
|
13523
|
-
/** Marks the extension task COMPLETED with the file list collected so far for its folder. */
|
|
13524
|
-
async completeExtensionTask(tracked, jobId, ctx) {
|
|
13525
|
-
tracked.status = ditto_codegen_types_12.Status.COMPLETED;
|
|
13526
|
-
try {
|
|
13527
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobId, tracked.taskId, ditto_codegen_types_12.Status.COMPLETED, buildExtensionTaskPayload(tracked, ctx.collectedFiles));
|
|
13528
|
-
logger_12.logger.info("[OpenCode] Completed extension task", {
|
|
13529
|
-
description: tracked.description
|
|
13530
|
-
});
|
|
13531
|
-
} catch (error) {
|
|
13532
|
-
logger_12.logger.error("[OpenCode] Failed to complete extension task", {
|
|
13533
|
-
error: error instanceof Error ? error.message : String(error)
|
|
13534
|
-
});
|
|
13535
|
-
}
|
|
13536
|
-
}
|
|
13537
|
-
};
|
|
13538
|
-
exports2.ExtensionTaskHandler = ExtensionTaskHandler;
|
|
13539
|
-
}
|
|
13540
|
-
});
|
|
13541
|
-
|
|
13542
|
-
// dist/opencode-integration/task-tracker/category-handler.js
|
|
13543
|
-
var require_category_handler = __commonJS({
|
|
13544
|
-
"dist/opencode-integration/task-tracker/category-handler.js"(exports2) {
|
|
13545
|
-
"use strict";
|
|
13546
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
13547
|
-
exports2.CategoryTaskHandler = void 0;
|
|
13548
|
-
var crypto_12 = require("crypto");
|
|
13549
|
-
var ditto_codegen_types_12 = require_dist4();
|
|
13550
|
-
var codeGenerationService_12 = require_codeGenerationService();
|
|
13551
|
-
var logger_12 = require_logger();
|
|
13552
|
-
var constants_1 = require_constants5();
|
|
13553
|
-
var init_task_1 = require_init_task();
|
|
13554
|
-
var CategoryKey;
|
|
13555
|
-
(function(CategoryKey2) {
|
|
13556
|
-
CategoryKey2["CodeSearch"] = "code-search";
|
|
13557
|
-
CategoryKey2["DocSearch"] = "doc-search";
|
|
13558
|
-
CategoryKey2["LoadSkill"] = "load-skill";
|
|
13559
|
-
CategoryKey2["RunCommands"] = "run-commands";
|
|
13560
|
-
CategoryKey2["WriteCode"] = "write-code";
|
|
13561
|
-
CategoryKey2["Validate"] = "validate";
|
|
13562
|
-
})(CategoryKey || (CategoryKey = {}));
|
|
13563
|
-
var CATEGORY_DESCRIPTIONS = {
|
|
13564
|
-
[CategoryKey.CodeSearch]: "Searching in code",
|
|
13565
|
-
[CategoryKey.DocSearch]: "Searching in docs",
|
|
13566
|
-
[CategoryKey.LoadSkill]: "Loading agent skills",
|
|
13567
|
-
[CategoryKey.RunCommands]: "Executing commands",
|
|
13568
|
-
[CategoryKey.WriteCode]: "Writing code",
|
|
13569
|
-
[CategoryKey.Validate]: "Validating code"
|
|
13570
|
-
};
|
|
13571
|
-
var CategoryTaskHandler = class {
|
|
13572
|
-
constructor() {
|
|
13573
|
-
this.created = /* @__PURE__ */ new Set();
|
|
13574
|
-
this.completed = /* @__PURE__ */ new Set();
|
|
13575
|
-
}
|
|
13576
|
-
async handle(tool, ctx, state) {
|
|
13577
|
-
if (!ctx.getJobContext())
|
|
13578
|
-
return;
|
|
13579
|
-
if ((0, constants_1.isMcpTool)(tool)) {
|
|
13580
|
-
await this.track(CategoryKey.DocSearch, ctx, state);
|
|
13581
|
-
}
|
|
13582
|
-
if (constants_1.CODE_SEARCH_TOOLS.has(tool)) {
|
|
13583
|
-
await this.track(CategoryKey.CodeSearch, ctx, state);
|
|
13584
|
-
}
|
|
13585
|
-
if (tool === "bash") {
|
|
13586
|
-
await this.track(CategoryKey.RunCommands, ctx, state);
|
|
13587
|
-
}
|
|
13588
|
-
if (tool === "validate") {
|
|
13589
|
-
await this.track(CategoryKey.Validate, ctx);
|
|
13590
|
-
}
|
|
13591
|
-
if (constants_1.WRITE_TOOLS.has(tool)) {
|
|
13592
|
-
await this.track(CategoryKey.WriteCode, ctx, state);
|
|
13593
|
-
}
|
|
13594
|
-
}
|
|
13595
|
-
async trackLoadSkill(ctx, state) {
|
|
13596
|
-
await this.track(CategoryKey.LoadSkill, ctx, state);
|
|
13597
|
-
}
|
|
13598
|
-
async track(key, ctx, state) {
|
|
13599
|
-
if (!this.created.has(key)) {
|
|
13600
|
-
await this.createTask(key, ctx);
|
|
13601
|
-
}
|
|
13602
|
-
if (state?.status === "completed" && !this.completed.has(key)) {
|
|
13603
|
-
await this.completeTask(key, ctx);
|
|
13604
|
-
}
|
|
13605
|
-
}
|
|
13606
|
-
async createTask(key, ctx) {
|
|
13607
|
-
this.created.add(key);
|
|
13608
|
-
const jobContext = ctx.getJobContext();
|
|
13609
|
-
if (!jobContext)
|
|
13416
|
+
const description = state.input?.step;
|
|
13417
|
+
if (!description)
|
|
13610
13418
|
return;
|
|
13611
13419
|
await (0, init_task_1.completeInitTask)(ctx);
|
|
13612
|
-
const description = CATEGORY_DESCRIPTIONS[key];
|
|
13613
|
-
const taskId = (0, crypto_12.randomUUID)();
|
|
13614
|
-
ctx.trackedTasks.set(key, {
|
|
13615
|
-
taskId,
|
|
13616
|
-
description,
|
|
13617
|
-
status: ditto_codegen_types_12.Status.RUNNING
|
|
13618
|
-
});
|
|
13619
13420
|
try {
|
|
13620
13421
|
await codeGenerationService_12.codeGenerationService.addTask(jobContext.jobId, {
|
|
13621
|
-
id:
|
|
13422
|
+
id: (0, crypto_12.randomUUID)(),
|
|
13622
13423
|
kind: ditto_codegen_types_12.TaskKind.RUN_AGENT,
|
|
13623
|
-
status: ditto_codegen_types_12.Status.
|
|
13424
|
+
status: ditto_codegen_types_12.Status.COMPLETED,
|
|
13624
13425
|
name: "run_agent",
|
|
13625
13426
|
description,
|
|
13626
13427
|
agentName: ""
|
|
13627
13428
|
});
|
|
13628
|
-
logger_12.logger.info("[OpenCode]
|
|
13629
|
-
|
|
13630
|
-
logger_12.logger.error("[OpenCode] Failed to create category task", {
|
|
13631
|
-
error: error instanceof Error ? error.message : String(error)
|
|
13632
|
-
});
|
|
13633
|
-
}
|
|
13634
|
-
}
|
|
13635
|
-
async completeTask(key, ctx) {
|
|
13636
|
-
this.completed.add(key);
|
|
13637
|
-
const jobContext = ctx.getJobContext();
|
|
13638
|
-
if (!jobContext)
|
|
13639
|
-
return;
|
|
13640
|
-
const tracked = ctx.trackedTasks.get(key);
|
|
13641
|
-
if (!tracked)
|
|
13642
|
-
return;
|
|
13643
|
-
tracked.status = ditto_codegen_types_12.Status.COMPLETED;
|
|
13644
|
-
try {
|
|
13645
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, tracked.taskId, ditto_codegen_types_12.Status.COMPLETED, {});
|
|
13646
|
-
logger_12.logger.info("[OpenCode] Completed category task", {
|
|
13647
|
-
description: tracked.description
|
|
13429
|
+
logger_12.logger.info("[OpenCode] Added completed progress step", {
|
|
13430
|
+
description
|
|
13648
13431
|
});
|
|
13649
13432
|
} catch (error) {
|
|
13650
|
-
logger_12.logger.error("[OpenCode] Failed to
|
|
13651
|
-
error: error instanceof Error ? error.message : String(error)
|
|
13652
|
-
taskId: tracked.taskId
|
|
13433
|
+
logger_12.logger.error("[OpenCode] Failed to add progress step", {
|
|
13434
|
+
error: error instanceof Error ? error.message : String(error)
|
|
13653
13435
|
});
|
|
13654
13436
|
}
|
|
13655
13437
|
}
|
|
13656
13438
|
};
|
|
13657
|
-
exports2.
|
|
13439
|
+
exports2.ProgressTaskHandler = ProgressTaskHandler;
|
|
13658
13440
|
}
|
|
13659
13441
|
});
|
|
13660
13442
|
|
|
@@ -13664,31 +13446,21 @@ var require_task_tracker = __commonJS({
|
|
|
13664
13446
|
"use strict";
|
|
13665
13447
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
13666
13448
|
exports2.OpenCodeTaskTracker = void 0;
|
|
13667
|
-
var ditto_codegen_types_12 = require_dist4();
|
|
13668
|
-
var codeGenerationService_12 = require_codeGenerationService();
|
|
13669
13449
|
var job_context_storage_12 = require_job_context_storage();
|
|
13670
13450
|
var types_1 = require_types4();
|
|
13671
13451
|
var logger_12 = require_logger();
|
|
13672
|
-
var
|
|
13673
|
-
var extension_handler_1 = require_extension_handler();
|
|
13674
|
-
var category_handler_1 = require_category_handler();
|
|
13452
|
+
var progress_handler_1 = require_progress_handler();
|
|
13675
13453
|
var hooks_1 = require_hooks();
|
|
13676
13454
|
var OpenCodeTaskTracker = class {
|
|
13677
13455
|
constructor(workingDirectory) {
|
|
13678
|
-
this.trackedTasks = /* @__PURE__ */ new Map();
|
|
13679
|
-
this.collectedFiles = [];
|
|
13680
13456
|
this.skillsUsed = /* @__PURE__ */ new Set();
|
|
13681
|
-
this.
|
|
13682
|
-
this.categoryHandler = new category_handler_1.CategoryTaskHandler();
|
|
13457
|
+
this.progressHandler = new progress_handler_1.ProgressTaskHandler();
|
|
13683
13458
|
this.store = job_context_storage_12.jobContextStorage.getStore();
|
|
13684
13459
|
this.workingDirectory = workingDirectory;
|
|
13685
13460
|
}
|
|
13686
13461
|
getSkillsUsed() {
|
|
13687
13462
|
return Array.from(this.skillsUsed);
|
|
13688
13463
|
}
|
|
13689
|
-
getExtensionsCreated() {
|
|
13690
|
-
return this.extensionHandler.getExtensionTypesCreated();
|
|
13691
|
-
}
|
|
13692
13464
|
getJobContext() {
|
|
13693
13465
|
if (!this.store?.jobId || !this.store?.taskId) {
|
|
13694
13466
|
return null;
|
|
@@ -13699,8 +13471,6 @@ var require_task_tracker = __commonJS({
|
|
|
13699
13471
|
return {
|
|
13700
13472
|
getJobContext: () => this.getJobContext(),
|
|
13701
13473
|
store: this.store,
|
|
13702
|
-
trackedTasks: this.trackedTasks,
|
|
13703
|
-
collectedFiles: this.collectedFiles,
|
|
13704
13474
|
workingDirectory: this.workingDirectory
|
|
13705
13475
|
};
|
|
13706
13476
|
}
|
|
@@ -13718,113 +13488,18 @@ var require_task_tracker = __commonJS({
|
|
|
13718
13488
|
const { tool, callID, state } = event.part || {};
|
|
13719
13489
|
if (!tool || !callID || !state)
|
|
13720
13490
|
return;
|
|
13721
|
-
if (constants_1.WRITE_TOOLS.has(tool)) {
|
|
13722
|
-
await this.handleWriteEvent(tool, state);
|
|
13723
|
-
}
|
|
13724
13491
|
if (tool === "skill" && state.status === "completed") {
|
|
13725
|
-
|
|
13726
|
-
}
|
|
13727
|
-
const ctx = this.handlerContext;
|
|
13728
|
-
await this.categoryHandler.handle(tool, ctx, state);
|
|
13729
|
-
await (0, hooks_1.runOnToolUse)((0, hooks_1.getActiveHooks)(), { tool, state });
|
|
13730
|
-
}
|
|
13731
|
-
async handleWriteEvent(tool, state) {
|
|
13732
|
-
const isCompleted = state.status === "completed";
|
|
13733
|
-
const expanded = this.expandWriteEvent(tool, state);
|
|
13734
|
-
for (const { state: fileState, effectiveTool } of expanded) {
|
|
13735
|
-
if (isCompleted) {
|
|
13736
|
-
this.trackFileChange(effectiveTool, fileState);
|
|
13737
|
-
}
|
|
13738
|
-
const ctx = this.handlerContext;
|
|
13739
|
-
await this.extensionHandler.handle(effectiveTool, fileState, ctx);
|
|
13740
|
-
}
|
|
13741
|
-
}
|
|
13742
|
-
/**
|
|
13743
|
-
* Expands a write-family tool event into per-file synthetic states so the
|
|
13744
|
-
* downstream extension/file-change collectors can stay tool-agnostic:
|
|
13745
|
-
* batch-write → N synthetic Write states (INSERT, exists=false)
|
|
13746
|
-
* multi-edit → N synthetic Edit states (EDIT)
|
|
13747
|
-
* write/edit → passed through unchanged
|
|
13748
|
-
*/
|
|
13749
|
-
expandWriteEvent(tool, state) {
|
|
13750
|
-
if (tool === "batch-write") {
|
|
13751
|
-
return (state.input?.files ?? []).map((f) => ({
|
|
13752
|
-
state: {
|
|
13753
|
-
status: state.status,
|
|
13754
|
-
input: { filePath: f.path, content: f.content },
|
|
13755
|
-
metadata: { exists: false }
|
|
13756
|
-
},
|
|
13757
|
-
effectiveTool: "write"
|
|
13758
|
-
}));
|
|
13492
|
+
this.handleSkillEvent(state);
|
|
13759
13493
|
}
|
|
13760
|
-
if (tool === "
|
|
13761
|
-
|
|
13762
|
-
state: {
|
|
13763
|
-
status: state.status,
|
|
13764
|
-
input: { filePath: e.path, new_string: e.newString },
|
|
13765
|
-
metadata: { exists: true }
|
|
13766
|
-
},
|
|
13767
|
-
effectiveTool: "edit"
|
|
13768
|
-
}));
|
|
13769
|
-
}
|
|
13770
|
-
return [{ state, effectiveTool: tool }];
|
|
13771
|
-
}
|
|
13772
|
-
trackFileChange(tool, state) {
|
|
13773
|
-
const filePath = state.input?.filePath || state.title;
|
|
13774
|
-
const operation = (0, constants_1.resolveFileOperation)(tool, state.metadata);
|
|
13775
|
-
if (!filePath || !operation)
|
|
13776
|
-
return;
|
|
13777
|
-
const normalized = (0, constants_1.normalizeFilePath)(filePath);
|
|
13778
|
-
if (!this.collectedFiles.some((f) => f.path === normalized)) {
|
|
13779
|
-
this.collectedFiles.push({ path: normalized, operation });
|
|
13494
|
+
if (tool === "progress") {
|
|
13495
|
+
void this.progressHandler.handle(state, this.handlerContext);
|
|
13780
13496
|
}
|
|
13497
|
+
await (0, hooks_1.runOnToolUse)((0, hooks_1.getActiveHooks)(), { tool, state });
|
|
13781
13498
|
}
|
|
13782
|
-
|
|
13499
|
+
handleSkillEvent(state) {
|
|
13783
13500
|
const skillName = state.title?.replace("Loaded skill: ", "") || "unknown";
|
|
13784
13501
|
this.skillsUsed.add(skillName);
|
|
13785
13502
|
logger_12.logger.info("[OpenCode] Loaded skill", { skillName });
|
|
13786
|
-
await this.categoryHandler.trackLoadSkill(this.handlerContext, state);
|
|
13787
|
-
}
|
|
13788
|
-
/** Marks all still-running tracked tasks as COMPLETED (called on successful process exit). */
|
|
13789
|
-
async completeRemainingTasks() {
|
|
13790
|
-
const jobContext = this.getJobContext();
|
|
13791
|
-
if (!jobContext)
|
|
13792
|
-
return;
|
|
13793
|
-
for (const [, tracked] of this.trackedTasks) {
|
|
13794
|
-
if (tracked.status === ditto_codegen_types_12.Status.RUNNING) {
|
|
13795
|
-
const payload = (0, extension_handler_1.buildExtensionTaskPayload)(tracked, this.collectedFiles);
|
|
13796
|
-
try {
|
|
13797
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, tracked.taskId, ditto_codegen_types_12.Status.COMPLETED, payload);
|
|
13798
|
-
logger_12.logger.info("[OpenCode] Completed task", {
|
|
13799
|
-
description: tracked.description
|
|
13800
|
-
});
|
|
13801
|
-
} catch (err) {
|
|
13802
|
-
logger_12.logger.error("[OpenCode] Failed to complete task", {
|
|
13803
|
-
error: err instanceof Error ? err.message : String(err)
|
|
13804
|
-
});
|
|
13805
|
-
}
|
|
13806
|
-
}
|
|
13807
|
-
}
|
|
13808
|
-
}
|
|
13809
|
-
/** Marks all still-running tracked tasks as FAILED (called on process error/timeout). */
|
|
13810
|
-
async failRemainingTasks(errorMessage) {
|
|
13811
|
-
const jobContext = this.getJobContext();
|
|
13812
|
-
if (!jobContext)
|
|
13813
|
-
return;
|
|
13814
|
-
for (const [, tracked] of this.trackedTasks) {
|
|
13815
|
-
if (tracked.status === ditto_codegen_types_12.Status.RUNNING) {
|
|
13816
|
-
try {
|
|
13817
|
-
await codeGenerationService_12.codeGenerationService.updateTask(jobContext.jobId, tracked.taskId, ditto_codegen_types_12.Status.FAILED, { error: errorMessage });
|
|
13818
|
-
logger_12.logger.info("[OpenCode] Failed sub-task", {
|
|
13819
|
-
description: tracked.description
|
|
13820
|
-
});
|
|
13821
|
-
} catch (err) {
|
|
13822
|
-
logger_12.logger.error("[OpenCode] Failed to mark sub-task as failed", {
|
|
13823
|
-
error: err instanceof Error ? err.message : String(err)
|
|
13824
|
-
});
|
|
13825
|
-
}
|
|
13826
|
-
}
|
|
13827
|
-
}
|
|
13828
13503
|
}
|
|
13829
13504
|
};
|
|
13830
13505
|
exports2.OpenCodeTaskTracker = OpenCodeTaskTracker;
|
|
@@ -13921,8 +13596,7 @@ var require_result_builder = __commonJS({
|
|
|
13921
13596
|
requiredPermissions: [],
|
|
13922
13597
|
filesChanged: (0, parser_1.parseFilesChanged)(stdout),
|
|
13923
13598
|
usage: (0, parser_1.parseUsageStats)(stdout),
|
|
13924
|
-
skillsUsed: []
|
|
13925
|
-
extensionsCreated: []
|
|
13599
|
+
skillsUsed: []
|
|
13926
13600
|
};
|
|
13927
13601
|
}
|
|
13928
13602
|
function createSuccessResult(code, stdout, stderr, startTime) {
|
|
@@ -13940,8 +13614,7 @@ var require_result_builder = __commonJS({
|
|
|
13940
13614
|
requiredPermissions: (0, parser_1.parseRequiredPermissions)(stdout),
|
|
13941
13615
|
filesChanged: (0, parser_1.parseFilesChanged)(stdout),
|
|
13942
13616
|
usage: (0, parser_1.parseUsageStats)(stdout),
|
|
13943
|
-
skillsUsed: []
|
|
13944
|
-
extensionsCreated: []
|
|
13617
|
+
skillsUsed: []
|
|
13945
13618
|
};
|
|
13946
13619
|
}
|
|
13947
13620
|
function createSpawnErrorResult(errorMessage, stdout, stderr, startTime) {
|
|
@@ -13958,8 +13631,7 @@ var require_result_builder = __commonJS({
|
|
|
13958
13631
|
requiredPermissions: [],
|
|
13959
13632
|
filesChanged: [],
|
|
13960
13633
|
usage: (0, parser_1.createEmptyUsageStats)(),
|
|
13961
|
-
skillsUsed: []
|
|
13962
|
-
extensionsCreated: []
|
|
13634
|
+
skillsUsed: []
|
|
13963
13635
|
};
|
|
13964
13636
|
}
|
|
13965
13637
|
}
|
|
@@ -14078,7 +13750,6 @@ var require_executor = __commonJS({
|
|
|
14078
13750
|
let accumulatedStdout = "";
|
|
14079
13751
|
let accumulatedUsage = (0, parser_1.createEmptyUsageStats)();
|
|
14080
13752
|
const accumulatedSkills = [];
|
|
14081
|
-
const accumulatedExtensions = [];
|
|
14082
13753
|
let currentPrompt = options.prompt;
|
|
14083
13754
|
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
14084
13755
|
if (attempt > 1) {
|
|
@@ -14090,7 +13761,6 @@ var require_executor = __commonJS({
|
|
|
14090
13761
|
accumulatedStdout += result.stdout;
|
|
14091
13762
|
accumulatedUsage = (0, parser_1.mergeUsageStats)(accumulatedUsage, result.usage);
|
|
14092
13763
|
accumulatedSkills.push(...result.skillsUsed);
|
|
14093
|
-
accumulatedExtensions.push(...result.extensionsCreated);
|
|
14094
13764
|
const errorMsg = result.error?.message.toLowerCase() ?? "";
|
|
14095
13765
|
const isIdleTimeout = !result.success && errorMsg.includes("idle timeout");
|
|
14096
13766
|
const isSessionError = (0, parser_1.hasSessionError)(result.stdout);
|
|
@@ -14100,8 +13770,7 @@ var require_executor = __commonJS({
|
|
|
14100
13770
|
...result,
|
|
14101
13771
|
filesChanged: (0, parser_1.parseFilesChanged)(accumulatedStdout),
|
|
14102
13772
|
usage: accumulatedUsage,
|
|
14103
|
-
skillsUsed: accumulatedSkills
|
|
14104
|
-
extensionsCreated: accumulatedExtensions
|
|
13773
|
+
skillsUsed: accumulatedSkills
|
|
14105
13774
|
};
|
|
14106
13775
|
logger_12.logger.info("[OpenCode] Usage summary", { usage: finalResult2.usage });
|
|
14107
13776
|
await logOpenCodeStats(options);
|
|
@@ -14121,8 +13790,7 @@ var require_executor = __commonJS({
|
|
|
14121
13790
|
...lastResult,
|
|
14122
13791
|
filesChanged: (0, parser_1.parseFilesChanged)(accumulatedStdout),
|
|
14123
13792
|
usage: accumulatedUsage,
|
|
14124
|
-
skillsUsed: Array.from(accumulatedSkills)
|
|
14125
|
-
extensionsCreated: accumulatedExtensions
|
|
13793
|
+
skillsUsed: Array.from(accumulatedSkills)
|
|
14126
13794
|
};
|
|
14127
13795
|
logger_12.logger.info("[OpenCode] Usage summary", { usage: finalResult.usage });
|
|
14128
13796
|
await logOpenCodeStats(options);
|
|
@@ -14161,13 +13829,7 @@ var require_executor = __commonJS({
|
|
|
14161
13829
|
return;
|
|
14162
13830
|
state.resolved = true;
|
|
14163
13831
|
(0, process_manager_1.clearTimers)(timers);
|
|
14164
|
-
if (result.success) {
|
|
14165
|
-
await taskTracker.completeRemainingTasks();
|
|
14166
|
-
} else {
|
|
14167
|
-
await taskTracker.failRemainingTasks(result.error?.message || "Code generation failed");
|
|
14168
|
-
}
|
|
14169
13832
|
result.skillsUsed = taskTracker.getSkillsUsed();
|
|
14170
|
-
result.extensionsCreated = taskTracker.getExtensionsCreated();
|
|
14171
13833
|
resolve(result);
|
|
14172
13834
|
};
|
|
14173
13835
|
const ctx = {
|
|
@@ -14213,8 +13875,7 @@ var require_executor = __commonJS({
|
|
|
14213
13875
|
requiredPermissions: [],
|
|
14214
13876
|
filesChanged: [],
|
|
14215
13877
|
usage: (0, parser_1.createEmptyUsageStats)(),
|
|
14216
|
-
skillsUsed: []
|
|
14217
|
-
extensionsCreated: []
|
|
13878
|
+
skillsUsed: []
|
|
14218
13879
|
});
|
|
14219
13880
|
}
|
|
14220
13881
|
});
|
|
@@ -14532,6 +14193,39 @@ var require_git_file_changes = __commonJS({
|
|
|
14532
14193
|
}
|
|
14533
14194
|
});
|
|
14534
14195
|
|
|
14196
|
+
// dist/opencode-integration/inject-created-by.js
|
|
14197
|
+
var require_inject_created_by = __commonJS({
|
|
14198
|
+
"dist/opencode-integration/inject-created-by.js"(exports2) {
|
|
14199
|
+
"use strict";
|
|
14200
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14201
|
+
exports2.injectCreatedByIntoExtensionFiles = injectCreatedByIntoExtensionFiles;
|
|
14202
|
+
var promises_1 = require("fs/promises");
|
|
14203
|
+
var path_1 = require("path");
|
|
14204
|
+
var logger_12 = require_logger();
|
|
14205
|
+
var constants_1 = require_constants5();
|
|
14206
|
+
async function injectCreatedByIntoExtensionFiles(cwd, createdExtensions) {
|
|
14207
|
+
for (const { path: filePath } of createdExtensions) {
|
|
14208
|
+
const absolutePath = (0, path_1.join)(cwd, filePath);
|
|
14209
|
+
try {
|
|
14210
|
+
const original = await (0, promises_1.readFile)(absolutePath, "utf-8");
|
|
14211
|
+
const injected = (0, constants_1.injectCreatedBy)(original);
|
|
14212
|
+
if (injected !== original) {
|
|
14213
|
+
await (0, promises_1.writeFile)(absolutePath, injected, "utf-8");
|
|
14214
|
+
logger_12.logger.info("[OpenCode] Injected createdBy into extension file", {
|
|
14215
|
+
filePath
|
|
14216
|
+
});
|
|
14217
|
+
}
|
|
14218
|
+
} catch (error) {
|
|
14219
|
+
logger_12.logger.error("[OpenCode] Failed to inject createdBy", {
|
|
14220
|
+
filePath,
|
|
14221
|
+
error: error instanceof Error ? error.message : String(error)
|
|
14222
|
+
});
|
|
14223
|
+
}
|
|
14224
|
+
}
|
|
14225
|
+
}
|
|
14226
|
+
}
|
|
14227
|
+
});
|
|
14228
|
+
|
|
14535
14229
|
// ../../node_modules/@wix/bi-logger-dev-tools-data/dist/cjs/v2/index.js
|
|
14536
14230
|
var require_v2 = __commonJS({
|
|
14537
14231
|
"../../node_modules/@wix/bi-logger-dev-tools-data/dist/cjs/v2/index.js"(exports2) {
|
|
@@ -19488,6 +19182,7 @@ var require_opencode_init = __commonJS({
|
|
|
19488
19182
|
var logger_12 = require_logger();
|
|
19489
19183
|
var config_12 = require_config();
|
|
19490
19184
|
var git_file_changes_1 = require_git_file_changes();
|
|
19185
|
+
var inject_created_by_1 = require_inject_created_by();
|
|
19491
19186
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19492
19187
|
var biEvents_1 = require_biEvents();
|
|
19493
19188
|
var pre_run_decision_1 = require_pre_run_decision();
|
|
@@ -19545,6 +19240,7 @@ var require_opencode_init = __commonJS({
|
|
|
19545
19240
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19546
19241
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19547
19242
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19243
|
+
await (0, inject_created_by_1.injectCreatedByIntoExtensionFiles)(outputPath, extensions.created);
|
|
19548
19244
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19549
19245
|
requiredPermissions: result.requiredPermissions,
|
|
19550
19246
|
files,
|
|
@@ -19564,7 +19260,7 @@ var require_opencode_init = __commonJS({
|
|
|
19564
19260
|
agentOutput: JSON.stringify({ files }),
|
|
19565
19261
|
jobDuration: String(Date.now() - flowStartTime),
|
|
19566
19262
|
skillsUsed: result.skillsUsed,
|
|
19567
|
-
extensionsCreated:
|
|
19263
|
+
extensionsCreated: extensions.created.map((extension) => extension.extensionType)
|
|
19568
19264
|
});
|
|
19569
19265
|
logger_12.logger.info("[OpenCode Init] Completed task", { taskId });
|
|
19570
19266
|
} catch (error) {
|
|
@@ -19686,6 +19382,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
19686
19382
|
var logger_12 = require_logger();
|
|
19687
19383
|
var config_12 = require_config();
|
|
19688
19384
|
var git_file_changes_1 = require_git_file_changes();
|
|
19385
|
+
var inject_created_by_1 = require_inject_created_by();
|
|
19689
19386
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19690
19387
|
var biEvents_1 = require_biEvents();
|
|
19691
19388
|
var hooks_1 = require_hooks();
|
|
@@ -19731,6 +19428,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
19731
19428
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19732
19429
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
19733
19430
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19431
|
+
await (0, inject_created_by_1.injectCreatedByIntoExtensionFiles)(outputPath, extensions.created);
|
|
19734
19432
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19735
19433
|
requiredPermissions: result.requiredPermissions,
|
|
19736
19434
|
files,
|
|
@@ -19749,7 +19447,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
19749
19447
|
agentOutput: JSON.stringify({ files }),
|
|
19750
19448
|
jobDuration: String(Date.now() - flowStartTime),
|
|
19751
19449
|
skillsUsed: result.skillsUsed,
|
|
19752
|
-
extensionsCreated:
|
|
19450
|
+
extensionsCreated: extensions.created.map((extension) => extension.extensionType)
|
|
19753
19451
|
});
|
|
19754
19452
|
logger_12.logger.info("[OpenCode Iterate] Completed task", { taskId });
|
|
19755
19453
|
} catch (error) {
|
|
@@ -19868,6 +19566,7 @@ var require_opencode_ask = __commonJS({
|
|
|
19868
19566
|
var logger_12 = require_logger();
|
|
19869
19567
|
var config_12 = require_config();
|
|
19870
19568
|
var git_file_changes_1 = require_git_file_changes();
|
|
19569
|
+
var inject_created_by_1 = require_inject_created_by();
|
|
19871
19570
|
var collect_extensions_created_1 = require_collect_extensions_created();
|
|
19872
19571
|
var biEvents_1 = require_biEvents();
|
|
19873
19572
|
var runOpencodeAskFlow = async (chatHistory) => {
|
|
@@ -19909,6 +19608,7 @@ var require_opencode_ask = __commonJS({
|
|
|
19909
19608
|
});
|
|
19910
19609
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
19911
19610
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
19611
|
+
await (0, inject_created_by_1.injectCreatedByIntoExtensionFiles)(outputPath, extensions.created);
|
|
19912
19612
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
19913
19613
|
files,
|
|
19914
19614
|
extensions
|
|
@@ -19925,7 +19625,8 @@ var require_opencode_ask = __commonJS({
|
|
|
19925
19625
|
taskCost: Math.round(result.usage.cost * 1e6),
|
|
19926
19626
|
taskStatus: ditto_codegen_types_12.Status.COMPLETED,
|
|
19927
19627
|
agentOutput: JSON.stringify({ answer: result.answer, files }),
|
|
19928
|
-
jobDuration: String(Date.now() - flowStartTime)
|
|
19628
|
+
jobDuration: String(Date.now() - flowStartTime),
|
|
19629
|
+
extensionsCreated: extensions.created.map((extension) => extension.extensionType)
|
|
19929
19630
|
});
|
|
19930
19631
|
logger_12.logger.info("[OpenCode Ask] Completed task", { taskId });
|
|
19931
19632
|
} catch (error) {
|
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.335",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"esbuild": "^0.27.2",
|
|
29
29
|
"vitest": "^4.0.16"
|
|
30
30
|
},
|
|
31
|
-
"falconPackageHash": "
|
|
31
|
+
"falconPackageHash": "b993f7a69dd7338107eee12a6b71c69f1b9ff64a1e5f56741c8c2523"
|
|
32
32
|
}
|