Add remote gc for provider hosts

This commit is contained in:
Codex
2026-05-29 01:43:14 +00:00
parent 3d5e613674
commit 3b9c8d8ddb
6 changed files with 1506 additions and 6 deletions
+6 -1
View File
@@ -3,6 +3,7 @@ import { closeSync, existsSync, ftruncateSync, lstatSync, mkdirSync, openSync, r
import { basename, join, resolve } from "node:path";
import { type UniDeskConfig, repoRoot, rootPath } from "./config";
import { runRemoteGcCommand } from "./gc-remote";
type GcRisk = "low" | "medium" | "high" | "blocked";
type GcItemKind =
@@ -183,6 +184,10 @@ const TMP_EXACT_PROTECT = new Set([
export async function runGcCommand(config: UniDeskConfig, args: string[]): Promise<unknown> {
const [action = "plan", ...rest] = args;
if (action === "remote") {
const [providerId, subaction = "plan", ...remoteArgs] = rest;
return await runRemoteGcCommand(config, providerId, subaction, remoteArgs);
}
if (action === "policy") {
const [subaction = "plan", ...policyArgs] = rest;
const options = parseGcPolicyOptions(policyArgs);
@@ -243,7 +248,7 @@ export async function runGcCommand(config: UniDeskConfig, args: string[]): Promi
ok: false,
error: "unsupported-gc-action",
action,
supportedActions: ["plan", "run", "db-trace", "policy"],
supportedActions: ["plan", "run", "db-trace", "policy", "remote"],
};
}