@erdoai/cli 0.35.0 → 0.37.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 +42 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -606,11 +606,13 @@ var ErdoClient = class {
606
606
  return this.request("GET", `/v1/threads/${encodeURIComponent(threadId)}/messages`);
607
607
  }
608
608
  // --- datasets ---
609
- listDatasets() {
610
- return this.request(
611
- "GET",
612
- "/v1/datasets"
613
- );
609
+ // class filters by structural class: omit (default) to show durable tables and
610
+ // hide scratch analysis by-products; "table"/"scratch" to select one; "all" for both.
611
+ listDatasets(params) {
612
+ const q = new URLSearchParams();
613
+ if (params?.class) q.set("class", params.class);
614
+ const qs = q.toString();
615
+ return this.request("GET", `/v1/datasets${qs ? `?${qs}` : ""}`);
614
616
  }
615
617
  // The endpoint's field is `question` (QueryDataNaturalLanguageInput). Sending
616
618
  // `query` made every `erdo datasets query` fail with "question is required".
@@ -790,12 +792,24 @@ var ErdoClient = class {
790
792
  // review id immediately (poll getPageReview for the typed findings). goal is
791
793
  // the operator's optional declared campaign goal — it steers which conversion
792
794
  // principles apply, and a page whose evident form contradicts it is a finding.
793
- reviewPages(urls, goal) {
794
- return this.request("POST", "/v1/page-reviews", goal ? { urls, goal } : { urls });
795
+ reviewPages(urls, goal, audience) {
796
+ const body = { urls };
797
+ if (goal) body.goal = goal;
798
+ if (audience) body.audience = audience;
799
+ return this.request("POST", "/v1/page-reviews", body);
795
800
  }
796
801
  getPageReview(id) {
797
802
  return this.request("GET", `/v1/page-reviews/${encodeURIComponent(id)}`);
798
803
  }
804
+ // List past reviews newest first as lean summaries (id, status, URLs, scores —
805
+ // no findings). Pass a url to track one page's score over time.
806
+ listPageReviews(url, limit) {
807
+ const params = new URLSearchParams();
808
+ if (url) params.set("url", url);
809
+ if (limit) params.set("limit", String(limit));
810
+ const qs = params.toString();
811
+ return this.request("GET", `/v1/page-reviews${qs ? "?" + qs : ""}`);
812
+ }
799
813
  updatePage(pageID, input) {
800
814
  return this.request("PUT", `/v1/pages/${encodeURIComponent(pageID)}`, input);
801
815
  }
@@ -2562,10 +2576,13 @@ pagesCmd.command("review <url...>").description(
2562
2576
  ).option("--wait", "poll until the review is ready, then print the findings").option(
2563
2577
  "--goal <goal>",
2564
2578
  "what the page's campaign is trying to achieve ('book demos', 'brand awareness for a launch') \u2014 steers which conversion principles apply; a page whose evident form contradicts the goal is itself a finding"
2579
+ ).option(
2580
+ "--audience <audience>",
2581
+ "who the page targets \u2014 the ICP ('out-of-state condo investors') \u2014 the critic judges clarity, proof, and tone through that reader's eyes; a page that evidently speaks to someone else is itself a finding"
2565
2582
  ).action(async (urls, opts) => {
2566
2583
  try {
2567
2584
  const client = new ErdoClient();
2568
- const started = await client.reviewPages(urls, opts.goal);
2585
+ const started = await client.reviewPages(urls, opts.goal, opts.audience);
2569
2586
  if (!opts.wait) {
2570
2587
  print(started);
2571
2588
  return;
@@ -2588,6 +2605,15 @@ pagesCmd.command("review <url...>").description(
2588
2605
  fail(e);
2589
2606
  }
2590
2607
  });
2608
+ pagesCmd.command("reviews").description(
2609
+ "List past page reviews (newest first) as lean summaries \u2014 id, status, reviewed URLs, and conversion scores, without the findings. --url filters to reviews that included that exact page: the way to see one page's score over time."
2610
+ ).option("--url <url>", "only reviews whose submitted URLs include this exact page URL").option("--limit <n>", "max reviews to return (default 20, max 100)").action(async (opts) => {
2611
+ try {
2612
+ print(await new ErdoClient().listPageReviews(opts.url, opts.limit ? Number(opts.limit) : void 0));
2613
+ } catch (e) {
2614
+ fail(e);
2615
+ }
2616
+ });
2591
2617
  pagesCmd.command("review-result <id>").description("Read a page review by id \u2014 its status and, once ready, the typed per-page findings").action(async (id) => {
2592
2618
  try {
2593
2619
  print(await new ErdoClient().getPageReview(id));
@@ -2596,10 +2622,14 @@ pagesCmd.command("review-result <id>").description("Read a page review by id \u2
2596
2622
  }
2597
2623
  });
2598
2624
  var datasetsCmd = program.command("datasets").description("Datasets");
2599
- datasetsCmd.command("list").description("List datasets").action(async () => {
2600
- try {
2601
- const { datasets } = await new ErdoClient().listDatasets();
2602
- for (const d of datasets) console.log(`${d.slug} ${d.type} ${d.status} ${d.name}`);
2625
+ datasetsCmd.command("list").description("List datasets").option(
2626
+ "--class <class>",
2627
+ "filter by structural class: 'table' or 'scratch', or 'all' to include scratch analysis by-products (default hides scratch)"
2628
+ ).action(async (opts) => {
2629
+ try {
2630
+ const { datasets } = await new ErdoClient().listDatasets({ class: opts.class });
2631
+ for (const d of datasets)
2632
+ console.log(`${d.slug} ${d.type} ${d.status} ${d.class ?? "-"} ${d.name}`);
2603
2633
  } catch (e) {
2604
2634
  fail(e);
2605
2635
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "description": "Erdo CLI — drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {