@erdoai/cli 0.226.0 → 0.227.0
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/index.js +5 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6938,10 +6938,10 @@ reviewsCmd.command("decide <id>").description(
|
|
|
6938
6938
|
);
|
|
6939
6939
|
var pagesCmd = program.command("pages").description("Create and manage pages/artifacts");
|
|
6940
6940
|
var criticCmd = program.command("critic").description("Review campaign creative");
|
|
6941
|
-
criticCmd.command("review").description("Review an ad or document and print per-lens findings").option("-f, --file <path>", "JSON file containing the full critic review request envelope").option("--text <text>", "Document text to review (use instead of --file)").option("--
|
|
6941
|
+
criticCmd.command("review").description("Review an ad or document and print per-lens findings").option("-f, --file <path>", "JSON file containing the full critic review request envelope").option("--text <text>", "Document text to review (use instead of --file)").option("--wait", "Poll a running document review's run until it completes").option("--json", "print the complete raw JSON response").action(async (opts) => {
|
|
6942
6942
|
try {
|
|
6943
6943
|
if (!opts.file && !opts.text) throw new Error("provide --file or --text");
|
|
6944
|
-
const input = opts.text ? { subject_kind: "document", document: { text: opts.text
|
|
6944
|
+
const input = opts.text ? { subject_kind: "document", document: { text: opts.text } } : JSON.parse(readFileSync5(opts.file, "utf8"));
|
|
6945
6945
|
const result = await new ErdoClient().reviewCritic(input);
|
|
6946
6946
|
let finalResult = result;
|
|
6947
6947
|
if (opts.wait && result.status === "running" && result.run_id) {
|
|
@@ -6969,15 +6969,12 @@ criticCmd.command("review").description("Review an ad or document and print per-
|
|
|
6969
6969
|
for (const lens of finalResult.lenses) {
|
|
6970
6970
|
console.log(`
|
|
6971
6971
|
${lens.lens_slug}: ${lens.summary}`);
|
|
6972
|
-
for (const finding of lens.findings) {
|
|
6973
|
-
console.log(` [${finding.severity}] ${finding.issue}`);
|
|
6972
|
+
for (const finding of lens.findings ?? []) {
|
|
6973
|
+
console.log(` [${finding.severity}] ${finding.issue}${finding.unsupported ? " (unsupported)" : ""}`);
|
|
6974
6974
|
console.log(` Evidence: ${finding.evidence}`);
|
|
6975
|
+
if (finding.source_url) console.log(` Source: ${finding.source_url}`);
|
|
6975
6976
|
console.log(` Suggested rewrite: ${finding.suggested_rewrite}`);
|
|
6976
6977
|
}
|
|
6977
|
-
for (const claim of lens.claims ?? []) {
|
|
6978
|
-
console.log(` Claim ${claim.claim_id}: ${claim.verdict} \u2014 ${claim.claim}`);
|
|
6979
|
-
if (claim.note) console.log(` Note: ${claim.note}`);
|
|
6980
|
-
}
|
|
6981
6978
|
}
|
|
6982
6979
|
if (finalResult.usage) console.log(`
|
|
6983
6980
|
Usage: ${JSON.stringify(finalResult.usage)}`);
|