@wix/ditto-codegen-public 1.0.315 → 1.0.316
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 +127 -38
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -10291,6 +10291,50 @@ var require_logger = __commonJS({
|
|
|
10291
10291
|
}
|
|
10292
10292
|
});
|
|
10293
10293
|
|
|
10294
|
+
// dist/services/wixTokenRefresh.js
|
|
10295
|
+
var require_wixTokenRefresh = __commonJS({
|
|
10296
|
+
"dist/services/wixTokenRefresh.js"(exports2) {
|
|
10297
|
+
"use strict";
|
|
10298
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
10299
|
+
exports2.refreshWixAccessToken = refreshWixAccessToken;
|
|
10300
|
+
var child_process_1 = require("child_process");
|
|
10301
|
+
var util_1 = require("util");
|
|
10302
|
+
var logger_12 = require_logger();
|
|
10303
|
+
var execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
|
|
10304
|
+
var inFlight = null;
|
|
10305
|
+
async function runWixToken() {
|
|
10306
|
+
const { stdout } = await execFileAsync("wix", ["token", "--json"], {
|
|
10307
|
+
timeout: 3e4
|
|
10308
|
+
});
|
|
10309
|
+
const parsed = JSON.parse(stdout);
|
|
10310
|
+
if (!parsed.accessToken) {
|
|
10311
|
+
throw new Error("wix token returned empty accessToken");
|
|
10312
|
+
}
|
|
10313
|
+
return parsed.accessToken;
|
|
10314
|
+
}
|
|
10315
|
+
async function refreshWixAccessToken() {
|
|
10316
|
+
if (inFlight)
|
|
10317
|
+
return inFlight;
|
|
10318
|
+
inFlight = (async () => {
|
|
10319
|
+
logger_12.logger.info("[Auth] Refreshing access token via `wix token`");
|
|
10320
|
+
try {
|
|
10321
|
+
const token = await runWixToken();
|
|
10322
|
+
logger_12.logger.info("[Auth] Access token refreshed");
|
|
10323
|
+
return token;
|
|
10324
|
+
} catch (err) {
|
|
10325
|
+
logger_12.logger.error("[Auth] Failed to refresh access token", {
|
|
10326
|
+
error: err instanceof Error ? err.message : String(err)
|
|
10327
|
+
});
|
|
10328
|
+
throw err;
|
|
10329
|
+
} finally {
|
|
10330
|
+
inFlight = null;
|
|
10331
|
+
}
|
|
10332
|
+
})();
|
|
10333
|
+
return inFlight;
|
|
10334
|
+
}
|
|
10335
|
+
}
|
|
10336
|
+
});
|
|
10337
|
+
|
|
10294
10338
|
// dist/services/CodeGenService.js
|
|
10295
10339
|
var require_CodeGenService = __commonJS({
|
|
10296
10340
|
"dist/services/CodeGenService.js"(exports2) {
|
|
@@ -10300,6 +10344,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10300
10344
|
exports2.createCodeGenErrorHandler = createCodeGenErrorHandler;
|
|
10301
10345
|
var http_client_1 = require_index_node();
|
|
10302
10346
|
var http_1 = require_http_impl();
|
|
10347
|
+
var wixTokenRefresh_1 = require_wixTokenRefresh();
|
|
10303
10348
|
var types_1 = require_types_impl();
|
|
10304
10349
|
Object.defineProperty(exports2, "Status", { enumerable: true, get: function() {
|
|
10305
10350
|
return types_1.Status;
|
|
@@ -10332,8 +10377,24 @@ var require_CodeGenService = __commonJS({
|
|
|
10332
10377
|
this.projectId = projectId;
|
|
10333
10378
|
this.accessToken = process.env.WIX_ACCESS_TOKEN;
|
|
10334
10379
|
this.sandboxId = process.env.SANDBOX_ID;
|
|
10380
|
+
this.refreshAccessToken = async () => {
|
|
10381
|
+
const token = await (0, wixTokenRefresh_1.refreshWixAccessToken)();
|
|
10382
|
+
this.setAccessToken(token);
|
|
10383
|
+
return token;
|
|
10384
|
+
};
|
|
10385
|
+
this.request = async (req) => {
|
|
10386
|
+
try {
|
|
10387
|
+
return await this.httpClient.request(this.withAuth(req));
|
|
10388
|
+
} catch (err) {
|
|
10389
|
+
if (!this.isUnauthorized(err))
|
|
10390
|
+
throw err;
|
|
10391
|
+
logger_12.logger.warn("[CodeGenService] 401 received, refreshing token and retrying once");
|
|
10392
|
+
await this.refreshAccessToken();
|
|
10393
|
+
return await this.httpClient.request(this.withAuth(req));
|
|
10394
|
+
}
|
|
10395
|
+
};
|
|
10335
10396
|
this.fetchPendingJobs = async () => {
|
|
10336
|
-
const resp = await this.
|
|
10397
|
+
const resp = await this.request((0, http_1.listProjectJobs)({
|
|
10337
10398
|
projectId: this.projectId
|
|
10338
10399
|
}));
|
|
10339
10400
|
const jobs = resp.data?.jobs ?? [];
|
|
@@ -10347,7 +10408,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10347
10408
|
return true;
|
|
10348
10409
|
};
|
|
10349
10410
|
this.markJobAsCompleted = async (jobId) => {
|
|
10350
|
-
await this.
|
|
10411
|
+
await this.request((0, http_1.updateJob)({
|
|
10351
10412
|
projectId: this.projectId,
|
|
10352
10413
|
job: {
|
|
10353
10414
|
id: jobId,
|
|
@@ -10357,7 +10418,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10357
10418
|
}));
|
|
10358
10419
|
};
|
|
10359
10420
|
this.markJobAsRuninng = async (jobId) => {
|
|
10360
|
-
await this.
|
|
10421
|
+
await this.request((0, http_1.updateJob)({
|
|
10361
10422
|
projectId: this.projectId,
|
|
10362
10423
|
job: {
|
|
10363
10424
|
id: jobId,
|
|
@@ -10367,7 +10428,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10367
10428
|
}));
|
|
10368
10429
|
};
|
|
10369
10430
|
this.markJobAsCancelled = async (jobId) => {
|
|
10370
|
-
await this.
|
|
10431
|
+
await this.request((0, http_1.updateJob)({
|
|
10371
10432
|
projectId: this.projectId,
|
|
10372
10433
|
job: {
|
|
10373
10434
|
id: jobId,
|
|
@@ -10377,7 +10438,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10377
10438
|
}));
|
|
10378
10439
|
};
|
|
10379
10440
|
this.updateJob = async (jobId, payload) => {
|
|
10380
|
-
await this.
|
|
10441
|
+
await this.request((0, http_1.updateJob)({
|
|
10381
10442
|
projectId: this.projectId,
|
|
10382
10443
|
job: {
|
|
10383
10444
|
id: jobId,
|
|
@@ -10391,7 +10452,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10391
10452
|
jobId,
|
|
10392
10453
|
status
|
|
10393
10454
|
});
|
|
10394
|
-
await this.
|
|
10455
|
+
await this.request((0, http_1.updateJob)({
|
|
10395
10456
|
projectId: this.projectId,
|
|
10396
10457
|
job: {
|
|
10397
10458
|
id: jobId,
|
|
@@ -10406,7 +10467,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10406
10467
|
decisionId: userDecision.id,
|
|
10407
10468
|
userDecision: JSON.stringify(userDecision, null, 2)
|
|
10408
10469
|
});
|
|
10409
|
-
await this.
|
|
10470
|
+
await this.request((0, http_1.updateJob)({
|
|
10410
10471
|
projectId: this.projectId,
|
|
10411
10472
|
job: {
|
|
10412
10473
|
id: jobId,
|
|
@@ -10418,7 +10479,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10418
10479
|
};
|
|
10419
10480
|
this.resumeJobFromDecision = async (jobId) => {
|
|
10420
10481
|
logger_12.logger.info("Resuming job from user decision");
|
|
10421
|
-
await this.
|
|
10482
|
+
await this.request((0, http_1.updateJob)({
|
|
10422
10483
|
projectId: this.projectId,
|
|
10423
10484
|
job: {
|
|
10424
10485
|
id: jobId,
|
|
@@ -10429,7 +10490,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10429
10490
|
}));
|
|
10430
10491
|
};
|
|
10431
10492
|
this.updateTask = async (jobId, taskId, status, payload) => {
|
|
10432
|
-
await this.
|
|
10493
|
+
await this.request((0, http_1.updateTask)({
|
|
10433
10494
|
projectId: this.projectId,
|
|
10434
10495
|
jobId,
|
|
10435
10496
|
task: {
|
|
@@ -10440,7 +10501,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10440
10501
|
}));
|
|
10441
10502
|
};
|
|
10442
10503
|
this.addTask = async (jobId, task) => {
|
|
10443
|
-
await this.
|
|
10504
|
+
await this.request((0, http_1.createTask)({
|
|
10444
10505
|
projectId: this.projectId,
|
|
10445
10506
|
jobId,
|
|
10446
10507
|
task: {
|
|
@@ -10455,7 +10516,7 @@ var require_CodeGenService = __commonJS({
|
|
|
10455
10516
|
}));
|
|
10456
10517
|
};
|
|
10457
10518
|
this.getJob = async (jobId) => {
|
|
10458
|
-
const resp = await this.
|
|
10519
|
+
const resp = await this.request((0, http_1.getJob)({
|
|
10459
10520
|
projectId: this.projectId,
|
|
10460
10521
|
jobId
|
|
10461
10522
|
}));
|
|
@@ -10468,12 +10529,32 @@ var require_CodeGenService = __commonJS({
|
|
|
10468
10529
|
const serverUrl = process.env.CODEGEN_SERVER_BASE_URL || "https://manage.wix.com";
|
|
10469
10530
|
this.httpClient = (0, http_client_1.createHttpClient)({
|
|
10470
10531
|
baseURL: serverUrl,
|
|
10471
|
-
headers: {
|
|
10472
|
-
authorization: `Bearer ${this.accessToken}`
|
|
10473
|
-
},
|
|
10474
10532
|
errorHandler: createCodeGenErrorHandler(() => this.httpClient)
|
|
10475
10533
|
});
|
|
10476
10534
|
}
|
|
10535
|
+
getAccessToken() {
|
|
10536
|
+
return this.accessToken;
|
|
10537
|
+
}
|
|
10538
|
+
setAccessToken(token) {
|
|
10539
|
+
this.accessToken = token;
|
|
10540
|
+
}
|
|
10541
|
+
isUnauthorized(error) {
|
|
10542
|
+
if (!http_client_1.HttpClient.isHttpError(error))
|
|
10543
|
+
return false;
|
|
10544
|
+
if (this.httpClient.isCancel(error))
|
|
10545
|
+
return false;
|
|
10546
|
+
return error.response?.status === 401;
|
|
10547
|
+
}
|
|
10548
|
+
withAuth(req) {
|
|
10549
|
+
const authHeader = { authorization: `Bearer ${this.accessToken}` };
|
|
10550
|
+
if (typeof req === "function") {
|
|
10551
|
+
return (ctx) => {
|
|
10552
|
+
const r = req(ctx);
|
|
10553
|
+
return { ...r, headers: { ...r.headers ?? {}, ...authHeader } };
|
|
10554
|
+
};
|
|
10555
|
+
}
|
|
10556
|
+
return { ...req, headers: { ...req.headers ?? {}, ...authHeader } };
|
|
10557
|
+
}
|
|
10477
10558
|
};
|
|
10478
10559
|
exports2.CodeGenService = CodeGenService;
|
|
10479
10560
|
}
|
|
@@ -12221,6 +12302,7 @@ var require_config = __commonJS({
|
|
|
12221
12302
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12222
12303
|
exports2.DEFAULT_MODEL = exports2.DEFAULT_TIMEOUT_MS = void 0;
|
|
12223
12304
|
exports2.getAnthropicBaseUrl = getAnthropicBaseUrl;
|
|
12305
|
+
exports2.setCurrentAccessToken = setCurrentAccessToken;
|
|
12224
12306
|
exports2.getOpenCodeEnv = getOpenCodeEnv;
|
|
12225
12307
|
var os_1 = require("os");
|
|
12226
12308
|
var constants_1 = require_constants5();
|
|
@@ -12236,9 +12318,13 @@ var require_config = __commonJS({
|
|
|
12236
12318
|
}
|
|
12237
12319
|
return `${AI_PROXY_BASE_URL}/projects/${projectId}/anthropic`;
|
|
12238
12320
|
}
|
|
12321
|
+
var currentAccessToken = process.env.WIX_ACCESS_TOKEN;
|
|
12322
|
+
function setCurrentAccessToken(token) {
|
|
12323
|
+
currentAccessToken = token;
|
|
12324
|
+
process.env.WIX_ACCESS_TOKEN = token;
|
|
12325
|
+
}
|
|
12239
12326
|
function getProviderConfig() {
|
|
12240
|
-
const
|
|
12241
|
-
const headers = accessToken ? { Authorization: `Bearer ${accessToken}` } : {};
|
|
12327
|
+
const headers = currentAccessToken ? { Authorization: `Bearer ${currentAccessToken}` } : {};
|
|
12242
12328
|
return {
|
|
12243
12329
|
anthropic: {
|
|
12244
12330
|
options: {
|
|
@@ -13190,18 +13276,18 @@ var require_process_handlers = __commonJS({
|
|
|
13190
13276
|
exports2.setupCloseHandler = setupCloseHandler;
|
|
13191
13277
|
exports2.setupErrorHandler = setupErrorHandler;
|
|
13192
13278
|
var parser_1 = require_parser();
|
|
13193
|
-
var
|
|
13279
|
+
var config_12 = require_config();
|
|
13194
13280
|
var process_manager_1 = require_process_manager();
|
|
13195
13281
|
var result_builder_1 = require_result_builder();
|
|
13196
13282
|
var logger_12 = require_logger();
|
|
13197
13283
|
function setupTotalTimeout(ctx) {
|
|
13198
13284
|
return setTimeout(() => {
|
|
13199
13285
|
if (ctx.child && !ctx.state.resolved) {
|
|
13200
|
-
logger_12.logger.warn(`[OpenCode] Process timed out after ${
|
|
13286
|
+
logger_12.logger.warn(`[OpenCode] Process timed out after ${config_12.DEFAULT_TIMEOUT_MS}ms (total timeout)`);
|
|
13201
13287
|
(0, process_manager_1.killProcess)(ctx.child, ctx.state.resolved);
|
|
13202
|
-
ctx.finalize((0, result_builder_1.createTimeoutResult)(`Process timed out after ${
|
|
13288
|
+
ctx.finalize((0, result_builder_1.createTimeoutResult)(`Process timed out after ${config_12.DEFAULT_TIMEOUT_MS}ms`, ctx.state.stdout, ctx.state.stderr, ctx.startTime));
|
|
13203
13289
|
}
|
|
13204
|
-
},
|
|
13290
|
+
}, config_12.DEFAULT_TIMEOUT_MS);
|
|
13205
13291
|
}
|
|
13206
13292
|
function setupIdleWatchdog(ctx) {
|
|
13207
13293
|
return setInterval(() => {
|
|
@@ -13276,7 +13362,7 @@ var require_executor = __commonJS({
|
|
|
13276
13362
|
exports2.executeOpenCode = executeOpenCode;
|
|
13277
13363
|
var child_process_1 = require("child_process");
|
|
13278
13364
|
var ditto_codegen_types_12 = require_dist4();
|
|
13279
|
-
var
|
|
13365
|
+
var config_12 = require_config();
|
|
13280
13366
|
var job_context_storage_12 = require_job_context_storage();
|
|
13281
13367
|
var parser_1 = require_parser();
|
|
13282
13368
|
var prompts_1 = require_prompts();
|
|
@@ -13343,7 +13429,7 @@ var require_executor = __commonJS({
|
|
|
13343
13429
|
}
|
|
13344
13430
|
async function logOpenCodeStats(options) {
|
|
13345
13431
|
const isAsk = job_context_storage_12.jobContextStorage.getStore()?.kind === ditto_codegen_types_12.TaskKind.ASK_CODEGEN;
|
|
13346
|
-
const env = (0,
|
|
13432
|
+
const env = (0, config_12.getOpenCodeEnv)(options.projectId, isAsk);
|
|
13347
13433
|
const stats = await (0, cost_tracker_1.fetchOpenCodeStats)(options.outputPath, env);
|
|
13348
13434
|
if (stats) {
|
|
13349
13435
|
console.log("[OpenCode] Stats\n", stats);
|
|
@@ -13399,7 +13485,7 @@ var require_executor = __commonJS({
|
|
|
13399
13485
|
workingDirectory: outputPath
|
|
13400
13486
|
});
|
|
13401
13487
|
const isAsk = job_context_storage_12.jobContextStorage.getStore()?.kind === ditto_codegen_types_12.TaskKind.ASK_CODEGEN;
|
|
13402
|
-
const env = (0,
|
|
13488
|
+
const env = (0, config_12.getOpenCodeEnv)(projectId, isAsk);
|
|
13403
13489
|
ctx.child = (0, child_process_1.spawn)("opencode", args, {
|
|
13404
13490
|
cwd: outputPath,
|
|
13405
13491
|
env,
|
|
@@ -18007,7 +18093,7 @@ var require_opencode_init = __commonJS({
|
|
|
18007
18093
|
var ditto_codegen_types_2 = require_dist4();
|
|
18008
18094
|
var context_12 = require_context();
|
|
18009
18095
|
var logger_12 = require_logger();
|
|
18010
|
-
var
|
|
18096
|
+
var config_12 = require_config();
|
|
18011
18097
|
var biEvents_1 = require_biEvents();
|
|
18012
18098
|
var pre_run_decision_1 = require_pre_run_decision();
|
|
18013
18099
|
var experiments_1 = require_experiments();
|
|
@@ -18033,7 +18119,7 @@ var require_opencode_init = __commonJS({
|
|
|
18033
18119
|
logger_12.logger.info("[OpenCode Init] Marked task RUNNING", { taskId });
|
|
18034
18120
|
(0, biEvents_1.reportSessionStart)({
|
|
18035
18121
|
...biBaseParams,
|
|
18036
|
-
Task_model:
|
|
18122
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18037
18123
|
Task_type: kind
|
|
18038
18124
|
});
|
|
18039
18125
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
@@ -18071,7 +18157,7 @@ var require_opencode_init = __commonJS({
|
|
|
18071
18157
|
}
|
|
18072
18158
|
(0, biEvents_1.reportSessionEnd)({
|
|
18073
18159
|
...biBaseParams,
|
|
18074
|
-
Task_model:
|
|
18160
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18075
18161
|
Task_type: kind,
|
|
18076
18162
|
Task_cost: Math.round(result.usage.cost * 1e6),
|
|
18077
18163
|
Task_status: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -18098,13 +18184,13 @@ var require_opencode_init = __commonJS({
|
|
|
18098
18184
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
18099
18185
|
(0, biEvents_1.reportSessionEnd)({
|
|
18100
18186
|
...biBaseParams,
|
|
18101
|
-
Task_model:
|
|
18187
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18102
18188
|
Task_type: kind,
|
|
18103
18189
|
Task_status: ditto_codegen_types_12.Status.FAILED
|
|
18104
18190
|
});
|
|
18105
18191
|
(0, biEvents_1.reportSessionError)({
|
|
18106
18192
|
...biBaseParams,
|
|
18107
|
-
task_model:
|
|
18193
|
+
task_model: config_12.DEFAULT_MODEL,
|
|
18108
18194
|
task_type: kind,
|
|
18109
18195
|
Agent_output: JSON.stringify(codegenError),
|
|
18110
18196
|
Error_desc: codegenError.errorType,
|
|
@@ -18196,7 +18282,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
18196
18282
|
var ditto_codegen_types_2 = require_dist4();
|
|
18197
18283
|
var context_12 = require_context();
|
|
18198
18284
|
var logger_12 = require_logger();
|
|
18199
|
-
var
|
|
18285
|
+
var config_12 = require_config();
|
|
18200
18286
|
var biEvents_1 = require_biEvents();
|
|
18201
18287
|
var hooks_1 = require_hooks();
|
|
18202
18288
|
var runOpencodeIterateFlow = async (chatHistory, agentData) => {
|
|
@@ -18219,7 +18305,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
18219
18305
|
logger_12.logger.info("[OpenCode Iterate] Marked task RUNNING", { taskId });
|
|
18220
18306
|
(0, biEvents_1.reportSessionStart)({
|
|
18221
18307
|
...biBaseParams,
|
|
18222
|
-
Task_model:
|
|
18308
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18223
18309
|
Task_type: kind
|
|
18224
18310
|
});
|
|
18225
18311
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
@@ -18249,7 +18335,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
18249
18335
|
});
|
|
18250
18336
|
(0, biEvents_1.reportSessionEnd)({
|
|
18251
18337
|
...biBaseParams,
|
|
18252
|
-
Task_model:
|
|
18338
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18253
18339
|
Task_type: kind,
|
|
18254
18340
|
Task_cost: Math.round(result.usage.cost * 1e6),
|
|
18255
18341
|
Task_status: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -18270,13 +18356,13 @@ var require_opencode_iterate = __commonJS({
|
|
|
18270
18356
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
18271
18357
|
(0, biEvents_1.reportSessionEnd)({
|
|
18272
18358
|
...biBaseParams,
|
|
18273
|
-
Task_model:
|
|
18359
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18274
18360
|
Task_type: kind,
|
|
18275
18361
|
Task_status: ditto_codegen_types_12.Status.FAILED
|
|
18276
18362
|
});
|
|
18277
18363
|
(0, biEvents_1.reportSessionError)({
|
|
18278
18364
|
...biBaseParams,
|
|
18279
|
-
task_model:
|
|
18365
|
+
task_model: config_12.DEFAULT_MODEL,
|
|
18280
18366
|
task_type: kind,
|
|
18281
18367
|
Agent_output: JSON.stringify(codegenError),
|
|
18282
18368
|
Error_desc: codegenError.errorType,
|
|
@@ -18366,7 +18452,7 @@ var require_opencode_ask = __commonJS({
|
|
|
18366
18452
|
var ditto_codegen_types_2 = require_dist4();
|
|
18367
18453
|
var context_12 = require_context();
|
|
18368
18454
|
var logger_12 = require_logger();
|
|
18369
|
-
var
|
|
18455
|
+
var config_12 = require_config();
|
|
18370
18456
|
var biEvents_1 = require_biEvents();
|
|
18371
18457
|
var runOpencodeAskFlow = async (chatHistory) => {
|
|
18372
18458
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
@@ -18388,7 +18474,7 @@ var require_opencode_ask = __commonJS({
|
|
|
18388
18474
|
logger_12.logger.info("[OpenCode Ask] Marked task RUNNING", { taskId });
|
|
18389
18475
|
(0, biEvents_1.reportSessionStart)({
|
|
18390
18476
|
...biBaseParams,
|
|
18391
|
-
Task_model:
|
|
18477
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18392
18478
|
Task_type: kind
|
|
18393
18479
|
});
|
|
18394
18480
|
try {
|
|
@@ -18407,7 +18493,7 @@ var require_opencode_ask = __commonJS({
|
|
|
18407
18493
|
});
|
|
18408
18494
|
(0, biEvents_1.reportSessionEnd)({
|
|
18409
18495
|
...biBaseParams,
|
|
18410
|
-
Task_model:
|
|
18496
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18411
18497
|
Task_type: kind,
|
|
18412
18498
|
Task_cost: Math.round(result.usage.cost * 1e6),
|
|
18413
18499
|
Task_status: ditto_codegen_types_12.Status.COMPLETED,
|
|
@@ -18419,13 +18505,13 @@ var require_opencode_ask = __commonJS({
|
|
|
18419
18505
|
await (0, codegen_flow_helpers_12.updateParentTaskStatus)(localJobContext, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
18420
18506
|
(0, biEvents_1.reportSessionEnd)({
|
|
18421
18507
|
...biBaseParams,
|
|
18422
|
-
Task_model:
|
|
18508
|
+
Task_model: config_12.DEFAULT_MODEL,
|
|
18423
18509
|
Task_type: kind,
|
|
18424
18510
|
Task_status: ditto_codegen_types_12.Status.FAILED
|
|
18425
18511
|
});
|
|
18426
18512
|
(0, biEvents_1.reportSessionError)({
|
|
18427
18513
|
...biBaseParams,
|
|
18428
|
-
task_model:
|
|
18514
|
+
task_model: config_12.DEFAULT_MODEL,
|
|
18429
18515
|
task_type: kind,
|
|
18430
18516
|
Agent_output: JSON.stringify(codegenError),
|
|
18431
18517
|
Error_desc: codegenError.errorType,
|
|
@@ -18713,6 +18799,7 @@ var logger_1 = require_logger();
|
|
|
18713
18799
|
var skills_installer_1 = require_skills_installer();
|
|
18714
18800
|
var rules_writer_1 = require_rules_writer();
|
|
18715
18801
|
var tools_writer_1 = require_tools_writer();
|
|
18802
|
+
var config_1 = require_config();
|
|
18716
18803
|
var environments_1 = require_environments();
|
|
18717
18804
|
var sessionId = process.env.CODEGEN_SESSION_ID || (0, crypto_1.randomUUID)();
|
|
18718
18805
|
process.env.CODEGEN_SESSION_ID = sessionId;
|
|
@@ -18745,6 +18832,8 @@ var alwaysOnLoop = async () => {
|
|
|
18745
18832
|
}
|
|
18746
18833
|
const jobId = job.id;
|
|
18747
18834
|
logger_1.logger.info("[Loop] Selected job", { jobId });
|
|
18835
|
+
const freshToken = await codeGenerationService_1.codeGenerationService.refreshAccessToken();
|
|
18836
|
+
(0, config_1.setCurrentAccessToken)(freshToken);
|
|
18748
18837
|
await codeGenerationService_1.codeGenerationService.markJobAsRuninng(jobId);
|
|
18749
18838
|
await processJob(job);
|
|
18750
18839
|
await codeGenerationService_1.codeGenerationService.markJobAsCompleted(jobId);
|
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.316",
|
|
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": "fdbca03775b0d9bfe701dc5d76f9b55cffa318cb0a728e41a97434c0"
|
|
31
31
|
}
|