@erdoai/cli 0.24.0 → 0.25.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 +80 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -427,6 +427,32 @@ var ErdoClient = class {
427
427
  input
428
428
  );
429
429
  }
430
+ // --- knowledge review queue ---
431
+ listReviewItems(params) {
432
+ const q = new URLSearchParams();
433
+ if (params?.status !== void 0) q.set("status", params.status);
434
+ if (params?.type) q.set("type", params.type);
435
+ if (params?.limit) q.set("limit", String(params.limit));
436
+ if (params?.offset) q.set("offset", String(params.offset));
437
+ const qs = q.toString();
438
+ return this.request(
439
+ "GET",
440
+ `/v1/review-items${qs ? `?${qs}` : ""}`
441
+ );
442
+ }
443
+ getReviewItem(id) {
444
+ return this.request(
445
+ "GET",
446
+ `/v1/review-items/${encodeURIComponent(id)}`
447
+ );
448
+ }
449
+ decideReviewItem(id, input) {
450
+ return this.request(
451
+ "POST",
452
+ `/v1/review-items/${encodeURIComponent(id)}/decide`,
453
+ input
454
+ );
455
+ }
430
456
  // --- agents ---
431
457
  ask(input) {
432
458
  return this.request("POST", "/v1/ask", input);
@@ -1982,6 +2008,60 @@ attnCmd.command("respond <id>").description(
1982
2008
  fail(e);
1983
2009
  }
1984
2010
  });
2011
+ var reviewsCmd = program.command("reviews").description(
2012
+ "The Knowledge Review queue \u2014 knowledge patches the critic proposes, investigations, and deduplicated failure signals awaiting a human decision"
2013
+ );
2014
+ reviewsCmd.command("list").description("List review items (decision items rank above failure signals)").option("--status <status>", "open (default) | snoozed | resolved | rejected | '' for all").option("--type <type>", "filter by type, e.g. knowledge_patch, eval_failure, failed_run").option("-n, --limit <n>", "max items", (v) => parseInt(v, 10)).option("--offset <n>", "pagination offset", (v) => parseInt(v, 10)).action(
2015
+ async (opts) => {
2016
+ try {
2017
+ print(
2018
+ await new ErdoClient().listReviewItems({
2019
+ status: opts.status,
2020
+ type: opts.type,
2021
+ limit: opts.limit,
2022
+ offset: opts.offset
2023
+ })
2024
+ );
2025
+ } catch (e) {
2026
+ fail(e);
2027
+ }
2028
+ }
2029
+ );
2030
+ reviewsCmd.command("show <id>").description("Show one review item with its full payload (the proposed patch body for a knowledge_patch)").action(async (id) => {
2031
+ try {
2032
+ print(await new ErdoClient().getReviewItem(id));
2033
+ } catch (e) {
2034
+ fail(e);
2035
+ }
2036
+ });
2037
+ reviewsCmd.command("decide <id>").description(
2038
+ "Decide a review item: --apply a knowledge patch (mutates Knowledge, then resolves), --resolve, --reject, or --snooze [minutes]"
2039
+ ).option("--apply", "apply a knowledge_patch: create/update the proposed Knowledge object, then resolve").option("--resolve", "close as handled").option("--reject", "close as declined").option("--snooze [minutes]", "hide the item for [minutes] (default 7 days)").option("--note <note>", "resolution note recorded on the item").action(
2040
+ async (id, opts) => {
2041
+ try {
2042
+ const chosen = [
2043
+ opts.apply ? "apply" : null,
2044
+ opts.resolve ? "resolve" : null,
2045
+ opts.reject ? "reject" : null,
2046
+ opts.snooze !== void 0 ? "snooze" : null
2047
+ ].filter(Boolean);
2048
+ if (chosen.length !== 1) {
2049
+ fail(new Error("provide exactly one of --apply, --resolve, --reject, or --snooze"));
2050
+ }
2051
+ const action = chosen[0];
2052
+ let minutes;
2053
+ if (action === "snooze" && typeof opts.snooze === "string") {
2054
+ minutes = parseInt(opts.snooze, 10);
2055
+ if (Number.isNaN(minutes)) {
2056
+ throw new Error("--snooze minutes must be a number");
2057
+ }
2058
+ }
2059
+ print(await new ErdoClient().decideReviewItem(id, { action, minutes, note: opts.note }));
2060
+ } catch (e) {
2061
+ fail(e);
2062
+ }
2063
+ }
2064
+ );
1985
2065
  var pagesCmd = program.command("pages").description("Create and manage pages/artifacts");
1986
2066
  function readMaybeFile(v) {
1987
2067
  if (!v) return void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@erdoai/cli",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "description": "Erdo CLI \u2014 drive datasets, pages, and evals from the terminal or CI",
5
5
  "type": "module",
6
6
  "bin": {