Files
ruvnet--RuView/tools/ruview-cli/src/index.ts
T
rUv 3f462a254d feat(tools): scaffold ruview MCP server + CLI + ADR-104 (#705)
Adds two new npm packages that expose RuView's WiFi-DensePose
sensing capabilities outside the Cognitum appliance ecosystem:

- tools/ruview-mcp/ (@ruv/ruview-mcp) — MCP server with 6 tools:
  ruview_csi_latest, ruview_pose_infer, ruview_count_infer,
  ruview_registry_list, ruview_train_count, ruview_job_status.
  Uses @modelcontextprotocol/sdk with stdio transport.
  6/6 smoke tests pass. TypeScript strict mode, Node 20.

- tools/ruview-cli/ (@ruv/ruview-cli) — Yargs CLI with matching
  subcommands: csi tail, pose infer, count infer, cogs list,
  train count, job status. Same fail-open pattern as the cog
  binaries (WARN to stderr, exit 0 on unavailable sensing-server).

- docs/adr/ADR-104-ruview-mcp-cli-distribution.md — design rationale,
  6-row threat table, packaging plan, acceptance gates, failure modes.

- docs/research/sota-2026-05-22/HORIZON.md — 12-hour horizon plan
  with 7 milestones tracked (M1 complete in this commit).

Both packages are private:true pending the user's publish decision.
Inference is via subprocess to the signed cog binaries (ADR-100/101/103)
— no JS/WASM ML engine bundled.
2026-05-21 23:33:18 -04:00

54 lines
1.8 KiB
JavaScript

#!/usr/bin/env node
/**
* @ruv/ruview-cli — RuView CLI
*
* Shell access to RuView sensing, inference, and training capabilities.
*
* Subcommands:
* ruview csi tail [--url <url>] stream live CSI frames
* ruview pose infer [--window <path>] 17-keypoint pose estimation
* ruview count infer [--window <path>] person-count inference
* ruview cogs list [--category <cat>] [--search q] list edge module registry
* ruview train count --paired <jsonl> kick off count-cog training
* ruview job status --id <job_id> poll a training job
*
* All subcommands write JSON to stdout and exit 0 on success.
* WARN-level outputs write to stderr; the exit code is still 0 so pipelines
* are not broken by a temporarily unreachable sensing-server.
*
* Usage:
* npx ruview --version
* npx ruview csi tail
* npx ruview pose infer --window ./window.json
* RUVIEW_SENSING_SERVER_URL=http://cognitum-v0:3000 npx ruview cogs list
*
* See ADR-104 for the full design rationale and security model.
*/
import yargs from "yargs";
import { hideBin } from "yargs/helpers";
import { csiCommand } from "./commands/csi.js";
import { poseCommand } from "./commands/pose.js";
import { countCommand } from "./commands/count.js";
import { cogsCommand } from "./commands/cogs.js";
import { trainCommand } from "./commands/train.js";
import { jobCommand } from "./commands/job.js";
const cli = yargs(hideBin(process.argv))
.scriptName("ruview")
.version("0.0.1")
.usage("$0 <command> [options]")
.strict()
.help()
.wrap(100);
// Register all top-level commands.
csiCommand(cli);
poseCommand(cli);
countCommand(cli);
cogsCommand(cli);
trainCommand(cli);
jobCommand(cli);
cli.demandCommand(1, "Specify a subcommand. Use --help for a list.").parse();