1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! dvm.run's Rust SDK: sandboxes whose every run replays.
//!
//! A sandbox is a VM made from an image: your agent sends it commands and
//! files until it stops it. Everything it ran is its execution, which
//! replays, the same, once it ends.
//!
//! ```no_run
//! # async fn example() -> dvm_run::Result<()> {
//! use std::time::Duration;
//!
//! let client = dvm_run::Client::from_env()?;
//! let sbx = client.create_sandbox("python:3.12").seed(7).await?;
//! sbx.files().write("/app/main.py", "print(1 + 1)\n").await?;
//! let r = sbx
//! .commands()
//! .run("python main.py")
//! .cwd("/app")
//! .timeout(Duration::from_secs(60))
//! .await?;
//! println!("{} {}", r.stdout, r.exit_code);
//!
//! let server = sbx.commands().spawn(["python", "-m", "http.server"]).await?;
//! server.kill().await?;
//! server.wait().await?;
//! sbx.stop().await?;
//!
//! let verdict = client.execution(sbx.id()).await?.replay().await?.wait().await?;
//! assert!(verdict.is_same());
//! # Ok(())
//! # }
//! ```
//!
//! [`Client::from_env`] takes dvm.run's address from `DVM_API_URL`, else
//! `https://sandbox.dvm.run`, and its key from `DVM_API_KEY`, else the one
//! `dvm-run login` saved for that address. The API's types are
//! [`dvm_api`]'s, here as [`api`].
pub use ;
pub use ;
pub use ;
pub use dvm_api as api;
pub use ;
pub use ;
pub use Files;
pub use ;
pub use ;