Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

feat(switchdash): install a single prerequisite from the host page (CHOO-1809)

switch-worker-louis-remote2f923b0811db
diff --git a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/controller.ts b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/controller.ts
index 20480e878..5a1912bd0 100644
--- a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/controller.ts
+++ b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/controller.ts
@@ -29,6 +29,7 @@ import { deletePersistedReachability } from './reachability-store';
import {
discardSetupPlan,
ensureSetupPlan,
+ installSetupStep,
readAllSetupPlans,
readSetupPlan,
recheckSetup,
@@ -222,6 +223,10 @@ export const remoteHostsController = createRPCController({
*/
runSetup: (sshHost: string): Promise<HostSetupPlan> => runSetup(sshHost),
+ /** Install one prerequisite or agent type on its own, then verify it. */
+ installSetupStep: (params: { sshHost: string; stepId: string }): Promise<HostSetupPlan> =>
+ installSetupStep(params.sshHost, params.stepId),
+
/** Move past a step the user has chosen not to fix, unblocking the rest. */
skipSetupStep: (params: { sshHost: string; stepId: string }): Promise<HostSetupPlan> =>
skipSetupStep(params.sshHost, params.stepId),
diff --git a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.test.ts b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.test.ts
index c84d9307a..85e7d5992 100644
--- a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.test.ts
+++ b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.test.ts
@@ -459,6 +459,60 @@ describe('checkAll — looking without touching', () => {
});
});
+describe('runSingleStep — installing one thing on its own', () => {
+ it('installs and verifies just that step, leaving the rest alone', async () => {
+ const { runner, installOrder } = makeRunner({
+ checks: {
+ git: [{ outcome: 'missing' }, { outcome: 'satisfied', version: '2.43.0' }],
+ node: [{ outcome: 'missing' }],
+ },
+ installs: { git: { ok: true } },
+ });
+
+ const result = await runner.runSingleStep(plan([step('git'), step('node')]), 'git');
+
+ expect(installOrder).toEqual(['git']);
+ expect(stateOf(result, 'git')).toBe('satisfied');
+ expect(stateOf(result, 'node')).toBe('pending');
+ });
+
+ it('does not mark it satisfied when the install cannot be verified', async () => {
+ const { runner } = makeRunner({
+ checks: { git: [{ outcome: 'missing' }, { outcome: 'missing' }] },
+ installs: { git: { ok: true } },
+ });
+
+ const result = await runner.runSingleStep(plan([step('git')]), 'git');
+
+ expect(stateOf(result, 'git')).toBe('failed');
+ });
+
+ it('reports the plan complete once the last outstanding step is installed', async () => {
+ const { runner } = makeRunner({
+ checks: {
+ git: [{ outcome: 'missing' }, { outcome: 'satisfied' }],
+ node: [{ outcome: 'satisfied' }],
+ },
+ installs: { git: { ok: true } },
+ });
+
+ const result = await runner.runSingleStep(
+ plan([step('git'), step('node', { state: 'satisfied' })]),
+ 'git'
+ );
+
+ expect(result.status).toBe('complete');
+ });
+
+ it('refuses on an unreachable host rather than reporting an install failure', async () => {
+ const { runner } = makeRunner({ checks: {}, installs: {}, reachable: false });
+
+ await expect(runner.runSingleStep(plan([step('git')]), 'git')).rejects.toBeInstanceOf(
+ HostSetupAbortedError
+ );
+ });
+});
+
describe('gh-auth steps', () => {
const ghStep = (patch: Partial<HostSetupStep> = {}) =>
step('gh:auth', { kind: 'gh-auth', name: 'GitHub CLI login', optional: true, ...patch });
diff --git a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.ts b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.ts
index 0fe1ff723..03109e7f2 100644
--- a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.ts
+++ b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-runner.ts
@@ -182,6 +182,38 @@ export class HostSetupRunner {
}
}
+ /**
+ * Install ONE step on its own — the per-item Install button.
+ *
+ * The ordered run is the right default, but it is not the only thing a user
+ * wants: seeing that git is missing and being offered only "run the whole
+ * plan" is why this existed as a gap. Same discipline as a step inside a run
+ * — reachability first, verify after — just without the rest of the plan.
+ */
+ async runSingleStep(plan: HostSetupPlan, stepId: string): Promise<HostSetupPlan> {
+ if (this.running) {
+ throw new Error(`A setup run is already in progress for ${this.deps.sshHost}`);
+ }
+ this.running = true;
+ try {
+ try {
+ this.deps.requireReachable(this.deps.sshHost);
+ } catch (error) {
+ throw new HostSetupAbortedError(
+ `Cannot install on ${this.deps.sshHost}: the host is not reachable.`,
+ error
+ );
+ }
+ const next = await this.runStep(plan, stepId);
+ return await this.transition(next, {
+ status: isPlanComplete(next) ? 'complete' : 'idle',
+ currentStepId: null,
+ });
+ } finally {
+ this.running = false;
+ }
+ }
+
/**
* Check one step, install it if that is both needed and possible, then
* re-check to verify. Never marks a step satisfied on the strength of an
diff --git a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-service.ts b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-service.ts
index 1ed642c5a..9ea16c3dd 100644
--- a/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-service.ts
+++ b/dash/apps/switchdash-desktop/src/main/core/remote-hosts/setup/host-setup-service.ts
@@ -205,6 +205,26 @@ export async function recheckSetup(sshHost: string): Promise<HostSetupPlan> {
}
}
+/**
+ * Install one step on its own — the per-item Install button. Checks, installs,
+ * and re-verifies just that step, leaving the rest of the plan alone.
+ */
+export async function installSetupStep(sshHost: string, stepId: string): Promise<HostSetupPlan> {
+ const plan = await ensureSetupPlan(sshHost);
+ const manager = await getRemoteDependencyManager(sshHost);
+ try {
+ return await runnerFor(sshHost, manager).runSingleStep(plan, stepId);
+ } catch (error) {
+ log.warn('[HostSetup] step install stopped', {
+ event: 'host-setup-step-install-stopped',
+ sshHost,
+ stepId,
+ error: String((error as Error)?.message ?? error),
+ });
+ throw error;
+ }
+}
+
/** Move past a step the user has chosen not to fix, unblocking the rest. */
export async function skipSetupStep(sshHost: string, stepId: string): Promise<HostSetupPlan> {
const plan = await getSetupPlan(sshHost);
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-detail-sheet.tsx b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-detail-sheet.tsx
index 54f575de0..6c7bc4d23 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-detail-sheet.tsx
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-detail-sheet.tsx
@@ -23,6 +23,7 @@ import { cn } from '@renderer/utils/utils';
import type { HostSetupStep } from '@shared/core/remote-hosts/setup';
import {
agentTypeBadge,
+ canInstall,
canSkip,
outcomeLabel,
stepBadge,
@@ -125,11 +126,15 @@ function isBlockedByDep(step: HostSetupStep): boolean {
function StepActions({
step,
+ onInstall,
+ installing,
onSkip,
skipping,
onAuthenticate,
}: {
step: HostSetupStep;
+ onInstall: () => void;
+ installing: boolean;
onSkip: () => void;
skipping: boolean;
onAuthenticate: () => void;
@@ -138,7 +143,9 @@ function StepActions({
// runs `gh` on the host, so offering it before the CLI exists sends the user
// into a failure that says nothing about the real problem.
const canSignIn = step.kind === 'gh-auth' && step.state !== 'satisfied' && !isBlockedByDep(step);
- if (!canSignIn && !canSkip(step)) return null;
+ const installable = canInstall(step);
+ const busy = installing || step.state === 'installing' || step.state === 'checking';
+ if (!canSignIn && !installable && !canSkip(step)) return null;
return (
<div className="flex shrink-0 items-center gap-1.5">
@@ -147,8 +154,19 @@ function StepActions({
{step.error?.includes('read:packages') ? 'Re-authenticate' : 'Sign in'}
</Button>
)}
+ {installable && (
+ <Button size="xs" disabled={busy} onClick={onInstall}>
+ {busy ? (
+ <Loader2 className="size-3.5 animate-spin" />
+ ) : step.state === 'failed' ? (
+ 'Retry'
+ ) : (
+ 'Install'
+ )}
+ </Button>
+ )}
{canSkip(step) && (
- <Button size="xs" variant="ghost" disabled={skipping} onClick={onSkip}>
+ <Button size="xs" variant="ghost" disabled={busy || skipping} onClick={onSkip}>
{skipping ? 'Skipping…' : 'Skip'}
</Button>
)}
@@ -193,6 +211,8 @@ export function SetupDetailSheet({
sshHost,
icon,
onClose,
+ onInstall,
+ installingStepId,
onSkip,
skippingStepId,
onAuthenticate,
@@ -202,6 +222,8 @@ export function SetupDetailSheet({
/** Icon for the prerequisite being shown; agent types use their own. */
icon: React.ReactNode;
onClose: () => void;
+ onInstall: (stepId: string) => void;
+ installingStepId: string | null;
onSkip: (stepId: string) => void;
skippingStepId: string | null;
onAuthenticate: () => void;
@@ -232,6 +254,8 @@ export function SetupDetailSheet({
actions={
<StepActions
step={target.step}
+ onInstall={() => onInstall(target.step.id)}
+ installing={installingStepId === target.step.id}
onSkip={() => onSkip(target.step.id)}
skipping={skippingStepId === target.step.id}
onAuthenticate={onAuthenticate}
@@ -244,6 +268,8 @@ export function SetupDetailSheet({
<AgentTypeDetail
row={target.row}
sshHost={sshHost}
+ onInstall={onInstall}
+ installingStepId={installingStepId}
onSkip={onSkip}
skippingStepId={skippingStepId}
onAuthenticate={onAuthenticate}
@@ -260,12 +286,16 @@ export function SetupDetailSheet({
function AgentTypeDetail({
row,
sshHost,
+ onInstall,
+ installingStepId,
onSkip,
skippingStepId,
onAuthenticate,
}: {
row: AgentTypeRow;
sshHost: string;
+ onInstall: (stepId: string) => void;
+ installingStepId: string | null;
onSkip: (stepId: string) => void;
skippingStepId: string | null;
onAuthenticate: () => void;
@@ -287,6 +317,8 @@ function AgentTypeDetail({
actions={
<StepActions
step={row.cli}
+ onInstall={() => onInstall(row.cli.id)}
+ installing={installingStepId === row.cli.id}
onSkip={() => onSkip(row.cli.id)}
skipping={skippingStepId === row.cli.id}
onAuthenticate={onAuthenticate}
@@ -311,6 +343,8 @@ function AgentTypeDetail({
</div>
<StepActions
step={row.plugin}
+ onInstall={() => onInstall(row.plugin!.id)}
+ installing={installingStepId === row.plugin.id}
onSkip={() => onSkip(row.plugin!.id)}
skipping={skippingStepId === row.plugin.id}
onAuthenticate={onAuthenticate}
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-rows.tsx b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-rows.tsx
index cb9b26579..d9a95fa33 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-rows.tsx
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/setup-rows.tsx
@@ -8,12 +8,20 @@
*/
import { GitBranch, Github, KeyRound, Package, Server, SquareTerminal } from 'lucide-react';
+import { Loader2 } from 'lucide-react';
import { AgentIcon } from '@renderer/lib/components/agent-icon';
+import { Button } from '@renderer/lib/ui/button';
import { Label } from '@renderer/lib/ui/label';
import { StatusBadge } from '@renderer/lib/ui/status-badge';
import { cn } from '@renderer/utils/utils';
import type { HostSetupStep } from '@shared/core/remote-hosts/setup';
-import { agentTypeBadge, stepBadge, type AgentTypeRow, type BadgeSpec } from './step-presentation';
+import {
+ agentTypeBadge,
+ canInstall,
+ stepBadge,
+ type AgentTypeRow,
+ type BadgeSpec,
+} from './step-presentation';
/** Lucide icons for the host tools. Agent types use their own brand icon. */
const PREREQUISITE_ICON: Record<string, React.ComponentType<{ className?: string }>> = {
@@ -49,6 +57,7 @@ function Row({
subtitle,
badge,
highlighted,
+ action,
onClick,
}: {
icon: React.ReactNode;
@@ -56,38 +65,81 @@ function Row({
subtitle?: string | null;
badge: BadgeSpec;
highlighted?: boolean;
+ /** Inline fix-it control, so acting on one item costs no navigation. */
+ action?: React.ReactNode;
onClick: () => void;
}) {
return (
- <button
- type="button"
- onClick={onClick}
+ <div
className={cn(
- 'group flex w-full cursor-pointer items-center gap-3 rounded-lg p-3 text-left hover:bg-background-1',
+ 'group flex w-full items-center gap-3 rounded-lg p-3 hover:bg-background-1',
highlighted && 'bg-background-1 ring-1 ring-amber-500/40'
)}
>
- <div className="flex size-6 shrink-0 items-center justify-center rounded-lg bg-background-1 p-1.5 group-hover:bg-background-2">
- {icon}
- </div>
- <div className="flex w-full min-w-0 items-center justify-between gap-2">
+ <button
+ type="button"
+ onClick={onClick}
+ className="flex min-w-0 flex-1 cursor-pointer items-center gap-3 text-left"
+ >
+ <div className="flex size-6 shrink-0 items-center justify-center rounded-lg bg-background-1 p-1.5 group-hover:bg-background-2">
+ {icon}
+ </div>
<span className="flex min-w-0 flex-col">
<span className="truncate text-sm text-foreground">{name}</span>
{subtitle && <span className="truncate text-xs text-foreground-muted">{subtitle}</span>}
</span>
+ </button>
+ <div className="flex shrink-0 items-center gap-2">
<StatusBadge tone={badge.tone}>{badge.label}</StatusBadge>
+ {action}
</div>
- </button>
+ </div>
+ );
+}
+
+/** The inline Install / Retry control, shown only when there is something to do. */
+function InstallAction({
+ step,
+ installing,
+ onInstall,
+}: {
+ step: HostSetupStep;
+ installing: boolean;
+ onInstall: () => void;
+}) {
+ if (!canInstall(step)) return null;
+ const busy = installing || step.state === 'installing' || step.state === 'checking';
+ return (
+ <Button
+ size="xs"
+ disabled={busy}
+ onClick={(event) => {
+ event.stopPropagation();
+ onInstall();
+ }}
+ >
+ {busy ? (
+ <Loader2 className="size-3.5 animate-spin" />
+ ) : step.state === 'failed' ? (
+ 'Retry'
+ ) : (
+ 'Install'
+ )}
+ </Button>
);
}
export function PrerequisiteRow({
step,
isCurrent,
+ installing,
+ onInstall,
onOpen,
}: {
step: HostSetupStep;
isCurrent: boolean;
+ installing: boolean;
+ onInstall: () => void;
onOpen: () => void;
}) {
return (
@@ -97,6 +149,7 @@ export function PrerequisiteRow({
subtitle={step.state === 'satisfied' ? step.version : null}
badge={stepBadge(step)}
highlighted={isCurrent}
+ action={<InstallAction step={step} installing={installing} onInstall={onInstall} />}
onClick={onOpen}
/>
);
@@ -105,12 +158,23 @@ export function PrerequisiteRow({
export function AgentTypeRowItem({
row,
isCurrent,
+ installingStepId,
+ onInstall,
onOpen,
}: {
row: AgentTypeRow;
isCurrent: boolean;
+ installingStepId: string | null;
+ onInstall: (stepId: string) => void;
onOpen: () => void;
}) {
+ // Fix whichever half is outstanding: the CLI first, then its connector. One
+ // button, because the row states one question — is this usable?
+ const next = canInstall(row.cli)
+ ? row.cli
+ : row.plugin && canInstall(row.plugin)
+ ? row.plugin
+ : null;
return (
<Row
icon={<AgentIcon id={row.agentId} size={16} />}
@@ -118,6 +182,15 @@ export function AgentTypeRowItem({
subtitle={row.cli.state === 'satisfied' ? row.cli.version : null}
badge={agentTypeBadge(row)}
highlighted={isCurrent}
+ action={
+ next ? (
+ <InstallAction
+ step={next}
+ installing={installingStepId === next.id}
+ onInstall={() => onInstall(next.id)}
+ />
+ ) : null
+ }
onClick={onOpen}
/>
);
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.test.ts b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.test.ts
index c62dd743b..342de1dc9 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.test.ts
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.test.ts
@@ -2,6 +2,7 @@ import { describe, expect, it } from 'vitest';
import type { HostSetupPlan, HostSetupStep } from '@shared/core/remote-hosts/setup';
import {
agentTypeBadge,
+ canInstall,
canSkip,
groupPlanSteps,
outcomeLabel,
@@ -179,9 +180,36 @@ describe('outcomeLabel', () => {
});
describe('canSkip', () => {
- it('offers a skip only once a step has actually failed', () => {
+ it('offers a skip on a failure', () => {
expect(canSkip(step({ state: 'failed' }))).toBe(true);
- expect(canSkip(step({ state: 'pending' }))).toBe(false);
- expect(canSkip(step({ state: 'satisfied' }))).toBe(false);
+ });
+
+ it('offers a skip on something observed to be missing', () => {
+ // After a re-check nothing has "failed" yet, but the user still needs a way
+ // past it.
+ expect(canSkip(step({ state: 'pending', outcome: 'missing' }))).toBe(true);
+ });
+
+ it('does not offer a skip for something never looked at, or already there', () => {
+ expect(canSkip(step({ state: 'pending', outcome: null }))).toBe(false);
+ expect(canSkip(step({ state: 'satisfied', outcome: 'satisfied' }))).toBe(false);
+ });
+});
+
+describe('canInstall', () => {
+ it('offers an install for anything outstanding', () => {
+ expect(canInstall(step({ state: 'pending', outcome: 'missing' }))).toBe(true);
+ expect(canInstall(step({ state: 'failed', outcome: 'missing' }))).toBe(true);
+ expect(canInstall(step({ state: 'blocked' }))).toBe(true);
+ });
+
+ it('does not offer an install for something already there or in flight', () => {
+ expect(canInstall(step({ state: 'satisfied' }))).toBe(false);
+ expect(canInstall(step({ state: 'installing' }))).toBe(false);
+ expect(canInstall(step({ state: 'checking' }))).toBe(false);
+ });
+
+ it('never offers an install for the GitHub login — it is a device flow, not a package', () => {
+ expect(canInstall(step({ kind: 'gh-auth', state: 'pending', outcome: 'missing' }))).toBe(false);
});
});
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.ts b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.ts
index 8ec4d0d41..a061b666f 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.ts
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/step-presentation.ts
@@ -36,9 +36,30 @@ export function outcomeLabel(outcome: DependencyCheckOutcome | null): string {
}
}
-/** Steps whose failure the user can act on directly, rather than only retrying. */
+/**
+ * Steps the user can move past. A failure is the obvious case, but a step we
+ * have observed to be missing is equally skippable — after a re-check nothing
+ * has "failed" yet, and offering no way forward would strand the run.
+ */
export function canSkip(step: HostSetupStep): boolean {
- return step.state === 'failed';
+ if (step.state === 'failed') return true;
+ return step.state === 'pending' && step.outcome !== null && step.outcome !== 'satisfied';
+}
+
+/**
+ * Whether switchdash can attempt an install for this step.
+ *
+ * The GitHub login is excluded because it is an interactive device flow, not an
+ * install. Whether an install command actually exists for this host's platform
+ * is known only in the main process — if it does not, the attempt reports that
+ * plainly rather than the button being silently absent.
+ */
+export function canInstall(step: HostSetupStep): boolean {
+ if (step.kind === 'gh-auth') return false;
+ if (step.state === 'satisfied' || step.state === 'checking' || step.state === 'installing') {
+ return false;
+ }
+ return true;
}
export type BadgeSpec = { tone: StatusTone; label: string };
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/use-host-setup.ts b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/use-host-setup.ts
index a5f7e6a78..542636841 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/use-host-setup.ts
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/setup/use-host-setup.ts
@@ -104,6 +104,16 @@ export function useRunSetup(sshHost: string) {
});
}
+/** Install one step on its own — the per-row Install button. */
+export function useInstallSetupStep(sshHost: string) {
+ const queryClient = useQueryClient();
+ return useMutation({
+ mutationFn: (stepId: string) => rpc.remoteHosts.installSetupStep({ sshHost, stepId }),
+ onSuccess: (plan) => queryClient.setQueryData(setupPlanQueryKey(sshHost), plan),
+ onError: (error) => log.error('Could not install a setup step', { sshHost, error }),
+ });
+}
+
export function useSkipSetupStep(sshHost: string) {
const queryClient = useQueryClient();
return useMutation({
diff --git a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
index a7c293fc5..d66ee575d 100644
--- a/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
+++ b/dash/apps/switchdash-desktop/src/renderer/features/remote-hosts/views/remote-host-view.tsx
@@ -43,6 +43,7 @@ import {
import { groupPlanSteps } from '../setup/step-presentation';
import {
useHostSetupPlan,
+ useInstallSetupStep,
usePrepareSetup,
useRecheckSetup,
useRunSetup,
@@ -69,6 +70,7 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
const recheck = useRecheckSetup(sshHost);
const run = useRunSetup(sshHost);
const skip = useSkipSetupStep(sshHost);
+ const installStep = useInstallSetupStep(sshHost);
const [authenticatingGh, setAuthenticatingGh] = useState(false);
const [sheetTarget, setSheetTarget] = useState<SheetTarget | null>(null);
@@ -94,7 +96,8 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
() => groupPlanSteps(plan.data ?? null),
[plan.data]
);
- const busy = run.isPending || prepare.isPending || recheck.isPending;
+ const busy = run.isPending || prepare.isPending || recheck.isPending || installStep.isPending;
+ const installingStepId = installStep.isPending ? (installStep.variables ?? null) : null;
const currentStepId = plan.data?.currentStepId ?? null;
// Keep an open sheet in step with pushed plan updates, so a row's detail
@@ -179,6 +182,11 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
{run.isError && (
<p className="text-destructive text-xs">{(run.error as Error).message}</p>
)}
+ {installStep.isError && (
+ <p className="text-destructive text-xs">
+ Could not install: {(installStep.error as Error).message}
+ </p>
+ )}
{recheck.isError && (
<p className="text-destructive text-xs">
Could not check this host: {(recheck.error as Error).message}
@@ -208,6 +216,8 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
<PrerequisiteRow
step={step}
isCurrent={step.id === currentStepId}
+ installing={installingStepId === step.id}
+ onInstall={() => installStep.mutate(step.id)}
onOpen={() => setSheetTarget({ kind: 'prerequisite', step })}
/>
</div>
@@ -223,6 +233,8 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
<AgentTypeRowItem
row={row}
isCurrent={row.cli.id === currentStepId || row.plugin?.id === currentStepId}
+ installingStepId={installingStepId}
+ onInstall={(stepId) => installStep.mutate(stepId)}
onOpen={() => setSheetTarget({ kind: 'agent-type', row })}
/>
</div>
@@ -257,6 +269,8 @@ export const RemoteHostMainPanel = observer(function RemoteHostMainPanel() {
) : null
}
onClose={() => setSheetTarget(null)}
+ onInstall={(stepId) => installStep.mutate(stepId)}
+ installingStepId={installingStepId}
onSkip={(stepId) => skip.mutate(stepId)}
skippingStepId={skip.isPending ? (skip.variables ?? null) : null}
onAuthenticate={() => {