From 6ce1593e6a4459d426d7e47b3f103e0cedd8fb77 Mon Sep 17 00:00:00 2001 From: Alfredo Gallardo Date: Mon, 2 Dec 2024 17:43:06 -0300 Subject: [PATCH] - feature: added no color to deno env (#75) --- .../src/tools/deno_runner.rs | 20 ++++++++----------- package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/libs/shinkai-tools-runner/src/tools/deno_runner.rs b/libs/shinkai-tools-runner/src/tools/deno_runner.rs index 763ff96..227695b 100644 --- a/libs/shinkai-tools-runner/src/tools/deno_runner.rs +++ b/libs/shinkai-tools-runner/src/tools/deno_runner.rs @@ -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, @@ -205,6 +194,9 @@ impl DenoRunner { let mut container_envs = Vec::::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={}", @@ -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 { @@ -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", diff --git a/package-lock.json b/package-lock.json index 1c445fb..3be3fe2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@shinkai_protocol/source", - "version": "0.8.6", + "version": "0.9.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@shinkai_protocol/source", - "version": "0.8.6", + "version": "0.9.0", "license": "SEE LICENSE IN LICENSE", "dependencies": { "@coinbase/coinbase-sdk": "^0.0.16", diff --git a/package.json b/package.json index ed0f992..9cb9612 100644 --- a/package.json +++ b/package.json @@ -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": "",