workyard_application/actions/remove/
mod.rs1mod action;
3mod cli;
4mod contract;
5mod input;
6
7use crate::{
8 contracts::Progress, execution::removal::RemovalRequest, presentation::cli::exit_status,
9};
10use trine::{
11 Action, RegistrationError,
12 application::{CliBinding, Entry},
13};
14
15pub use action::remove;
16pub use contract::RemoveOutcome;
17pub use input::RemoveInput;
18
19type RemoveEntry = Entry<RemovalRequest<RemoveInput>, RemoveOutcome, RemoveOutcome, Progress>;
20
21pub(crate) fn build_entry() -> Result<RemoveEntry, RegistrationError> {
22 let handler = Action::new(
23 "remove",
24 "Remove task worktrees and retire membership",
25 action::execute,
26 )?;
27 let cli = CliBinding::new(cli::bindings());
28 let rpc = crate::presentation::structured::progress_binding();
29 let mcp = crate::presentation::mcp::progress_binding();
30
31 Entry::new(handler)
32 .cli(
33 cli,
34 |output| {
35 Ok(cli::RemoveView {
36 output,
37 started: false,
38 progress_open: false,
39 })
40 },
41 |result| exit_status::operation(result, |outcome| &outcome.operation),
42 )
43 .rpc(rpc)
44 .mcp_with_input(
45 mcp,
46 "Retire a task and remove its worktrees. Review any disclosed files before approving discard.",
47 input::McpRemoveInput::into,
48 )
49}