Add provider triage health contract

This commit is contained in:
Codex
2026-05-20 11:59:44 +00:00
parent 34e0dca884
commit 9259fce80f
7 changed files with 539 additions and 10 deletions
+9 -1
View File
@@ -2,6 +2,7 @@ import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { type UniDeskConfig, repoRoot, rootPath } from "./config";
import { runCommand } from "./command";
import { runProviderTriage } from "./provider-triage";
interface ProviderAttachOptions {
providerId: string;
@@ -177,7 +178,14 @@ function inspectAttachedContainer(options: ProviderAttachOptions): ProviderAttac
export async function runProviderCommand(config: UniDeskConfig, args: string[]): Promise<unknown> {
const [sub] = args;
if (sub !== "attach") {
throw new Error("provider requires subcommand: attach");
if (sub === "triage") {
const providerId = args[1];
if (providerId === undefined || providerId.length === 0) {
throw new Error("provider triage requires provider id, for example: bun scripts/cli.ts provider triage D601");
}
return runProviderTriage(config, providerId, args.slice(2));
}
throw new Error("provider requires subcommand: attach|triage");
}
const options = parseAttachOptions(config, args.slice(1));
mkdirSync(options.logDir, { recursive: true });