@claude-flow/embeddings
Version:
V3 Embedding Service - OpenAI, Transformers.js, Agentic-Flow (ONNX), Mock providers with hyperbolic embeddings, normalization, and chunking
77 lines • 3.42 kB
TypeScript
/**
* ADR-121 Phase 5 (lightweight) — ruvector MCP sidecar availability probe.
*
* The `ruvector` CLI ships its own MCP server with a rich tool surface
* (`hooks_*`, vector memory, trajectory tracking, etc.). The full
* Phase 5 plan is to wire a sidecar MCP server alongside `@claude-flow/cli`
* so embedding-heavy MCP tools can delegate to the optimized Rust
* backend. That's a multi-package integration (touches the CLI's MCP
* registry, the doctor command, the cost-tracker) and lands in a
* follow-up.
*
* This module ships the *foundation* for that work: a structured
* availability probe that detects whether `ruvector` is installed,
* what version, and which MCP tools it exposes. The probe is
* shellout-based (spawns `ruvector --version` + `ruvector mcp tools`),
* times out cleanly, and degrades to a `null` report when the CLI
* isn't on the PATH.
*
* Consumers:
* - `ruflo doctor` integration (follow-up PR) — reports the sidecar
* availability + version in the system health table
* - New `embeddings_check_ruvector_sidecar` MCP tool — exposes the
* report to LLM agents that want to know whether the optimized
* backend is reachable before issuing embedding-heavy calls
* - CI guards — assert the probe handles both installed/not-installed
* paths cleanly
*/
/**
* Single MCP tool entry as reported by `ruvector mcp tools`.
* Mirrors the columns of the CLI's text output.
*/
export interface RuvectorMcpTool {
/** Tool group (e.g. 'hooks-core', 'hooks-trajectory'). */
readonly group: string;
/** Tool name (e.g. 'hooks_route'). */
readonly name: string;
/** Parameter signature as a free-form string. */
readonly params: string;
/** Human-readable description. */
readonly description: string;
}
export interface RuvectorAvailability {
/** True iff `ruvector` is on the PATH and `--version` succeeded. */
readonly available: boolean;
/** CLI version (e.g. "0.2.13") when available. */
readonly version?: string;
/** Resolved binary path when available. */
readonly binary?: string;
/** Tools surfaced by `ruvector mcp tools` when available. */
readonly tools?: readonly RuvectorMcpTool[];
/** Total tool count (cheap top-level number for dashboards). */
readonly toolCount?: number;
/** Tool-group breakdown — { 'hooks-core': 10, 'hooks-trajectory': 3, ... }. */
readonly groups?: Readonly<Record<string, number>>;
/** Human-readable reason when `available === false`. */
readonly reason?: string;
/** Wall-clock ms the probe took. */
readonly probeMs: number;
}
export interface RuvectorProbeOptions {
/** Per-shellout timeout (default 5_000 ms). */
readonly timeoutMs?: number;
/** Override the binary name (default 'ruvector'). For tests. */
readonly binary?: string;
}
/**
* Probe ruvector CLI availability + MCP tool surface. Never throws;
* returns a `RuvectorAvailability` report with `available: false` and
* a `reason` string when the CLI isn't reachable.
*/
export declare function probeRuvectorSidecar(options?: RuvectorProbeOptions): Promise<RuvectorAvailability>;
/**
* Compact summary for dashboards / `ruflo doctor` output. Returns
* a single line suitable for a table row.
*/
export declare function formatRuvectorAvailability(r: RuvectorAvailability): string;
//# sourceMappingURL=ruvector-mcp-probe.d.ts.map