* Switch models from the Command Center Add a model switcher to the Command-K Command Center. Typing surfaces a flat, filterable list of "Model › Provider › Name" breadcrumb rows with provider icons: - Running agent: its own provider's models (a live agent can't change provider); selecting calls setAgentModel. - New draft tab: every available provider's models in one flat list; selecting sets provider + model on the draft via a focused-draft controller published to a global store (the draft form state is local to the composer subtree and otherwise unreachable from the global Command Center). Models only appear once the user starts typing, so the default palette view is unchanged. Reuses useProvidersSnapshot and the existing setAgentModel RPC — no protocol changes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * Update packages/app/src/components/command-center.tsx Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * Update packages/app/src/hooks/use-command-center.ts Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> * refactor(app): make Command Center extensible Let focused features register stable actions while the palette owns search, selection, and a single virtualized result projection. * fix(app): save model preference after agent switch Persist the shared model choice only after the daemon confirms the live agent switched successfully. --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Co-authored-by: Mohamed Boudra <boudra.moha@gmail.com>
21 lines
885 B
TypeScript
21 lines
885 B
TypeScript
import { withUnistyles } from "react-native-unistyles";
|
|
import type { AgentProvider } from "@getpaseo/protocol/agent-types";
|
|
import { getProviderIcon } from "@/components/provider-icons";
|
|
import type { CommandCenterIcon, CommandCenterIconProps } from "./contributions";
|
|
|
|
const commandCenterProviderIcons = new Map<AgentProvider, CommandCenterIcon>();
|
|
|
|
export function getCommandCenterProviderIcon(provider: AgentProvider): CommandCenterIcon {
|
|
const cached = commandCenterProviderIcons.get(provider);
|
|
if (cached) return cached;
|
|
|
|
const ProviderIcon = withUnistyles(getProviderIcon(provider), (theme) => ({
|
|
color: theme.colors.foregroundMuted,
|
|
}));
|
|
function CommandCenterProviderIcon({ size }: CommandCenterIconProps) {
|
|
return <ProviderIcon size={size} />;
|
|
}
|
|
commandCenterProviderIcons.set(provider, CommandCenterProviderIcon);
|
|
return CommandCenterProviderIcon;
|
|
}
|