@oxagen/cli 5.5.1-308 → 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 +151 -3
  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-308";
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-308",
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}`));
@@ -203376,6 +203507,21 @@ function addSandboxRunsAndRuntimes(sandbox) {
203376
203507
  async (opts) => (await Promise.resolve().then(() => (init_sandbox_runtime(), sandbox_runtime_exports))).sandboxRuntimeSetup(opts)
203377
203508
  );
203378
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
+ }
203379
203525
  function addRemovalCommands(program2) {
203380
203526
  const groups = [
203381
203527
  {
@@ -203397,7 +203543,9 @@ function addRemovalCommands(program2) {
203397
203543
  }
203398
203544
  ];
203399
203545
  for (const group of groups) {
203400
- 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(
203401
203549
  "<records...>",
203402
203550
  `Each record as <type>:<id>, where the type is ${group.types}. Up to 100`
203403
203551
  ).option("--reason <text>", "Why, recorded with each deletion");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxagen/cli",
3
- "version": "5.5.1-308",
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": {