mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
refactor: rename ACP "provider" to "runtime" across the codebase (#783)
This commit is contained in:
@@ -11,7 +11,7 @@ import * as React from "react";
|
||||
import { toast } from "sonner";
|
||||
|
||||
import {
|
||||
useAvailableAcpProviders,
|
||||
useAvailableAcpRuntimes,
|
||||
usePersonasQuery,
|
||||
useTeamsQuery,
|
||||
} from "@/features/agents/hooks";
|
||||
@@ -25,7 +25,7 @@ import {
|
||||
import { AddChannelBotPersonasSection } from "@/features/channels/ui/AddChannelBotPersonasSection";
|
||||
import { ProfileAvatar } from "@/features/profile/ui/ProfileAvatar";
|
||||
import type {
|
||||
AcpProvider,
|
||||
AcpRuntime,
|
||||
AgentPersona,
|
||||
AgentTeam,
|
||||
ChannelTemplate,
|
||||
@@ -295,8 +295,8 @@ function TemplateFormDialog({
|
||||
const updateMutation = useUpdateChannelTemplateMutation();
|
||||
const personasQuery = usePersonasQuery();
|
||||
const teamsQuery = useTeamsQuery();
|
||||
const providersQuery = useAvailableAcpProviders();
|
||||
const providers = providersQuery.data ?? [];
|
||||
const providersQuery = useAvailableAcpRuntimes();
|
||||
const runtimes = providersQuery.data ?? [];
|
||||
|
||||
const [name, setName] = React.useState("");
|
||||
const [description, setDescription] = React.useState("");
|
||||
@@ -305,10 +305,10 @@ function TemplateFormDialog({
|
||||
[],
|
||||
);
|
||||
const [selectedTeamIds, setSelectedTeamIds] = React.useState<string[]>([]);
|
||||
const [personaProviders, setPersonaProviders] = React.useState<
|
||||
const [personaRuntimes, setPersonaRuntimes] = React.useState<
|
||||
Record<string, string>
|
||||
>({});
|
||||
const [teamProviders, setTeamProviders] = React.useState<
|
||||
const [teamRuntimes, setTeamRuntimes] = React.useState<
|
||||
Record<string, string>
|
||||
>({});
|
||||
|
||||
@@ -322,24 +322,24 @@ function TemplateFormDialog({
|
||||
setCanvasTemplate(template.canvasTemplate ?? "");
|
||||
setSelectedPersonaIds(template.agents.personas.map((p) => p.personaId));
|
||||
setSelectedTeamIds(template.agents.teams.map((t) => t.teamId));
|
||||
const pProviders: Record<string, string> = {};
|
||||
const pRuntimes: Record<string, string> = {};
|
||||
for (const p of template.agents.personas) {
|
||||
if (p.provider) pProviders[p.personaId] = p.provider;
|
||||
if (p.runtime) pRuntimes[p.personaId] = p.runtime;
|
||||
}
|
||||
setPersonaProviders(pProviders);
|
||||
const tProviders: Record<string, string> = {};
|
||||
setPersonaRuntimes(pRuntimes);
|
||||
const tRuntimes: Record<string, string> = {};
|
||||
for (const t of template.agents.teams) {
|
||||
if (t.provider) tProviders[t.teamId] = t.provider;
|
||||
if (t.runtime) tRuntimes[t.teamId] = t.runtime;
|
||||
}
|
||||
setTeamProviders(tProviders);
|
||||
setTeamRuntimes(tRuntimes);
|
||||
} else {
|
||||
setName("");
|
||||
setDescription("");
|
||||
setCanvasTemplate("");
|
||||
setSelectedPersonaIds([]);
|
||||
setSelectedTeamIds([]);
|
||||
setPersonaProviders({});
|
||||
setTeamProviders({});
|
||||
setPersonaRuntimes({});
|
||||
setTeamRuntimes({});
|
||||
}
|
||||
}, [open, template]);
|
||||
|
||||
@@ -351,14 +351,14 @@ function TemplateFormDialog({
|
||||
const agents = {
|
||||
personas: selectedPersonaIds.map((personaId) => ({
|
||||
personaId,
|
||||
provider: personaProviders[personaId] || null,
|
||||
runtime: personaRuntimes[personaId] || null,
|
||||
model: null,
|
||||
role: null,
|
||||
backend: null,
|
||||
})),
|
||||
teams: selectedTeamIds.map((teamId) => ({
|
||||
teamId,
|
||||
provider: teamProviders[teamId] || null,
|
||||
runtime: teamRuntimes[teamId] || null,
|
||||
model: null,
|
||||
backend: null,
|
||||
})),
|
||||
@@ -409,7 +409,7 @@ function TemplateFormDialog({
|
||||
function handleTogglePersona(personaId: string) {
|
||||
setSelectedPersonaIds((prev) => {
|
||||
if (prev.includes(personaId)) {
|
||||
setPersonaProviders((pp) => {
|
||||
setPersonaRuntimes((pp) => {
|
||||
const next = { ...pp };
|
||||
delete next[personaId];
|
||||
return next;
|
||||
@@ -423,7 +423,7 @@ function TemplateFormDialog({
|
||||
function handleToggleTeam(teamId: string) {
|
||||
setSelectedTeamIds((prev) => {
|
||||
if (prev.includes(teamId)) {
|
||||
setTeamProviders((tp) => {
|
||||
setTeamRuntimes((tp) => {
|
||||
const next = { ...tp };
|
||||
delete next[teamId];
|
||||
return next;
|
||||
@@ -557,25 +557,25 @@ function TemplateFormDialog({
|
||||
isLoading={teamsQuery.isLoading}
|
||||
/>
|
||||
|
||||
{/* Provider assignments */}
|
||||
<ProviderAssignments
|
||||
{/* Runtime assignments */}
|
||||
<RuntimeAssignments
|
||||
isPending={isPending}
|
||||
personas={personasQuery.data ?? []}
|
||||
personaProviders={personaProviders}
|
||||
providers={providers}
|
||||
personaRuntimes={personaRuntimes}
|
||||
providers={runtimes}
|
||||
providersLoading={providersQuery.isLoading}
|
||||
selectedPersonaIds={selectedPersonaIds}
|
||||
selectedTeamIds={selectedTeamIds}
|
||||
teamProviders={teamProviders}
|
||||
teamRuntimes={teamRuntimes}
|
||||
teams={teamsQuery.data ?? []}
|
||||
onPersonaProviderChange={(personaId, providerId) =>
|
||||
setPersonaProviders((prev) => ({
|
||||
onPersonaRuntimeChange={(personaId, runtimeId) =>
|
||||
setPersonaRuntimes((prev) => ({
|
||||
...prev,
|
||||
[personaId]: providerId,
|
||||
[personaId]: runtimeId,
|
||||
}))
|
||||
}
|
||||
onTeamProviderChange={(teamId, providerId) =>
|
||||
setTeamProviders((prev) => ({ ...prev, [teamId]: providerId }))
|
||||
onTeamRuntimeChange={(teamId, runtimeId) =>
|
||||
setTeamRuntimes((prev) => ({ ...prev, [teamId]: runtimeId }))
|
||||
}
|
||||
/>
|
||||
</form>
|
||||
@@ -647,32 +647,32 @@ function TemplateTeamSelector({
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// ProviderAssignments — per-entry provider dropdowns for selected agents
|
||||
// RuntimeAssignments — per-entry runtime dropdowns for selected agents
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function ProviderAssignments({
|
||||
function RuntimeAssignments({
|
||||
isPending,
|
||||
onPersonaProviderChange,
|
||||
onTeamProviderChange,
|
||||
onPersonaRuntimeChange,
|
||||
onTeamRuntimeChange,
|
||||
personas,
|
||||
personaProviders,
|
||||
personaRuntimes,
|
||||
providers,
|
||||
providersLoading,
|
||||
selectedPersonaIds,
|
||||
selectedTeamIds,
|
||||
teamProviders,
|
||||
teamRuntimes,
|
||||
teams,
|
||||
}: {
|
||||
isPending: boolean;
|
||||
onPersonaProviderChange: (personaId: string, providerId: string) => void;
|
||||
onTeamProviderChange: (teamId: string, providerId: string) => void;
|
||||
onPersonaRuntimeChange: (personaId: string, runtimeId: string) => void;
|
||||
onTeamRuntimeChange: (teamId: string, runtimeId: string) => void;
|
||||
personas: AgentPersona[];
|
||||
personaProviders: Record<string, string>;
|
||||
providers: AcpProvider[];
|
||||
personaRuntimes: Record<string, string>;
|
||||
providers: AcpRuntime[];
|
||||
providersLoading: boolean;
|
||||
selectedPersonaIds: readonly string[];
|
||||
selectedTeamIds: readonly string[];
|
||||
teamProviders: Record<string, string>;
|
||||
teamRuntimes: Record<string, string>;
|
||||
teams: readonly AgentTeam[];
|
||||
}) {
|
||||
const hasSelections =
|
||||
@@ -687,7 +687,7 @@ function ProviderAssignments({
|
||||
return (
|
||||
<div className="space-y-3">
|
||||
<div>
|
||||
<div className="text-sm font-medium">Runtime providers</div>
|
||||
<div className="text-sm font-medium">Runtimes</div>
|
||||
<p className="text-xs text-muted-foreground">
|
||||
Choose which runtime to use for each agent.
|
||||
</p>
|
||||
@@ -697,34 +697,32 @@ function ProviderAssignments({
|
||||
<p className="text-xs text-muted-foreground">Discovering runtimes...</p>
|
||||
) : providers.length === 0 ? (
|
||||
<p className="text-xs text-muted-foreground">
|
||||
No ACP runtimes detected. Install one to assign providers.
|
||||
No ACP runtimes detected. Install one to assign runtimes.
|
||||
</p>
|
||||
) : (
|
||||
<div className="space-y-2">
|
||||
{selectedPersonas.map((persona) => (
|
||||
<ProviderRow
|
||||
<RuntimeRow
|
||||
key={persona.id}
|
||||
avatarUrl={persona.avatarUrl}
|
||||
disabled={isPending}
|
||||
label={persona.displayName}
|
||||
onChange={(providerId) =>
|
||||
onPersonaProviderChange(persona.id, providerId)
|
||||
onChange={(runtimeId) =>
|
||||
onPersonaRuntimeChange(persona.id, runtimeId)
|
||||
}
|
||||
providers={providers}
|
||||
value={personaProviders[persona.id] ?? ""}
|
||||
value={personaRuntimes[persona.id] ?? ""}
|
||||
/>
|
||||
))}
|
||||
{selectedTeams.map((team) => (
|
||||
<ProviderRow
|
||||
<RuntimeRow
|
||||
key={team.id}
|
||||
disabled={isPending}
|
||||
icon="team"
|
||||
label={team.name}
|
||||
onChange={(providerId) =>
|
||||
onTeamProviderChange(team.id, providerId)
|
||||
}
|
||||
onChange={(runtimeId) => onTeamRuntimeChange(team.id, runtimeId)}
|
||||
providers={providers}
|
||||
value={teamProviders[team.id] ?? ""}
|
||||
value={teamRuntimes[team.id] ?? ""}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
@@ -733,7 +731,7 @@ function ProviderAssignments({
|
||||
);
|
||||
}
|
||||
|
||||
function ProviderRow({
|
||||
function RuntimeRow({
|
||||
avatarUrl,
|
||||
disabled,
|
||||
icon,
|
||||
@@ -746,8 +744,8 @@ function ProviderRow({
|
||||
disabled: boolean;
|
||||
icon?: "team";
|
||||
label: string;
|
||||
onChange: (providerId: string) => void;
|
||||
providers: AcpProvider[];
|
||||
onChange: (runtimeId: string) => void;
|
||||
providers: AcpRuntime[];
|
||||
value: string;
|
||||
}) {
|
||||
return (
|
||||
@@ -771,9 +769,9 @@ function ProviderRow({
|
||||
value={value}
|
||||
>
|
||||
<option value="">Default</option>
|
||||
{providers.map((provider) => (
|
||||
<option key={provider.id} value={provider.id}>
|
||||
{provider.label}
|
||||
{providers.map((runtime) => (
|
||||
<option key={runtime.id} value={runtime.id}>
|
||||
{runtime.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
|
||||
@@ -11,18 +11,18 @@ import {
|
||||
import { openUrl } from "@tauri-apps/plugin-opener";
|
||||
|
||||
import {
|
||||
useAcpProvidersQuery,
|
||||
useAcpRuntimesQuery,
|
||||
useInstallAcpRuntimeMutation,
|
||||
} from "@/features/agents/hooks";
|
||||
import { describeResolvedCommand } from "@/features/agents/ui/agentUi";
|
||||
import type { AcpProviderCatalogEntry } from "@/shared/api/types";
|
||||
import type { AcpRuntimeCatalogEntry } from "@/shared/api/types";
|
||||
import { cn } from "@/shared/lib/cn";
|
||||
import { Button } from "@/shared/ui/button";
|
||||
|
||||
function StatusIcon({
|
||||
availability,
|
||||
}: {
|
||||
availability: AcpProviderCatalogEntry["availability"];
|
||||
availability: AcpRuntimeCatalogEntry["availability"];
|
||||
}) {
|
||||
switch (availability) {
|
||||
case "available":
|
||||
@@ -39,15 +39,15 @@ function StatusIcon({
|
||||
function InstallActions({
|
||||
isInstalling,
|
||||
onInstall,
|
||||
provider,
|
||||
runtime,
|
||||
}: {
|
||||
isInstalling: boolean;
|
||||
onInstall: () => void;
|
||||
provider: AcpProviderCatalogEntry;
|
||||
runtime: AcpRuntimeCatalogEntry;
|
||||
}) {
|
||||
return (
|
||||
<div className="mt-2 flex items-center gap-2">
|
||||
{provider.canAutoInstall ? (
|
||||
{runtime.canAutoInstall ? (
|
||||
<Button
|
||||
disabled={isInstalling}
|
||||
onClick={onInstall}
|
||||
@@ -65,7 +65,7 @@ function InstallActions({
|
||||
) : null}
|
||||
<button
|
||||
className="inline-flex items-center gap-1 text-xs text-muted-foreground underline-offset-2 hover:text-foreground hover:underline"
|
||||
onClick={() => void openUrl(provider.installInstructionsUrl)}
|
||||
onClick={() => void openUrl(runtime.installInstructionsUrl)}
|
||||
type="button"
|
||||
>
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
@@ -75,80 +75,80 @@ function InstallActions({
|
||||
);
|
||||
}
|
||||
|
||||
function ProviderRow({
|
||||
function RuntimeRow({
|
||||
installError,
|
||||
installSuccess,
|
||||
isInstalling,
|
||||
onInstall,
|
||||
provider,
|
||||
runtime,
|
||||
}: {
|
||||
installError: string | null;
|
||||
installSuccess: boolean;
|
||||
isInstalling: boolean;
|
||||
onInstall: () => void;
|
||||
provider: AcpProviderCatalogEntry;
|
||||
runtime: AcpRuntimeCatalogEntry;
|
||||
}) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex items-start gap-3 rounded-xl border px-4 py-3",
|
||||
provider.availability === "available"
|
||||
runtime.availability === "available"
|
||||
? "border-border/70 bg-background/80"
|
||||
: provider.availability === "adapter_missing" ||
|
||||
provider.availability === "cli_missing"
|
||||
: runtime.availability === "adapter_missing" ||
|
||||
runtime.availability === "cli_missing"
|
||||
? "border-amber-500/30 bg-amber-500/5"
|
||||
: "border-border/50 bg-muted/30",
|
||||
)}
|
||||
data-testid={`doctor-provider-${provider.id}`}
|
||||
data-testid={`doctor-runtime-${runtime.id}`}
|
||||
>
|
||||
<div className="mt-0.5 shrink-0">
|
||||
<StatusIcon availability={provider.availability} />
|
||||
<StatusIcon availability={runtime.availability} />
|
||||
</div>
|
||||
|
||||
<div className="min-w-0 flex-1">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<p className="text-sm font-semibold tracking-tight">
|
||||
{provider.label}
|
||||
{runtime.label}
|
||||
</p>
|
||||
{provider.command ? (
|
||||
{runtime.command ? (
|
||||
<code className="rounded bg-muted px-1.5 py-0.5 text-[11px]">
|
||||
{provider.command}
|
||||
{runtime.command}
|
||||
</code>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
{provider.availability === "available" &&
|
||||
provider.command &&
|
||||
provider.binaryPath ? (
|
||||
{runtime.availability === "available" &&
|
||||
runtime.command &&
|
||||
runtime.binaryPath ? (
|
||||
<>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
Available via{" "}
|
||||
{describeResolvedCommand(provider.command, provider.binaryPath)}.
|
||||
{describeResolvedCommand(runtime.command, runtime.binaryPath)}.
|
||||
</p>
|
||||
{provider.defaultArgs.length > 0 ? (
|
||||
{runtime.defaultArgs.length > 0 ? (
|
||||
<p className="mt-2 text-xs text-muted-foreground">
|
||||
Default args:{" "}
|
||||
<code className="font-mono">
|
||||
{provider.defaultArgs.join(", ")}
|
||||
{runtime.defaultArgs.join(", ")}
|
||||
</code>
|
||||
</p>
|
||||
) : null}
|
||||
{provider.underlyingCliPath &&
|
||||
provider.underlyingCliPath !== provider.binaryPath ? (
|
||||
{runtime.underlyingCliPath &&
|
||||
runtime.underlyingCliPath !== runtime.binaryPath ? (
|
||||
<div className="mt-1 space-y-0.5">
|
||||
<p className="break-all font-mono text-[11px] text-muted-foreground/80">
|
||||
<span className="text-muted-foreground">CLI:</span>{" "}
|
||||
{provider.underlyingCliPath}
|
||||
{runtime.underlyingCliPath}
|
||||
</p>
|
||||
<p className="break-all font-mono text-[11px] text-muted-foreground/80">
|
||||
<span className="text-muted-foreground">ACP adapter:</span>{" "}
|
||||
{provider.binaryPath}
|
||||
{runtime.binaryPath}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<>
|
||||
<p className="mt-1 break-all font-mono text-[11px] text-muted-foreground/80">
|
||||
{provider.binaryPath}
|
||||
{runtime.binaryPath}
|
||||
</p>
|
||||
<p className="mt-1 text-[11px] text-muted-foreground/60">
|
||||
ACP support built-in — no separate adapter needed.
|
||||
@@ -156,57 +156,57 @@ function ProviderRow({
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
) : provider.availability === "adapter_missing" ? (
|
||||
) : runtime.availability === "adapter_missing" ? (
|
||||
<>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
CLI detected at{" "}
|
||||
<code className="rounded bg-muted px-1 py-0.5 text-[11px]">
|
||||
{provider.underlyingCliPath ?? "unknown path"}
|
||||
{runtime.underlyingCliPath ?? "unknown path"}
|
||||
</code>{" "}
|
||||
but ACP adapter not found.
|
||||
</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
{provider.installHint}
|
||||
{runtime.installHint}
|
||||
</p>
|
||||
<InstallActions
|
||||
isInstalling={isInstalling}
|
||||
onInstall={onInstall}
|
||||
provider={provider}
|
||||
runtime={runtime}
|
||||
/>
|
||||
</>
|
||||
) : provider.availability === "cli_missing" ? (
|
||||
) : runtime.availability === "cli_missing" ? (
|
||||
<>
|
||||
<p className="mt-1 text-sm text-muted-foreground">
|
||||
ACP adapter found at{" "}
|
||||
<code className="rounded bg-muted px-1 py-0.5 text-[11px]">
|
||||
{provider.binaryPath ?? "unknown path"}
|
||||
{runtime.binaryPath ?? "unknown path"}
|
||||
</code>{" "}
|
||||
but the {provider.label} CLI is not installed.
|
||||
but the {runtime.label} CLI is not installed.
|
||||
</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
{provider.installHint}
|
||||
{runtime.installHint}
|
||||
</p>
|
||||
<InstallActions
|
||||
isInstalling={isInstalling}
|
||||
onInstall={onInstall}
|
||||
provider={provider}
|
||||
runtime={runtime}
|
||||
/>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
<p className="mt-1 text-sm text-muted-foreground">Not installed</p>
|
||||
<p className="mt-1 text-xs text-muted-foreground">
|
||||
{provider.installHint}
|
||||
{runtime.installHint}
|
||||
</p>
|
||||
<InstallActions
|
||||
isInstalling={isInstalling}
|
||||
onInstall={onInstall}
|
||||
provider={provider}
|
||||
runtime={runtime}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
|
||||
{installSuccess && provider.availability !== "available" ? (
|
||||
{installSuccess && runtime.availability !== "available" ? (
|
||||
<p className="mt-2 rounded-lg border border-green-500/30 bg-green-500/10 px-3 py-1.5 text-xs text-green-700 dark:text-green-400">
|
||||
Installed successfully!
|
||||
</p>
|
||||
@@ -222,31 +222,31 @@ function ProviderRow({
|
||||
}
|
||||
|
||||
export function DoctorSettingsPanel() {
|
||||
const providersQuery = useAcpProvidersQuery();
|
||||
const providers = providersQuery.data ?? [];
|
||||
const isRefreshing = providersQuery.isFetching;
|
||||
const runtimesQuery = useAcpRuntimesQuery();
|
||||
const runtimes = runtimesQuery.data ?? [];
|
||||
const isRefreshing = runtimesQuery.isFetching;
|
||||
const installMutation = useInstallAcpRuntimeMutation();
|
||||
const [installResults, setInstallResults] = React.useState<
|
||||
Record<string, { success: boolean; error: string | null }>
|
||||
>({});
|
||||
|
||||
function handleInstall(providerId: string) {
|
||||
function handleInstall(runtimeId: string) {
|
||||
setInstallResults((prev) => ({
|
||||
...prev,
|
||||
[providerId]: { success: false, error: null },
|
||||
[runtimeId]: { success: false, error: null },
|
||||
}));
|
||||
installMutation.mutate(providerId, {
|
||||
installMutation.mutate(runtimeId, {
|
||||
onSuccess: (result) => {
|
||||
if (result.success) {
|
||||
setInstallResults((prev) => ({
|
||||
...prev,
|
||||
[providerId]: { success: true, error: null },
|
||||
[runtimeId]: { success: true, error: null },
|
||||
}));
|
||||
} else {
|
||||
const lastStep = result.steps[result.steps.length - 1];
|
||||
setInstallResults((prev) => ({
|
||||
...prev,
|
||||
[providerId]: {
|
||||
[runtimeId]: {
|
||||
success: false,
|
||||
error: lastStep
|
||||
? `Step "${lastStep.step}" failed: ${lastStep.stderr || lastStep.stdout || "unknown error"}`
|
||||
@@ -258,7 +258,7 @@ export function DoctorSettingsPanel() {
|
||||
onError: (error) => {
|
||||
setInstallResults((prev) => ({
|
||||
...prev,
|
||||
[providerId]: {
|
||||
[runtimeId]: {
|
||||
success: false,
|
||||
error: error instanceof Error ? error.message : "Install failed.",
|
||||
},
|
||||
@@ -285,7 +285,7 @@ export function DoctorSettingsPanel() {
|
||||
disabled={isRefreshing}
|
||||
onClick={() => {
|
||||
setInstallResults({});
|
||||
void providersQuery.refetch();
|
||||
void runtimesQuery.refetch();
|
||||
}}
|
||||
size="sm"
|
||||
type="button"
|
||||
@@ -308,22 +308,22 @@ export function DoctorSettingsPanel() {
|
||||
</p>
|
||||
|
||||
<div className="mt-4 space-y-2">
|
||||
{providersQuery.isLoading ? (
|
||||
{runtimesQuery.isLoading ? (
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Looking for ACP runtimes...
|
||||
</p>
|
||||
) : providers.length > 0 ? (
|
||||
providers.map((provider) => (
|
||||
<ProviderRow
|
||||
installError={installResults[provider.id]?.error ?? null}
|
||||
installSuccess={installResults[provider.id]?.success ?? false}
|
||||
) : runtimes.length > 0 ? (
|
||||
runtimes.map((runtime) => (
|
||||
<RuntimeRow
|
||||
installError={installResults[runtime.id]?.error ?? null}
|
||||
installSuccess={installResults[runtime.id]?.success ?? false}
|
||||
isInstalling={
|
||||
installMutation.isPending &&
|
||||
installMutation.variables === provider.id
|
||||
installMutation.variables === runtime.id
|
||||
}
|
||||
key={provider.id}
|
||||
onInstall={() => handleInstall(provider.id)}
|
||||
provider={provider}
|
||||
key={runtime.id}
|
||||
onInstall={() => handleInstall(runtime.id)}
|
||||
runtime={runtime}
|
||||
/>
|
||||
))
|
||||
) : (
|
||||
@@ -333,9 +333,9 @@ export function DoctorSettingsPanel() {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{providersQuery.error instanceof Error ? (
|
||||
{runtimesQuery.error instanceof Error ? (
|
||||
<p className="mt-4 rounded-xl border border-destructive/30 bg-destructive/10 px-4 py-3 text-sm text-destructive">
|
||||
{providersQuery.error.message}
|
||||
{runtimesQuery.error.message}
|
||||
</p>
|
||||
) : null}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user