@erdoai/cli 0.185.1 → 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.
Files changed (2) hide show
  1. package/dist/index.js +34 -2
  2. 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 {
@@ -4813,7 +4844,7 @@ caseCmd.command("rm <slug> <caseName>").description("Archive a case from a suite
4813
4844
  }
4814
4845
  });
4815
4846
  var agentCmd = program.command("agent").description("Run agents");
4816
- agentCmd.command("ask <question>").description("Ask the data-question agent (one-shot); question accepts @path to a UTF-8 file").option("-d, --datasets <csv>", "dataset slugs to scope to").option(
4847
+ agentCmd.command("ask <question>").description("Ask the data-question agent (one-shot); question accepts @path to a UTF-8 file").option("-d, --datasets <csv>", "dataset slugs to scope to").option("--allow-writes", "let this question create datasets, write declarations, schedule syncs, and persist other changes. A question is read-only without it").option(
4817
4848
  "--sync",
4818
4849
  "hold one long HTTP request open until the run finishes, instead of polling. Faster for quick questions; a proxy will time it out on any run over ~100s, losing the thread id while the run continues server-side"
4819
4850
  ).action(async (question, opts) => {
@@ -4822,6 +4853,7 @@ agentCmd.command("ask <question>").description("Ask the data-question agent (one
4822
4853
  const res = await client.ask({
4823
4854
  question: readMaybeFile(question) ?? "",
4824
4855
  dataset_slugs: opts.datasets ? opts.datasets.split(",").map((s) => s.trim()) : void 0,
4856
+ allow_writes: opts.allowWrites ? true : void 0,
4825
4857
  async: !opts.sync
4826
4858
  });
4827
4859
  if (opts.sync) {
@@ -6650,7 +6682,7 @@ domainsCmd.command("manager-default <domain>").description(
6650
6682
  fail(e);
6651
6683
  }
6652
6684
  });
6653
- domainsCmd.command("home <domain> [artifactId]").description("Set the domain root's public home page, or clear it with --unset").option("--unset", "clear the home page (the domain root will return 404)").action(async (domain, artifactId, opts) => {
6685
+ domainsCmd.command("home <domain> [artifactId]").description("Set the domain root's public home page (also allows search engines to index it), or clear the root with --unset").option("--unset", "clear the home page (the domain root will return 404)").action(async (domain, artifactId, opts) => {
6654
6686
  try {
6655
6687
  if (opts.unset ? artifactId !== void 0 : !artifactId) {
6656
6688
  throw new Error("Provide a page artifact ID, or use --unset without an ID");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.185.1",
3
+ "version": "0.188.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {