MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/sandbox.rs:81–115  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

79
80impl 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.

Callers

nothing calls this directly

Calls 15

sandbox_createFunction · 0.85
sandbox_stageFunction · 0.85
sandbox_sealFunction · 0.85
find_repository_rootFunction · 0.85
openFunction · 0.85
pointer_fromFunction · 0.85
create_view_fromMethod · 0.80
desired_view_nameMethod · 0.80
stageMethod · 0.80
sealMethod · 0.80

Tested by

no test coverage detected