@oxagen/cli 2.1.4-463 → 2.1.4-474

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/oxagen.mjs +71 -12
  2. package/package.json +1 -1
package/oxagen.mjs CHANGED
@@ -23363,7 +23363,7 @@ import { readFileSync as readFileSync11 } from "node:fs";
23363
23363
  import { dirname as dirname8, resolve as resolve2 } from "node:path";
23364
23364
  import { fileURLToPath } from "node:url";
23365
23365
  function readVersion() {
23366
- if (true) return "2.1.4-463";
23366
+ if (true) return "2.1.4-474";
23367
23367
  try {
23368
23368
  const here = dirname8(fileURLToPath(import.meta.url));
23369
23369
  const pkg = JSON.parse(
@@ -52035,7 +52035,7 @@ var init_package = __esm({
52035
52035
  "package.json"() {
52036
52036
  package_default = {
52037
52037
  name: "@oxagen/cli",
52038
- version: "2.1.4-463",
52038
+ version: "2.1.4-474",
52039
52039
  description: "Oxagen governance CLI \u2014 spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
52040
52040
  type: "module",
52041
52041
  main: "./dist/index.js",
@@ -54406,6 +54406,9 @@ __export(findings_exports, {
54406
54406
  function isStatus(value) {
54407
54407
  return STATUSES.includes(value);
54408
54408
  }
54409
+ function isLevel(value) {
54410
+ return LEVELS.includes(value);
54411
+ }
54409
54412
  function isRunId(value) {
54410
54413
  return /^(arun|tse)_[0-9a-z]+$/.test(value);
54411
54414
  }
@@ -54440,11 +54443,47 @@ async function findingsList(opts, writer = stdoutWriter) {
54440
54443
  );
54441
54444
  return;
54442
54445
  }
54446
+ if (opts.level !== void 0 && !isLevel(opts.level)) {
54447
+ process.exitCode = 2;
54448
+ out.error(
54449
+ `Invalid --level "${opts.level}". Use tool, agent, operator or workspace.`,
54450
+ "usage"
54451
+ );
54452
+ return;
54453
+ }
54454
+ if (opts.subject !== void 0 && (opts.subject.length === 0 || opts.subject.length > SUBJECT_MAX)) {
54455
+ process.exitCode = 2;
54456
+ out.error(
54457
+ `Invalid --subject. Provide an agent key, an operator id, a tool name or the workspace id, at most ${SUBJECT_MAX} characters.`,
54458
+ "usage"
54459
+ );
54460
+ return;
54461
+ }
54462
+ if (opts.kind !== void 0 && !/^[a-z_]+$/.test(opts.kind)) {
54463
+ process.exitCode = 2;
54464
+ out.error(
54465
+ `Invalid --kind "${opts.kind}". Provide a finding kind, such as retry_loops.`,
54466
+ "usage"
54467
+ );
54468
+ return;
54469
+ }
54470
+ if (opts.cursor !== void 0 && (opts.cursor.length === 0 || opts.cursor.length > CURSOR_MAX)) {
54471
+ process.exitCode = 2;
54472
+ out.error(
54473
+ "Invalid --cursor. Copy the cursor the previous page printed.",
54474
+ "usage"
54475
+ );
54476
+ return;
54477
+ }
54443
54478
  let result2;
54444
54479
  try {
54445
54480
  result2 = await apiPostOrThrow("spend/findings", {
54446
54481
  status: status2,
54447
- ...opts.run === void 0 ? {} : { runId: opts.run }
54482
+ ...opts.run === void 0 ? {} : { runId: opts.run },
54483
+ ...opts.level === void 0 ? {} : { level: opts.level },
54484
+ ...opts.subject === void 0 ? {} : { subject: opts.subject },
54485
+ ...opts.kind === void 0 ? {} : { kind: opts.kind },
54486
+ ...opts.cursor === void 0 ? {} : { cursor: opts.cursor }
54448
54487
  });
54449
54488
  } catch (err2) {
54450
54489
  out.error(err2, "api");
@@ -54454,9 +54493,15 @@ async function findingsList(opts, writer = stdoutWriter) {
54454
54493
  out.data(result2);
54455
54494
  return;
54456
54495
  }
54457
- const scope = opts.run === void 0 ? "" : ` citing ${opts.run}`;
54496
+ const scope = [
54497
+ opts.kind === void 0 ? "" : ` of kind ${opts.kind}`,
54498
+ opts.run === void 0 ? "" : ` citing ${opts.run}`,
54499
+ opts.subject === void 0 ? "" : ` about ${opts.subject}`
54500
+ ].join("");
54458
54501
  if (result2.findings.length === 0) {
54459
- writer.write(`No ${status2} findings${scope}.`);
54502
+ writer.write(
54503
+ opts.cursor === void 0 ? `No ${status2} findings${scope}.` : `No more ${status2} findings${scope}.`
54504
+ );
54460
54505
  return;
54461
54506
  }
54462
54507
  writer.write(
@@ -54484,13 +54529,19 @@ async function findingsList(opts, writer = stdoutWriter) {
54484
54529
  writer
54485
54530
  );
54486
54531
  if (result2.truncated === true) {
54532
+ const first = (result2.offset ?? 0) + 1;
54533
+ const last = first + result2.findings.length - 1;
54487
54534
  writer.write("");
54488
54535
  writer.write(
54489
- `The list shows the first ${result2.findings.length} of ${result2.counts.findings} ${status2} findings.`
54536
+ `The list shows findings ${first} to ${last} of ${result2.counts.findings} ${status2} findings.`
54490
54537
  );
54538
+ if (typeof result2.nextCursor === "string")
54539
+ writer.write(
54540
+ `Run the command again with --cursor ${result2.nextCursor} to list the next page.`
54541
+ );
54491
54542
  }
54492
54543
  }
54493
- var STATUSES, FRAMES_SHOWN;
54544
+ var STATUSES, LEVELS, CURSOR_MAX, SUBJECT_MAX, FRAMES_SHOWN;
54494
54545
  var init_findings = __esm({
54495
54546
  "src/commands/findings.ts"() {
54496
54547
  init_rate_card();
@@ -54498,6 +54549,9 @@ var init_findings = __esm({
54498
54549
  init_capture_writer();
54499
54550
  init_output();
54500
54551
  STATUSES = ["open", "applied", "dismissed"];
54552
+ LEVELS = ["tool", "agent", "operator", "workspace"];
54553
+ CURSOR_MAX = 256;
54554
+ SUBJECT_MAX = 256;
54501
54555
  FRAMES_SHOWN = 5;
54502
54556
  }
54503
54557
  });
@@ -116286,11 +116340,16 @@ function buildProgram() {
116286
116340
  });
116287
116341
  const findingsCmd = program2.command("findings").description("The workspace's costed findings and what each would save");
116288
116342
  findingsCmd.command("list").description(
116289
- "List the findings by the money at stake; with --run, only those citing the run, with the frames each cites"
116290
- ).option("--run <id>", "A run id (arun_\u2026 or tse_\u2026)").option("--status <status>", "open (default) | applied | dismissed").option("--json", "Output JSON").action(async (opts) => {
116291
- const { findingsList: findingsList2 } = await Promise.resolve().then(() => (init_findings(), findings_exports));
116292
- await findingsList2(opts);
116293
- });
116343
+ "List the findings by the money at stake, 50 a page; with --run, only those citing the run, with the frames each cites"
116344
+ ).option("--run <id>", "A run id (arun_\u2026 or tse_\u2026)").option("--status <status>", "open (default) | applied | dismissed").option("--level <level>", "tool | agent | operator | workspace").option(
116345
+ "--subject <key>",
116346
+ "An agent key, an operator id (prn_\u2026), a tool name or the workspace id"
116347
+ ).option("--kind <kind>", "A finding kind, such as retry_loops").option("--cursor <cursor>", "The cursor the previous page printed").option("--json", "Output JSON").action(
116348
+ async (opts) => {
116349
+ const { findingsList: findingsList2 } = await Promise.resolve().then(() => (init_findings(), findings_exports));
116350
+ await findingsList2(opts);
116351
+ }
116352
+ );
116294
116353
  const contextCmd = program2.command("context").description(
116295
116354
  "Steering: record a proposal on a lineage, or revert a merged one"
116296
116355
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxagen/cli",
3
- "version": "2.1.4-463",
3
+ "version": "2.1.4-474",
4
4
  "description": "Oxagen governance CLI — spend, lineage, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
5
5
  "type": "module",
6
6
  "bin": {