From b12ebe3ffa3329ed69a8c2c944342264c41e3a10 Mon Sep 17 00:00:00 2001 From: VarunJoshi10 Date: Wed, 28 Feb 2024 12:00:49 +0530 Subject: [PATCH] added model code --- package.json | 4 +- src/common/App.tsx | 61 ++++-- src/helpers/determineNextAction.ts | 51 ++--- src/manifest.json | 8 + src/pages/Popup/FormComponent.tsx | 41 ++++ src/pages/Popup/src/index.ts | 113 +++++++++++ src/pages/Popup/views/index.handlebars | 0 .../Popup/views/oauthCallback.handlebars | 11 + yarn.lock | 188 +++++++++++++++++- 9 files changed, 421 insertions(+), 56 deletions(-) create mode 100644 src/pages/Popup/FormComponent.tsx create mode 100644 src/pages/Popup/src/index.ts create mode 100644 src/pages/Popup/views/index.handlebars create mode 100644 src/pages/Popup/views/oauthCallback.handlebars diff --git a/package.json b/package.json index 0bb04b5..d1e6a6b 100755 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "autosurf-ai-browser-extension", "version": "1.1.0", "description": "Web agent to do your bidding online", - "scripts": { "build": "node utils/build.js", "start": "node utils/webserver.js", @@ -13,6 +12,8 @@ "dependencies": { "@chakra-ui/icons": "^2.0.16", "@chakra-ui/react": "^2.4.8", + "@cubist-labs/cubesigner-sdk": "^0.3.25", + "@cubist-labs/cubesigner-sdk-fs-storage": "^0.3.25", "@emotion/react": "^11.10.5", "@emotion/styled": "^11.10.5", "@mozilla/readability": "^0.4.2", @@ -21,6 +22,7 @@ "babel-jest": "^29.5.0", "dotenv-webpack": "^8.0.1", "eslint-plugin-unused-imports": "^2.0.0", + "express-handlebars": "^7.1.2", "framer-motion": "^8.4.3", "immer": "^9.0.21", "lodash": "^4.17.21", diff --git a/src/common/App.tsx b/src/common/App.tsx index 16c7005..9c448b6 100644 --- a/src/common/App.tsx +++ b/src/common/App.tsx @@ -1,39 +1,60 @@ +import React, { useState } from 'react'; import { Box, ChakraProvider, Heading, HStack } from '@chakra-ui/react'; -import React from 'react'; import { useAppState } from '../state/store'; import ModelDropdown from './ModelDropdown'; import SetAPIKey from './SetAPIKey'; import TaskUI from './TaskUI'; import OptionsDropdown from './OptionsDropdown'; import logo from '../assets/img/icon-128.png'; +import FormComponent from '../pages/Popup/FormComponent'; // Import the FormComponent -const App = () => { +const App: React.FC = () => { const openAIKey = useAppState((state) => state.settings.openAIKey); + const [formSubmitted, setFormSubmitted] = useState(false); + + const handleFormSubmit = () => { + setFormSubmitted(true); + }; return ( - - logo - - - Autosurf - - - - - - - {openAIKey ? : } + {/* {formSubmitted ? ( + + ) : ( + + )} */} + ); }; +const AppUI: React.FC = () => { + const openAIKey = useAppState((state) => state.settings.openAIKey); + + return ( + <> + + logo + + + Autosurf + + + + + + + {openAIKey ? : } + + ); +}; + export default App; diff --git a/src/helpers/determineNextAction.ts b/src/helpers/determineNextAction.ts index 21b07af..7bdd744 100644 --- a/src/helpers/determineNextAction.ts +++ b/src/helpers/determineNextAction.ts @@ -1,8 +1,3 @@ -import { - Configuration, - CreateCompletionResponseUsage, - OpenAIApi, -} from 'openai'; import { useAppState } from '../state/store'; import { availableActions } from './availableActions'; import { ParsedResponseSuccess } from './parseResponse'; @@ -42,17 +37,8 @@ export async function determineNextAction( ) { const model = useAppState.getState().settings.selectedModel; const prompt = formatPrompt(taskInstructions, previousActions, simplifiedDOM); - const key = useAppState.getState().settings.openAIKey; - if (!key) { - notifyError?.('No OpenAI key found'); - return null; - } - const openai = new OpenAIApi( - new Configuration({ - apiKey: key, - }) - ); + const apiEndpoint = 'https://leo.tektorch.info/chat/completions'; // Replace with your own API endpoint const maxSystemMessageLength = 3000; // Choose a reasonable length for the system message const truncatedSystemMessage = systemMessage.substring(0, maxSystemMessageLength); @@ -61,30 +47,33 @@ export async function determineNextAction( try { const messages = [ { - role: 'system', - content: truncatedSystemMessage, + role: "user", + content: prompt+" "+truncatedSystemMessage + } + ] + console.log(JSON.stringify({ messages })) + + const response = await fetch(apiEndpoint, { + method: 'POST', + headers: { + 'Content-Type': 'application/json', }, - { role: 'user', content: prompt }, - ]; + body: JSON.stringify({ messages }), + } + ); - const completion = await openai.createChatCompletion({ - model: model, - messages: messages, - max_tokens: 500, - temperature: 0, - stop: [''], - }); + const data = await response.json(); + console.log(data[0].content); return { - usage: completion.data.usage as CreateCompletionResponseUsage, + usage: data.usage, // Replace with your own API response format prompt, - response: - completion.data.choices[0].message?.content?.trim() + '', + response: data[0].content, // Replace with your own API response format }; } catch (error: any) { console.log('determineNextAction error', error); if (error.response.data.error.message.includes('server error')) { - // Problem with the OpenAI API, try again + // Problem with the API, try again if (notifyError) { notifyError(error.response.data.error.message); } @@ -131,4 +120,4 @@ Current time: ${new Date().toLocaleString()} Current page contents: ${pageContents}`; -} +} \ No newline at end of file diff --git a/src/manifest.json b/src/manifest.json index fa38e66..edc3834 100755 --- a/src/manifest.json +++ b/src/manifest.json @@ -13,6 +13,14 @@ "debugger", "management" ], + "host_permissions": [ + "https://accounts.google.com/", + "https://apis.google.com", + "https://www.gstatic.com", + "https://www.googleapis.com", + "https://securetoken.googleapis.com" + ], + "action": { "default_popup": "popup.html", "default_icon": "icon-34.png" diff --git a/src/pages/Popup/FormComponent.tsx b/src/pages/Popup/FormComponent.tsx new file mode 100644 index 0000000..d4793a1 --- /dev/null +++ b/src/pages/Popup/FormComponent.tsx @@ -0,0 +1,41 @@ +import React, { useEffect } from 'react'; + +interface FormComponentProps { + onFormSubmit: () => void; +} + +const FormComponent: React.FC = ({ onFormSubmit }) => { + useEffect(() => { + const handleSignInCompletion = (event: MessageEvent) => { + // Check if the message indicates sign-in completion + if (event.data === 'signInCompleted') { + // If sign-in completed, trigger the parent's callback + onFormSubmit(); + } + }; + + // Add event listener to listen for messages from the child window + window.addEventListener('message', handleSignInCompletion); + + // Load the specified URL in the child window + const childWindow = window.open('https://cubesigner-backend-production.up.railway.app/', '_blank'); + + return () => { + // Cleanup: remove event listener when the component unmounts + window.removeEventListener('message', handleSignInCompletion); + + // Close the child window if it exists + if (childWindow) { + childWindow.close(); + } + }; + }, [onFormSubmit]); + + return ( +
+ {/* This form will be hidden */} +
+ ); +}; + +export default FormComponent; diff --git a/src/pages/Popup/src/index.ts b/src/pages/Popup/src/index.ts new file mode 100644 index 0000000..8edd308 --- /dev/null +++ b/src/pages/Popup/src/index.ts @@ -0,0 +1,113 @@ +import * as cs from "@cubist-labs/cubesigner-sdk"; +import * as csFs from "@cubist-labs/cubesigner-sdk-fs-storage"; +import * as dotenv from "dotenv"; +import bodyParser from "body-parser"; +import express from "express"; +import { engine } from "express-handlebars"; +import assert from "assert"; + +dotenv.config(); + +const PORT = process.env["PORT"] ?? 3000; +const GOOGLE_CLIENT_ID = process.env["GOOGLE_CLIENT_ID"]; +const TWITTER_CLIENT_ID = process.env["TWITTER_CLIENT_ID"]; +const FACEBOOK_CLIENT_ID = process.env["FACEBOOK_CLIENT_ID"]; +const ORG_ID = process.env["ORG_ID"]!; +const API_ROOT = process.env["CS_API_ROOT"] ?? "https://gamma.signer.cubist.dev"; +const TWITTER_COOKIE_NAME = "twitterCookie"; + +const app = express(); + +app.engine("handlebars", engine()); +app.set("view engine", "handlebars"); +app.set("views", "./views"); + +app.use(express.static("public")); +app.use(bodyParser.urlencoded({ extended: true })); +app.use(express.json()); + +// Render landing page +app.get("/", (_, res) => { + res.render("index", { + googleClientId: GOOGLE_CLIENT_ID, + twitterClientId: TWITTER_CLIENT_ID, + twitterCookieName: TWITTER_COOKIE_NAME, + facebookClientId: FACEBOOK_CLIENT_ID, + orgId: ORG_ID, + apiRoot: API_ROOT, + port: PORT, + }); +}); + +app.use((req, res, next) => { + res.setHeader('Content-Security-Policy', "script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules' http://localhost:* http://127.0.0.1:* https://accounts.google.com;"); + next(); + }); + + +app.get("/oauthCallback", (_, res) => { + res.render("oauthCallback") +}); + +app.post("/createUser", async (req, res) => { + try { + // In practice we would require the OIDC token and validate it. + // For this demo we just trust the client. + const id = req.body; + console.log(`Creating user ${id.email} with iss=${id.iss} and sub=${id.sub}`); + await createUser(id); + res.contentType("application/json").status(200).send(); + } catch (e) { + console.error(`Failed to create user: ${e}`); + res.contentType("application/json").status(500).send(); + } +}); + +app.listen(PORT); +console.log(`Listening on http://localhost:${PORT}`); + +/** + * Create a user with the given OIDC claims. + * @param {cs.IdentityProof} proof The proof of identity + */ +async function createUser(proof: cs.IdentityProof) { + // Create a management session + console.log("Loading CubeSigner management session"); + console.log(`Using org ${ORG_ID}`); + + const cubesigner = await csFs.loadManagementSession(); + const org = new cs.Org(cubesigner); + + console.log("Verifying identity", proof); + try { + await org.verifyIdentity(proof); + console.log("Verified"); + } catch (e) { + console.log(`Not verified: ${e}`); + throw e; + } + + assert(proof.identity, "Identity should be set when proof is obtained using OIDC token"); + const iss = proof.identity!.iss; + const sub = proof.identity!.sub; + const email = proof.email; + const name = proof.preferred_username; + + // If user does not exist, create it + if (!proof.user_info?.user_id) { + console.log(`Creating OIDC user ${email}`); + const userId = await org.createOidcUser({ iss, sub }, email, { + name, + mfaPolicy: { + num_auth_factors: 1, + allowed_mfa_types: ["Fido"], + }, + }); + console.log(`Creating key for user ${userId}...`); + // Create a key for the OIDC user + const key = await org.createKey(cs.Secp256k1.Evm, userId); + console.log(`${await key.type()} key created ${key.materialId}`); + } else { + console.log(`User ${proof.user_info.user_id} already exists for ${email}`); + } +} \ No newline at end of file diff --git a/src/pages/Popup/views/index.handlebars b/src/pages/Popup/views/index.handlebars new file mode 100644 index 0000000..e69de29 diff --git a/src/pages/Popup/views/oauthCallback.handlebars b/src/pages/Popup/views/oauthCallback.handlebars new file mode 100644 index 0000000..c6805b6 --- /dev/null +++ b/src/pages/Popup/views/oauthCallback.handlebars @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 582bbc0..6004fc5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1958,6 +1958,20 @@ resolved "https://registry.yarnpkg.com/@chakra-ui/visually-hidden/-/visually-hidden-2.0.15.tgz#60df64e0ab97d95fee4e6c61ccabd15fd5ace398" integrity sha512-WWULIiucYRBIewHKFA7BssQ2ABLHLVd9lrUo3N3SZgR0u4ZRDDVEUNOy+r+9ruDze8+36dGbN9wsN1IdELtdOw== +"@cubist-labs/cubesigner-sdk-fs-storage@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@cubist-labs/cubesigner-sdk-fs-storage/-/cubesigner-sdk-fs-storage-0.3.25.tgz#0adee66e3b372cb42b3eb76389ee5a12a57f8a97" + integrity sha512-p058ygx8jQI3z3D4lgoA0gMO6Q8Kz1pOx8sMzg95jDCDEnHp4IyrNRfmml/AeEwqBYuILZUy7PoOhzwdF6C9Rg== + +"@cubist-labs/cubesigner-sdk@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@cubist-labs/cubesigner-sdk/-/cubesigner-sdk-0.3.25.tgz#3e0ea16add5946c0a42cb58e77d811d8b9e31d70" + integrity sha512-HUZuf/eTFPJ9PVnJ5NRGEaMjkvlSN4KclHzRtDDpPx49dpAKBvxXrlbycvAxZmXQXNuu9fGhWisSwaQ/JbiMYg== + dependencies: + openapi-fetch "0.6.1" + optionalDependencies: + "@hpke/core" "^1.2.7" + "@discoveryjs/json-ext@^0.5.0": version "0.5.7" resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" @@ -2132,6 +2146,11 @@ resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== +"@hpke/core@^1.2.7": + version "1.2.7" + resolved "https://registry.yarnpkg.com/@hpke/core/-/core-1.2.7.tgz#f2720099373df55e1dfbc61a45917d36fed57509" + integrity sha512-wEbNmyZ2qtFSNnnhkZV/vJi7BnMKYDjQNxiaktJP68rfVTVcgRnsO6o4+59kzX2OrgEbEKWSp7mNSUJeJU5ncQ== + "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" @@ -2151,6 +2170,18 @@ resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== +"@isaacs/cliui@^8.0.2": + version "8.0.2" + resolved "https://registry.yarnpkg.com/@isaacs/cliui/-/cliui-8.0.2.tgz#b37667b7bc181c168782259bab42474fbf52b550" + integrity sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA== + dependencies: + string-width "^5.1.2" + string-width-cjs "npm:string-width@^4.2.0" + strip-ansi "^7.0.1" + strip-ansi-cjs "npm:strip-ansi@^6.0.1" + wrap-ansi "^8.1.0" + wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" + "@istanbuljs/load-nyc-config@^1.0.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" @@ -2530,6 +2561,11 @@ mkdirp "^1.0.4" rimraf "^3.0.2" +"@pkgjs/parseargs@^0.11.0": + version "0.11.0" + resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" + integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== + "@popperjs/core@^2.9.3": version "2.11.6" resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.6.tgz#cee20bd55e68a1720bdab363ecf0c821ded4cd45" @@ -3403,6 +3439,11 @@ ansi-regex@^5.0.1: resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== +ansi-regex@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-6.0.1.tgz#3183e38fae9a65d7cb5e53945cd5897d0260a06a" + integrity sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -3422,6 +3463,11 @@ ansi-styles@^5.0.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== +ansi-styles@^6.1.0: + version "6.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.2.1.tgz#0e62320cf99c21afff3b3012192546aacbfb05c5" + integrity sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug== + anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.3" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" @@ -4242,7 +4288,7 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -4608,6 +4654,11 @@ dotenv@^8.2.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.6.0.tgz#061af664d19f7f4d8fc6e4ff9b584ce237adcb8b" integrity sha512-IrPdXQsk2BbzvCBGBOTmmSH5SodmqZNt4ERAZDmW4CT+tL8VtvinqywuANaFu4bOMWki16nqf0e4oC0QIaDr/g== +eastasianwidth@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" + integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== + ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" @@ -5141,6 +5192,15 @@ expect@^29.5.0: jest-message-util "^29.5.0" jest-util "^29.5.0" +express-handlebars@^7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/express-handlebars/-/express-handlebars-7.1.2.tgz#2471673d11af46f496cba4098a705f0217232fda" + integrity sha512-ss9d3mBChOLTEtyfzXCsxlItUxpgS3i4cb/F70G6Q5ohQzmD12XB4x/Y9U6YboeeYBJZt7WQ5yUNu7ZSQ/EGyQ== + dependencies: + glob "^10.3.3" + graceful-fs "^4.2.11" + handlebars "^4.7.8" + express@^4.17.3: version "4.18.2" resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" @@ -5354,6 +5414,14 @@ for-each@^0.3.3: dependencies: is-callable "^1.1.3" +foreground-child@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.1.1.tgz#1d173e776d75d2772fed08efe4a0de1ea1b12d0d" + integrity sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg== + dependencies: + cross-spawn "^7.0.0" + signal-exit "^4.0.1" + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -5534,6 +5602,17 @@ glob-to-regexp@^0.4.1: resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== +glob@^10.3.3: + version "10.3.10" + resolved "https://registry.yarnpkg.com/glob/-/glob-10.3.10.tgz#0351ebb809fd187fe421ab96af83d3a70715df4b" + integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== + dependencies: + foreground-child "^3.1.0" + jackspeak "^2.3.5" + minimatch "^9.0.1" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-scurry "^1.10.1" + glob@^7.0.0, glob@^7.0.3, glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -5640,6 +5719,11 @@ graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.2.11: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" @@ -5650,6 +5734,18 @@ handle-thing@^2.0.0: resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" integrity sha512-9Qn4yBxelxoh2Ow62nP+Ka/kMnOXRi8BXnRaUwezLNhqelnN49xKz4F/dPP8OYLxLxq6JDtZb2i9XznUQbNPTg== +handlebars@^4.7.8: + version "4.7.8" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" + integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== + dependencies: + minimist "^1.2.5" + neo-async "^2.6.2" + source-map "^0.6.1" + wordwrap "^1.0.0" + optionalDependencies: + uglify-js "^3.1.4" + hard-rejection@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/hard-rejection/-/hard-rejection-2.1.0.tgz#1c6eda5c1685c63942766d79bb40ae773cecd883" @@ -6371,6 +6467,15 @@ istanbul-reports@^3.1.3: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jackspeak@^2.3.5: + version "2.3.6" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-2.3.6.tgz#647ecc472238aee4b06ac0e461acc21a8c505ca8" + integrity sha512-N3yCS/NegsOBokc8GAdM8UcmfsKiSS8cipheD/nivzr700H+nsMOxJjQnvwOcRYVuFkdH0wGUvW2WbXGmrZGbQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + optionalDependencies: + "@pkgjs/parseargs" "^0.11.0" + jest-changed-files@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" @@ -7023,6 +7128,11 @@ lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.14.1.tgz#8da8d2f5f59827edb388e63e459ac23d6d408fea" integrity sha512-ysxwsnTKdAx96aTRdhDOCQfDgbHnt8SK0KY8SEjO0wHinhWOFTESbjVCMPbU1uGXg/ch4lifqx0wfjOawU2+WA== +"lru-cache@^9.1.1 || ^10.0.0": + version "10.2.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.2.0.tgz#0bd445ca57363465900f4d1f9bd8db343a4d95c3" + integrity sha512-2bIM8x+VAf6JT4bKAljS1qUWgMsqZRPGJS6FSahIMPVvctcNhyVp7AJu7quxOW9jwkryBReKZY5tY5JYv2n/7Q== + make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" @@ -7207,6 +7317,13 @@ minimatch@^5.0.1: dependencies: brace-expansion "^2.0.1" +minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.3.tgz#a6e00c3de44c3a542bfaae70abfc22420a6da825" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@~3.0.2: version "3.0.8" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" @@ -7228,6 +7345,11 @@ minimist@^1.2.0, minimist@^1.2.6: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== +minimist@^1.2.5: + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== + minipass-collect@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/minipass-collect/-/minipass-collect-1.0.2.tgz#22b813bf745dc6edba2576b940022ad6edc8c617" @@ -7292,6 +7414,11 @@ minipass@^4.0.0: dependencies: yallist "^4.0.0" +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0": + version "7.0.4" + resolved "https://registry.yarnpkg.com/minipass/-/minipass-7.0.4.tgz#dbce03740f50a4786ba994c1fb908844d27b038c" + integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== + minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" @@ -7608,6 +7735,11 @@ openai@^3.2.1: axios "^0.26.0" form-data "^4.0.0" +openapi-fetch@0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/openapi-fetch/-/openapi-fetch-0.6.1.tgz#90d785ead213b82beb8f094a756ad9320ba28b32" + integrity sha512-CGWPqqtL31uC2e4eEU9NHoqYMXnJ7Jk4H/4Yguil4tO22MIZi91hlQJ/51E8CiaKdSTODh03yF4ndjIOABVHUw== + optionator@^0.8.1: version "0.8.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495" @@ -7772,6 +7904,14 @@ path-parse@^1.0.7: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== +path-scurry@^1.10.1: + version "1.10.1" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" + integrity sha512-MkhCqzzBEpPvxxQ71Md0b1Kk51W01lrYvlMzSUaIzNsODdd7mqhiimSZlr+VegAz5Z6Vzt9Xg2ttE//XBhH3EQ== + dependencies: + lru-cache "^9.1.1 || ^10.0.0" + minipass "^5.0.0 || ^6.0.2 || ^7.0.0" + path-to-regexp@0.1.7: version "0.1.7" resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" @@ -8683,6 +8823,11 @@ signal-exit@^3.0.3, signal-exit@^3.0.7: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== +signal-exit@^4.0.1: + version "4.1.0" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-4.1.0.tgz#952188c1cbd546070e2dd20d0f41c0ae0530cb04" + integrity sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw== + sisteransi@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" @@ -8934,7 +9079,7 @@ string-natural-compare@^3.0.1: resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4" integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw== -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -8943,6 +9088,15 @@ string-natural-compare@^3.0.1: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" +string-width@^5.0.1, string-width@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794" + integrity sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA== + dependencies: + eastasianwidth "^0.2.0" + emoji-regex "^9.2.2" + strip-ansi "^7.0.1" + string.prototype.matchall@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.8.tgz#3bf85722021816dcd1bf38bb714915887ca79fd3" @@ -8989,13 +9143,20 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== dependencies: ansi-regex "^5.0.1" +strip-ansi@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45" + integrity sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ== + dependencies: + ansi-regex "^6.0.1" + strip-bom@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" @@ -9298,6 +9459,11 @@ typescript@^4.9.4: resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +uglify-js@^3.1.4: + version "3.17.4" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.17.4.tgz#61678cf5fa3f5b7eb789bb345df29afb8257c22c" + integrity sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g== + unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" @@ -9708,7 +9874,12 @@ word-wrap@^1.2.3, word-wrap@~1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== -wrap-ansi@^7.0.0: +wordwrap@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" + integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== + +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -9717,6 +9888,15 @@ wrap-ansi@^7.0.0: string-width "^4.1.0" strip-ansi "^6.0.0" +wrap-ansi@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" + integrity sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ== + dependencies: + ansi-styles "^6.1.0" + string-width "^5.0.1" + strip-ansi "^7.0.1" + wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"