Skip to content

Commit 42aeb15

Browse files
authored
feat(desktop): add Pi agent preset (#7208)
## Summary Add Pi as a selectable desktop ACP runtime via `pi-acp`, including discovery guidance and its official logo. ### Related issue Follow-up to closed #6546. ### Testing - Focused Tauri preset and desktop logo tests - TypeScript typecheck Generated with Codex --------- Signed-off-by: Salman Mohammed <[email protected]>
1 parent 5aed49b commit 42aeb15

7 files changed

Lines changed: 91 additions & 5 deletions

File tree

‎crates/buzz-acp/README.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ Buzz Desktop supports registering any ACP-speaking agent tool as a selectable ru
283283

284284
**Tier-1 — compiled-in runtimes** (Goose, Claude Code, Codex, Buzz Agent): have auto-installers, auth probes, and first-class onboarding. Their IDs (`goose`, `claude`, `codex`, `buzz-agent`) are reserved and cannot be overridden.
285285

286-
**Tier-2 — preset catalog** (Cursor, Oh My Pi, Grok Build, OpenCode, Kimi Code, Amp, Hermes Agent, OpenClaw): static `HarnessDefinition` entries in `desktop/src-tauri/src/managed_agents/discovery.rs` (`PRESET_HARNESSES`). They are always present in the runtime catalog, PATH-probed for availability, not editable or deletable by the user. Displayed with bundled logos; if not installed, a docs link appears instead.
286+
**Tier-2 — preset catalog** (Cursor, Oh My Pi, Pi, Grok Build, OpenCode, Kimi Code, Amp, Hermes Agent, OpenClaw): static `HarnessDefinition` entries in `desktop/src-tauri/src/managed_agents/discovery/presets.rs` (`PRESET_HARNESSES`). They are always present in the runtime catalog, PATH-probed for availability, not editable or deletable by the user. Displayed with bundled logos; if not installed, a docs link appears instead.
287287

288288
> **Note — OpenClaw:** `openclaw acp` is a Gateway-backed bridge; PATH availability shows "Available" even when the OpenClaw Gateway daemon is not running. This is expected tier-2 semantics (same class as a preset with unconfigured auth). The Gateway URL is configured via `OPENCLAW_GATEWAY_URL` (or the equivalent env var from OpenClaw's docs) — set it in the agent's **env vars** in Edit Agent, not in the definition env (the preset definition carries no env entries). Note that `openclaw acp` executes tools inside the Gateway daemon, not the Desktop process, so Desktop-injected `BUZZ_*` env vars do NOT reach the execution locus unless you also set them on the Gateway's own environment.
289289
@@ -327,10 +327,9 @@ Invalid files (bad JSON, unknown id, empty command) are skipped with a warning a
327327
To add a new runtime to the tier-2 gallery:
328328

329329
1. **Verify the ACP entrypoint** from the vendor's own documentation — do not rely on a PR description alone. Test with the actual binary.
330-
2. **Add a `HarnessDefinition` entry** to the `PRESET_HARNESSES` slice in `desktop/src-tauri/src/managed_agents/discovery.rs`. Fill `id`, `label`, `command`, `args`, `install_instructions_url`, `install_hint`. Leave `env` empty unless the harness requires a specific env var to enable ACP mode.
331-
3. **Add the preset id to `BUILTIN_IDS`** in `desktop/src-tauri/src/managed_agents/custom_harnesses.rs` so custom JSON files cannot shadow it.
332-
4. **Add a bundled logo** (64×64 PNG or optimised SVG) to `desktop/public/harness-logos/<id>.png` and add a corresponding entry to `PRESET_LOGOS` in `desktop/src/features/onboarding/ui/RuntimeIcon.tsx`. Record the source and license in `desktop/public/harness-logos/CREDITS.md`. Only bundle a mark whose upstream license permits redistribution; skipping this step is caught by `presetLogos.test.mjs`, which asserts every `PRESET_HARNESSES` id has a mapped logo that exists on disk.
333-
5. Run `cargo test --lib` and `just desktop-typecheck` to verify everything compiles.
330+
2. **Add a `PresetHarness` entry** to the `PRESET_HARNESSES` slice in `desktop/src-tauri/src/managed_agents/discovery/presets.rs`. Fill `id`, `label`, `command`, `args`, `install_instructions_url`, `install_hint`, and `underlying_cli` when the command wraps a separately installed CLI. Preset ids are automatically reserved so custom JSON files cannot shadow them.
331+
3. **Add a bundled logo** (64×64 PNG or optimised SVG) to `desktop/public/harness-logos/<id>.png` and add a corresponding entry to `PRESET_LOGOS` in `desktop/src/features/onboarding/ui/RuntimeIcon.tsx`. Record the source and license in `desktop/public/harness-logos/CREDITS.md`. Only bundle a mark whose upstream license permits redistribution; skipping this step is caught by `presetLogos.test.mjs`, which asserts every `PRESET_HARNESSES` id has a mapped logo that exists on disk.
332+
4. Run `cargo test --lib` and `just desktop-typecheck` to verify everything compiles.
334333

335334
The built-in `BUILTIN_IDS` set (`goose`, `claude`, `codex`, `buzz-agent`, and all current preset ids) is the reserved namespace; every other id is available for custom harnesses.
336335

‎desktop/public/harness-logos/CREDITS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ license permits redistribution.
1313
| `hermes.png` | [NousResearch/hermes-agent](https://github.com/NousResearch/hermes-agent) | `6ad632b` | MIT © 2025 Nous Research | `website/static/img/logo.png` | Cropped the baked-in border frame, padded to square, resized to 64×64, quantised to a 16-colour palette |
1414
| `openclaw.svg` | [openclaw/openclaw](https://github.com/openclaw/openclaw) | `b06f40a` | MIT © 2026 OpenClaw Foundation | `ui/public/favicon.svg` | Removed the SMIL animation elements (renders the upstream rest pose statically — verified pixel-identical to the upstream frame at t=0); minified paths |
1515
| `omp.svg` | [can1357/oh-my-pi](https://github.com/can1357/oh-my-pi) | `667111575ebba136dadfd6989379e7f67e0d40d9` | MIT © 2025 Mario Zechner; © 2025–2026 Can Bölük | `assets/icon.svg` | None |
16+
| `pi.svg` | [earendil-works/pi-website](https://github.com/earendil-works/pi-website) | `2f5e410b97474d0a34ec2500aa1aa58d6c3f992c` | MIT © 2026 Earendil Inc. and contributors | `src/favicon.svg` | None |
1617
| `kimi.png` | [MoonshotAI/kimi-cli](https://github.com/MoonshotAI/kimi-cli) | `4a550effdfcb29a25a5d325bf935296cc50cd417` | Apache-2.0; NOTICE: Kimi Code CLI © 2025 Moonshot AI | `web/public/logo.png` | None |
1718
| `grok.svg` | [SpaceXAI brand guidelines](https://x.ai/legal/brand-guidelines) | Retrieved 2026-07-25 | xAI Brand Guidelines: marks may be used to accurately refer to xAI or its services; logos must be used exactly as provided | `SpaceXAI_Grok_Assets.zip` → `Grok_Logomark_Dark.svg` | None |
1819

Lines changed: 21 additions & 0 deletions
Loading

‎desktop/src-tauri/src/managed_agents/discovery/presets.rs‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,15 @@ pub(super) fn preset_catalog_entry(
9090
}
9191

9292
pub(super) const PRESET_HARNESSES: &[PresetHarness] = &[
93+
PresetHarness {
94+
id: "pi",
95+
label: "Pi",
96+
command: "pi-acp",
97+
args: &[],
98+
install_instructions_url: "https://github.com/svkozak/pi-acp",
99+
install_hint: "Buzz talks to Pi through the pi-acp adapter. Install Pi with `npm install -g --ignore-scripts @earendil-works/pi-coding-agent`, then install the adapter with `npm install -g pi-acp`.",
100+
underlying_cli: Some("pi"),
101+
},
93102
PresetHarness {
94103
id: "devin",
95104
label: "Devin",
@@ -347,6 +356,48 @@ mod tests {
347356
assert_eq!(entry.source, HarnessSource::Preset);
348357
}
349358

359+
#[test]
360+
fn pi_preset_uses_zero_arg_adapter_and_reports_missing_component() {
361+
let preset = PRESET_HARNESSES
362+
.iter()
363+
.find(|preset| preset.id == "pi")
364+
.expect("Pi preset should be present");
365+
366+
assert_eq!(preset.label, "Pi");
367+
assert_eq!(preset.command, "pi-acp");
368+
assert!(preset.args.is_empty());
369+
assert_eq!(preset.underlying_cli, Some("pi"));
370+
371+
let available = preset_catalog_entry(preset, |command| match command {
372+
"pi-acp" => Some(PathBuf::from("/usr/local/bin/pi-acp")),
373+
"pi" => Some(PathBuf::from("/usr/local/bin/pi")),
374+
_ => None,
375+
});
376+
assert_eq!(available.availability, AcpAvailabilityStatus::Available);
377+
assert_eq!(available.command.as_deref(), Some("pi-acp"));
378+
assert!(available.default_args.is_empty());
379+
assert_eq!(
380+
available.underlying_cli_path.as_deref(),
381+
Some("/usr/local/bin/pi")
382+
);
383+
384+
let adapter_missing = preset_catalog_entry(preset, |command| {
385+
(command == "pi").then(|| PathBuf::from("/usr/local/bin/pi"))
386+
});
387+
assert_eq!(
388+
adapter_missing.availability,
389+
AcpAvailabilityStatus::AdapterMissing
390+
);
391+
assert!(adapter_missing.command.is_none());
392+
assert!(adapter_missing.default_args.is_empty());
393+
394+
let not_installed = preset_catalog_entry(preset, |_| None);
395+
assert_eq!(
396+
not_installed.availability,
397+
AcpAvailabilityStatus::NotInstalled
398+
);
399+
}
400+
350401
#[test]
351402
fn adapter_missing_when_underlying_cli_present() {
352403
let entry = preset_catalog_entry(&ADAPTER_PRESET, |command| {

‎desktop/src/features/onboarding/ui/RuntimeIcon.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const RUNTIME_LOGOS: Record<string, string> = {
1919
export const PRESET_LOGOS: Record<string, string> = {
2020
devin: "/harness-logos/devin.svg",
2121
omp: "/harness-logos/omp.svg",
22+
pi: "/harness-logos/pi.svg",
2223
grok: "/harness-logos/grok.svg",
2324
opencode: "/harness-logos/opencode.svg",
2425
kimi: "/harness-logos/kimi.png",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import assert from "node:assert/strict";
2+
import test from "node:test";
3+
4+
import { harnessDescription } from "./harnessCatalogCopy.ts";
5+
6+
test("Pi catalog entry has its curated product description", () => {
7+
assert.equal(
8+
harnessDescription("pi"),
9+
"A minimal terminal coding harness, connected through the pi-acp adapter.",
10+
);
11+
});

‎desktop/src/features/settings/ui/harnessCatalogCopy.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ const HARNESS_DESCRIPTIONS: Record<string, string> = {
2727
cursor: "Cursor's coding agent, connected to Buzz through its ACP server.",
2828
// Source: https://github.com/can1357/oh-my-pi
2929
omp: "A terminal coding agent with integrated development tools.",
30+
// Sources: https://pi.dev/docs/latest, https://github.com/svkozak/pi-acp
31+
pi: "A minimal terminal coding harness, connected through the pi-acp adapter.",
3032
// Source: https://build.x.ai (docs unavailable during research; kept
3133
// deliberately conservative).
3234
grok: "xAI's coding agent, connected to Buzz through its ACP entrypoint.",

0 commit comments

Comments
 (0)