@erdoai/cli 0.187.0 → 0.188.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 +31 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2249,6 +2249,9 @@ var ErdoClient = class {
|
|
|
2249
2249
|
reviewAd(input) {
|
|
2250
2250
|
return this.request("POST", "/v1/critic/reviews", input);
|
|
2251
2251
|
}
|
|
2252
|
+
assessInvestigation(input) {
|
|
2253
|
+
return this.request("POST", "/v1/investigations", input);
|
|
2254
|
+
}
|
|
2252
2255
|
getPageReview(id) {
|
|
2253
2256
|
return this.request("GET", `/v1/page-reviews/${encodeURIComponent(id)}`);
|
|
2254
2257
|
}
|
|
@@ -3927,6 +3930,34 @@ evalCmd.command("suite <slug>").description("Show a suite and its cases").action
|
|
|
3927
3930
|
fail(e);
|
|
3928
3931
|
}
|
|
3929
3932
|
});
|
|
3933
|
+
var investigationCmd = program.command("investigation").description("Assess a data question from evidence already collected");
|
|
3934
|
+
investigationCmd.command("assess").description("Assess a question from a JSON file of definitions, observations, and claims").requiredOption("-f, --file <path>", "JSON assessment request").option("--json", "print the assessment JSON").action(async (opts) => {
|
|
3935
|
+
try {
|
|
3936
|
+
const input = JSON.parse(readFileSync4(opts.file, "utf8"));
|
|
3937
|
+
const result = await new ErdoClient().assessInvestigation(input);
|
|
3938
|
+
if (opts.json) {
|
|
3939
|
+
print(result);
|
|
3940
|
+
return;
|
|
3941
|
+
}
|
|
3942
|
+
printInvestigation(result);
|
|
3943
|
+
} catch (e) {
|
|
3944
|
+
fail(e);
|
|
3945
|
+
}
|
|
3946
|
+
});
|
|
3947
|
+
function printInvestigation(result) {
|
|
3948
|
+
console.log(result.status);
|
|
3949
|
+
for (const finding of result.findings ?? []) {
|
|
3950
|
+
const count = finding.count === void 0 ? "" : ` ${finding.count}`;
|
|
3951
|
+
const role = finding.role ? ` ${finding.role}` : "";
|
|
3952
|
+
const entity = finding.entity ? ` ${finding.entity}` : "";
|
|
3953
|
+
const meaning = finding.meaning ? ` (${finding.meaning})` : "";
|
|
3954
|
+
console.log(`${finding.subject}${meaning}${entity}${role}${count} ${finding.status}`);
|
|
3955
|
+
}
|
|
3956
|
+
if (result.missing?.length) console.log(`missing: ${result.missing.join(", ")}`);
|
|
3957
|
+
if (result.alternatives?.length) console.log(`alternatives: ${result.alternatives.join(", ")}`);
|
|
3958
|
+
if (result.artifact_ids?.length) console.log(`artifacts: ${result.artifact_ids.join(", ")}`);
|
|
3959
|
+
if (result.cited?.length) console.log(`cited: ${result.cited.join(", ")}`);
|
|
3960
|
+
}
|
|
3930
3961
|
var projectCmd = program.command("project").description("Projects \u2014 the container workstreams and experiments live in");
|
|
3931
3962
|
projectCmd.command("list").description("List projects in the active org").option("-n, --limit <n>", "max projects", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(async (opts) => {
|
|
3932
3963
|
try {
|