Skip to main content

thndrs_lib/cli/commands/
acp.rs

1//! ACP server, inspection, and smoke-test command definitions.
2
3use std::path::PathBuf;
4
5use clap::Subcommand;
6
7/// ACP inspection and smoke-test commands.
8#[derive(Clone, Debug, Eq, PartialEq, Subcommand)]
9pub enum AcpCommand {
10    /// Run `thndrs` as an ACP agent server over stdio.
11    Serve,
12    /// List configured ACP agents.
13    List,
14    /// Show one configured ACP agent with redacted values.
15    Inspect {
16        /// Configured ACP agent name.
17        name: String,
18    },
19    /// Initialize an ACP agent, create a temporary session, send one prompt, and print events.
20    Smoke {
21        /// Configured ACP agent name.
22        name: String,
23        /// Prompt text to send.
24        #[arg(long)]
25        prompt: String,
26    },
27    /// Log out through the ACP agent when it advertises logout support.
28    Logout {
29        /// Configured ACP agent name.
30        name: String,
31    },
32    /// List sessions owned by an ACP agent.
33    ListSessions {
34        /// Configured ACP agent name.
35        name: String,
36    },
37    /// Load an ACP agent-owned session and print replayed updates.
38    LoadSession {
39        /// Configured ACP agent name.
40        name: String,
41        /// Opaque external ACP session id.
42        session_id: String,
43    },
44    /// Resume an ACP agent-owned session without replaying history.
45    ResumeSession {
46        /// Configured ACP agent name.
47        name: String,
48        /// Opaque external ACP session id.
49        session_id: String,
50    },
51    /// Close an ACP agent-owned session.
52    CloseSession {
53        /// Configured ACP agent name.
54        name: String,
55        /// Opaque external ACP session id.
56        session_id: String,
57    },
58    /// List available agents from the read-only ACP Registry.
59    Registry {
60        /// Read registry JSON from a local file instead of the official CDN.
61        #[arg(long)]
62        file: Option<PathBuf>,
63    },
64    /// Install one registry agent into workspace ACP config metadata.
65    Install {
66        /// Registry agent id.
67        agent_id: String,
68        /// Local ACP agent name. Defaults to the registry id without a trailing `-acp`.
69        #[arg(long)]
70        name: Option<String>,
71        /// Read registry JSON from a local file instead of the official CDN.
72        #[arg(long)]
73        file: Option<PathBuf>,
74        /// Confirm writing workspace config and install metadata.
75        #[arg(long)]
76        yes: bool,
77    },
78    /// Update one registry-managed ACP agent in workspace config metadata.
79    Update {
80        /// Local ACP agent name.
81        name: String,
82        /// Read registry JSON from a local file instead of the official CDN.
83        #[arg(long)]
84        file: Option<PathBuf>,
85        /// Confirm writing workspace config and install metadata.
86        #[arg(long)]
87        yes: bool,
88    },
89}