Compare commits
2 Commits
52356ead6c
...
3df590f276
| Author | SHA1 | Date | |
|---|---|---|---|
|
3df590f276
|
|||
|
91300c16fe
|
@@ -6,14 +6,14 @@
|
|||||||
# sbx cp $HOME/.coyote_password testing:/home/agent/
|
# sbx cp $HOME/.coyote_password testing:/home/agent/
|
||||||
# sbx run testing --kit ./sbx-kit/
|
# sbx run testing --kit ./sbx-kit/
|
||||||
schemaVersion: '1'
|
schemaVersion: '1'
|
||||||
kind: agent
|
kind: sandbox
|
||||||
name: coyote
|
name: coyote
|
||||||
displayName: Coyote
|
displayName: Coyote
|
||||||
description: >
|
description: >
|
||||||
An all-in-one, batteries-included LLM CLI tool featuring Shell Assistant,
|
An all-in-one, batteries-included LLM CLI tool featuring Shell Assistant,
|
||||||
CLI & REPL mode, RAG, AI tools & agents, MCP servers, skills, and macros.
|
CLI & REPL mode, RAG, AI tools & agents, MCP servers, skills, and macros.
|
||||||
|
|
||||||
agent:
|
sandbox:
|
||||||
image: 'docker/sandbox-templates:shell-docker'
|
image: 'docker/sandbox-templates:shell-docker'
|
||||||
aiFilename: COYOTE.md
|
aiFilename: COYOTE.md
|
||||||
entrypoint:
|
entrypoint:
|
||||||
@@ -293,7 +293,7 @@ commands:
|
|||||||
background: false
|
background: false
|
||||||
description: Bootstrap Coyote config directory on first sandbox start
|
description: Bootstrap Coyote config directory on first sandbox start
|
||||||
|
|
||||||
memory: |
|
agentContext: |
|
||||||
## Sandbox environment
|
## Sandbox environment
|
||||||
|
|
||||||
You are running inside a Docker sandbox launched via `sbx run coyote`. The
|
You are running inside a Docker sandbox launched via `sbx run coyote`. The
|
||||||
|
|||||||
+22
-17
@@ -69,7 +69,7 @@ pub fn launch(name: Option<String>, fresh: bool, no_mixins: bool) -> Result<()>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exec_run(&name, &kit_path)
|
exec_run(&name)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ensure_sbx_installed() -> Result<()> {
|
fn ensure_sbx_installed() -> Result<()> {
|
||||||
@@ -316,6 +316,7 @@ fn sandbox_exists(name: &str) -> Result<bool> {
|
|||||||
fn create_sandbox(name: &str, kit_path: &Path, mixins: &[DiscoveredMixin]) -> Result<()> {
|
fn create_sandbox(name: &str, kit_path: &Path, mixins: &[DiscoveredMixin]) -> Result<()> {
|
||||||
info!("Creating sandbox '{name}'");
|
info!("Creating sandbox '{name}'");
|
||||||
let args = build_create_args(name, kit_path, mixins)?;
|
let args = build_create_args(name, kit_path, mixins)?;
|
||||||
|
debug!("sbx {}", args.join(" "));
|
||||||
let status = Command::new(SBX_BINARY)
|
let status = Command::new(SBX_BINARY)
|
||||||
.args(&args)
|
.args(&args)
|
||||||
.stdin(Stdio::inherit())
|
.stdin(Stdio::inherit())
|
||||||
@@ -342,6 +343,8 @@ fn build_create_args(
|
|||||||
|
|
||||||
let mut args = vec![
|
let mut args = vec![
|
||||||
"create".to_string(),
|
"create".to_string(),
|
||||||
|
"--name".to_string(),
|
||||||
|
name.to_string(),
|
||||||
"--kit".to_string(),
|
"--kit".to_string(),
|
||||||
kit_str.to_string(),
|
kit_str.to_string(),
|
||||||
];
|
];
|
||||||
@@ -356,8 +359,6 @@ fn build_create_args(
|
|||||||
args.push(mixin_str);
|
args.push(mixin_str);
|
||||||
}
|
}
|
||||||
|
|
||||||
args.push("--name".to_string());
|
|
||||||
args.push(name.to_string());
|
|
||||||
args.push(SANDBOX_AGENT.to_string());
|
args.push(SANDBOX_AGENT.to_string());
|
||||||
args.push(".".to_string());
|
args.push(".".to_string());
|
||||||
|
|
||||||
@@ -369,11 +370,17 @@ fn copy_host_files(name: &str) -> Result<()> {
|
|||||||
let home_dir = dirs::home_dir().context("Could not determine home directory")?;
|
let home_dir = dirs::home_dir().context("Could not determine home directory")?;
|
||||||
|
|
||||||
if config_dir.exists() {
|
if config_dir.exists() {
|
||||||
ensure_sandbox_dir(name, "/home/agent/.config")?;
|
let sandbox_config_dir = "/home/agent/.config/coyote";
|
||||||
let src = format!("{}/", config_dir.display());
|
ensure_sandbox_dir(name, sandbox_config_dir)?;
|
||||||
let dest = format!("{name}:/home/agent/.config/");
|
let dest = format!("{name}:{sandbox_config_dir}/");
|
||||||
sbx_cp(&src, &dest)?;
|
for entry in fs::read_dir(&config_dir)
|
||||||
chown_agent_recursive(name, "/home/agent/.config")?;
|
.with_context(|| format!("Failed to read {}", config_dir.display()))?
|
||||||
|
{
|
||||||
|
let entry = entry?;
|
||||||
|
let path = entry.path();
|
||||||
|
sbx_cp(&path.display().to_string(), &dest)?;
|
||||||
|
}
|
||||||
|
chown_agent_recursive(name, sandbox_config_dir)?;
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
"Skipping config copy: {} does not exist",
|
"Skipping config copy: {} does not exist",
|
||||||
@@ -503,12 +510,10 @@ fn sbx_cp(src: &str, dest: &str) -> Result<()> {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn exec_run(name: &str, kit_path: &Path) -> Result<()> {
|
fn exec_run(name: &str) -> Result<()> {
|
||||||
let kit_str = kit_path
|
debug!("sbx run --name {name}");
|
||||||
.to_str()
|
|
||||||
.ok_or_else(|| anyhow!("Kit path is not valid UTF-8: {}", kit_path.display()))?;
|
|
||||||
let status = Command::new(SBX_BINARY)
|
let status = Command::new(SBX_BINARY)
|
||||||
.args(["run", name, "--kit", kit_str])
|
.args(["run", "--name", name])
|
||||||
.stdin(Stdio::inherit())
|
.stdin(Stdio::inherit())
|
||||||
.stdout(Stdio::inherit())
|
.stdout(Stdio::inherit())
|
||||||
.stderr(Stdio::inherit())
|
.stderr(Stdio::inherit())
|
||||||
@@ -644,14 +649,14 @@ mod tests {
|
|||||||
args,
|
args,
|
||||||
vec![
|
vec![
|
||||||
"create".to_string(),
|
"create".to_string(),
|
||||||
|
"--name".to_string(),
|
||||||
|
"my-box".to_string(),
|
||||||
"--kit".to_string(),
|
"--kit".to_string(),
|
||||||
"/cache/sbx-kit".to_string(),
|
"/cache/sbx-kit".to_string(),
|
||||||
"--kit".to_string(),
|
"--kit".to_string(),
|
||||||
dir_a.display().to_string(),
|
dir_a.display().to_string(),
|
||||||
"--kit".to_string(),
|
"--kit".to_string(),
|
||||||
dir_b.display().to_string(),
|
dir_b.display().to_string(),
|
||||||
"--name".to_string(),
|
|
||||||
"my-box".to_string(),
|
|
||||||
"coyote".to_string(),
|
"coyote".to_string(),
|
||||||
".".to_string(),
|
".".to_string(),
|
||||||
]
|
]
|
||||||
@@ -669,10 +674,10 @@ mod tests {
|
|||||||
args,
|
args,
|
||||||
vec![
|
vec![
|
||||||
"create".to_string(),
|
"create".to_string(),
|
||||||
"--kit".to_string(),
|
|
||||||
"/cache/sbx-kit".to_string(),
|
|
||||||
"--name".to_string(),
|
"--name".to_string(),
|
||||||
"box".to_string(),
|
"box".to_string(),
|
||||||
|
"--kit".to_string(),
|
||||||
|
"/cache/sbx-kit".to_string(),
|
||||||
"coyote".to_string(),
|
"coyote".to_string(),
|
||||||
".".to_string(),
|
".".to_string(),
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user