mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-05-02 22:00:19 +00:00
fix(ux): show cloud count and credential readiness in interactive agent picker (#1025)
When users run `spawn` interactively, the agent picker now shows how many clouds each agent supports and how many have credentials ready. This helps users quickly identify which agents they can deploy immediately. Before: "Claude Code AI coding assistant" After: "Claude Code 2 clouds, 1 ready" Agent: ux-engineer Co-authored-by: A <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
46b760cf2b
commit
b76f04cd78
2 changed files with 144 additions and 2 deletions
|
|
@ -305,15 +305,36 @@ export function prioritizeCloudsByCredentials(
|
|||
return { sortedClouds: [...withCreds, ...withoutCreds], hintOverrides, credCount: withCreds.length };
|
||||
}
|
||||
|
||||
/** Build hint overrides for the agent picker showing cloud count and credential readiness */
|
||||
export function buildAgentPickerHints(manifest: Manifest): Record<string, string> {
|
||||
const hints: Record<string, string> = {};
|
||||
for (const agent of agentKeys(manifest)) {
|
||||
const implClouds = getImplementedClouds(manifest, agent);
|
||||
if (implClouds.length === 0) {
|
||||
hints[agent] = "no clouds available yet";
|
||||
continue;
|
||||
}
|
||||
const readyCount = implClouds.filter(c => hasCloudCredentials(manifest.clouds[c].auth)).length;
|
||||
const cloudLabel = `${implClouds.length} cloud${implClouds.length !== 1 ? "s" : ""}`;
|
||||
if (readyCount > 0) {
|
||||
hints[agent] = `${cloudLabel}, ${readyCount} ready`;
|
||||
} else {
|
||||
hints[agent] = cloudLabel;
|
||||
}
|
||||
}
|
||||
return hints;
|
||||
}
|
||||
|
||||
export async function cmdInteractive(): Promise<void> {
|
||||
p.intro(pc.inverse(` spawn v${VERSION} `));
|
||||
|
||||
const manifest = await loadManifestWithSpinner();
|
||||
|
||||
const agents = agentKeys(manifest);
|
||||
const agentHints = buildAgentPickerHints(manifest);
|
||||
const agentChoice = await p.select({
|
||||
message: "Select an agent",
|
||||
options: mapToSelectOptions(agents, manifest.agents),
|
||||
options: mapToSelectOptions(agents, manifest.agents, agentHints),
|
||||
});
|
||||
if (p.isCancel(agentChoice)) handleCancel();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue