mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
- Add tool-detector.ts (6 CLI tools: claude, codex, opencode, cline, kilocode, continue) - Add config-generator/ factory + 6 generators (JSON + YAML) - Add doctor/checks.ts for CLI tool health checks - Add log-streamer.ts for usage log streaming - Add @omniroute/opencode-provider npm package - Add 5 CLI commands: config, status, logs, update, provider - Add 3 API routes: config, detect, apply - Update bin/omniroute.mjs, bin/cli/index.mjs, package.json - Update docs: SETUP_GUIDE.md, CLI-TOOLS.md - All tests pass (4302/4326, 24 pre-existing failures unchanged)
42 lines
1.0 KiB
TypeScript
42 lines
1.0 KiB
TypeScript
import path from "node:path";
|
|
import os from "node:os";
|
|
|
|
export interface DoctorCheckResult {
|
|
name: string;
|
|
status: "ok" | "warn" | "fail";
|
|
message: string;
|
|
details: Record<string, unknown>;
|
|
}
|
|
|
|
export async function collectCliToolChecks(): Promise<DoctorCheckResult[]> {
|
|
const { detectAllTools } = await import("../tool-detector.js");
|
|
const tools = await detectAllTools();
|
|
|
|
return tools.map((tool) => {
|
|
if (!tool.installed) {
|
|
return {
|
|
name: `CLI: ${tool.name}`,
|
|
status: "warn" as const,
|
|
message: `${tool.name} not installed`,
|
|
details: { id: tool.id, installed: false },
|
|
};
|
|
}
|
|
|
|
if (!tool.configured) {
|
|
return {
|
|
name: `CLI: ${tool.name}`,
|
|
status: "warn" as const,
|
|
message: `${tool.name} not configured for OmniRoute`,
|
|
details: { id: tool.id, configured: false },
|
|
};
|
|
}
|
|
|
|
return {
|
|
name: `CLI: ${tool.name}`,
|
|
status: "ok" as const,
|
|
message: `${tool.name} configured`,
|
|
details: { id: tool.id, configured: true },
|
|
};
|
|
});
|
|
}
|