@synchronized-studio/cmsassets-agent 0.6.0 → 0.6.1
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-RGKHFUIW.js +9 -0
- package/dist/chunk-3D6MPYQN.js +88 -0
- package/dist/chunk-BHI66HZ7.js +492 -0
- package/dist/chunk-DJEPQELD.js +2052 -0
- package/dist/chunk-XXNYL6ZI.js +2002 -0
- package/dist/cli.js +8 -8
- package/dist/fileFromPath-BV3LA72M.js +129 -0
- package/dist/index.js +4 -4
- package/dist/openai-KWKRAYIT.js +10931 -0
- package/dist/openaiClient-ZGXSVDHJ.js +11 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -9,9 +9,9 @@ import {
|
|
|
9
9
|
saveReport,
|
|
10
10
|
scan,
|
|
11
11
|
verify
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XXNYL6ZI.js";
|
|
13
13
|
import "./chunk-W7TNFULQ.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-3D6MPYQN.js";
|
|
15
15
|
import "./chunk-QGM4M3NI.js";
|
|
16
16
|
|
|
17
17
|
// src/cli.ts
|
|
@@ -384,7 +384,7 @@ var initCommand = defineCommand({
|
|
|
384
384
|
consola3.log(` ${pc.yellow("No OPENAI_API_KEY")} \u2014 using mixed fallback (AST for high/medium, report-only for low)`);
|
|
385
385
|
consola3.log("");
|
|
386
386
|
} else if (aiMode) {
|
|
387
|
-
const { checkAiVerifyReady } = await import("./openaiClient-
|
|
387
|
+
const { checkAiVerifyReady } = await import("./openaiClient-ZGXSVDHJ.js");
|
|
388
388
|
let ready = await checkAiVerifyReady(root);
|
|
389
389
|
if (!ready.ok && ready.canInstallInProject) {
|
|
390
390
|
const openaiInstallCmd = getOpenAiInstallCommand(scanResult.packageManager);
|
|
@@ -420,7 +420,7 @@ var initCommand = defineCommand({
|
|
|
420
420
|
if (args["ai-verify"]) {
|
|
421
421
|
const appliedPaths = applyReport.files.filter((f) => f.applied).map((f) => f.filePath);
|
|
422
422
|
if (appliedPaths.length > 0) {
|
|
423
|
-
const { checkAiVerifyReady } = await import("./openaiClient-
|
|
423
|
+
const { checkAiVerifyReady } = await import("./openaiClient-ZGXSVDHJ.js");
|
|
424
424
|
let ready = await checkAiVerifyReady(root);
|
|
425
425
|
if (!ready.ok && ready.canInstallInProject) {
|
|
426
426
|
const openaiInstallCmd = getOpenAiInstallCommand(scanResult.packageManager);
|
|
@@ -441,7 +441,7 @@ var initCommand = defineCommand({
|
|
|
441
441
|
consola3.log(pc.bold(" CMS Assets Agent \u2014 AI Verification"));
|
|
442
442
|
consola3.log(pc.dim(" \u2500".repeat(25)));
|
|
443
443
|
consola3.log("");
|
|
444
|
-
const { aiReviewAll } = await import("./aiReview-
|
|
444
|
+
const { aiReviewAll } = await import("./aiReview-RGKHFUIW.js");
|
|
445
445
|
aiReviewReport = await aiReviewAll(root, appliedPaths, plan, {
|
|
446
446
|
model: args["ai-model"] ?? "gpt-4o",
|
|
447
447
|
maxIterations: parseInt(args["ai-max-iterations"] ?? "3", 10)
|
|
@@ -850,7 +850,7 @@ var applyCommand = defineCommand4({
|
|
|
850
850
|
consola6.warn("OPENAI_API_KEY is not set. Falling back to AST mode.");
|
|
851
851
|
aiMode = false;
|
|
852
852
|
} else {
|
|
853
|
-
const { checkAiVerifyReady } = await import("./openaiClient-
|
|
853
|
+
const { checkAiVerifyReady } = await import("./openaiClient-ZGXSVDHJ.js");
|
|
854
854
|
const ready = await checkAiVerifyReady(root);
|
|
855
855
|
if (!ready.ok) {
|
|
856
856
|
consola6.warn(`AI mode unavailable: ${ready.reason}. Falling back to AST mode.`);
|
|
@@ -884,7 +884,7 @@ var applyCommand = defineCommand4({
|
|
|
884
884
|
if (args["ai-verify"]) {
|
|
885
885
|
const appliedPaths = applyReport.files.filter((f) => f.applied).map((f) => f.filePath);
|
|
886
886
|
if (appliedPaths.length > 0) {
|
|
887
|
-
const { checkAiVerifyReady } = await import("./openaiClient-
|
|
887
|
+
const { checkAiVerifyReady } = await import("./openaiClient-ZGXSVDHJ.js");
|
|
888
888
|
const ready = await checkAiVerifyReady(root);
|
|
889
889
|
if (!ready.ok) {
|
|
890
890
|
consola6.warn(` ${pc4.yellow("AI Verification skipped:")} ${ready.reason}`);
|
|
@@ -893,7 +893,7 @@ var applyCommand = defineCommand4({
|
|
|
893
893
|
consola6.log(pc4.bold(" CMS Assets Agent \u2014 AI Verification"));
|
|
894
894
|
consola6.log(pc4.dim(" \u2500".repeat(25)));
|
|
895
895
|
consola6.log("");
|
|
896
|
-
const { aiReviewAll } = await import("./aiReview-
|
|
896
|
+
const { aiReviewAll } = await import("./aiReview-RGKHFUIW.js");
|
|
897
897
|
aiReviewReport = await aiReviewAll(root, appliedPaths, plan, {
|
|
898
898
|
model: args["ai-model"] ?? "gpt-4o",
|
|
899
899
|
maxIterations: parseInt(args["ai-max-iterations"] ?? "3", 10)
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
File,
|
|
3
|
+
isFile
|
|
4
|
+
} from "./chunk-DJEPQELD.js";
|
|
5
|
+
import {
|
|
6
|
+
__commonJS,
|
|
7
|
+
__require,
|
|
8
|
+
__toESM
|
|
9
|
+
} from "./chunk-QGM4M3NI.js";
|
|
10
|
+
|
|
11
|
+
// ../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js
|
|
12
|
+
var require_node_domexception = __commonJS({
|
|
13
|
+
"../../node_modules/.pnpm/node-domexception@1.0.0/node_modules/node-domexception/index.js"(exports, module) {
|
|
14
|
+
"use strict";
|
|
15
|
+
if (!globalThis.DOMException) {
|
|
16
|
+
try {
|
|
17
|
+
const { MessageChannel } = __require("worker_threads"), port = new MessageChannel().port1, ab = new ArrayBuffer();
|
|
18
|
+
port.postMessage(ab, [ab, ab]);
|
|
19
|
+
} catch (err) {
|
|
20
|
+
err.constructor.name === "DOMException" && (globalThis.DOMException = err.constructor);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
module.exports = globalThis.DOMException;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js
|
|
28
|
+
var import_node_domexception = __toESM(require_node_domexception(), 1);
|
|
29
|
+
import { statSync, createReadStream, promises as fs } from "fs";
|
|
30
|
+
import { basename } from "path";
|
|
31
|
+
|
|
32
|
+
// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/isPlainObject.js
|
|
33
|
+
var getType = (value) => Object.prototype.toString.call(value).slice(8, -1).toLowerCase();
|
|
34
|
+
function isPlainObject(value) {
|
|
35
|
+
if (getType(value) !== "object") {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
const pp = Object.getPrototypeOf(value);
|
|
39
|
+
if (pp === null || pp === void 0) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
const Ctor = pp.constructor && pp.constructor.toString();
|
|
43
|
+
return Ctor === Object.toString();
|
|
44
|
+
}
|
|
45
|
+
var isPlainObject_default = isPlainObject;
|
|
46
|
+
|
|
47
|
+
// ../../node_modules/.pnpm/formdata-node@4.4.1/node_modules/formdata-node/lib/esm/fileFromPath.js
|
|
48
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
49
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
50
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
51
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
52
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
53
|
+
};
|
|
54
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
55
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
56
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
57
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
58
|
+
};
|
|
59
|
+
var _FileFromPath_path;
|
|
60
|
+
var _FileFromPath_start;
|
|
61
|
+
var MESSAGE = "The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.";
|
|
62
|
+
var FileFromPath = class _FileFromPath {
|
|
63
|
+
constructor(input) {
|
|
64
|
+
_FileFromPath_path.set(this, void 0);
|
|
65
|
+
_FileFromPath_start.set(this, void 0);
|
|
66
|
+
__classPrivateFieldSet(this, _FileFromPath_path, input.path, "f");
|
|
67
|
+
__classPrivateFieldSet(this, _FileFromPath_start, input.start || 0, "f");
|
|
68
|
+
this.name = basename(__classPrivateFieldGet(this, _FileFromPath_path, "f"));
|
|
69
|
+
this.size = input.size;
|
|
70
|
+
this.lastModified = input.lastModified;
|
|
71
|
+
}
|
|
72
|
+
slice(start, end) {
|
|
73
|
+
return new _FileFromPath({
|
|
74
|
+
path: __classPrivateFieldGet(this, _FileFromPath_path, "f"),
|
|
75
|
+
lastModified: this.lastModified,
|
|
76
|
+
size: end - start,
|
|
77
|
+
start
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
async *stream() {
|
|
81
|
+
const { mtimeMs } = await fs.stat(__classPrivateFieldGet(this, _FileFromPath_path, "f"));
|
|
82
|
+
if (mtimeMs > this.lastModified) {
|
|
83
|
+
throw new import_node_domexception.default(MESSAGE, "NotReadableError");
|
|
84
|
+
}
|
|
85
|
+
if (this.size) {
|
|
86
|
+
yield* createReadStream(__classPrivateFieldGet(this, _FileFromPath_path, "f"), {
|
|
87
|
+
start: __classPrivateFieldGet(this, _FileFromPath_start, "f"),
|
|
88
|
+
end: __classPrivateFieldGet(this, _FileFromPath_start, "f") + this.size - 1
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
get [(_FileFromPath_path = /* @__PURE__ */ new WeakMap(), _FileFromPath_start = /* @__PURE__ */ new WeakMap(), Symbol.toStringTag)]() {
|
|
93
|
+
return "File";
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
function createFileFromPath(path, { mtimeMs, size }, filenameOrOptions, options = {}) {
|
|
97
|
+
let filename;
|
|
98
|
+
if (isPlainObject_default(filenameOrOptions)) {
|
|
99
|
+
[options, filename] = [filenameOrOptions, void 0];
|
|
100
|
+
} else {
|
|
101
|
+
filename = filenameOrOptions;
|
|
102
|
+
}
|
|
103
|
+
const file = new FileFromPath({ path, size, lastModified: mtimeMs });
|
|
104
|
+
if (!filename) {
|
|
105
|
+
filename = file.name;
|
|
106
|
+
}
|
|
107
|
+
return new File([file], filename, {
|
|
108
|
+
...options,
|
|
109
|
+
lastModified: file.lastModified
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function fileFromPathSync(path, filenameOrOptions, options = {}) {
|
|
113
|
+
const stats = statSync(path);
|
|
114
|
+
return createFileFromPath(path, stats, filenameOrOptions, options);
|
|
115
|
+
}
|
|
116
|
+
async function fileFromPath(path, filenameOrOptions, options) {
|
|
117
|
+
const stats = await fs.stat(path);
|
|
118
|
+
return createFileFromPath(path, stats, filenameOrOptions, options);
|
|
119
|
+
}
|
|
120
|
+
export {
|
|
121
|
+
fileFromPath,
|
|
122
|
+
fileFromPathSync,
|
|
123
|
+
isFile
|
|
124
|
+
};
|
|
125
|
+
/*! Bundled license information:
|
|
126
|
+
|
|
127
|
+
node-domexception/index.js:
|
|
128
|
+
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
129
|
+
*/
|
package/dist/index.js
CHANGED
|
@@ -33,12 +33,12 @@ import {
|
|
|
33
33
|
saveReport,
|
|
34
34
|
scan,
|
|
35
35
|
verify
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-XXNYL6ZI.js";
|
|
37
37
|
import {
|
|
38
38
|
aiReviewAll
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-BHI66HZ7.js";
|
|
40
40
|
import "./chunk-W7TNFULQ.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-3D6MPYQN.js";
|
|
42
42
|
import "./chunk-QGM4M3NI.js";
|
|
43
43
|
|
|
44
44
|
// src/engine.ts
|
|
@@ -73,7 +73,7 @@ async function runFullPipeline(opts) {
|
|
|
73
73
|
const patchMode = plan.policies.patchMode ?? "hybrid";
|
|
74
74
|
let aiMode = patchMode !== "ast" && !!process.env.OPENAI_API_KEY;
|
|
75
75
|
if (aiMode) {
|
|
76
|
-
const { checkAiVerifyReady } = await import("./openaiClient-
|
|
76
|
+
const { checkAiVerifyReady } = await import("./openaiClient-ZGXSVDHJ.js");
|
|
77
77
|
const ready = await checkAiVerifyReady(root);
|
|
78
78
|
if (!ready.ok) aiMode = false;
|
|
79
79
|
}
|