diff --git a/crates/neatcoder/Cargo.toml b/crates/neatcoder/Cargo.toml index 63bc12e..bebd027 100644 --- a/crates/neatcoder/Cargo.toml +++ b/crates/neatcoder/Cargo.toml @@ -28,6 +28,7 @@ js-sys = "0.3" wasm-bindgen-futures = "0.4.37" serde-wasm-bindgen = "0.5.0" web-sys = { version = "0.3", features = ['console'] } +chrono = {version = "0.4", features = ["serde"]} [dev-dependencies] wasm-bindgen-test = "0.3" diff --git a/crates/neatcoder/src/consts.rs b/crates/neatcoder/src/consts.rs index 3342529..f2a3b7c 100644 --- a/crates/neatcoder/src/consts.rs +++ b/crates/neatcoder/src/consts.rs @@ -1,3 +1,4 @@ +///< Constants used throughout the application. pub const CONFIG_EXTENSIONS: [&str; 15] = [ "txt", "json", "toml", "lock", "yaml", "gemspec", "xml", "gradle", "csproj", "config", "sln", "mod", "sbt", "cabal", "md", diff --git a/crates/neatcoder/src/endpoints/get_chat_title.rs b/crates/neatcoder/src/endpoints/get_chat_title.rs new file mode 100644 index 0000000..99e8947 --- /dev/null +++ b/crates/neatcoder/src/endpoints/get_chat_title.rs @@ -0,0 +1,64 @@ +use anyhow::{anyhow, Result}; +use js_sys::Function; + +use crate::openai::{ + msg::{GptRole, OpenAIMsg}, + params::{OpenAIModels, OpenAIParams}, + request::chat_raw, +}; + +pub async fn get_chat_title( + msg: &str, + request_callback: &Function, +) -> Result { + let mut prompts = Vec::new(); + + prompts.push(OpenAIMsg { + role: GptRole::System, + content: String::from( + " +- Context: Briefly describe the key topics or themes of the chat. +- Title Specifications: The title should be concise, and not exceed 6 words. It should reflect the tone of the chat (e.g., professional, casual, informative, provocative, etc.). +- Output: Provide a title that encapsulates the main focus of the chat. + ", + ), + }); + + let main_prompt = format!( + " +Your task is to create a title for the following prompt: +\"\"\"{}\"\"\" + +The title of the prompt is:", + msg + ); + + prompts.push(OpenAIMsg { + role: GptRole::User, + content: main_prompt, + }); + + let prompts = prompts.iter().map(|x| x).collect::>(); + + let ai_params = + OpenAIParams::empty(OpenAIModels::Gpt35Turbo).max_tokens(15); + + let chat = + chat_raw(request_callback, &ai_params, &prompts, &[], &[]).await?; + + let mut answer = chat + .choices + .first() + .ok_or_else(|| anyhow!("LLM Respose seems to be empty :("))? + .message + .content + .clone(); + + answer = clean_title(answer); + + Ok(answer) +} + +fn clean_title(answer: String) -> String { + answer.replace("\"", "") +} diff --git a/crates/neatcoder/src/endpoints/mod.rs b/crates/neatcoder/src/endpoints/mod.rs index cc9e79f..775947a 100644 --- a/crates/neatcoder/src/endpoints/mod.rs +++ b/crates/neatcoder/src/endpoints/mod.rs @@ -1,2 +1,4 @@ +///< internal API endpoint definitions. pub mod scaffold_project; pub mod stream_code; +pub mod get_chat_title; diff --git a/crates/neatcoder/src/lib.rs b/crates/neatcoder/src/lib.rs index 3ac00c5..d70c609 100644 --- a/crates/neatcoder/src/lib.rs +++ b/crates/neatcoder/src/lib.rs @@ -1,4 +1,5 @@ -use js_sys::Reflect; +use chrono::{DateTime, Utc}; +use js_sys::{Date as IDate, Reflect}; use serde::de::DeserializeOwned; use serde::Serialize; use serde_wasm_bindgen::to_value; @@ -7,19 +8,13 @@ use std::hash::Hash; use utils::log_err; use wasm_bindgen::{JsCast, JsValue}; -// Public modules declaration pub mod consts; -///< Constants used throughout the application. pub mod endpoints; -///< internal API endpoint definitions. pub mod models; -///< Data models used in the application. pub mod openai; -///< Client for interacting with the OpenAI API. pub mod prelude; -///< Re-exports commonly used items. +pub mod typescript; pub mod utils; -///< Contains utility functions and helpers. /// Type alias for JavaScript errors represented as JsValue pub type JsError = JsValue; @@ -336,3 +331,40 @@ where }) } } + +impl WasmType for DateTime { + type RustType = DateTime; + + fn to_extern(rust_type: Self::RustType) -> Result { + // Convert the Rust DateTime to a string + let iso_string = rust_type.to_rfc3339(); + // Create a new JavaScript Date object from the string + let js_date = js_sys::Date::new(&JsValue::from_str(&iso_string)); + + // Check if the conversion was successful + if js_date.is_instance_of::() { + Ok(js_date) + } else { + Err(JsError::from( + "Failed to create JavaScript Date object.".to_owned(), + )) + } + } + + fn from_extern(extern_type: IDate) -> Result { + // Ensure we have a Date object + if let Some(date) = extern_type.dyn_into::().ok() { + // Convert the JavaScript Date object to an ISO string + let iso_string = + date.to_iso_string().as_string().unwrap_or_default(); + // Parse the ISO string into a Rust DateTime + DateTime::parse_from_rfc3339(&iso_string) + .map(|dt| dt.with_timezone(&Utc)) + .map_err(|e| JsError::from(e.to_string())) + } else { + Err(JsError::from( + "Input JsValue is not a Date object.".to_owned(), + )) + } + } +} diff --git a/crates/neatcoder/src/models/app_data/interfaces/apis.rs b/crates/neatcoder/src/models/app_data/interfaces/apis.rs index a8835b2..a6944c1 100644 --- a/crates/neatcoder/src/models/app_data/interfaces/apis.rs +++ b/crates/neatcoder/src/models/app_data/interfaces/apis.rs @@ -1,6 +1,7 @@ -use super::{AsContext, ISchemas, SchemaFile}; +use super::{AsContext, SchemaFile}; use crate::{ openai::msg::{GptRole, OpenAIMsg}, + typescript::ISchemas, JsError, WasmType, }; use anyhow::Result; diff --git a/crates/neatcoder/src/models/app_data/interfaces/dbs.rs b/crates/neatcoder/src/models/app_data/interfaces/dbs.rs index 9b762b4..f0bb43a 100644 --- a/crates/neatcoder/src/models/app_data/interfaces/dbs.rs +++ b/crates/neatcoder/src/models/app_data/interfaces/dbs.rs @@ -1,6 +1,7 @@ -use super::{AsContext, ISchemas, SchemaFile}; +use super::{AsContext, SchemaFile}; use crate::{ openai::msg::{GptRole, OpenAIMsg}, + typescript::ISchemas, JsError, WasmType, }; use anyhow::Result; diff --git a/crates/neatcoder/src/models/app_data/interfaces/mod.rs b/crates/neatcoder/src/models/app_data/interfaces/mod.rs index 57df93c..c80d47e 100644 --- a/crates/neatcoder/src/models/app_data/interfaces/mod.rs +++ b/crates/neatcoder/src/models/app_data/interfaces/mod.rs @@ -3,18 +3,12 @@ pub mod dbs; pub mod storage; use self::{apis::Api, dbs::Database, storage::Storage}; -use crate::{openai::msg::OpenAIMsg, JsError}; +use crate::{openai::msg::OpenAIMsg, typescript::ISchemas, JsError}; use anyhow::{anyhow, Result}; use serde::{Deserialize, Serialize}; use std::collections::BTreeMap; use wasm_bindgen::{prelude::wasm_bindgen, JsValue}; -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Record")] - pub type ISchemas; -} - #[derive(Debug, Deserialize, Serialize, Clone)] #[serde(rename_all = "camelCase")] #[wasm_bindgen] diff --git a/crates/neatcoder/src/models/app_data/interfaces/storage.rs b/crates/neatcoder/src/models/app_data/interfaces/storage.rs index 21bffdc..99a5f0a 100644 --- a/crates/neatcoder/src/models/app_data/interfaces/storage.rs +++ b/crates/neatcoder/src/models/app_data/interfaces/storage.rs @@ -1,5 +1,6 @@ use crate::{ openai::msg::{GptRole, OpenAIMsg}, + typescript::ISchemas, JsError, WasmType, }; use anyhow::Result; @@ -11,7 +12,7 @@ use std::{ }; use wasm_bindgen::prelude::wasm_bindgen; -use super::{AsContext, ISchemas, SchemaFile}; +use super::{AsContext, SchemaFile}; /// Struct documenting a Data storage interface. This refers to more raw storage /// solutions that usually provide a direct interface to a file or object-store diff --git a/crates/neatcoder/src/models/app_data/mod.rs b/crates/neatcoder/src/models/app_data/mod.rs index 1bdcb42..8076cd5 100644 --- a/crates/neatcoder/src/models/app_data/mod.rs +++ b/crates/neatcoder/src/models/app_data/mod.rs @@ -8,6 +8,7 @@ use crate::{ stream_code::{stream_code, CodeGenParams}, }, openai::params::OpenAIParams, + typescript::{ICodebase, IInterfaces, ITasksVec}, JsError, WasmType, }; use anyhow::{anyhow, Result}; @@ -83,18 +84,6 @@ pub struct AppData { pub(crate) task_pool: TaskPool, } -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Record")] - pub type IInterfaces; - - #[wasm_bindgen(typescript_type = "Record")] - pub type ICodebase; - - #[wasm_bindgen(typescript_type = "Array")] - pub type ITasksVec; -} - #[wasm_bindgen] impl AppData { #[wasm_bindgen(constructor)] diff --git a/crates/neatcoder/src/models/app_data/task_pool/mod.rs b/crates/neatcoder/src/models/app_data/task_pool/mod.rs index e2dd604..814209f 100644 --- a/crates/neatcoder/src/models/app_data/task_pool/mod.rs +++ b/crates/neatcoder/src/models/app_data/task_pool/mod.rs @@ -5,7 +5,10 @@ pub mod task; pub mod task_params; use self::{task::Task, task_params::TaskParams}; -use crate::{JsError, WasmType}; +use crate::{ + typescript::{IOrder, ITasks}, + JsError, WasmType, +}; use anyhow::Result; use serde::{Deserialize, Serialize}; use std::collections::{BTreeMap, VecDeque}; @@ -141,15 +144,6 @@ impl TaskPool { pub type Todo = Pipeline; pub type Done = Pipeline; -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Record")] - pub type ITasks; - - #[wasm_bindgen(typescript_type = "Array")] - pub type IOrder; -} - #[wasm_bindgen] #[derive(Debug, Serialize, Deserialize, Clone)] #[serde(rename_all = "camelCase")] diff --git a/crates/neatcoder/src/models/chat.rs b/crates/neatcoder/src/models/chat.rs index 8d43780..13d9035 100644 --- a/crates/neatcoder/src/models/chat.rs +++ b/crates/neatcoder/src/models/chat.rs @@ -1,65 +1,63 @@ use anyhow::Result; -use js_sys::JsString; +use chrono::{DateTime, Utc}; +use js_sys::{Date as IDate, Function, JsString}; use serde::{Deserialize, Serialize}; -use std::{ - collections::{BTreeMap, HashMap}, - ops::{Deref, DerefMut}, -}; +use std::collections::HashMap; use wasm_bindgen::prelude::{wasm_bindgen, JsValue}; -use crate::{openai::msg::OpenAIMsg, JsError, WasmType}; - -#[wasm_bindgen] -#[derive(Debug, Deserialize, Serialize, Clone)] -#[serde(rename_all = "camelCase")] -pub struct Chats(BTreeMap); - -#[wasm_bindgen] -impl Chats { - #[wasm_bindgen(constructor)] - pub fn new() -> Result { - Ok(Self(BTreeMap::new())) - } - - #[wasm_bindgen(js_name = insertChat)] - pub fn insert_chat(&mut self, chat: Chat) { - self.insert(chat.session_id.clone(), chat); - } - - #[wasm_bindgen(js_name = removeChat)] - pub fn remove_chat(&mut self, chat_id: String) { - self.remove(&chat_id); - } -} - -impl AsRef> for Chats { - fn as_ref(&self) -> &BTreeMap { - &self.0 - } -} - -impl Deref for Chats { - type Target = BTreeMap; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for Chats { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Record")] - pub type IModels; +use crate::{ + endpoints::get_chat_title::get_chat_title, + openai::{msg::OpenAIMsg, params::OpenAIModels}, + typescript::{IMessages, IModels}, + JsError, WasmType, +}; - #[wasm_bindgen(typescript_type = "Array")] - pub type IMessages; -} +// TODO: Do we need to store all chates in a BTreeMap or just a +// reference to all chats? We could lazily read the chats as they're opened +// in the webview as opposed to having all the chats in the BTreeMap on start + +// #[wasm_bindgen] +// #[derive(Debug, Deserialize, Serialize, Clone)] +// #[serde(rename_all = "camelCase")] +// pub struct Chats(BTreeMap); + +// #[wasm_bindgen] +// impl Chats { +// #[wasm_bindgen(constructor)] +// pub fn new() -> Result { +// Ok(Self(BTreeMap::new())) +// } + +// #[wasm_bindgen(js_name = insertChat)] +// pub fn insert_chat(&mut self, chat: Chat) { +// self.insert(chat.session_id.clone(), chat); +// } + +// #[wasm_bindgen(js_name = removeChat)] +// pub fn remove_chat(&mut self, chat_id: String) { +// self.remove(&chat_id); +// } +// } + +// impl AsRef> for Chats { +// fn as_ref(&self) -> &BTreeMap { +// &self.0 +// } +// } + +// impl Deref for Chats { +// type Target = BTreeMap; + +// fn deref(&self) -> &Self::Target { +// &self.0 +// } +// } + +// impl DerefMut for Chats { +// fn deref_mut(&mut self) -> &mut Self::Target { +// &mut self.0 +// } +// } #[wasm_bindgen] #[derive(Debug, Deserialize, Serialize, Clone)] @@ -74,13 +72,13 @@ pub struct Chat { #[wasm_bindgen] impl Chat { #[wasm_bindgen(constructor)] - pub fn new() -> Result { - Ok(Self { - session_id: String::from("TODO"), - title: String::from("TODO"), + pub fn new(session_id: String, title: String) -> Chat { + Self { + session_id, + title, models: HashMap::new(), messages: Vec::new(), - }) + } } #[wasm_bindgen(getter, js_name = sessionId)] @@ -103,6 +101,49 @@ impl Chat { Vec::to_extern(self.messages.clone()) } + #[wasm_bindgen(js_name = setTitle)] + pub async fn set_title( + &mut self, + request_callback: &Function, + ) -> Result<(), JsError> { + if !self.messages.is_empty() { + // Get the first element using indexing (index 0) + let first_msg = self.messages[0].clone(); + let title = + get_chat_title(&first_msg.payload.content, request_callback) + .await + .map_err(|e| JsError::from_str(&e.to_string()))?; + + self.title = title; + + Ok(()) + } else { + Err(JsError::from(JsValue::from_str( + "Unable to create title. No messages in the Chat.", + ))) + } + } + + #[wasm_bindgen(js_name = addMessage)] + pub fn add_message(&mut self, message: Message) { + self.messages.push(message); + } + + #[wasm_bindgen(js_name = setMessages)] + pub fn set_messages(&mut self, messages: IMessages) -> Result<(), JsError> { + let messages = Vec::from_extern(messages)?; + + self.messages = messages; + + Ok(()) + } + + #[wasm_bindgen(js_name = addModel)] + pub fn add_model(&mut self, model: OpenAIModels) { + let model_id = model.as_string(); + self.models.insert(model_id.clone(), Model::new(model_id)); + } + #[wasm_bindgen(js_name = castFromString)] pub fn cast_from_string(json: String) -> Result { let chat = serde_json::from_str(&json) @@ -125,7 +166,6 @@ impl Chat { #[serde(rename_all = "camelCase")] pub struct Model { pub(crate) id: String, - pub(crate) model: String, pub(crate) uri: String, pub(crate) interface: String, } @@ -133,13 +173,12 @@ pub struct Model { #[wasm_bindgen] impl Model { #[wasm_bindgen(constructor)] - pub fn new() -> Result { - Ok(Self { - id: String::from("TODO"), - model: String::from("TODO"), - uri: String::from("TODO"), - interface: String::from("TODO"), - }) + pub fn new(id: String) -> Model { + Self { + id, + uri: String::from("https://api.openai.com/v1/chat/completions"), + interface: String::from("OpenAI"), + } } #[wasm_bindgen(getter)] @@ -147,11 +186,6 @@ impl Model { self.id.clone().into() } - #[wasm_bindgen(getter)] - pub fn model(&self) -> JsString { - self.model.clone().into() - } - #[wasm_bindgen(getter)] pub fn uri(&self) -> JsString { self.uri.clone().into() @@ -168,18 +202,23 @@ impl Model { #[serde(rename_all = "camelCase")] pub struct Message { pub(crate) user: String, - pub(crate) ts: String, + pub(crate) ts: DateTime, pub(crate) payload: OpenAIMsg, } #[wasm_bindgen] impl Message { #[wasm_bindgen(constructor)] - pub fn new() -> Result { + pub fn new( + user: String, + ts: IDate, + payload: OpenAIMsg, + ) -> Result { + let datetime = DateTime::from_extern(ts.into())?; Ok(Self { - user: String::from("TODO"), - ts: String::from("TODO"), - payload: OpenAIMsg::user("TODO"), + user, + ts: datetime, + payload, }) } @@ -189,8 +228,8 @@ impl Message { } #[wasm_bindgen(getter)] - pub fn ts(&self) -> JsString { - self.ts.clone().into() + pub fn ts(&self) -> Result { + DateTime::to_extern(self.ts.clone().into()) } #[wasm_bindgen(getter)] diff --git a/crates/neatcoder/src/models/mod.rs b/crates/neatcoder/src/models/mod.rs index d619c12..7e574ad 100644 --- a/crates/neatcoder/src/models/mod.rs +++ b/crates/neatcoder/src/models/mod.rs @@ -1,2 +1,3 @@ +///< Data models used in the application. pub mod app_data; pub mod chat; diff --git a/crates/neatcoder/src/openai/mod.rs b/crates/neatcoder/src/openai/mod.rs index 4b06ae5..ed79442 100644 --- a/crates/neatcoder/src/openai/mod.rs +++ b/crates/neatcoder/src/openai/mod.rs @@ -1,6 +1,6 @@ +///< Client for interacting with the OpenAI API. pub mod msg; pub mod params; pub mod request; pub mod response; - pub mod utils; diff --git a/crates/neatcoder/src/openai/params.rs b/crates/neatcoder/src/openai/params.rs index 606b8ab..40da8c6 100644 --- a/crates/neatcoder/src/openai/params.rs +++ b/crates/neatcoder/src/openai/params.rs @@ -171,6 +171,12 @@ impl OpenAIParams { self } + #[wasm_bindgen(js_name = maxTokens)] + pub fn max_tokens(mut self, max_tokens: u64) -> Self { + self.max_tokens = Some(max_tokens); + self + } + #[wasm_bindgen(js_name = frequencyPenalty)] pub fn frequency_penalty(mut self, frequency_penalty: f64) -> Self { self.frequency_penalty = Some( diff --git a/crates/neatcoder/src/openai/request.rs b/crates/neatcoder/src/openai/request.rs index 11cfb19..7091e38 100644 --- a/crates/neatcoder/src/openai/request.rs +++ b/crates/neatcoder/src/openai/request.rs @@ -1,5 +1,5 @@ use super::{msg::OpenAIMsg, params::OpenAIParams, response::ResponseBody}; -use crate::{utils::log, JsError, WasmType}; +use crate::{typescript::IOpenAIMsg, utils::log, JsError, WasmType}; use anyhow::{anyhow, Result}; use js_sys::{Function, Promise}; use serde_json::{json, Value}; @@ -8,12 +8,6 @@ use std::ops::Deref; use wasm_bindgen::{prelude::wasm_bindgen, JsCast, JsValue}; use wasm_bindgen_futures::JsFuture; -#[wasm_bindgen] -extern "C" { - #[wasm_bindgen(typescript_type = "Array")] - pub type IOpenAIMsg; -} - #[wasm_bindgen(js_name = requestBody)] pub fn request_body_( msgs: IOpenAIMsg, diff --git a/crates/neatcoder/src/prelude.rs b/crates/neatcoder/src/prelude.rs index f90b032..b6fc6df 100644 --- a/crates/neatcoder/src/prelude.rs +++ b/crates/neatcoder/src/prelude.rs @@ -1,2 +1,3 @@ +///< Re-exports commonly used items. pub use anyhow::{anyhow, Error as AnyError, Result}; pub use log::{debug, error, info, warn}; diff --git a/crates/neatcoder/src/typescript.rs b/crates/neatcoder/src/typescript.rs new file mode 100644 index 0000000..615458e --- /dev/null +++ b/crates/neatcoder/src/typescript.rs @@ -0,0 +1,44 @@ +///< Provides foreign typescript types +use wasm_bindgen::prelude::wasm_bindgen; + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "Record")] + pub type IModels; + + #[wasm_bindgen(typescript_type = "Array")] + pub type IMessages; +} + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "Record")] + pub type IInterfaces; + + #[wasm_bindgen(typescript_type = "Record")] + pub type ICodebase; + + #[wasm_bindgen(typescript_type = "Array")] + pub type ITasksVec; +} + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "Record")] + pub type ISchemas; +} + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "Record")] + pub type ITasks; + + #[wasm_bindgen(typescript_type = "Array")] + pub type IOrder; +} + +#[wasm_bindgen] +extern "C" { + #[wasm_bindgen(typescript_type = "Array")] + pub type IOpenAIMsg; +} diff --git a/crates/neatcoder/src/utils.rs b/crates/neatcoder/src/utils.rs index 192bc33..1f448e3 100644 --- a/crates/neatcoder/src/utils.rs +++ b/crates/neatcoder/src/utils.rs @@ -1,3 +1,4 @@ +///< Contains utility functions and helpers. use crate::openai::request::chat_raw; use crate::openai::{msg::OpenAIMsg, params::OpenAIParams}; use crate::JsError; diff --git a/vsce/package-lock.json b/vsce/package-lock.json index af924d4..5ed47f0 100644 --- a/vsce/package-lock.json +++ b/vsce/package-lock.json @@ -1,27 +1,31 @@ { "name": "neatcoder", - "version": "0.0.1", + "version": "9.9.9", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "neatcoder", - "version": "0.0.1", - "license": "UNLICENSED", + "version": "9.9.9", "dependencies": { + "@types/web": "^0.0.114", "@wasm-tool/wasm-pack-plugin": "^1.7.0", "eventsource": "^2.0.2", + "http": "^0.0.1-security", "node-fetch": "^3.3.2", "pako": "^2.1.0", "rimraf": "^5.0.1", + "uuid": "^9.0.1", "ws": "^8.13.0" }, "devDependencies": { "@types/chai": "^4.3.6", + "@types/eventsource": "^1.1.11", "@types/glob": "^8.1.0", "@types/mocha": "^10.0.1", - "@types/node": "20.2.5", + "@types/node": "^20.6.0", "@types/pako": "^2.0.0", + "@types/uuid": "^9.0.6", "@types/vscode": ">=1.80.0", "@typescript-eslint/eslint-plugin": "^5.59.8", "@typescript-eslint/parser": "^5.59.8", @@ -198,12 +202,12 @@ } }, "node_modules/@babel/generator": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz", - "integrity": "sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", + "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", "dev": true, "dependencies": { - "@babel/types": "^7.22.15", + "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -253,22 +257,22 @@ "dev": true }, "node_modules/@babel/helper-environment-visitor": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz", - "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", + "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-function-name": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz", - "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", + "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", "dev": true, "dependencies": { - "@babel/template": "^7.22.5", - "@babel/types": "^7.22.5" + "@babel/template": "^7.22.15", + "@babel/types": "^7.23.0" }, "engines": { "node": ">=6.9.0" @@ -351,9 +355,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz", - "integrity": "sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ==", + "version": "7.22.20", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", + "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", "dev": true, "engines": { "node": ">=6.9.0" @@ -468,9 +472,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz", - "integrity": "sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", + "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", "dev": true, "bin": { "parser": "bin/babel-parser.js" @@ -494,19 +498,19 @@ } }, "node_modules/@babel/traverse": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.15.tgz", - "integrity": "sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ==", + "version": "7.23.2", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", + "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.22.15", - "@babel/helper-environment-visitor": "^7.22.5", - "@babel/helper-function-name": "^7.22.5", + "@babel/generator": "^7.23.0", + "@babel/helper-environment-visitor": "^7.22.20", + "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.22.15", - "@babel/types": "^7.22.15", + "@babel/parser": "^7.23.0", + "@babel/types": "^7.23.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -524,13 +528,13 @@ } }, "node_modules/@babel/types": { - "version": "7.22.15", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz", - "integrity": "sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA==", + "version": "7.23.0", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", + "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", - "@babel/helper-validator-identifier": "^7.22.15", + "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, "engines": { @@ -1059,6 +1063,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/eventsource": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.14.tgz", + "integrity": "sha512-WiPIkZ5fuhTkeaVaPKbaP6vHuTX9FHnFNTrkSbm+Uf6g4TH3YNbdfw5/1oLzKIWsQRbrvSiByO2nPSxjr5/cgQ==", + "dev": true + }, "node_modules/@types/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-8.1.0.tgz", @@ -1070,13 +1080,6 @@ "@types/node": "*" } }, - "node_modules/@types/glob/node_modules/@types/node": { - "version": "20.4.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.9.tgz", - "integrity": "sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/json-schema": { "version": "7.0.12", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", @@ -1099,11 +1102,13 @@ "license": "MIT" }, "node_modules/@types/node": { - "version": "20.2.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz", - "integrity": "sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ==", + "version": "20.8.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", + "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", "dev": true, - "license": "MIT" + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/pako": { "version": "2.0.0", @@ -1119,6 +1124,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/uuid": { + "version": "9.0.6", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.6.tgz", + "integrity": "sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew==", + "dev": true + }, "node_modules/@types/vscode": { "version": "1.81.0", "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.81.0.tgz", @@ -1126,6 +1137,11 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/web": { + "version": "0.0.114", + "resolved": "https://registry.npmjs.org/@types/web/-/web-0.0.114.tgz", + "integrity": "sha512-nrkwsB8u0VNHwElFSl6ZCgu0BCbsQu5BPq7mJtBpW7rYBmiLZNWE5KqcHDw8GXQMqWsnFB3EnXsAx7UysQwcMg==" + }, "node_modules/@typescript-eslint/eslint-plugin": { "version": "5.62.0", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.62.0.tgz", @@ -3075,9 +3091,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -3258,6 +3274,11 @@ "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/http": { + "version": "0.0.1-security", + "resolved": "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz", + "integrity": "sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g==" + }, "node_modules/http-proxy-agent": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", @@ -3649,6 +3670,15 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/istanbul-lib-processinfo/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/istanbul-lib-report": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", @@ -3750,13 +3780,6 @@ "node": ">= 10.13.0" } }, - "node_modules/jest-worker/node_modules/@types/node": { - "version": "20.4.9", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.9.tgz", - "integrity": "sha512-8e2HYcg7ohnTUbHk8focoklEQYvemQmu9M/f43DZVx43kHn0tE3BY/6gSDxS7k0SprtS0NHvj+L80cGLnoOUcQ==", - "dev": true, - "license": "MIT" - }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5740,6 +5763,12 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/update-browserslist-db": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz", @@ -5789,10 +5818,13 @@ "license": "MIT" }, "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], "bin": { "uuid": "dist/bin/uuid" } diff --git a/vsce/package.json b/vsce/package.json index 3d88af5..2e2277a 100644 --- a/vsce/package.json +++ b/vsce/package.json @@ -1,241 +1,247 @@ -{ - "name": "neatcoder", - "displayName": "Neatcoder", - "description": "Turn your IDE into an AI Sofware engineer.", - "version": "9.9.9", - "publisher": "NeatworkAi", - "repository": { - "url": "https://github.com/neatwork-ai/neatcoder-issues.git", - "type": "git" - }, - "icon": "assets/logo.png", - "engines": { - "vscode": ">=1.80.0" - }, - "categories": [ - "Other" - ], - "activationEvents": [ - "workspaceContains:**" - ], - "main": "./dist/extension.js", - "contributes": { - "commands": [ - { - "command": "extension.runTask", - "title": "Run Task", - "icon": "$(play)" - }, - { - "command": "extension.addSchema", - "title": "Select files to add to an Interface Component", - "icon": "$(add)" - }, - { - "command": "extension.initCodeBase", - "title": "Init Codebase", - "icon": "$(bracket-dot)" - }, - { - "command": "extension.runAllTasks", - "title": "Run All Tasks", - "icon": "$(notebook-execute-all)" - }, - { - "command": "extension.addDatastore", - "title": "Add Datastore", - "icon": "$(database)" - }, - { - "command": "extension.addApi", - "title": "Add API", - "icon": "$(plug)" - }, - { - "command": "extension.removeInterface", - "title": "Remove Interface", - "icon": "$(remove)" - }, - { - "command": "extension.removeSchema", - "title": "Remove Schema", - "icon": "$(remove)" - }, - { - "command": "extension.removeTask", - "title": "Remove Task", - "icon": "$(remove)" - }, - { - "command": "extension.removeAllTasks", - "title": "Remove all Tasks", - "icon": "$(trash)" - }, - { - "command": "extension.createChat", - "title": "Chat" - }, - { - "command": "extension.retryTask", - "title": "Retry Task", - "icon": "$(debug-restart)" - }, - { - "command": "extension.chooseModel", - "title": "Choose Model" - } - ], - "viewsContainers": { - "activitybar": [ - { - "id": "activityBarViews", - "title": "Neatcoder", - "icon": "assets/neatwork-icon-bar.svg" - } - ] - }, - "views": { - "activityBarViews": [ - { - "id": "taskPoolView", - "name": "TASK MANAGER" - }, - { - "id": "auditTrailView", - "name": "TASKS COMPLETED" - }, - { - "id": "interfacesView", - "name": "DATA MODELS & APIS" - }, - { - "id": "chatTreeView", - "name": "Chats" - } - ] - }, - "menus": { - "view/title": [ - { - "command": "extension.initCodeBase", - "when": "view == taskPoolView", - "group": "navigation@1" - }, - { - "command": "extension.runAllTasks", - "when": "view == taskPoolView", - "group": "navigation@2" - }, - { - "command": "extension.removeAllTasks", - "when": "view == taskPoolView", - "group": "navigation@3" - }, - { - "command": "extension.addDatastore", - "when": "view == interfacesView", - "group": "navigation@1" - }, - { - "command": "extension.addApi", - "when": "view == interfacesView", - "group": "navigation@2" - } - ], - "view/item/context": [ - { - "command": "extension.runTask", - "when": "view == taskPoolView && viewItem == taskItem", - "group": "inline@1" - }, - { - "command": "extension.removeTask", - "when": "view == taskPoolView && viewItem == taskItem", - "group": "inline@2" - }, - { - "command": "extension.retryTask", - "when": "view == auditTrailView && viewItem == taskItem", - "group": "inline@1" - }, - { - "command": "extension.removeInterface", - "when": "view == interfacesView && (viewItem == databaseItem || viewItem == apiItem)", - "group": "inline@2" - }, - { - "command": "extension.addSchema", - "when": "view == interfacesView && (viewItem == databaseItem || viewItem == apiItem)", - "group": "inline@1" - }, - { - "command": "extension.removeSchema", - "when": "view == interfacesView && viewItem == fileItem", - "group": "inline" - } - ] - }, - "configuration": { - "title": "Neatcoder Configuration", - "properties": { - "extension.apiKey": { - "type": "string", - "default": "", - "description": "The API key for OpenAI." - }, - "extension.modelVersion": { - "type": "string", - "default": "", - "description": "The Model Version for OpenAI." - } - } - } - }, - "scripts": { - "vscode:prepublish": "yarn run package", - "compile": "webpack", - "watch": "webpack --watch", - "package": "webpack --mode production --devtool hidden-source-map", - "compile-tests": "tsc -p . --outDir out", - "watch-tests": "tsc -p . -w --outDir out", - "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", - "lint": "eslint src --ext ts", - "test": "node ./out/test/runTest.js" - }, - "devDependencies": { - "@types/chai": "^4.3.6", - "@types/eventsource": "^1.1.11", - "@types/glob": "^8.1.0", - "@types/mocha": "^10.0.1", - "@types/node": "^20.6.0", - "@types/pako": "^2.0.0", - "@types/uuid": "^9.0.6", - "@types/vscode": ">=1.80.0", - "@typescript-eslint/eslint-plugin": "^5.59.8", - "@typescript-eslint/parser": "^5.59.8", - "@vscode/test-electron": "^2.3.2", - "chai": "^4.3.8", - "copy-webpack-plugin": "^11.0.0", - "eslint": "^8.41.0", - "glob": "^8.1.0", - "mocha": "^10.2.0", - "nyc": "^15.1.0", - "ts-loader": "^9.4.4", - "ts-node": "^10.9.1", - "typescript": "^5.1.3", - "webpack": "^5.88.2", - "webpack-cli": "^5.1.4" - }, - "dependencies": { - "@types/web": "^0.0.114", - "@wasm-tool/wasm-pack-plugin": "^1.7.0", - "eventsource": "^2.0.2", - "http": "^0.0.1-security", - "mixpanel": "^0.18.0", - "node-fetch": "^3.3.2", - "pako": "^2.1.0", - "rimraf": "^5.0.1", - "uuid": "^9.0.1", - "ws": "^8.13.0" - } -} +{ + "name": "neatcoder", + "displayName": "Neatcoder", + "description": "Turn your IDE into an AI Sofware engineer.", + "version": "9.9.9", + "publisher": "NeatworkAi", + "repository": { + "url": "https://github.com/neatwork-ai/neatcoder-issues.git", + "type": "git" + }, + "icon": "assets/logo.png", + "engines": { + "vscode": ">=1.80.0" + }, + "categories": [ + "Other" + ], + "activationEvents": [ + "workspaceContains:**" + ], + "main": "./dist/extension.js", + "contributes": { + "commands": [ + { + "command": "extension.runTask", + "title": "Run Task", + "icon": "$(play)" + }, + { + "command": "extension.addSchema", + "title": "Select files to add to an Interface Component", + "icon": "$(add)" + }, + { + "command": "extension.initCodeBase", + "title": "Init Codebase", + "icon": "$(bracket-dot)" + }, + { + "command": "extension.runAllTasks", + "title": "Run All Tasks", + "icon": "$(notebook-execute-all)" + }, + { + "command": "extension.addDatastore", + "title": "Add Datastore", + "icon": "$(database)" + }, + { + "command": "extension.addApi", + "title": "Add API", + "icon": "$(plug)" + }, + { + "command": "extension.removeInterface", + "title": "Remove Interface", + "icon": "$(remove)" + }, + { + "command": "extension.removeSchema", + "title": "Remove Schema", + "icon": "$(remove)" + }, + { + "command": "extension.removeTask", + "title": "Remove Task", + "icon": "$(remove)" + }, + { + "command": "extension.removeAllTasks", + "title": "Remove all Tasks", + "icon": "$(trash)" + }, + { + "command": "extension.createChat", + "title": "New Chat", + "icon": "$(notebook-render-output)" + }, + { + "command": "extension.retryTask", + "title": "Retry Task", + "icon": "$(debug-restart)" + }, + { + "command": "extension.chooseModel", + "title": "Choose Model" + } + ], + "viewsContainers": { + "activitybar": [ + { + "id": "activityBarViews", + "title": "Neatcoder", + "icon": "assets/neatwork-icon-bar.svg" + } + ] + }, + "views": { + "activityBarViews": [ + { + "id": "taskPoolView", + "name": "TASK MANAGER" + }, + { + "id": "auditTrailView", + "name": "TASKS COMPLETED" + }, + { + "id": "interfacesView", + "name": "DATA MODELS & APIS" + }, + { + "id": "chatTreeView", + "name": "Chats" + } + ] + }, + "menus": { + "view/title": [ + { + "command": "extension.initCodeBase", + "when": "view == taskPoolView", + "group": "navigation@1" + }, + { + "command": "extension.runAllTasks", + "when": "view == taskPoolView", + "group": "navigation@2" + }, + { + "command": "extension.removeAllTasks", + "when": "view == taskPoolView", + "group": "navigation@3" + }, + { + "command": "extension.addDatastore", + "when": "view == interfacesView", + "group": "navigation@1" + }, + { + "command": "extension.addApi", + "when": "view == interfacesView", + "group": "navigation@2" + }, + { + "command": "extension.createChat", + "when": "view == chatTreeView", + "group": "navigation@1" + } + ], + "view/item/context": [ + { + "command": "extension.runTask", + "when": "view == taskPoolView && viewItem == taskItem", + "group": "inline@1" + }, + { + "command": "extension.removeTask", + "when": "view == taskPoolView && viewItem == taskItem", + "group": "inline@2" + }, + { + "command": "extension.retryTask", + "when": "view == auditTrailView && viewItem == taskItem", + "group": "inline@1" + }, + { + "command": "extension.removeInterface", + "when": "view == interfacesView && (viewItem == databaseItem || viewItem == apiItem)", + "group": "inline@2" + }, + { + "command": "extension.addSchema", + "when": "view == interfacesView && (viewItem == databaseItem || viewItem == apiItem)", + "group": "inline@1" + }, + { + "command": "extension.removeSchema", + "when": "view == interfacesView && viewItem == fileItem", + "group": "inline" + } + ] + }, + "configuration": { + "title": "Neatcoder Configuration", + "properties": { + "extension.apiKey": { + "type": "string", + "default": "", + "description": "The API key for OpenAI." + }, + "extension.modelVersion": { + "type": "string", + "default": "", + "description": "The Model Version for OpenAI." + } + } + } + }, + "scripts": { + "vscode:prepublish": "yarn run package", + "compile": "webpack", + "watch": "webpack --watch", + "package": "webpack --mode production --devtool hidden-source-map", + "compile-tests": "tsc -p . --outDir out", + "watch-tests": "tsc -p . -w --outDir out", + "pretest": "yarn run compile-tests && yarn run compile && yarn run lint", + "lint": "eslint src --ext ts", + "test": "node ./out/test/runTest.js" + }, + "devDependencies": { + "@types/chai": "^4.3.6", + "@types/eventsource": "^1.1.11", + "@types/glob": "^8.1.0", + "@types/mocha": "^10.0.1", + "@types/node": "^20.6.0", + "@types/pako": "^2.0.0", + "@types/uuid": "^9.0.6", + "@types/vscode": ">=1.80.0", + "@typescript-eslint/eslint-plugin": "^5.59.8", + "@typescript-eslint/parser": "^5.59.8", + "@vscode/test-electron": "^2.3.2", + "chai": "^4.3.8", + "copy-webpack-plugin": "^11.0.0", + "eslint": "^8.41.0", + "glob": "^8.1.0", + "mocha": "^10.2.0", + "nyc": "^15.1.0", + "ts-loader": "^9.4.4", + "ts-node": "^10.9.1", + "typescript": "^5.1.3", + "webpack": "^5.88.2", + "webpack-cli": "^5.1.4" + }, + "dependencies": { + "@types/web": "^0.0.114", + "@wasm-tool/wasm-pack-plugin": "^1.7.0", + "eventsource": "^2.0.2", + "http": "^0.0.1-security", + "node-fetch": "^3.3.2", + "pako": "^2.1.0", + "rimraf": "^5.0.1", + "uuid": "^9.0.1", + "ws": "^8.13.0", + "mixpanel": "^0.18.0" + } +} diff --git a/vsce/src/chat/commands.ts b/vsce/src/chat/commands.ts index d88e7ab..9246dba 100644 --- a/vsce/src/chat/commands.ts +++ b/vsce/src/chat/commands.ts @@ -1,10 +1,18 @@ import * as wasm from "../../pkg/neatcoder"; import * as vscode from "vscode"; +import * as fs from "fs"; import * as path from "path"; -import { storeChat } from "../utils/utils"; +import { + getOrCreateConfigPath, + getOrInitConfig, + getOrSetModelVersion, + storeChat, +} from "../utils/utils"; import { setWebviewContent } from "./webview"; import { promptLLM } from "./handlers"; -import { activePanels, chats } from "."; +import { ChatProvider, activePanels } from "."; +import { v4 as uuidv4 } from "uuid"; +import { makeRequest } from "../utils/httpClient"; export let panelCounter = 1; @@ -30,18 +38,96 @@ export async function initChat( path.join(context.extensionPath, "assets", "robot-32-30.png") ); - const newChat = new wasm.Chat(); - storeChat("TODO", newChat); - chats.insertChat(newChat); + let modelVersion = await getOrSetModelVersion(); + const sessionId = uuidv4(); + const chat = new wasm.Chat(sessionId, "TODO"); + chat.addModel(modelVersion!); + storeChat(chat); // Setup event listeners and corresponding handlers panel.webview.onDidReceiveMessage( - (message) => { + async (message) => { switch (message.command) { case "promptLLM": // Now, when we call buildOpenAIRequest, we pass along the // panel so it knows which panel sent the message + chat.setMessages(message.msgs); // TODO: Move to addMessage to reduce communication overhead + storeChat(chat); + const msgs: Array = message.msgs; + const isFirst = msgs.length === 1 ? true : false; + + console.log(`Is first? ${isFirst}`); + promptLLM(panel, message); + + if (isFirst) { + await chat.setTitle(makeRequest); + storeChat(chat); + + // Change the title in the config + let config = getOrInitConfig(); + + const chatEntry = { + id: chat.sessionId, + title: chat.title, + }; + + console.log(`The new title: ${chatEntry.title}`); + + console.log(`Is config.chats? ${config?.chats}`); + if (config?.chats) { + const isChatEntryExist = config.chats.some( + (chat) => chat.id === chatEntry.id + ); + + console.log(`Is isChatEntryExist? ${isChatEntryExist}`); + if (!isChatEntryExist) { + config = { + ...config, + chats: [...config.chats, chatEntry], + }; + } else { + console.log("Updating title."); + const chatIndexToUpdate = config.chats.findIndex( + (chat) => chat.id === chatEntry.id + ); + + console.log(`chatIndexToUpdate? ${chatIndexToUpdate}`); + if (chatIndexToUpdate !== -1) { + // Chat entry with the specified ID exists; update its properties + config = { + ...config, + chats: config.chats.map((chat, index) => + index === chatIndexToUpdate + ? { ...chat, ...chatEntry } + : chat + ), + }; + } else { + throw new Error(`Failed to update title in the config file`); + } + } + } else { + console.log("Adding new title.."); + config = { + ...config, + chats: [chatEntry], + }; + } + + console.log("Persisting changes"); + // Persist changes to the config - TODO: centralize this logic + let configPath = getOrCreateConfigPath(); + const updatedContent = Buffer.from(JSON.stringify(config, null, 4)); // 4 spaces indentation + fs.writeFileSync(configPath, updatedContent); + } + + break; + + case "saveChat": + // Store when GPT answer is complete + chat.setMessages(message.msgs); // TODO: Move to addMessage to reduce communication overhead + storeChat(chat); break; case "getUserId": const userId = vscode.workspace.getConfiguration().get('NeatworkAi.neatcoder.userId'); @@ -62,7 +148,6 @@ export async function initChat( for (const [key, activePanel] of activePanels.entries()) { if (activePanel === panel) { activePanels.delete(key); - chats.removeChat("TODO"); } } }); diff --git a/vsce/src/chat/index.ts b/vsce/src/chat/index.ts index 850df75..266f891 100644 --- a/vsce/src/chat/index.ts +++ b/vsce/src/chat/index.ts @@ -1,9 +1,7 @@ -export { ChatTreeViewProvider } from "./providers"; +// export { ChatTreeViewProvider } from "./providers"; export { initChat } from "./commands"; export { setupChatWatcher } from "./watchers"; - -import * as wasm from "../../pkg/neatcoder"; +export { ChatProvider } from "./providers"; import * as vscode from "vscode"; export const activePanels: Map = new Map(); -export const chats = new wasm.Chats(); diff --git a/vsce/src/chat/providers.ts b/vsce/src/chat/providers.ts index 0bdb6d7..89d7be9 100644 --- a/vsce/src/chat/providers.ts +++ b/vsce/src/chat/providers.ts @@ -1,64 +1,96 @@ import * as vscode from "vscode"; -import * as path from "path"; +import { getConfigIfAny } from "../utils/utils"; -class ChatTreeItem extends vscode.TreeItem { - constructor(public readonly chatId: string, public readonly label: string) { +export type ChatEntry = { + id: string; + title: string; +}; + +export class ChatItem extends vscode.TreeItem { + constructor(public readonly id: string, public readonly label: string) { super(label, vscode.TreeItemCollapsibleState.None); } } -export class ChatTreeViewProvider - implements vscode.TreeDataProvider -{ - private _onDidChangeTreeData: vscode.EventEmitter = - new vscode.EventEmitter(); - readonly onDidChangeTreeData: vscode.Event = - this._onDidChangeTreeData.event; - - getTreeItem(element: ChatTreeItem): vscode.TreeItem { - return element; +/** + * Class implementing the vscode.TreeDataProvider interface to provide data for a tree view + * in a VS Code extension. It manages the representation of chats. + */ +export class ChatProvider implements vscode.TreeDataProvider { + /** + * Constructor initializes a new event emitter instance for tree data change notifications. + */ + constructor() { + this._onDidChangeTreeData = new vscode.EventEmitter(); + this.onDidChangeTreeData = this._onDidChangeTreeData.event; } - getChildren(element?: ChatTreeItem): Thenable { - return Promise.resolve(this.getChatTreeItems()); + /** + * Private property holding an event emitter instance to notify about tree data changes. + */ + private _onDidChangeTreeData: vscode.EventEmitter< + ChatItem | undefined | null | void + > = new vscode.EventEmitter(); + + /** + * Public readonly property to expose the event for external listeners to detect tree data changes. + */ + readonly onDidChangeTreeData: vscode.Event< + ChatItem | undefined | null | void + > = this._onDidChangeTreeData.event; + + /** + * Method to refresh the tree view. It triggers a refresh of the tree data by firing an event + * with undefined data, indicating a complete refresh. + */ + refresh(): void { + // Since the entire tree data might be updated after a change to the config, + // we pass undefined to indicate that the whole tree has changed, + // and it should refresh all its items. + this._onDidChangeTreeData.fire(undefined); } - private async getChatTreeItems(): Promise { - const chats: ChatTreeItem[] = []; - const chatsDir = vscode.Uri.file( - vscode.workspace.rootPath + "/.neat/chats" - ); + /** + * Method to retrieve a tree item given an element. It simply returns the passed tree item. + * + * @param element - The tree item to retrieve. + * @returns The retrieved tree item. + */ + getTreeItem(element: vscode.TreeItem) { + return element; + } - let directoryExists = true; - try { - await vscode.workspace.fs.stat(chatsDir); - } catch { - directoryExists = false; - } + /** + * Method to dynamically fetch the children of a tree item based on the configuration file. + * It returns different sets of children items depending on the type of the passed item + * (database, API, or file). + * + * @param element - The parent tree item for which to retrieve children. + * @returns A promise resolving to an array of child ChatItem objects. + */ + getChildren(element?: ChatItem): Thenable { + if (vscode.workspace.workspaceFolders) { + const root = vscode.workspace.workspaceFolders[0].uri.fsPath; - if (directoryExists) { - const chatFiles = await vscode.workspace.fs.readDirectory(chatsDir); + // The root call for getChildren has no element + if (!element) { + const config = getConfigIfAny(); - chatFiles.forEach(([file, type]) => { - if (type === vscode.FileType.File) { - const chatName = path.basename(file, ".json"); // Extract name without extension - chats.push(new ChatTreeItem(chatName, `${chatName}`)); + if (config === null) { + // If no config available then if means there are no interfaces... + return Promise.resolve([]); } - }); - } - return chats; - } + const chatItems = config.chats + ? config.chats.map((chat) => { + return new ChatItem(chat.id, chat.title); + }) + : []; - refresh(): void { - this._onDidChangeTreeData.fire(undefined); + return Promise.resolve(chatItems); + } + } + + return Promise.resolve([]); } } - -const chatTreeViewProvider = new ChatTreeViewProvider(); -vscode.window.registerTreeDataProvider("chatTreeView", chatTreeViewProvider); - -// Update the tree view whenever a panel is created or closed -vscode.window.onDidChangeVisibleTextEditors(() => { - chatTreeViewProvider.refresh(); -}); diff --git a/vsce/src/chat/watchers.ts b/vsce/src/chat/watchers.ts index ef67b1c..97c6a13 100644 --- a/vsce/src/chat/watchers.ts +++ b/vsce/src/chat/watchers.ts @@ -1,50 +1,77 @@ import * as vscode from "vscode"; import * as fs from "fs"; -import * as path from "path"; -import { ChatTreeViewProvider } from "../chat/providers"; -import { getChat } from "../utils/utils"; -import { chats } from "."; +import { ChatEntry, ChatProvider } from "../chat/providers"; +import { + getChat, + getConfigIfAny, + getOrCreateConfigPath, + getOrInitConfig, +} from "../utils/utils"; -type ChatInfo = { - chatId: string; - chatTitle: string; -}; - -const chatMap: Map = new Map(); +const chatMap: Map = new Map(); export function setupChatWatcher( - chatTreeViewProvider: ChatTreeViewProvider + chatTreeViewProvider: ChatProvider ): vscode.FileSystemWatcher { const watcher = vscode.workspace.createFileSystemWatcher( "**/.neat/chats/*.json" ); watcher.onDidChange(async (uri: vscode.Uri) => { - console.log("onDidChange triggered", uri.path); - try { - const chat = await getChat(uri); - chats.insertChat(chat); - chatTreeViewProvider.refresh(); - } catch (error) { - vscode.window.showErrorMessage( - `[ERROR] Failed to read chat file ${uri}. Error: ${error}` - ); - - console.error("Failed to update chat state:", error); - throw new Error(`Failed to update chat state ${uri.path}: ${error}`); - } + // No-Op + // console.log("onDidChange triggered", uri.path); + // try { + // const chat = await getChat(uri); + // // chats.insertChat(chat); // TODO: Lazily read chats on webview open + // chatTreeViewProvider.refresh(); + // } catch (error) { + // vscode.window.showErrorMessage( + // `[ERROR] Failed to read chat file ${uri}. Error: ${error}` + // ); + // console.error("Failed to update chat state:", error); + // throw new Error(`Failed to update chat state ${uri.path}: ${error}`); + // } }); watcher.onDidCreate(async (uri: vscode.Uri) => { console.log("onDidCreate triggered", uri.path); try { const chat = await getChat(uri); - chatMap.set(uri.toString(), { - chatId: chat.sessionId, - chatTitle: chat.title, - }); - chats.insertChat(chat); - chatTreeViewProvider.refresh(); + + const chatEntry = { + id: chat.sessionId, + title: chat.title, + }; + + chatMap.set(uri.toString(), chatEntry); + + // Add the chat entry to the config + let config = getOrInitConfig(); + + if (config?.chats) { + const isChatEntryExist = config.chats.some( + (chat) => chat.id === chatEntry.id + ); + + if (!isChatEntryExist) { + config = { + ...config, + chats: [...config.chats, chatEntry], + }; + } + } else { + config = { + ...config, + chats: [chatEntry], + }; + } + + // Persist changes to the config - TODO: centralize this logic + let configPath = getOrCreateConfigPath(); + const updatedContent = Buffer.from(JSON.stringify(config, null, 4)); // 4 spaces indentation + fs.writeFileSync(configPath, updatedContent); + + chatTreeViewProvider.refresh(); // Redundant? } catch (error) { vscode.window.showErrorMessage( `[ERROR] Failed to read new chat file ${uri}. Error: ${error}` @@ -57,9 +84,32 @@ export function setupChatWatcher( watcher.onDidDelete((uri: vscode.Uri) => { try { const uriString = uri.toString(); - const chatInfo = chatMap.get(uriString)!; - chats.removeChat(chatInfo.chatId); + const chatEntry = chatMap.get(uriString)!; chatMap.delete(uriString); + + let config = getOrInitConfig(); + + const chatIndexToDelete = config.chats.findIndex( + (chat) => chat.id === chatEntry.id + ); + + if (chatIndexToDelete !== -1) { + config = { + ...config, + chats: [ + ...config.chats.slice(0, chatIndexToDelete), + ...config.chats.slice(chatIndexToDelete + 1), + ], + }; + + // Persist changes to the config - TODO: centralize this logic + + let configPath = getOrCreateConfigPath(); + const updatedContent = Buffer.from(JSON.stringify(config, null, 4)); // 4 spaces indentation + fs.writeFileSync(configPath, updatedContent); + } + + chatTreeViewProvider.refresh(); } catch (error) { console.error("Failed to remove chat state:", error); throw new Error(`Failed to remove chat state from ${uri.path}: ${error}`); diff --git a/vsce/src/core/appData.ts b/vsce/src/core/appData.ts index 967e6cc..b0c22f5 100644 --- a/vsce/src/core/appData.ts +++ b/vsce/src/core/appData.ts @@ -12,7 +12,6 @@ import { TaskPoolProvider, TasksCompletedProvider, } from "../taskPool/providers"; -import { Task } from "../../pkg/neatcoder"; /** * A class to manage the application state, including functionalities such as @@ -141,21 +140,20 @@ export class appDataManager { const tasks: wasm.Task[] = this.appData.getTodoTasks(); if (tasks.length === 0) { - window.showInformationMessage("No tasks to run in the task pool."); - return; + window.showInformationMessage("No tasks to run in the task pool."); + return; } // Run each task sequentially. for (const task of tasks) { - const taskId = task.id; // Assuming task object has an id property - await this.runTask(taskId, llmParams); + const taskId = task.id; // Assuming task object has an id property + await this.runTask(taskId, llmParams); } window.showInformationMessage("All tasks completed."); - } catch (error) { - console.error("Error while running all tasks:", error); - window.showErrorMessage(`Error while running all tasks: ${error}`); + console.error("Error while running all tasks:", error); + window.showErrorMessage(`Error while running all tasks: ${error}`); } } @@ -232,7 +230,7 @@ export class appDataManager { this.refresh(); // need to refresh to reflect the state rollback } - /** + /** * Retries a task based on the task ID and the associated task parameters. * * @param {number} taskId - The ID of the task to retry. diff --git a/vsce/src/core/watchers.ts b/vsce/src/core/watchers.ts index ec08e95..c76fd3b 100644 --- a/vsce/src/core/watchers.ts +++ b/vsce/src/core/watchers.ts @@ -7,12 +7,14 @@ import { appDataManager } from "../core/appData"; import { logger } from "../utils/logger"; import { InterfacesProvider } from "../foreignInterfaces/providers"; import { setupSchemaWatchers } from "../foreignInterfaces/watchers"; +import { ChatProvider } from "../chat/providers"; let originalConfig: any; export function setupDotNeatWatcher( schemaWatchers: { [key: string]: fs.FSWatcher }, interfacesProvider: InterfacesProvider, + chatProvider: ChatProvider, // TODO: Add data from chats from this watcher appManager: appDataManager ) { if (!vscode.workspace.workspaceFolders) { @@ -25,18 +27,33 @@ export function setupDotNeatWatcher( if (fs.existsSync(configDir)) { if (fs.existsSync(configPath)) { - setupFileWatcher(schemaWatchers, interfacesProvider, appManager); + setupCoreWatcher( + schemaWatchers, + interfacesProvider, + chatProvider, + appManager + ); setupSchemaWatchers(schemaWatchers, interfacesProvider, appManager); } else { watchForFileCreation(configDir, "config.json", () => { - setupFileWatcher(schemaWatchers, interfacesProvider, appManager); + setupCoreWatcher( + schemaWatchers, + interfacesProvider, + chatProvider, + appManager + ); setupSchemaWatchers(schemaWatchers, interfacesProvider, appManager); }); } } else { watchForFileCreation(root, ".neat", () => { watchForFileCreation(configDir, "config.json", () => { - setupFileWatcher(schemaWatchers, interfacesProvider, appManager); + setupCoreWatcher( + schemaWatchers, + interfacesProvider, + chatProvider, + appManager + ); setupSchemaWatchers(schemaWatchers, interfacesProvider, appManager); }); }); @@ -64,9 +81,10 @@ function watchForFileCreation( * @param interfacesProvider - Provider for managing interfaces. * @param appManager - The application manager for handling state and configurations. */ -export function setupFileWatcher( +export function setupCoreWatcher( schemaWatchers: { [key: string]: fs.FSWatcher }, interfacesProvider: InterfacesProvider, + chatProvider: ChatProvider, appManager: appDataManager ) { if (!vscode.workspace.workspaceFolders) { @@ -93,6 +111,7 @@ export function setupFileWatcher( // Refresh UI interfacesProvider.refresh(); + chatProvider.refresh(); // Read the new content const newContentString = fs.readFileSync(fullPath, "utf-8"); @@ -105,6 +124,8 @@ export function setupFileWatcher( return; } + // Propagate Interface changes to AppData + // Compare and handle additions const bool1 = handleAdditions( originalConfig.dbs, @@ -135,6 +156,8 @@ export function setupFileWatcher( const toUpdate = bool1 || bool2 || bool3 || bool4; + // Update Schema watchers according to interface changes + if (toUpdate) { // Close the old schema watchers for (const key in schemaWatchers) { diff --git a/vsce/src/extension.ts b/vsce/src/extension.ts index fa981a9..2acbbf7 100644 --- a/vsce/src/extension.ts +++ b/vsce/src/extension.ts @@ -23,7 +23,7 @@ import { } from "./taskPool"; import { initCodeBase, appDataManager, setupDotNeatWatcher } from "./core"; import { getOrSetApiKey, initStatusBar, initLogger, logger } from "./utils"; -import { ChatTreeViewProvider, initChat, setupChatWatcher } from "./chat"; +import { ChatProvider, initChat, setupChatWatcher } from "./chat"; import { getOrSetModelVersion, setModelVersion } from "./utils/utils"; import MixpanelHelper from "./utils/mixpanelHelper"; @@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) { const jobQueueProvider = new TaskPoolProvider(); const auditTrailProvider = new TasksCompletedProvider(); const interfacesProvider = new InterfacesProvider(); - const chatTreeProvider = new ChatTreeViewProvider(); + const chatProvider = new ChatProvider(); // init Mixpanel let mixpanel = MixpanelHelper.getInstance(); @@ -70,8 +70,13 @@ export async function activate(context: vscode.ExtensionContext) { // Setup File Watcher which checks for changes in the `.neat` and // communicates them to the server if relevant - setupDotNeatWatcher(schemaWatchers, interfacesProvider, appManager); - chatWatcher = setupChatWatcher(chatTreeProvider); + setupDotNeatWatcher( + schemaWatchers, + interfacesProvider, + chatProvider, + appManager + ); + chatWatcher = setupChatWatcher(chatProvider); // === Registration & Garbage Collection === @@ -97,7 +102,7 @@ export async function activate(context: vscode.ExtensionContext) { ); context.subscriptions.push( - vscode.window.registerTreeDataProvider("chatTreeView", chatTreeProvider) + vscode.window.registerTreeDataProvider("chatTreeView", chatProvider) ); // Register the Chat command diff --git a/vsce/src/utils/utils.ts b/vsce/src/utils/utils.ts index f236543..976d8c8 100644 --- a/vsce/src/utils/utils.ts +++ b/vsce/src/utils/utils.ts @@ -4,6 +4,7 @@ import * as path from "path"; import * as pako from "pako"; import * as wasm from "../../pkg/neatcoder"; import { ApiEntry, DbEntry, PathEntry } from "../foreignInterfaces/providers"; +import { ChatEntry } from "../chat/providers"; /// ===== Read ===== /// @@ -55,11 +56,6 @@ export function saveappDataToFile(appData: wasm.AppData): void { saveFile(payload, ".neat/cache", "state"); } -export function saveCump(appData: wasm.AppData): void { - const payload = serializeappData(appData); - saveFile(payload, ".neat/cache", "state"); -} - function saveFile( payload: ArrayBuffer, folder: string, @@ -118,6 +114,7 @@ export function getConfigIfAny(): { paths: PathEntry[]; dbs: DbEntry[]; apis: ApiEntry[]; + chats: ChatEntry[]; } | null { const root = getRoot(); @@ -147,6 +144,17 @@ export function getConfigIfAny(): { return config; } +export function getOrInitConfig(): { + paths: PathEntry[]; + dbs: DbEntry[]; + apis: ApiEntry[]; + chats: ChatEntry[]; +} { + getOrCreateConfigPath(); + + return getConfigIfAny()!; +} + export function getOrCreateConfigPath(): string { const root = getRoot(); const neatPath = path.join(root, ".neat"); @@ -325,8 +333,9 @@ export async function getChat(uri: vscode.Uri): Promise { } } -export async function storeChat(name: string, chat: wasm.Chat): Promise { +export async function storeChat(chat: wasm.Chat): Promise { try { + const chatId = chat.sessionId; // Convert the chat instance to a JSON string const jsonString = chat.castToString(); @@ -336,7 +345,7 @@ export async function storeChat(name: string, chat: wasm.Chat): Promise { ".neat", "chats" ); - const filePath = path.join(folderPath, `${name}.json`); + const filePath = path.join(folderPath, `${chatId}.json`); // Ensure the directory exists await vscode.workspace.fs.createDirectory(vscode.Uri.file(folderPath)); diff --git a/vsce/yarn.lock b/vsce/yarn.lock index 277404f..a7918f3 100644 --- a/vsce/yarn.lock +++ b/vsce/yarn.lock @@ -28,7 +28,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz" integrity sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ== -"@babel/core@^7.7.5": +"@babel/core@^7.0.0", "@babel/core@^7.7.5": version "7.22.15" resolved "https://registry.npmjs.org/@babel/core/-/core-7.22.15.tgz" integrity sha512-PtZqMmgRrvj8ruoEOIwVA3yoF91O+Hgw9o7DAUTNBA6Mo2jpu31clx9a7Nz/9JznqetTR6zwfC4L3LAjKQXUwA== @@ -49,12 +49,12 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.22.15.tgz" - integrity sha512-Zu9oWARBqeVOW0dZOjXc3JObrzuqothQ3y/n1kUtrjCoCPLkXUwMvOo/F/TCfoHMbWIFlWwpZtkZVb9ga4U2pA== +"@babel/generator@^7.22.15", "@babel/generator@^7.23.0": + version "7.23.0" + resolved "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz" + integrity sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g== dependencies: - "@babel/types" "^7.22.15" + "@babel/types" "^7.23.0" "@jridgewell/gen-mapping" "^0.3.2" "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" @@ -70,18 +70,18 @@ lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-environment-visitor@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz" - integrity sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q== +"@babel/helper-environment-visitor@^7.22.20", "@babel/helper-environment-visitor@^7.22.5": + version "7.22.20" + resolved "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz" + integrity sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA== -"@babel/helper-function-name@^7.22.5": - version "7.22.5" - resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz" - integrity sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ== +"@babel/helper-function-name@^7.23.0": + version "7.23.0" + resolved "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz" + integrity sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw== dependencies: - "@babel/template" "^7.22.5" - "@babel/types" "^7.22.5" + "@babel/template" "^7.22.15" + "@babel/types" "^7.23.0" "@babel/helper-hoist-variables@^7.22.5": version "7.22.5" @@ -127,10 +127,10 @@ resolved "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz" integrity sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw== -"@babel/helper-validator-identifier@^7.22.15", "@babel/helper-validator-identifier@^7.22.5": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.15.tgz" - integrity sha512-4E/F9IIEi8WR94324mbDUMo074YTheJmd7eZF5vITTeYchqAi6sYXRLHUVsmkdmY4QjfKTcB2jB7dVP3NaBElQ== +"@babel/helper-validator-identifier@^7.22.15", "@babel/helper-validator-identifier@^7.22.20", "@babel/helper-validator-identifier@^7.22.5": + version "7.22.20" + resolved "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz" + integrity sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A== "@babel/helper-validator-option@^7.22.15": version "7.22.15" @@ -155,12 +155,12 @@ chalk "^2.4.2" js-tokens "^4.0.0" -"@babel/parser@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.22.15.tgz" - integrity sha512-RWmQ/sklUN9BvGGpCDgSubhHWfAx24XDTDObup4ffvxaYsptOg2P3KG0j+1eWKLxpkX0j0uHxmpq2Z1SP/VhxA== +"@babel/parser@^7.22.15", "@babel/parser@^7.23.0": + version "7.23.0" + resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz" + integrity sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw== -"@babel/template@^7.22.15", "@babel/template@^7.22.5": +"@babel/template@^7.22.15": version "7.22.15" resolved "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz" integrity sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w== @@ -170,28 +170,28 @@ "@babel/types" "^7.22.15" "@babel/traverse@^7.22.15": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.15.tgz" - integrity sha512-DdHPwvJY0sEeN4xJU5uRLmZjgMMDIvMPniLuYzUVXj/GGzysPl0/fwt44JBkyUIzGJPV8QgHMcQdQ34XFuKTYQ== + version "7.23.2" + resolved "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz" + integrity sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw== dependencies: "@babel/code-frame" "^7.22.13" - "@babel/generator" "^7.22.15" - "@babel/helper-environment-visitor" "^7.22.5" - "@babel/helper-function-name" "^7.22.5" + "@babel/generator" "^7.23.0" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" "@babel/helper-hoist-variables" "^7.22.5" "@babel/helper-split-export-declaration" "^7.22.6" - "@babel/parser" "^7.22.15" - "@babel/types" "^7.22.15" + "@babel/parser" "^7.23.0" + "@babel/types" "^7.23.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.22.15", "@babel/types@^7.22.5": - version "7.22.15" - resolved "https://registry.npmjs.org/@babel/types/-/types-7.22.15.tgz" - integrity sha512-X+NLXr0N8XXmN5ZsaQdm9U2SSC3UbIYq/doL++sueHOTisgZHoKaQtZxGuV2cUPQHMfjKEfg/g6oy7Hm6SKFtA== +"@babel/types@^7.22.15", "@babel/types@^7.22.5", "@babel/types@^7.23.0": + version "7.23.0" + resolved "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz" + integrity sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg== dependencies: "@babel/helper-string-parser" "^7.22.5" - "@babel/helper-validator-identifier" "^7.22.15" + "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" "@cspotcode/source-map-support@^0.8.0": @@ -317,14 +317,6 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": version "0.3.19" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz" @@ -333,6 +325,14 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz" @@ -341,7 +341,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": +"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -411,9 +411,9 @@ integrity sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA== "@types/eventsource@^1.1.11": - version "1.1.11" - resolved "https://registry.yarnpkg.com/@types/eventsource/-/eventsource-1.1.11.tgz#a2c0bfd0436b7db42ed1b2b2117f7ec2e8478dc7" - integrity sha512-L7wLDZlWm5mROzv87W0ofIYeQP5K2UhoFnnUyEWLKM6UBb0ZNRgAqp98qE5DkgfBXdWfc2kYmw9KZm4NLjRbsw== + version "1.1.14" + resolved "https://registry.npmjs.org/@types/eventsource/-/eventsource-1.1.14.tgz" + integrity sha512-WiPIkZ5fuhTkeaVaPKbaP6vHuTX9FHnFNTrkSbm+Uf6g4TH3YNbdfw5/1oLzKIWsQRbrvSiByO2nPSxjr5/cgQ== "@types/glob@^8.1.0": version "8.1.0" @@ -438,15 +438,12 @@ resolved "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.1.tgz" integrity sha512-/fvYntiO1GeICvqbQ3doGDIP97vWmvFt83GKguJ6prmQM2iXZfFcq6YE8KteFyRtX2/h5Hf91BYvPodJKFYv5Q== -"@types/node@*": - version "20.2.5" - resolved "https://registry.npmjs.org/@types/node/-/node-20.2.5.tgz" - integrity sha512-JJulVEQXmiY9Px5axXHeYGLSjhkZEnD+MDPDGbCbIAbMslkKwmygtZFy1X6s/075Yo94sf8GuSlFfPzysQrWZQ== - -"@types/node@^20.6.0": - version "20.6.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.6.0.tgz#9d7daa855d33d4efec8aea88cd66db1c2f0ebe16" - integrity sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg== +"@types/node@*", "@types/node@^20.6.0": + version "20.8.10" + resolved "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz" + integrity sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w== + dependencies: + undici-types "~5.26.4" "@types/pako@^2.0.0": version "2.0.0" @@ -458,6 +455,11 @@ resolved "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz" integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== +"@types/uuid@^9.0.6": + version "9.0.6" + resolved "https://registry.npmjs.org/@types/uuid/-/uuid-9.0.6.tgz" + integrity sha512-BT2Krtx4xaO6iwzwMFUYvWBWkV2pr37zD68Vmp1CDV196MzczBRxuEpD6Pr395HAgebC/co7hOphs53r8V7jew== + "@types/vscode@>=1.80.0": version "1.81.0" resolved "https://registry.npmjs.org/@types/vscode/-/vscode-1.81.0.tgz" @@ -465,7 +467,7 @@ "@types/web@^0.0.114": version "0.0.114" - resolved "https://registry.yarnpkg.com/@types/web/-/web-0.0.114.tgz#468e69265d7d9e5872a51e0df05a6bc40e5a5434" + resolved "https://registry.npmjs.org/@types/web/-/web-0.0.114.tgz" integrity sha512-nrkwsB8u0VNHwElFSl6ZCgu0BCbsQu5BPq7mJtBpW7rYBmiLZNWE5KqcHDw8GXQMqWsnFB3EnXsAx7UysQwcMg== "@typescript-eslint/eslint-plugin@^5.59.8": @@ -484,7 +486,7 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.59.8": +"@typescript-eslint/parser@^5.0.0", "@typescript-eslint/parser@^5.59.8": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.62.0.tgz" integrity sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA== @@ -572,7 +574,7 @@ watchpack "^2.1.1" which "^2.0.2" -"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": +"@webassemblyjs/ast@^1.11.5", "@webassemblyjs/ast@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz" integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== @@ -673,7 +675,7 @@ "@webassemblyjs/wasm-gen" "1.11.6" "@webassemblyjs/wasm-parser" "1.11.6" -"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": +"@webassemblyjs/wasm-parser@^1.11.5", "@webassemblyjs/wasm-parser@1.11.6": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz" integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== @@ -733,7 +735,7 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz" integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== -acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: +"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8, acorn@^8.4.1, acorn@^8.7.1, acorn@^8.8.2, acorn@^8.9.0: version "8.10.0" resolved "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz" integrity sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw== @@ -772,7 +774,7 @@ ajv-keywords@^5.1.0: dependencies: fast-deep-equal "^3.1.3" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -782,7 +784,17 @@ ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.9.0: +ajv@^8.0.0: + version "8.12.0" + resolved "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz" + integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== + dependencies: + fast-deep-equal "^3.1.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + uri-js "^4.2.2" + +ajv@^8.8.2, ajv@^8.9.0: version "8.12.0" resolved "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -910,7 +922,7 @@ browser-stdout@1.3.1: resolved "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz" integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== -browserslist@^4.14.5, browserslist@^4.21.9: +browserslist@^4.14.5, browserslist@^4.21.9, "browserslist@>= 4.21.0": version "4.21.10" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz" integrity sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ== @@ -940,7 +952,12 @@ callsites@^3.0.0: resolved "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz" integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== -camelcase@^5.0.0, camelcase@^5.3.1: +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^5.3.1: version "5.3.1" resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== @@ -968,7 +985,16 @@ chai@^4.3.8: pathval "^1.1.1" type-detect "^4.0.5" -chalk@^2.4.1, chalk@^2.4.2: +chalk@^2.4.1: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chalk@^2.4.2: version "2.4.2" resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -1056,16 +1082,16 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" - integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== - color-name@~1.1.4: version "1.1.4" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + colorette@^2.0.14: version "2.0.20" resolved "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz" @@ -1137,7 +1163,7 @@ data-uri-to-buffer@^4.0.0: resolved "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz" integrity sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A== -debug@4, debug@4.3.4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4, debug@4, debug@4.3.4: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -1173,16 +1199,16 @@ default-require-extensions@^3.0.0: dependencies: strip-bom "^4.0.0" -diff@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" - integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== - diff@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz" integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== +diff@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz" + integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz" @@ -1245,17 +1271,17 @@ escalade@^3.1.1: resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" - integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== - escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== -eslint-scope@5.1.1, eslint-scope@^5.1.1: +escape-string-regexp@^4.0.0, escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-scope@^5.1.1, eslint-scope@5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -1276,7 +1302,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.2.tgz" integrity sha512-8drBzUEyZ2llkpCA67iYrgEssKDUu68V8ChqqOfFupIaG/LCVPUT+CoGJpT77zJprs4T/W7p07LP7zAIMuweVw== -eslint@^8.41.0: +eslint@*, "eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", eslint@^8.41.0: version "8.46.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.46.0.tgz" integrity sha512-cIO74PvbW0qU8e0mIvk5IV3ToWdCq5FYG6gWPHHkx6gNdjlbAYvtfHmlCMXxjcoVaIdwy/IAt3+mDkZkfvb2Dg== @@ -1441,15 +1467,15 @@ find-cache-dir@^3.2.0: make-dir "^3.0.2" pkg-dir "^4.1.0" -find-up@5.0.0, find-up@^5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" - integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== dependencies: - locate-path "^6.0.0" + locate-path "^5.0.0" path-exists "^4.0.0" -find-up@^4.0.0, find-up@^4.1.0: +find-up@^4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -1457,6 +1483,14 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" +find-up@^5.0.0, find-up@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz" @@ -1529,9 +1563,9 @@ get-caller-file@^2.0.1, get-caller-file@^2.0.5: integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz" - integrity sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig== + version "2.0.2" + resolved "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz" + integrity sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ== get-package-type@^0.1.0: version "0.1.0" @@ -1545,7 +1579,14 @@ glob-parent@^5.1.2, glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" -glob-parent@^6.0.1, glob-parent@^6.0.2: +glob-parent@^6.0.1: + version "6.0.2" + resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob-parent@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz" integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== @@ -1557,18 +1598,6 @@ glob-to-regexp@^0.4.1: resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@7.2.0: - version "7.2.0" - resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - glob@^10.2.5: version "10.3.3" resolved "https://registry.npmjs.org/glob/-/glob-10.3.3.tgz" @@ -1580,7 +1609,19 @@ glob@^10.2.5: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" -glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: +glob@^7.1.3, glob@^7.1.6: + version "7.2.3" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.4: version "7.2.3" resolved "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -1603,6 +1644,18 @@ glob@^8.1.0: minimatch "^5.0.1" once "^1.3.0" +glob@7.2.0: + version "7.2.0" + resolved "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz" + integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" @@ -1694,7 +1747,7 @@ http-proxy-agent@^4.0.1: http@^0.0.1-security: version "0.0.1-security" - resolved "https://registry.yarnpkg.com/http/-/http-0.0.1-security.tgz#3aac09129d12dc2747bbce4157afde20ad1f7995" + resolved "https://registry.npmjs.org/http/-/http-0.0.1-security.tgz" integrity sha512-RnDvP10Ty9FxqOtPZuxtebw1j4L/WiqNMDtuc1YMH1XQm5TgDRaR1G9u8upL6KD1bXHSp9eSXo/ED+8Q7FAr+g== https-proxy-agent@^5.0.0: @@ -1749,7 +1802,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@~2.0.3: +inherits@~2.0.3, inherits@2: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -1930,13 +1983,6 @@ js-tokens@^4.0.0: resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@4.1.0, js-yaml@^4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" @@ -1945,6 +1991,13 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" +js-yaml@^4.1.0, js-yaml@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" @@ -2117,13 +2170,6 @@ mime-types@^2.1.27: dependencies: mime-db "1.52.0" -minimatch@5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== - dependencies: - brace-expansion "^2.0.1" - minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" @@ -2145,6 +2191,13 @@ minimatch@^9.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz" + integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== + dependencies: + brace-expansion "^2.0.1" + "minipass@^5.0.0 || ^6.0.2 || ^7.0.0": version "7.0.3" resolved "https://registry.npmjs.org/minipass/-/minipass-7.0.3.tgz" @@ -2526,7 +2579,14 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@^3.0.0: + version "3.0.2" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== @@ -2576,7 +2636,17 @@ schema-utils@^4.0.0: ajv-formats "^2.1.1" ajv-keywords "^5.1.0" -semver@^6.0.0, semver@^6.3.0, semver@^6.3.1: +semver@^6.0.0: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^6.3.0: + version "6.3.1" + resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" + integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== + +semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -2588,7 +2658,7 @@ semver@^7.3.4, semver@^7.3.7, semver@^7.5.2, semver@^7.5.3: dependencies: lru-cache "^6.0.0" -serialize-javascript@6.0.0, serialize-javascript@^6.0.0: +serialize-javascript@^6.0.0, serialize-javascript@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz" integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== @@ -2681,8 +2751,23 @@ sprintf-js@~1.0.2: resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== -"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0: - name string-width-cjs +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +string-width@^4.1.0, string-width@^4.2.0: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -2700,15 +2785,14 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: - safe-buffer "~5.1.0" + ansi-regex "^5.0.1" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: - name strip-ansi-cjs +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -2727,18 +2811,11 @@ strip-bom@^4.0.0: resolved "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== -strip-json-comments@3.1.1, strip-json-comments@^3.1.1: +strip-json-comments@^3.1.1, strip-json-comments@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -supports-color@8.1.1, supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - supports-color@^5.3.0: version "5.5.0" resolved "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz" @@ -2753,6 +2830,13 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.0.0, supports-color@8.1.1: + version "8.1.1" + resolved "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz" @@ -2880,11 +2964,16 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^5.1.3: +typescript@*, typescript@^5.1.3, typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta": version "5.1.6" resolved "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz" integrity sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA== +undici-types@~5.26.4: + version "5.26.5" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz" + integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== + update-browserslist-db@^1.0.11: version "1.0.11" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz" @@ -2910,6 +2999,11 @@ uuid@^8.3.2: resolved "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + v8-compile-cache-lib@^3.0.1: version "3.0.1" resolved "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz" @@ -2928,7 +3022,7 @@ web-streams-polyfill@^3.0.3: resolved "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.2.1.tgz" integrity sha512-e0MO3wdXWKrLbL0DgGnUV7WHVuw9OUvL4hjgnPkIeEvESk74gAITi5G606JtZPp39cd8HA9VQzCIvA49LpPN5Q== -webpack-cli@^5.1.4: +webpack-cli@^5.1.4, webpack-cli@5.x.x: version "5.1.4" resolved "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz" integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== @@ -2960,7 +3054,7 @@ webpack-sources@^3.2.3: resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.88.2: +webpack@^5.0.0, webpack@^5.1.0, webpack@^5.88.2, webpack@5.x.x: version "5.88.2" resolved "https://registry.npmjs.org/webpack/-/webpack-5.88.2.tgz" integrity sha512-JmcgNZ1iKj+aiR0OvTYtWQqJwq37Pf683dY9bVORwVbUrDhLhdn/PlO2sHsFHPkj7sHNQF3JwaAkp49V+Sq1tQ== @@ -3012,8 +3106,7 @@ workerpool@6.2.1: resolved "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz" integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: - name wrap-ansi-cjs +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -3031,6 +3124,15 @@ wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^7.0.0: + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -3080,11 +3182,6 @@ yallist@^4.0.0: resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== - yargs-parser@^18.1.2: version "18.1.3" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz" @@ -3098,6 +3195,11 @@ yargs-parser@^20.2.2: resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== + yargs-unparser@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz" @@ -3108,19 +3210,6 @@ yargs-unparser@2.0.0: flat "^5.0.2" is-plain-obj "^2.1.0" -yargs@16.2.0: - version "16.2.0" - resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" - integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.0" - y18n "^5.0.5" - yargs-parser "^20.2.2" - yargs@^15.0.2: version "15.4.1" resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz" @@ -3138,6 +3227,19 @@ yargs@^15.0.2: y18n "^4.0.0" yargs-parser "^18.1.2" +yargs@16.2.0: + version "16.2.0" + resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" + integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== + dependencies: + cliui "^7.0.2" + escalade "^3.1.1" + get-caller-file "^2.0.5" + require-directory "^2.1.1" + string-width "^4.2.0" + y18n "^5.0.5" + yargs-parser "^20.2.2" + yn@3.1.1: version "3.1.1" resolved "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz" diff --git a/webview/src/ components/chatContainer.tsx b/webview/src/ components/chatContainer.tsx index c102622..8c62ffe 100644 --- a/webview/src/ components/chatContainer.tsx +++ b/webview/src/ components/chatContainer.tsx @@ -2,7 +2,7 @@ import React, { useRef, useState } from 'react'; import ChatStream from './chatStream'; -import { promptLLM } from './httpClient'; +import { promptLLM, saveChat } from './vsceClient'; import { Message } from '../../wasm/neatcoderInterface'; import QuillEditor from './reactQuill'; import SendButton from './sendButton'; @@ -21,7 +21,7 @@ const ChatContainer: React.FC = () => { return; } - const newMessages = [...messages, { user: 'user', ts: "todo", payload: { content: text, role: "user" } }]; + const newMessages = [...messages, { user: 'user', ts: new Date(), payload: { content: text, role: "user" } }]; // Add user's message to the chat stream setMessages(newMessages); @@ -39,7 +39,7 @@ const ChatContainer: React.FC = () => { if (token) { try { if (tokenCount === 0) { - setMessages((prevMessages) => [...prevMessages, { user: 'assistant', ts: "todo", payload: { content: token, role: "assistant" } }]); + setMessages((prevMessages) => [...prevMessages, { user: 'assistant', ts: new Date(), payload: { content: token, role: "assistant" } }]); tokenCount += 1; } else { setMessages((prevMessages) => { @@ -55,8 +55,10 @@ const ChatContainer: React.FC = () => { } if (done) { + saveChat(newMessages); setIsStreaming(false); // End streaming tokenCount += 0; + // Make call to VSCE to store the latest chat state break }; } diff --git a/webview/src/ components/httpClient.tsx b/webview/src/ components/vsceClient.tsx similarity index 86% rename from webview/src/ components/httpClient.tsx rename to webview/src/ components/vsceClient.tsx index a0aa54f..4c75307 100644 --- a/webview/src/ components/httpClient.tsx +++ b/webview/src/ components/vsceClient.tsx @@ -29,3 +29,10 @@ export function promptLLM(msgs: Array, stream: boolean): ReadableStream return readable; } + +export function saveChat(msgs: Array) { + vscode.postMessage({ + command: 'saveChat', + msgs: msgs, + }); +} diff --git a/webview/wasm/neatcoderInterface.d.ts b/webview/wasm/neatcoderInterface.d.ts index a52738f..e4df4b2 100644 --- a/webview/wasm/neatcoderInterface.d.ts +++ b/webview/wasm/neatcoderInterface.d.ts @@ -20,9 +20,6 @@ export interface Chat { title: string; } -export interface Chats { -} - export interface CodeGenParams { filename: string; } @@ -55,14 +52,13 @@ export interface Language { export interface Message { payload: OpenAIMsg; - ts: string; + ts: Date; user: string; } export interface Model { id: string; interface: string; - model: string; uri: string; }