Skip to main content

agentmux_srv_core/backend/providers/
pi.rs

1// Copyright 2025-2026, AgentMux Corp.
2// SPDX-License-Identifier: Apache-2.0
3
4use super::{Tier, ProviderConfig, ControllerType};
5
6// Pi runs through `pi-acp`, an ACP adapter that drives `pi --mode rpc`: pi
7// itself speaks no ACP (`pi --json` was never an option, so no Pi launch ever
8// started). Both packages install together (`companion_npm_packages`), and
9// `pi-acp` is told which `pi` to run (`PI_ACP_PI_COMMAND`, acp.rs).
10// SPEC_PI_HARNESS_VIA_PI_ACP_2026_10_06.md.
11pub(super) static PI: ProviderConfig = ProviderConfig {
12    id: "pi",
13    tier: Tier::Preview,
14    cli_command: "pi-acp",
15    controller_type: ControllerType::Acp,
16    app_server: None,
17    launch_args: &[],
18    persistent_launch_args: None,
19    resume_flag: None,
20    session_id_field: "sessionId",
21    styled_output_format: "acp",
22    // pi's own config/auth dir variable; `PI_HOME` was never read.
23    auth_config_dir_env_var: "PI_CODING_AGENT_DIR",
24    auth_dir_name: "pi",
25    // Not OAuth-class -- never reaches ensure_history_link. Also
26    // ACP-native if that changes.
27    history_native_subdir: None,
28    auth_extra_env: &[],
29    unset_env: &[],
30    npm_package: "pi-acp",
31    pinned_version: "0.0.35",
32    base_url_env_var: None,
33    supported_vendors: &["pi"],
34    // AGENTS.md, a context file pi always loads. pi 1.0.4 treats
35    // .pi/APPEND_SYSTEM.md (the earlier target) and .pi/SYSTEM.md as
36    // trust-protected, and RPC mode (pi-acp) skips them for a project with no
37    // saved trust decision, so the instructions written there were never read.
38    // SPEC_PI_HARNESS_VIA_PI_ACP_2026_10_06.md.
39    startup_instructions_filename: Some("AGENTS.md"),
40    // pi reads AGENTS.md or CLAUDE.md as context, and .pi/SYSTEM.md (which
41    // replaces its default prompt) and .pi/APPEND_SYSTEM.md in a trusted
42    // project. A repo-provided SYSTEM.md is exactly the kind of instruction
43    // file Phase 3 exists to surface.
44    native_instruction_sources: &["AGENTS.md", "CLAUDE.md", ".pi/APPEND_SYSTEM.md", ".pi/SYSTEM.md"],
45    native_instruction_dirs: &[],
46};