mirror of
https://github.com/ruvnet/RuView.git
synced 2026-10-22 14:42:44 -05:00
- ui://ruview/console-v1.html: one self-contained widget for MCP Apps hosts
and ChatGPT (ui.resourceUri + openai/outputTemplate). Renders node
streams, device scans and doctor results; Refresh re-runs the tool via
window.openai.callTool or an MCP Apps tools/call. Empty CSP allowlist, no
network, textContent only, parent-frame messages only.
- MCP: protocol negotiation (2025-06-18/2025-03-26/2024-11-05),
structuredContent + compact JSON text (17-33% smaller, MEASURED),
resources/list|read, tool titles, canonical tool name in result _meta.
Transport-neutral handleRpc + shared FIFO dispatcher.
- `mcp start --http`: Streamable HTTP for ChatGPT/remote clients. Bearer or
secret-path token (constant-time), loopback default, Origin allowlist,
256 KiB cap, no batches, write grants never honoured over HTTP.
- CLI: formatted TTY output (tables, rate bars, alerts first, NO_COLOR),
JSON for pipes/--json, capture countdown, `esp32 --watch` with per-node
sparklines, lazy module loading (--help ~20% faster, MEASURED).
- monitor detects Ameba CSI report-buffer starvation ("lack of csi buf"),
the root cause of the Realtek heartbeat-only stall seen live.
- Size budget 320 -> 384 KiB (package ~339 kB).
Verified: 160 tests + 83 security tests; headless-Chrome e2e of the MCP
Apps flow against live boards (refresh round trip 108 -> 105 packets);
HTTP security probes; clean tarball smoke (stdio + HTTP).
Co-Authored-By: claude-flow <ruv@ruv.net>
26 lines
956 B
JavaScript
26 lines
956 B
JavaScript
#!/usr/bin/env node
|
|
// SPDX-License-Identifier: MIT
|
|
// `npx ruview` launcher. The logic lives in src/cli.js, which loads modules on
|
|
// demand (ADR-375); `run` is re-exported for tests and embedders.
|
|
|
|
import { realpathSync } from 'node:fs';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { argv } from 'node:process';
|
|
import { run } from '../src/cli.js';
|
|
|
|
export { run };
|
|
|
|
// CLI guard: run only when invoked directly (realpath both sides — npm/npx shims
|
|
// pass a non-normalized, possibly case-skewed argv[1] on Windows).
|
|
const invokedDirectly = (() => {
|
|
if (!argv[1]) return false;
|
|
try {
|
|
const a = realpathSync(argv[1]);
|
|
const b = realpathSync(fileURLToPath(import.meta.url));
|
|
return process.platform === 'win32' ? a.toLowerCase() === b.toLowerCase() : a === b;
|
|
} catch { return false; }
|
|
})();
|
|
if (invokedDirectly) {
|
|
run(argv.slice(2)).then((code) => process.exit(code)).catch((err) => { console.error(err); process.exit(1); });
|
|
}
|