Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/acp-client/src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl AcpDriver {
is_remote: false,
})
.ok_or_else(|| {
"No ACP agent found. Install Goose, Claude Code, Codex, or Pi and ensure it's on your PATH."
"No ACP agent found. Install Goose, Claude Code, Codex, Pi, or Amp and ensure it's on your PATH."
.to_string()
})
}
Expand Down
6 changes: 6 additions & 0 deletions crates/acp-client/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ pub(crate) const KNOWN_AGENTS: &[KnownAgent] = &[
command: "pi-acp",
acp_args: &[],
},
KnownAgent {
id: "amp",
label: "Amp",
command: "amp-acp",
acp_args: &[],
},
];

// =============================================================================
Expand Down
5 changes: 3 additions & 2 deletions staged/src-tauri/src/session_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,10 @@ pub fn start_branch_session(
}
};

// For remote branches, pass the workspace name and agent ID as the provider
// For remote branches, prefer the user's UI selection, fall back to the
// agent stored on the branch.
let effective_provider = if is_remote {
branch.agent.clone()
provider.or_else(|| branch.agent.clone())
} else {
provider
};
Expand Down
21 changes: 11 additions & 10 deletions staged/src/lib/AgentSelector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,22 @@
<script lang="ts">
import { onMount, onDestroy } from 'svelte';
import { ChevronDown, Check, Bot } from 'lucide-svelte';
import { agentState } from './stores/agent.svelte';
import { agentState, REMOTE_AGENTS } from './stores/agent.svelte';
import { preferences, setAiAgent } from './stores/preferences.svelte';

interface Props {
disabled?: boolean;
remote?: boolean;
}

let { disabled = false }: Props = $props();
let { disabled = false, remote = false }: Props = $props();

let showDropdown = $state(false);

let agents = $derived(remote ? REMOTE_AGENTS : agentState.providers);

let currentLabel = $derived(
agentState.providers.find((p) => p.id === preferences.aiAgent)?.label ??
preferences.aiAgent ??
'Agent'
agents.find((p) => p.id === preferences.aiAgent)?.label ?? preferences.aiAgent ?? 'Agent'
);

onMount(() => {
Expand All @@ -51,30 +52,30 @@
}

function toggle() {
if (!disabled && agentState.providers.length > 1) {
if (!disabled && agents.length > 1) {
showDropdown = !showDropdown;
}
}
</script>

{#if agentState.loaded && agentState.providers.length > 0}
{#if (remote || agentState.loaded) && agents.length > 0}
<div class="agent-selector">
<button
type="button"
class="selector-btn"
onclick={toggle}
{disabled}
title={agentState.providers.length > 1 ? 'Select AI agent' : currentLabel}
title={agents.length > 1 ? 'Select AI agent' : currentLabel}
>
<Bot size={12} />
<span class="selector-label">{currentLabel}</span>
{#if agentState.providers.length > 1}
{#if agents.length > 1}
<ChevronDown size={12} />
{/if}
</button>
{#if showDropdown}
<div class="selector-dropdown">
{#each agentState.providers as provider (provider.id)}
{#each agents as provider (provider.id)}
<button
type="button"
class="selector-option"
Expand Down
5 changes: 3 additions & 2 deletions staged/src/lib/NewSessionModal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,12 @@
branch: Branch;
mode: BranchSessionType;
initialPrompt?: string;
remote?: boolean;
onClose: (draft: { prompt: string; mode: BranchSessionType }) => void;
onStarted: (result: { sessionId: string; artifactId: string }) => void;
}

let { branch, mode, initialPrompt = '', onClose, onStarted }: Props = $props();
let { branch, mode, initialPrompt = '', remote = false, onClose, onStarted }: Props = $props();

let prompt = $state('');
let currentMode = $state<BranchSessionType>('commit');
Expand Down Expand Up @@ -177,7 +178,7 @@
{/if}

<div class="form-actions">
<AgentSelector disabled={starting} />
<AgentSelector disabled={starting} {remote} />
<div class="form-actions-right">
<button type="button" class="cancel-btn" onclick={handleClose} disabled={starting}>
Cancel
Expand Down
1 change: 1 addition & 0 deletions staged/src/lib/RemoteBranchCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@
{branch}
mode={newSessionMode}
initialPrompt={draftPrompt}
remote
onClose={handleNewSessionClose}
onStarted={handleNewSessionStarted}
/>
Expand Down
11 changes: 11 additions & 0 deletions staged/src/lib/stores/agent.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,19 @@ export const KNOWN_AGENTS: KnownAgent[] = [
description: 'AI coding agent by Mario Zechner',
installUrl: null,
},
{
id: 'amp',
label: 'Amp',
description: 'AI coding agent by Sourcegraph',
installUrl: 'https://www.npmjs.com/package/amp-acp',
},
];

/** Agents always available on remote Blox workstations, regardless of local installs. */
export const REMOTE_AGENTS: KnownAgent[] = KNOWN_AGENTS.filter((a) =>
['goose', 'claude', 'amp'].includes(a.id)
);

// =============================================================================
// Reactive discovery cache
// =============================================================================
Expand Down