fix(install): change install method from multiselect to single select

This commit is contained in:
chenbaowang 2026-04-14 10:50:28 +08:00
parent c8e58e0476
commit a85beea6b9

View file

@ -83,23 +83,27 @@ async function selectAgentsInteractive(isGlobal: boolean): Promise<string[] | nu
}
async function selectInstallMode(): Promise<"symlink" | "copy" | null> {
const result = await searchMultiselect({
const result = await p.select({
message: "Installation method?",
items: [
{ value: "symlink", label: "Symlink (Recommended)", hint: "single source of truth" },
{ value: "copy", label: "Copy to all agents", hint: "independent copies" },
options: [
{
value: "symlink",
label: "Symlink (Recommended)",
hint: "single source of truth",
},
{
value: "copy",
label: "Copy to all agents",
hint: "independent copies",
},
],
initialSelected: ["symlink"],
});
if (result === cancelSymbol) {
if (p.isCancel(result)) {
return null;
}
if ((result as string[]).includes("symlink")) {
return "symlink";
}
return "copy";
return result as "symlink" | "copy";
}
function buildAgentSummary(targetAgents: { key: string; name: string; skillsDir: string }[], mode: "symlink" | "copy"): string[] {