@oxagen/cli 2.1.4-463 → 2.1.4-481

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 +88 -15
  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-481";
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-481",
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
  });
@@ -69318,10 +69372,24 @@ var init_evidence = __esm({
69318
69372
  });
69319
69373
 
69320
69374
  // ../../packages/tacho/src/session-subject.ts
69321
- var GITHUB_REF_SOURCE;
69375
+ var ENRICHMENT_BUDGET_NOTE, ENRICHMENT_LIMIT_NOTE, PARTIAL_NOTE_HEAD, PARTIAL_NOTE_TAIL, escapeRegExp2, NOTE_SOURCE, TRAILING_NOTES, GITHUB_REF_SOURCE;
69322
69376
  var init_session_subject = __esm({
69323
69377
  "../../packages/tacho/src/session-subject.ts"() {
69324
69378
  "use strict";
69379
+ ENRICHMENT_BUDGET_NOTE = " The account covers only the start of the run: its enrichment budget ran out before the rest was read.";
69380
+ ENRICHMENT_LIMIT_NOTE = " The account covers only the start of the run because its transcript reached a read limit.";
69381
+ PARTIAL_NOTE_HEAD = "Evidence is partial: ";
69382
+ PARTIAL_NOTE_TAIL = " recorded bodies were unavailable.";
69383
+ escapeRegExp2 = (text4) => text4.replace(/[.*+?^${}()|[\]\\]/gu, "\\$&");
69384
+ NOTE_SOURCE = [
69385
+ `${escapeRegExp2(PARTIAL_NOTE_HEAD)}\\d+${escapeRegExp2(PARTIAL_NOTE_TAIL)}`,
69386
+ escapeRegExp2(ENRICHMENT_BUDGET_NOTE.trim()),
69387
+ escapeRegExp2(ENRICHMENT_LIMIT_NOTE.trim())
69388
+ ].join("|");
69389
+ TRAILING_NOTES = new RegExp(
69390
+ `(?:^|\\s)((?:${NOTE_SOURCE})(?:\\s(?:${NOTE_SOURCE}))*)$`,
69391
+ "u"
69392
+ );
69325
69393
  GITHUB_REF_SOURCE = String.raw`\bhttps?:\/\/(?:www\.)?github\.com\/[\w.-]+\/[\w.-]+\/(pull|issues)\/(\d+)\S*`;
69326
69394
  }
69327
69395
  });
@@ -70880,11 +70948,11 @@ var init_budget3 = __esm({
70880
70948
  });
70881
70949
 
70882
70950
  // ../../packages/steering-check/src/checks/compile.ts
70883
- function escapeRegExp2(text4) {
70951
+ function escapeRegExp3(text4) {
70884
70952
  return text4.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
70885
70953
  }
70886
70954
  function hasOperation(document, operation) {
70887
- const name = escapeRegExp2(operation);
70955
+ const name = escapeRegExp3(operation);
70888
70956
  const yaml = new RegExp(`^\\s*operationId:\\s*["']?${name}["']?\\s*$`, "m");
70889
70957
  const json2 = new RegExp(`"operationId"\\s*:\\s*"${name}"`);
70890
70958
  return yaml.test(document) || json2.test(document);
@@ -116286,11 +116354,16 @@ function buildProgram() {
116286
116354
  });
116287
116355
  const findingsCmd = program2.command("findings").description("The workspace's costed findings and what each would save");
116288
116356
  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
- });
116357
+ "List the findings by the money at stake, 50 a page; with --run, only those citing the run, with the frames each cites"
116358
+ ).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(
116359
+ "--subject <key>",
116360
+ "An agent key, an operator id (prn_\u2026), a tool name or the workspace id"
116361
+ ).option("--kind <kind>", "A finding kind, such as retry_loops").option("--cursor <cursor>", "The cursor the previous page printed").option("--json", "Output JSON").action(
116362
+ async (opts) => {
116363
+ const { findingsList: findingsList2 } = await Promise.resolve().then(() => (init_findings(), findings_exports));
116364
+ await findingsList2(opts);
116365
+ }
116366
+ );
116294
116367
  const contextCmd = program2.command("context").description(
116295
116368
  "Steering: record a proposal on a lineage, or revert a merged one"
116296
116369
  );
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-481",
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": {