@oxagen/cli 5.5.1-303 → 5.5.1-312

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 +190 -11
  2. package/package.json +1 -1
package/oxagen.mjs CHANGED
@@ -34569,7 +34569,7 @@ import { readFileSync as readFileSync13 } from "node:fs";
34569
34569
  import { dirname as dirname14, resolve as resolve3 } from "node:path";
34570
34570
  import { fileURLToPath } from "node:url";
34571
34571
  function readVersion() {
34572
- if (true) return "5.5.1-303";
34572
+ if (true) return "5.5.1-312";
34573
34573
  try {
34574
34574
  const here = dirname14(fileURLToPath(import.meta.url));
34575
34575
  const pkg = JSON.parse(
@@ -82354,7 +82354,7 @@ var init_package = __esm({
82354
82354
  "package.json"() {
82355
82355
  package_default = {
82356
82356
  name: "@oxagen/cli",
82357
- version: "5.5.1-303",
82357
+ version: "5.5.1-312",
82358
82358
  description: "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
82359
82359
  type: "module",
82360
82360
  main: "./dist/index.js",
@@ -98968,6 +98968,137 @@ var init_sandbox_runtime = __esm({
98968
98968
  }
98969
98969
  });
98970
98970
 
98971
+ // ../../packages/oxagen/src/contracts/equipment.search.ts
98972
+ var EQUIPMENT_SEARCH_TYPES, EQUIPMENT_SEARCH_STATES, EQUIPMENT_SEARCH_MAX_HITS, equipmentSearchTypeSchema, equipmentSearch;
98973
+ var init_equipment_search = __esm({
98974
+ "../../packages/oxagen/src/contracts/equipment.search.ts"() {
98975
+ "use strict";
98976
+ init_zod();
98977
+ init_registry4();
98978
+ EQUIPMENT_SEARCH_TYPES = [
98979
+ "agent",
98980
+ "runtime",
98981
+ "mcp",
98982
+ "toolbelt",
98983
+ "skill",
98984
+ "steering"
98985
+ ];
98986
+ EQUIPMENT_SEARCH_STATES = [
98987
+ "ran",
98988
+ "skipped_no_embeddings",
98989
+ "skipped_budget",
98990
+ "unavailable",
98991
+ "failed"
98992
+ ];
98993
+ EQUIPMENT_SEARCH_MAX_HITS = 1e3;
98994
+ equipmentSearchTypeSchema = external_exports.enum(EQUIPMENT_SEARCH_TYPES);
98995
+ equipmentSearch = registerCapability({
98996
+ name: "search_equipment",
98997
+ domain: "equipment",
98998
+ description: "Find agents, runtimes, MCP servers, toolbelts, skills and steering records in this workspace by meaning, so budget finds a daily spend cap. Returns each record's type, its id as Equipment lists it, and a score from 0 to 1, best first. state says whether the search ran or why it did not.",
98999
+ mode: "sync",
99000
+ surfaces: ["api", "mcp", "cli", "agent"],
99001
+ layers: ["schema", "api", "mcp", "cli", "unit", "docs", "app"],
99002
+ scoped: true,
99003
+ // Equipment calls it as a person types, so a gate that charges each call
99004
+ // would bill a page's search box. The query's embedding is charged on the
99005
+ // code graph spend meter, as search_code_graph's is.
99006
+ noBillingGate: true,
99007
+ agent: { requiresApproval: false, riskLevel: "low", category: "read" },
99008
+ sensitivity: "low",
99009
+ mutates: false,
99010
+ defaultEffect: "deny",
99011
+ // Any workspace member may call it. It answers only the types each caller
99012
+ // may list, so it shows nothing their list would not.
99013
+ defaultRoles: {
99014
+ org: { Owner: "allow", ComplianceBilling: "allow" },
99015
+ workspace: { Admin: "allow", Member: "allow" }
99016
+ },
99017
+ input: external_exports.object({
99018
+ query: external_exports.string().trim().min(1).max(500),
99019
+ types: external_exports.array(equipmentSearchTypeSchema).min(1).max(6).optional(),
99020
+ limit: external_exports.number().int().min(1).max(EQUIPMENT_SEARCH_MAX_HITS).default(50)
99021
+ }).strict(),
99022
+ output: external_exports.object({
99023
+ state: external_exports.enum(EQUIPMENT_SEARCH_STATES),
99024
+ hits: external_exports.array(
99025
+ external_exports.object({
99026
+ type: equipmentSearchTypeSchema,
99027
+ id: external_exports.string().min(1),
99028
+ score: external_exports.number().min(0).max(1)
99029
+ })
99030
+ )
99031
+ })
99032
+ });
99033
+ }
99034
+ });
99035
+
99036
+ // src/commands/equipment.search.ts
99037
+ var equipment_search_exports = {};
99038
+ __export(equipment_search_exports, {
99039
+ equipmentSearchCommand: () => equipmentSearchCommand
99040
+ });
99041
+ async function equipmentSearchCommand(opts, writer = stdoutWriter) {
99042
+ const out = createOutput({ json: opts.json, quiet: opts.quiet }, writer);
99043
+ const types = opts.types?.split(",").map((type) => type.trim()).filter((type) => type !== "");
99044
+ const input2 = equipmentSearch.input.safeParse({
99045
+ query: opts.query,
99046
+ ...types === void 0 ? {} : { types },
99047
+ ...opts.limit === void 0 ? {} : { limit: Number(opts.limit) }
99048
+ });
99049
+ if (!input2.success) {
99050
+ process.exitCode = 2;
99051
+ out.error(
99052
+ `Use a query of 1 to 500 characters, types from ${EQUIPMENT_SEARCH_TYPES.join(", ")}, and a limit of 1 to ${String(EQUIPMENT_SEARCH_MAX_HITS)}.`,
99053
+ "usage"
99054
+ );
99055
+ return;
99056
+ }
99057
+ const scope = scopeOrRefuse(opts.workspaceSlug, out);
99058
+ if (!scope) return;
99059
+ try {
99060
+ const answer = equipmentSearch.output.parse(
99061
+ await apiPostOrThrow("equipment/search", input2.data, scope)
99062
+ );
99063
+ if (out.isJson) {
99064
+ out.data(answer);
99065
+ return;
99066
+ }
99067
+ if (answer.state !== "ran") {
99068
+ out.info(STATE_LINES[answer.state]);
99069
+ return;
99070
+ }
99071
+ if (answer.hits.length === 0) {
99072
+ out.info("No equipment matches the query.");
99073
+ return;
99074
+ }
99075
+ for (const line of formatTable(
99076
+ ["Score", "Type", "ID"],
99077
+ answer.hits.map((hit) => [hit.score.toFixed(2), hit.type, hit.id])
99078
+ )) {
99079
+ writer.write(line);
99080
+ }
99081
+ } catch (err2) {
99082
+ out.error(err2, "api");
99083
+ }
99084
+ }
99085
+ var STATE_LINES;
99086
+ var init_equipment_search2 = __esm({
99087
+ "src/commands/equipment.search.ts"() {
99088
+ init_equipment_search();
99089
+ init_api();
99090
+ init_capture_writer();
99091
+ init_output();
99092
+ init_sandbox_run();
99093
+ STATE_LINES = {
99094
+ skipped_no_embeddings: "This workspace keeps embeddings off, so nothing was searched by meaning.",
99095
+ skipped_budget: "The code graph's monthly spend cap is reached, so nothing was searched by meaning.",
99096
+ unavailable: "This database has no vector column, so nothing was searched by meaning.",
99097
+ failed: "The search by meaning failed. Try again."
99098
+ };
99099
+ }
99100
+ });
99101
+
98971
99102
  // ../../packages/oxagen/src/contracts/removal.shared.ts
98972
99103
  function uniqueRemovalItems(items) {
98973
99104
  const seen = new Set(items.map((item) => `${item.type}\0${item.id}`));
@@ -109937,7 +110068,8 @@ async function priceList(opts, writer = stdoutWriter) {
109937
110068
  try {
109938
110069
  const result2 = await apiPostOrThrow("cost/price-entries", {
109939
110070
  at: at2,
109940
- ...opts.includeScheduled ? { includeScheduled: true } : {}
110071
+ ...opts.includeScheduled ? { includeScheduled: true } : {},
110072
+ ...opts.onePerModel ? { onePerModel: true } : {}
109941
110073
  });
109942
110074
  if (out.isJson) out.data(result2);
109943
110075
  else renderEntries(result2.entries, writer);
@@ -123089,7 +123221,10 @@ async function runChain(runId, opts = {}, writer = stdoutWriter) {
123089
123221
  const out = createOutput({ json: opts.json }, writer);
123090
123222
  let result2;
123091
123223
  try {
123092
- result2 = await apiPostOrThrow("runs/chain", { runId });
123224
+ result2 = await apiPostOrThrow("runs/chain", {
123225
+ runId,
123226
+ ...opts.after === void 0 ? {} : { after: opts.after }
123227
+ });
123093
123228
  } catch (err2) {
123094
123229
  out.error(err2, "api");
123095
123230
  return;
@@ -123144,7 +123279,12 @@ async function runChain(runId, opts = {}, writer = stdoutWriter) {
123144
123279
  );
123145
123280
  }
123146
123281
  }
123147
- if (!result2.complete) {
123282
+ const next = result2.next ?? null;
123283
+ if (next !== null) {
123284
+ writer.write(
123285
+ `The walk stopped at frame ${next}: these are the gaps of one page. Walk the next page with --after ${next}.`
123286
+ );
123287
+ } else if (!result2.complete) {
123148
123288
  writer.write(
123149
123289
  "The walk was cut short: these are the gaps of a prefix, not of the whole run."
123150
123290
  );
@@ -123763,7 +123903,10 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
123763
123903
  const out = createOutput({ json: opts.json }, writer);
123764
123904
  let result2;
123765
123905
  try {
123766
- result2 = await apiPostOrThrow("runs/context", { runId });
123906
+ result2 = await apiPostOrThrow("runs/context", {
123907
+ runId,
123908
+ ...opts.after === void 0 ? {} : { after: opts.after }
123909
+ });
123767
123910
  } catch (err2) {
123768
123911
  out.error(err2, "api");
123769
123912
  return;
@@ -123782,8 +123925,9 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
123782
123925
  );
123783
123926
  if (result2.windows.length === 0) {
123784
123927
  writer.write(
123785
- "The run recorded no window. A window is recorded when the model call passes through the Oxagen gateway."
123928
+ opts.after === void 0 ? "The run recorded no window. A window is recorded when the model call passes through the Oxagen gateway." : "This page holds no window."
123786
123929
  );
123930
+ writeNextPage(result2, writer);
123787
123931
  return;
123788
123932
  }
123789
123933
  const rows = [
@@ -123812,7 +123956,16 @@ async function runContext(runId, opts = {}, writer = stdoutWriter) {
123812
123956
  ]);
123813
123957
  writer.write("");
123814
123958
  writeColumns(rows, writer, 2);
123815
- if (!result2.complete) {
123959
+ writeNextPage(result2, writer);
123960
+ }
123961
+ function writeNextPage(result2, writer) {
123962
+ const next = result2.next ?? null;
123963
+ if (next !== null) {
123964
+ writer.write("");
123965
+ writer.write(
123966
+ `The run is longer than one read carries. Read the next page with --after ${next}.`
123967
+ );
123968
+ } else if (!result2.complete) {
123816
123969
  writer.write("");
123817
123970
  writer.write(
123818
123971
  `The run is longer than one read carries. These are its first ${result2.windows.length} windows.`
@@ -203354,6 +203507,21 @@ function addSandboxRunsAndRuntimes(sandbox) {
203354
203507
  async (opts) => (await Promise.resolve().then(() => (init_sandbox_runtime(), sandbox_runtime_exports))).sandboxRuntimeSetup(opts)
203355
203508
  );
203356
203509
  }
203510
+ function addEquipmentSearchCommand(equipment) {
203511
+ equipment.command("search").description(
203512
+ "Find agents, runtimes, MCP servers, toolbelts, skills and steering records by meaning, best first"
203513
+ ).requiredOption(
203514
+ "-q, --query <text>",
203515
+ "What to look for, 1 to 500 characters"
203516
+ ).option(
203517
+ "--types <types>",
203518
+ "Only these types, separated by commas: agent, runtime, mcp, toolbelt, skill or steering"
203519
+ ).option("--limit <n>", "How many to return, 1 to 1000. 50 when unset").option("--workspace-slug <slug>", WORKSPACE_SLUG_HELP).option("--json", "Output the answer as JSON").option("--quiet", "Print the hits and no other line").action(
203520
+ async (opts) => (await Promise.resolve().then(() => (init_equipment_search2(), equipment_search_exports))).equipmentSearchCommand(
203521
+ opts
203522
+ )
203523
+ );
203524
+ }
203357
203525
  function addRemovalCommands(program2) {
203358
203526
  const groups = [
203359
203527
  {
@@ -203375,7 +203543,9 @@ function addRemovalCommands(program2) {
203375
203543
  }
203376
203544
  ];
203377
203545
  for (const group of groups) {
203378
- const command2 = program2.command(group.noun).description(group.description).command("delete").alias("rm").description(group.deleteDescription).argument(
203546
+ const parent = program2.command(group.noun).description(group.description);
203547
+ if (group.noun === "equipment") addEquipmentSearchCommand(parent);
203548
+ const command2 = parent.command("delete").alias("rm").description(group.deleteDescription).argument(
203379
203549
  "<records...>",
203380
203550
  `Each record as <type>:<id>, where the type is ${group.types}. Up to 100`
203381
203551
  ).option("--reason <text>", "Why, recorded with each deletion");
@@ -203686,6 +203856,9 @@ function buildProgram() {
203686
203856
  ).option("--at <instant>", "RFC 3339 read instant; omit for now").option(
203687
203857
  "--include-scheduled",
203688
203858
  "Include this organization's future negotiated rates"
203859
+ ).option(
203860
+ "--one-per-model",
203861
+ "List one row for each provider and model in place of every row"
203689
203862
  ).option("--json", "Output JSON").action(
203690
203863
  async (opts) => {
203691
203864
  const { priceList: priceList2 } = await Promise.resolve().then(() => (init_price(), price_exports));
@@ -204249,7 +204422,10 @@ function buildProgram() {
204249
204422
  );
204250
204423
  runCmd.command("chain").description(
204251
204424
  "Show what makes a run's record tamper-evident: the hash rule, the root, the locks taken along the way, the gaps, and the replay ladder"
204252
- ).argument("<run-id>", "The run's public id (arun_\u2026 or tse_\u2026)").option("--json", "Output JSON").action(async (runId, opts) => {
204425
+ ).argument("<run-id>", "The run's public id (arun_\u2026 or tse_\u2026)").option(
204426
+ "--after <seq>",
204427
+ "Walk the page after this frame: the frame an earlier walk stopped at"
204428
+ ).option("--json", "Output JSON").action(async (runId, opts) => {
204253
204429
  const { runChain: runChain2 } = await Promise.resolve().then(() => (init_run5(), run_exports));
204254
204430
  await runChain2(runId, opts);
204255
204431
  });
@@ -204272,7 +204448,10 @@ function buildProgram() {
204272
204448
  );
204273
204449
  runCmd.command("context").description(
204274
204450
  "Show what each of a run's model requests carried: the prompt tokens and each block's share of them"
204275
- ).argument("<run-id>", "The run's public id (arun_\u2026 or tse_\u2026)").option("--json", "Output JSON").action(async (runId, opts) => {
204451
+ ).argument("<run-id>", "The run's public id (arun_\u2026 or tse_\u2026)").option(
204452
+ "--after <seq>",
204453
+ "Read the page after this frame: the next frame an earlier read printed"
204454
+ ).option("--json", "Output JSON").action(async (runId, opts) => {
204276
204455
  const { runContext: runContext2 } = await Promise.resolve().then(() => (init_run_context(), run_context_exports));
204277
204456
  await runContext2(runId, opts);
204278
204457
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxagen/cli",
3
- "version": "5.5.1-303",
3
+ "version": "5.5.1-312",
4
4
  "description": "Oxagen governance CLI: spend, source tracking, grounding, credentials, and audit (agentic coding lives in the stella CLI)",
5
5
  "type": "module",
6
6
  "bin": {