@synchronized-studio/cmsassets-agent 0.1.2 → 0.1.3
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/aiReview-6WOTHK5N.js +9 -0
- package/dist/chunk-E74TGIFQ.js +88 -0
- package/dist/chunk-OAWCNTAC.js +397 -0
- package/dist/chunk-Q6VYUIS7.js +1035 -0
- package/dist/chunk-WDZHZ32V.js +1433 -0
- package/dist/cli.js +79 -42
- package/dist/index.js +4 -3
- package/dist/openaiClient-YGAFYB3X.js +11 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9,8 +9,9 @@ import {
|
|
|
9
9
|
saveReport,
|
|
10
10
|
scan,
|
|
11
11
|
verify
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
} from "./chunk-WDZHZ32V.js";
|
|
13
|
+
import "./chunk-Q6VYUIS7.js";
|
|
14
|
+
import "./chunk-E74TGIFQ.js";
|
|
14
15
|
import "./chunk-QGM4M3NI.js";
|
|
15
16
|
|
|
16
17
|
// src/cli.ts
|
|
@@ -67,6 +68,18 @@ function confirm(question) {
|
|
|
67
68
|
});
|
|
68
69
|
});
|
|
69
70
|
}
|
|
71
|
+
function getOpenAiInstallCommand(packageManager) {
|
|
72
|
+
switch (packageManager) {
|
|
73
|
+
case "pnpm":
|
|
74
|
+
return "pnpm add openai";
|
|
75
|
+
case "yarn":
|
|
76
|
+
return "yarn add openai";
|
|
77
|
+
case "bun":
|
|
78
|
+
return "bun add openai";
|
|
79
|
+
default:
|
|
80
|
+
return "npm install openai";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
70
83
|
var initCommand = defineCommand({
|
|
71
84
|
meta: {
|
|
72
85
|
name: "init",
|
|
@@ -227,25 +240,43 @@ var initCommand = defineCommand({
|
|
|
227
240
|
if (args["ai-verify"]) {
|
|
228
241
|
const appliedPaths = applyReport.files.filter((f) => f.applied).map((f) => f.filePath);
|
|
229
242
|
if (appliedPaths.length > 0) {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
+
const { checkAiVerifyReady } = await import("./openaiClient-YGAFYB3X.js");
|
|
244
|
+
let ready = await checkAiVerifyReady(root);
|
|
245
|
+
if (!ready.ok && ready.canInstallInProject) {
|
|
246
|
+
const openaiInstallCmd = getOpenAiInstallCommand(scanResult.packageManager);
|
|
247
|
+
consola2.info(`Installing openai in project: ${openaiInstallCmd}`);
|
|
248
|
+
try {
|
|
249
|
+
const { execSync } = await import("child_process");
|
|
250
|
+
execSync(openaiInstallCmd, { cwd: root, stdio: "inherit" });
|
|
251
|
+
ready = await checkAiVerifyReady(root);
|
|
252
|
+
} catch {
|
|
253
|
+
consola2.warn("Installing openai failed. AI verification skipped.");
|
|
254
|
+
ready = { ok: false };
|
|
255
|
+
}
|
|
243
256
|
}
|
|
244
|
-
if (
|
|
245
|
-
consola2.
|
|
257
|
+
if (!ready.ok) {
|
|
258
|
+
consola2.warn(` ${pc.yellow("AI Verification skipped:")} ${ready.reason}`);
|
|
259
|
+
} else {
|
|
260
|
+
consola2.log("");
|
|
261
|
+
consola2.log(pc.bold(" CMS Assets Agent \u2014 AI Verification"));
|
|
262
|
+
consola2.log(pc.dim(" \u2500".repeat(25)));
|
|
263
|
+
consola2.log("");
|
|
264
|
+
const { aiReviewAll } = await import("./aiReview-6WOTHK5N.js");
|
|
265
|
+
aiReviewReport = await aiReviewAll(root, appliedPaths, plan, {
|
|
266
|
+
model: args["ai-model"] ?? "gpt-4o",
|
|
267
|
+
maxIterations: parseInt(args["ai-max-iterations"] ?? "3", 10)
|
|
268
|
+
});
|
|
269
|
+
consola2.log("");
|
|
270
|
+
consola2.log(` ${pc.green("Passed:")} ${aiReviewReport.filesPassed} files`);
|
|
271
|
+
if (aiReviewReport.filesFixed > 0) {
|
|
272
|
+
consola2.log(` ${pc.blue("Fixed:")} ${aiReviewReport.filesFixed} files`);
|
|
273
|
+
}
|
|
274
|
+
if (aiReviewReport.filesFailed > 0) {
|
|
275
|
+
consola2.log(` ${pc.red("Failed:")} ${aiReviewReport.filesFailed} files`);
|
|
276
|
+
}
|
|
277
|
+
consola2.log(` ${pc.dim(`Tokens used: ${aiReviewReport.tokensUsed}`)}`);
|
|
278
|
+
consola2.log("");
|
|
246
279
|
}
|
|
247
|
-
consola2.log(` ${pc.dim(`Tokens used: ${aiReviewReport.tokensUsed}`)}`);
|
|
248
|
-
consola2.log("");
|
|
249
280
|
}
|
|
250
281
|
}
|
|
251
282
|
let scriptAdded = false;
|
|
@@ -643,28 +674,34 @@ var applyCommand = defineCommand4({
|
|
|
643
674
|
if (args["ai-verify"]) {
|
|
644
675
|
const appliedPaths = applyReport.files.filter((f) => f.applied).map((f) => f.filePath);
|
|
645
676
|
if (appliedPaths.length > 0) {
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
consola5.log(` ${pc4.
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
677
|
+
const { checkAiVerifyReady } = await import("./openaiClient-YGAFYB3X.js");
|
|
678
|
+
const ready = await checkAiVerifyReady(root);
|
|
679
|
+
if (!ready.ok) {
|
|
680
|
+
consola5.warn(` ${pc4.yellow("AI Verification skipped:")} ${ready.reason}`);
|
|
681
|
+
} else {
|
|
682
|
+
consola5.log("");
|
|
683
|
+
consola5.log(pc4.bold(" CMS Assets Agent \u2014 AI Verification"));
|
|
684
|
+
consola5.log(pc4.dim(" \u2500".repeat(25)));
|
|
685
|
+
consola5.log("");
|
|
686
|
+
const { aiReviewAll } = await import("./aiReview-6WOTHK5N.js");
|
|
687
|
+
aiReviewReport = await aiReviewAll(root, appliedPaths, plan, {
|
|
688
|
+
model: args["ai-model"] ?? "gpt-4o",
|
|
689
|
+
maxIterations: parseInt(args["ai-max-iterations"] ?? "3", 10)
|
|
690
|
+
});
|
|
691
|
+
consola5.log("");
|
|
692
|
+
consola5.log(` ${pc4.green("Passed:")} ${aiReviewReport.filesPassed} files`);
|
|
693
|
+
if (aiReviewReport.filesFixed > 0) {
|
|
694
|
+
consola5.log(` ${pc4.blue("Fixed:")} ${aiReviewReport.filesFixed} files`);
|
|
695
|
+
}
|
|
696
|
+
if (aiReviewReport.filesFailed > 0) {
|
|
697
|
+
consola5.log(` ${pc4.red("Failed:")} ${aiReviewReport.filesFailed} files`);
|
|
698
|
+
}
|
|
699
|
+
consola5.log(` ${pc4.dim(`Tokens used: ${aiReviewReport.tokensUsed}`)}`);
|
|
700
|
+
consola5.log("");
|
|
701
|
+
if (aiReviewReport.filesFixed > 0 && gitOps.isGitRepo(root) && branchCreated) {
|
|
702
|
+
gitOps.stageAll(root);
|
|
703
|
+
gitOps.commit(root, "chore(cmsassets-agent): AI-verified fixes for missed transforms");
|
|
704
|
+
}
|
|
668
705
|
}
|
|
669
706
|
}
|
|
670
707
|
}
|
|
@@ -974,7 +1011,7 @@ var rollbackCommand = defineCommand7({
|
|
|
974
1011
|
var main = defineCommand8({
|
|
975
1012
|
meta: {
|
|
976
1013
|
name: "cmsassets-agent",
|
|
977
|
-
version: "0.1.
|
|
1014
|
+
version: "0.1.3",
|
|
978
1015
|
description: "Auto-integrate @synchronized-studio/response-transformer into any JS/TS project."
|
|
979
1016
|
},
|
|
980
1017
|
subCommands: {
|
package/dist/index.js
CHANGED
|
@@ -25,11 +25,12 @@ import {
|
|
|
25
25
|
saveReport,
|
|
26
26
|
scan,
|
|
27
27
|
verify
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-WDZHZ32V.js";
|
|
29
29
|
import {
|
|
30
30
|
aiReviewAll
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import "./chunk-
|
|
31
|
+
} from "./chunk-OAWCNTAC.js";
|
|
32
|
+
import "./chunk-Q6VYUIS7.js";
|
|
33
|
+
import "./chunk-E74TGIFQ.js";
|
|
33
34
|
import "./chunk-QGM4M3NI.js";
|
|
34
35
|
|
|
35
36
|
// src/engine.ts
|
package/package.json
CHANGED