Skip to content

Commit

Permalink
- feature: added no color to deno env (#75)
Browse files Browse the repository at this point in the history
  • Loading branch information
agallardol authored Dec 2, 2024
1 parent d46a7ae commit 6ce1593
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
20 changes: 8 additions & 12 deletions libs/shinkai-tools-runner/src/tools/deno_runner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,6 @@ impl DenoRunner {
/// Returns a Result containing:
/// - Ok(String): The combined stdout/stderr output from the code execution
/// - Err(anyhow::Error): Any errors that occurred during setup or execution
///
/// # Example
///
/// ```no_run
/// let mut runner = DenoRunner::new(DenoRunnerOptions::default());
/// let result = runner.run(
/// "console.log('Hello from Deno!')",
/// None,
/// Some(30)
/// ).await?;
/// ```
pub async fn run(
&mut self,
code_files: CodeFiles,
Expand Down Expand Up @@ -205,6 +194,9 @@ impl DenoRunner {

let mut container_envs = Vec::<String>::new();

container_envs.push(String::from("-e"));
container_envs.push("NO_COLOR=true".to_string());

container_envs.push(String::from("-e"));
container_envs.push(format!(
"DENO_DIR={}",
Expand All @@ -226,7 +218,10 @@ impl DenoRunner {
container_envs.push(String::from("-e"));
container_envs.push(format!("CONTEXT_ID={}", self.options.context.context_id));
container_envs.push(String::from("-e"));
container_envs.push(format!("EXECUTION_ID={}", self.options.context.execution_id));
container_envs.push(format!(
"EXECUTION_ID={}",
self.options.context.execution_id
));

if let Some(envs) = envs {
for (key, value) in envs {
Expand Down Expand Up @@ -417,6 +412,7 @@ impl DenoRunner {
.stderr(std::process::Stdio::piped())
.kill_on_drop(true);

command.env("NO_COLOR", "true");
command.env("DENO_DIR", execution_storage.deno_cache_folder_path.clone());
command.env(
"SHINKAI_NODE_LOCATION",
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shinkai_protocol/source",
"version": "0.8.6",
"version": "0.9.0",
"description": "This repository serves as the ecosystem to execute Shinkai tools, provided by the Shinkai team or third-party developers, in a secure environment. It provides a sandboxed space for executing these tools, ensuring that they run safely and efficiently, while also allowing for seamless integration with Rust code.",
"main": "index.js",
"author": "",
Expand Down

0 comments on commit 6ce1593

Please sign in to comment.