(&self)
| 79 | |
| 80 | impl Command for Sandbox { |
| 81 | fn run(&self) -> CliResult<()> { |
| 82 | // Route every form through the service layer: the handler runs the |
| 83 | // same domain calls (view creation, copy-on-write provisioning, |
| 84 | // OCI stage/seal) and the CLI renders the local reports. |
| 85 | if let Some((root, _)) = crate::remote_sandbox::current() { |
| 86 | return match &self.command { |
| 87 | SandboxCommands::Materialize(cmd) => cmd.run(), |
| 88 | _ => Err(crate::remote_sandbox::refusal( |
| 89 | &root, |
| 90 | "only `atomic sandbox materialize` runs inside a remote sandbox", |
| 91 | )), |
| 92 | }; |
| 93 | } |
| 94 | let routed = match &self.command { |
| 95 | SandboxCommands::Open(cmd) => return cmd.run(), |
| 96 | SandboxCommands::Renew(cmd) => return cmd.run(), |
| 97 | SandboxCommands::Close(cmd) => return cmd.run(), |
| 98 | SandboxCommands::Materialize(cmd) => return cmd.run(), |
| 99 | SandboxCommands::Create(cmd) => crate::commands::rpc::sandbox_create(cmd)?, |
| 100 | SandboxCommands::Stage(cmd) => crate::commands::rpc::sandbox_stage(cmd)?, |
| 101 | SandboxCommands::Seal(cmd) => crate::commands::rpc::sandbox_seal(cmd)?, |
| 102 | }; |
| 103 | if routed { |
| 104 | return Ok(()); |
| 105 | } |
| 106 | match &self.command { |
| 107 | SandboxCommands::Create(cmd) => cmd.run(), |
| 108 | SandboxCommands::Stage(cmd) => cmd.run(), |
| 109 | SandboxCommands::Seal(cmd) => cmd.run(), |
| 110 | SandboxCommands::Open(_) |
| 111 | | SandboxCommands::Renew(_) |
| 112 | | SandboxCommands::Close(_) |
| 113 | | SandboxCommands::Materialize(_) => unreachable!("handled above"), |
| 114 | } |
| 115 | } |
| 116 | } |
| 117 | |
| 118 | /// Create a sandbox working tree for an agent. |
nothing calls this directly
no test coverage detected