diff --git a/.gitignore b/.gitignore index f1b638ff..18d1e427 100644 --- a/.gitignore +++ b/.gitignore @@ -34,4 +34,3 @@ src/tailwind.output.css *-checkpoint* back/ -ui/src/proto/* \ No newline at end of file diff --git a/apps/api/src/resolver_user.ts b/apps/api/src/resolver_user.ts index ad816e0c..d04be227 100644 --- a/apps/api/src/resolver_user.ts +++ b/apps/api/src/resolver_user.ts @@ -128,29 +128,6 @@ export function createUserResolver({ jwtSecret, googleClientId }) { }; } - async function updateCodeiumAPIKey(_, { apiKey }, { userId }) { - if (!userId) throw Error("Unauthenticated"); - let user = await prisma.user.findFirst({ - where: { - id: userId, - }, - }); - if (!user) throw Error("User not found."); - if (user.id !== userId) { - throw new Error("You do not have access to the user."); - } - // do the udpate - await prisma.user.update({ - where: { - id: userId, - }, - data: { - codeiumAPIKey: apiKey, - }, - }); - return true; - } - return { Query: { me, @@ -160,7 +137,6 @@ export function createUserResolver({ jwtSecret, googleClientId }) { loginWithGoogle, signup, updateUser, - updateCodeiumAPIKey, }, }; } diff --git a/apps/api/src/typedefs.ts b/apps/api/src/typedefs.ts index 7a698966..fdd6de67 100644 --- a/apps/api/src/typedefs.ts +++ b/apps/api/src/typedefs.ts @@ -12,7 +12,6 @@ export const typeDefs = gql` password: String! firstname: String! lastname: String! - codeiumAPIKey: String } type Repo { @@ -55,7 +54,5 @@ export const typeDefs = gql` deleteCollaborator(repoId: String!, collaboratorId: String!): Boolean star(repoId: ID!): Boolean unstar(repoId: ID!): Boolean - - updateCodeiumAPIKey(apiKey: String!): Boolean } `; diff --git a/apps/file-backend/src/server.ts b/apps/file-backend/src/server.ts index c34fc470..368d115e 100644 --- a/apps/file-backend/src/server.ts +++ b/apps/file-backend/src/server.ts @@ -13,7 +13,6 @@ export const typeDefs = gql` password: String! firstname: String! lastname: String! - codeiumAPIKey: String } type Repo { diff --git a/apps/ui/.gitignore b/apps/ui/.gitignore index 33a81d5e..a547bf36 100644 --- a/apps/ui/.gitignore +++ b/apps/ui/.gitignore @@ -1,5 +1,3 @@ -src/proto/* - # Logs logs *.log diff --git a/apps/ui/Dockerfile b/apps/ui/Dockerfile index 1850bac5..4605e553 100644 --- a/apps/ui/Dockerfile +++ b/apps/ui/Dockerfile @@ -9,7 +9,6 @@ RUN yarn install --frozen-lockfile COPY . . ENV NODE_OPTIONS="--max_old_space_size=4096" -RUN yarn run generate RUN yarn build FROM nginx:1.19-alpine AS server diff --git a/apps/ui/buf.gen.yaml b/apps/ui/buf.gen.yaml deleted file mode 100644 index 052a442a..00000000 --- a/apps/ui/buf.gen.yaml +++ /dev/null @@ -1,14 +0,0 @@ -# buf.gen.yaml defines a local generation template. -# For details, see https://docs.buf.build/configuration/v1/buf-gen-yaml -version: v1 -plugins: - - name: es - out: proto - opt: - - target=ts - - import_extension=none - - name: connect-es - out: proto - opt: - - target=ts - - import_extension=none diff --git a/apps/ui/buf.lock b/apps/ui/buf.lock deleted file mode 100644 index 8585935f..00000000 --- a/apps/ui/buf.lock +++ /dev/null @@ -1,8 +0,0 @@ -# Generated by buf. DO NOT EDIT. -version: v1 -deps: - - remote: buf.build - owner: envoyproxy - repository: protoc-gen-validate - commit: 6607b10f00ed4a3d98f906807131c44a - digest: shake256:acc7b2ededb2f88d296862943a003b157bdb68ec93ed13dcd8566b2d06e47993ea6daf12013b9655658aaf6bbdb141cf65bfe400ce2870f4654b0a5b45e57c09 diff --git a/apps/ui/buf.yaml b/apps/ui/buf.yaml deleted file mode 100644 index 0ffab535..00000000 --- a/apps/ui/buf.yaml +++ /dev/null @@ -1,15 +0,0 @@ -version: v1 -deps: - - buf.build/envoyproxy/protoc-gen-validate -build: - excludes: - - node_modules -lint: - use: - - DEFAULT - except: - - PACKAGE_VERSION_SUFFIX - allow_comment_ignores: true -breaking: - except: - - FILE_NO_DELETE diff --git a/apps/ui/exa/codeium_common_pb/codeium_common.proto b/apps/ui/exa/codeium_common_pb/codeium_common.proto deleted file mode 100644 index ef17d4b8..00000000 --- a/apps/ui/exa/codeium_common_pb/codeium_common.proto +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright Exafunction, Inc. - -syntax = "proto3"; - -package exa.codeium_common_pb; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/Exafunction/Exafunction/exa/codeium_common_pb"; - -// Next ID: 12, Previous field: entropy. -message Completion { - string completion_id = 1; - string text = 2; - string prefix = 3; - string stop = 4; - double score = 5; - repeated uint64 tokens = 6; - repeated string decoded_tokens = 7; - repeated double probabilities = 8; - repeated double adjusted_probabilities = 9; - uint64 generated_length = 10; -} - -// Authentication source for users on the cloud service. -enum AuthSource { - AUTH_SOURCE_CODEIUM = 0; -} - -// Next ID: 15, Previous field: url. -message Metadata { - string ide_name = 1 [(validate.rules).string.min_len = 1]; - string ide_version = 7 [(validate.rules).string.min_len = 1]; - string extension_name = 12; - string extension_version = 2 [(validate.rules).string.min_len = 1]; - string api_key = 3 [(validate.rules).string.uuid = true]; - // Regex derived from https://stackoverflow.com/a/48300605. - // TODO(prem): Should this be mandatory? - string locale = 4 [(validate.rules).string = { - ignore_empty: true, - pattern: "^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$" - }]; - // UID identifying a single session for the given user. - string session_id = 10; - - // Used purely in language server to cancel in flight requests. - // If request_id is 0, then the request is not cancelable. - // This should be a strictly monotonically increasing number - // for the duration of a session. - uint64 request_id = 9; - - // Browser-specific information. - string user_agent = 13; - string url = 14 [(validate.rules).string = { - ignore_empty: true, - uri: true - }]; - - // Authentication source information. - AuthSource auth_source = 15; -} - -// Next ID: 3, Previous field: insert_spaces. -message EditorOptions { - uint64 tab_size = 1 [(validate.rules).uint64.gt = 0]; - bool insert_spaces = 2; -} - -message Event { - EventType event_type = 1; - string event_json = 2; - int64 timestamp_unix_ms = 3; -} - -enum EventType { - EVENT_TYPE_UNSPECIFIED = 0; - EVENT_TYPE_ENABLE_CODEIUM = 1; - EVENT_TYPE_DISABLE_CODEIUM = 2; - EVENT_TYPE_SHOW_PREVIOUS_COMPLETION = 3; - EVENT_TYPE_SHOW_NEXT_COMPLETION = 4; -} - -enum CompletionSource { - COMPLETION_SOURCE_UNSPECIFIED = 0; - COMPLETION_SOURCE_TYPING_AS_SUGGESTED = 1; - COMPLETION_SOURCE_CACHE = 2; - COMPLETION_SOURCE_NETWORK = 3; -} - -// Every time this list is updated, we should be redeploying the API server -// since it uses the string representation for BQ. -enum Language { - LANGUAGE_UNSPECIFIED = 0; - LANGUAGE_C = 1; - LANGUAGE_CLOJURE = 2; - LANGUAGE_COFFEESCRIPT = 3; - LANGUAGE_CPP = 4; - LANGUAGE_CSHARP = 5; - LANGUAGE_CSS = 6; - LANGUAGE_CUDACPP = 7; - LANGUAGE_DOCKERFILE = 8; - LANGUAGE_GO = 9; - LANGUAGE_GROOVY = 10; - LANGUAGE_HANDLEBARS = 11; - LANGUAGE_HASKELL = 12; - LANGUAGE_HCL = 13; - LANGUAGE_HTML = 14; - LANGUAGE_INI = 15; - LANGUAGE_JAVA = 16; - LANGUAGE_JAVASCRIPT = 17; - LANGUAGE_JSON = 18; - LANGUAGE_JULIA = 19; - LANGUAGE_KOTLIN = 20; - LANGUAGE_LATEX = 21; - LANGUAGE_LESS = 22; - LANGUAGE_LUA = 23; - LANGUAGE_MAKEFILE = 24; - LANGUAGE_MARKDOWN = 25; - LANGUAGE_OBJECTIVEC = 26; - LANGUAGE_OBJECTIVECPP = 27; - LANGUAGE_PERL = 28; - LANGUAGE_PHP = 29; - LANGUAGE_PLAINTEXT = 30; - LANGUAGE_PROTOBUF = 31; - LANGUAGE_PBTXT = 32; - LANGUAGE_PYTHON = 33; - LANGUAGE_R = 34; - LANGUAGE_RUBY = 35; - LANGUAGE_RUST = 36; - LANGUAGE_SASS = 37; - LANGUAGE_SCALA = 38; - LANGUAGE_SCSS = 39; - LANGUAGE_SHELL = 40; - LANGUAGE_SQL = 41; - LANGUAGE_STARLARK = 42; - LANGUAGE_SWIFT = 43; - LANGUAGE_TSX = 44; - LANGUAGE_TYPESCRIPT = 45; - LANGUAGE_VISUALBASIC = 46; - LANGUAGE_VUE = 47; - LANGUAGE_XML = 48; - LANGUAGE_XSL = 49; - LANGUAGE_YAML = 50; - LANGUAGE_SVELTE = 51; - LANGUAGE_TOML = 52; - LANGUAGE_DART = 53; - LANGUAGE_RST = 54; - LANGUAGE_OCAML = 55; - LANGUAGE_CMAKE = 56; - LANGUAGE_PASCAL = 57; - LANGUAGE_ELIXIR = 58; - LANGUAGE_FSHARP = 59; - LANGUAGE_LISP = 60; - LANGUAGE_MATLAB = 61; - LANGUAGE_POWERSHELL = 62; - LANGUAGE_SOLIDITY = 63; - LANGUAGE_ADA = 64; - LANGUAGE_OCAML_INTERFACE = 65; -} diff --git a/apps/ui/exa/language_server_pb/language_server.proto b/apps/ui/exa/language_server_pb/language_server.proto deleted file mode 100644 index 6473ff4f..00000000 --- a/apps/ui/exa/language_server_pb/language_server.proto +++ /dev/null @@ -1,155 +0,0 @@ -// Copyright Exafunction, Inc. - -syntax = "proto3"; - -package exa.language_server_pb; - -import "exa/codeium_common_pb/codeium_common.proto"; -import "validate/validate.proto"; - -option go_package = "github.com/Exafunction/Exafunction/exa/language_server_pb"; - -service LanguageServerService { - rpc GetCompletions(GetCompletionsRequest) returns (GetCompletionsResponse) {} - rpc AcceptCompletion(AcceptCompletionRequest) returns (AcceptCompletionResponse) {} - rpc GetAuthToken(GetAuthTokenRequest) returns (GetAuthTokenResponse) {} -} - -// Next ID: 9, Previous field: disable_cache. -message GetCompletionsRequest { - codeium_common_pb.Metadata metadata = 1 [(validate.rules).message.required = true]; - Document document = 2 [(validate.rules).message.required = true]; - codeium_common_pb.EditorOptions editor_options = 3 [(validate.rules).message.required = true]; - repeated Document other_documents = 5; -} - -// Next ID: 5, Previous field: latency_info. -message GetCompletionsResponse { - State state = 1; - repeated CompletionItem completion_items = 2; -} - -// Next ID: 3, Previous field: completion_id. -message AcceptCompletionRequest { - codeium_common_pb.Metadata metadata = 1 [(validate.rules).message.required = true]; - string completion_id = 2; -} - -// Next ID: 1, Previous field: N/A. -message AcceptCompletionResponse {} - -// Next ID: 1, Previous field: N/A. -message GetAuthTokenRequest {} - -// Next ID: 3, Previous field: uuid. -message GetAuthTokenResponse { - string auth_token = 1; - string uuid = 2; -} - -/*****************************************************************************/ -/* Helper Messages */ -/*****************************************************************************/ - -message DocumentPosition { - // 0-indexed. Measured in UTF-8 bytes. - uint64 row = 1; - // 0-indexed. Measured in UTF-8 bytes. - uint64 col = 2; -} - -// Next ID: 9, Previous field: cursor_position. -message Document { - string absolute_path = 1; - // Path relative to the root of the workspace. - string relative_path = 2; - string text = 3; - // Language ID provided by the editor. - string editor_language = 4 [(validate.rules).string.min_len = 1]; - // Language enum standardized across editors. - codeium_common_pb.Language language = 5; - // Measured in number of UTF-8 bytes. - uint64 cursor_offset = 6; - // May be present instead of cursor_offset. - DocumentPosition cursor_position = 8; - // \n or \r\n, if known. - string line_ending = 7 [(validate.rules).string = { - in: [ - "", - "\n", - "\r\n" - ] - }]; -} - -enum CodeiumState { - CODEIUM_STATE_UNSPECIFIED = 0; - CODEIUM_STATE_INACTIVE = 1; - CODEIUM_STATE_PROCESSING = 2; - CODEIUM_STATE_SUCCESS = 3; - CODEIUM_STATE_WARNING = 4; - CODEIUM_STATE_ERROR = 5; -} - -// Next ID: 3, Previous field: message. -message State { - CodeiumState state = 1; - string message = 2; -} - -enum LineType { - LINE_TYPE_UNSPECIFIED = 0; - LINE_TYPE_SINGLE = 1; - LINE_TYPE_MULTI = 2; -} - -// Next ID: 5, Previous field: end_position. -message Range { - uint64 start_offset = 1; - uint64 end_offset = 2; - DocumentPosition start_position = 3; - DocumentPosition end_position = 4; -} - -message Suffix { - // Text to insert after the cursor when accepting the completion. - string text = 1; - // Cursor position delta (as signed offset) from the end of the inserted - // completion (including the suffix). - int64 delta_cursor_offset = 2; -} - -enum CompletionPartType { - COMPLETION_PART_TYPE_UNSPECIFIED = 0; - // Single-line completion parts that appear within an existing line of text. - COMPLETION_PART_TYPE_INLINE = 1; - // Possibly multi-line completion parts that appear below an existing line of text. - COMPLETION_PART_TYPE_BLOCK = 2; - // Like COMPLETION_PART_TYPE_INLINE, but overwrites the existing text. - COMPLETION_PART_TYPE_INLINE_MASK = 3; -} - -// Represents a contiguous part of the completion text that is not -// already in the document. -// Next ID: 4, Previous field: prefix. -message CompletionPart { - string text = 1; - // Offset in the original document where the part starts. For block - // parts, this is always the end of the line before the block. - uint64 offset = 2; - CompletionPartType type = 3; - // The section of the original line that came before this part. Only valid for - // COMPLETION_PART_TYPE_INLINE. - string prefix = 4; - // In the case of COMPLETION_PART_TYPE_BLOCK, represents the line it is below. - uint64 line = 5; -} - -// Next ID: 9, Previous field: completion_parts. -message CompletionItem { - codeium_common_pb.Completion completion = 1; - Suffix suffix = 5; - Range range = 2; - codeium_common_pb.CompletionSource source = 3; - repeated CompletionPart completion_parts = 8; -} diff --git a/apps/ui/package.json b/apps/ui/package.json index 14490539..526b372b 100644 --- a/apps/ui/package.json +++ b/apps/ui/package.json @@ -5,7 +5,6 @@ "type": "module", "main": "src/index.tsx", "scripts": { - "generate": "chmod 777 -R /root && rm -rf ./src/proto && npx buf generate --output ./src/", "dev": "vite --host", "build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", @@ -14,12 +13,6 @@ "dependencies": { "@apollo/client": "^3.8.1", "@benrbray/prosemirror-math": "^0.2.2", - "@bufbuild/buf": "^1.26.1", - "@bufbuild/connect": "^0.9.1", - "@bufbuild/connect-web": "^0.9.1", - "@bufbuild/protobuf": "^1.2.1", - "@bufbuild/protoc-gen-connect-es": "^0.13.0", - "@bufbuild/protoc-gen-es": "^1.3.0", "@emotion/react": "^11.11.1", "@emotion/styled": "^11.11.0", "@mui/icons-material": "^5.10.9", diff --git a/apps/ui/src/components/MyMonaco.tsx b/apps/ui/src/components/MyMonaco.tsx index 6c41e202..df2f171c 100644 --- a/apps/ui/src/components/MyMonaco.tsx +++ b/apps/ui/src/components/MyMonaco.tsx @@ -30,8 +30,6 @@ monaco.languages.setLanguageConfiguration("julia", { }, }); -console.log("monaco", monaco); -console.log("languages", monaco.languages.registerInlineCompletionsProvider); function construct_indent(pos, indent) { return [ { @@ -508,7 +506,6 @@ export const MyMonaco = memo(function MyMonaco({ // }); // bind it to the ytext with pod id - // if (monaco.languages.registerInlineCompletionsProvider) if (!codeMap.has(id)) { codeMap.set(id, new Y.Text()); } diff --git a/apps/ui/src/components/SettingDialog.tsx b/apps/ui/src/components/SettingDialog.tsx deleted file mode 100755 index 9c129536..00000000 --- a/apps/ui/src/components/SettingDialog.tsx +++ /dev/null @@ -1,210 +0,0 @@ -import React, { useEffect, useContext, useState, useRef } from "react"; -import DialogTitle from "@mui/material/DialogTitle"; -import Dialog from "@mui/material/Dialog"; -import DialogActions from "@mui/material/DialogActions"; -import DialogContent from "@mui/material/DialogContent"; -import DialogContentText from "@mui/material/DialogContentText"; -import FormGroup from "@mui/material/FormGroup"; -import FormControlLabel from "@mui/material/FormControlLabel"; -import TextField from "@mui/material/TextField"; -import Switch from "@mui/material/Switch"; -import InputAdornment from "@mui/material/InputAdornment"; -import Chip from "@mui/material/Chip"; -import { useStore } from "zustand"; -import { RepoContext } from "../lib/store"; -import { Link, Stack } from "@mui/material"; -import LaunchIcon from "@mui/icons-material/Launch"; -import { gql, useApolloClient, useMutation } from "@apollo/client"; -import Button from "@mui/material/Button"; -import DoneIcon from "@mui/icons-material/Done"; -import CloseIcon from "@mui/icons-material/Close"; -import Snackbar from "@mui/material/Snackbar"; -import Alert, { AlertColor } from "@mui/material/Alert"; -import { openTokenPage, registerUser } from "../lib/monacoCompletionProvider"; - -interface SettingDiagProps { - open: boolean; -} - -export function SettingDialog({ open = false }: SettingDiagProps) { - const store = useContext(RepoContext); - if (!store) throw new Error("Missing BearContext.Provider in the tree"); - const setSettingOpen = useStore(store, (state) => state.setSettingOpen); - const apiKey = useStore(store, (state) => state.user.codeiumAPIKey); - const user = useStore(store, (state) => state.user); - const isCustomToken = useStore(store, (state) => state.isCustomToken); - const setIsCustomToken = useStore(store, (state) => state.setIsCustomToken); - const client = useApolloClient(); - const inputRef = useRef(null); - const [infoShow, setInfoShow] = useState(false); - const [status, setStatus] = useState<"success" | "error" | "warning">( - "success" - ); - const [message, setMessage] = useState(""); - - const onAlertClose = ( - event: React.SyntheticEvent | Event, - reason?: string - ) => { - if (reason === "clickaway") { - return; - } - setInfoShow(false); - }; - - const [updateCodeiumAPIKey, { data, error }] = useMutation(gql` - mutation updateCodeiumAPIKey($apiKey: String!) { - updateCodeiumAPIKey(apiKey: $apiKey) - } - `); - - useEffect(() => { - if (data?.updateCodeiumAPIKey) { - setStatus("success"); - setMessage(`${user.name}, welcome. Token updated`); - setInfoShow(true); - } - if (error) { - setStatus("error"); - setMessage(error.message || "Unknown error"); - setInfoShow(true); - } - }, [data, error]); - - const updateToken = async () => { - const token = inputRef.current?.value.trim(); - if (!token) { - setStatus("error"); - setMessage("Token cannot be empty"); - setInfoShow(true); - return; - } - try { - const { api_key, name, error } = await registerUser(token); - if (api_key === "" || api_key === undefined || error) { - throw new Error( - error - ? `Error code: ${error}. Check your token or network` - : "Unknown error" - ); - } - updateCodeiumAPIKey({ - variables: { apiKey: api_key }, - refetchQueries: ["Me"], - }); - } catch (e) { - setStatus("error"); - setMessage((e as Error).message || "Unknown error"); - setInfoShow(true); - return; - } - }; - - return ( - - Auto Completion - - - The AI code auto completion is powered by{" "} - - Codeium{" "} - - {" "} - You can also use your own token instead of our default API keys, which - records your own activities of using Codeium. - - - - {apiKey ? ( - } - sx={{ marginTop: 1 }} - /> - ) : ( - } - sx={{ marginTop: 1 }} - /> - )} - - {apiKey && ( - - )} - - - - - setIsCustomToken(e.target.checked)} - /> - } - label="Use my own token" - /> - - {isCustomToken && ( - - - - ), - }} - /> - )} - - - - {message} - - - - - - - - ); -} diff --git a/apps/ui/src/components/Sidebar.tsx b/apps/ui/src/components/Sidebar.tsx index 091eccd9..a6e91600 100644 --- a/apps/ui/src/components/Sidebar.tsx +++ b/apps/ui/src/components/Sidebar.tsx @@ -20,7 +20,6 @@ import ListItemButton from "@mui/material/ListItemButton"; import ChevronLeftIcon from "@mui/icons-material/ChevronLeft"; import ChevronRightIcon from "@mui/icons-material/ChevronRight"; import RestartAltIcon from "@mui/icons-material/RestartAlt"; -import HelpOutlineOutlinedIcon from "@mui/icons-material/HelpOutlineOutlined"; import Typography from "@mui/material/Typography"; import TreeView from "@mui/lab/TreeView"; import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; @@ -54,21 +53,9 @@ import { Menu, } from "@mui/material"; import { getUpTime, myNanoId } from "../lib/utils/utils"; -import { registerCompletion } from "../lib/monacoCompletionProvider"; -import { SettingDialog } from "./SettingDialog"; import { toSvg } from "html-to-image"; import { match } from "ts-pattern"; -const defaultAPIKey = import.meta.env.VITE_APP_CODEIUM_API_KEY; - -function Flex(props) { - return ( - - {props.children} - - ); -} - function SidebarSettings() { const store = useContext(RepoContext); if (!store) throw new Error("Missing BearContext.Provider in the tree"); @@ -86,24 +73,12 @@ function SidebarSettings() { store, (state) => state.setShowLineNumbers ); - const isGuest = useStore(store, (state) => state.role === "GUEST"); const autoRunLayout = useStore(store, (state) => state.autoRunLayout); const setAutoRunLayout = useStore(store, (state) => state.setAutoRunLayout); const contextualZoom = useStore(store, (state) => state.contextualZoom); const setContextualZoom = useStore(store, (state) => state.setContextualZoom); - const autoCompletion = useStore( - store, - (state) => !isGuest && state.autoCompletion - ); - const setAutoCompletion = useStore(store, (state) => state.setAutoCompletion); const autoLayoutROOT = useStore(store, (state) => state.autoLayoutROOT); - const apiKey = useStore(store, (state) => - state.isCustomToken - ? state.user.codeiumAPIKey ?? defaultAPIKey - : defaultAPIKey - ); - const setSettingOpen = useStore(store, (state) => state.setSettingOpen); const contextualZoomParams = useStore( store, @@ -117,14 +92,6 @@ function SidebarSettings() { store, (state) => state.restoreParamsDefault ); - useEffect(() => { - if (autoCompletion && apiKey) { - const dispose = registerCompletion(apiKey); - if (dispose !== null) { - return dispose; - } - } - }, [autoCompletion, apiKey]); return ( @@ -480,50 +447,6 @@ function SidebarSettings() { /> - - - ) => { - if (apiKey) { - setAutoCompletion(event.target.checked); - } else { - setSettingOpen(true); - } - }} - /> - } - label={ - <> - Auto Completion - - - setSettingOpen(true)} - disabled={isGuest} - > - - - - - - } - disabled={isGuest} - /> - - = ({ const store = useContext(RepoContext); if (!store) throw new Error("Missing BearContext.Provider in the tree"); const isGuest = useStore(store, (state) => state.role === "GUEST"); - const settingOpen = useStore(store, (state) => state.settingOpen); return ( <> @@ -1111,8 +1033,6 @@ export const Sidebar: React.FC = ({ - - {settingOpen && } ); }; diff --git a/apps/ui/src/lib/auth.tsx b/apps/ui/src/lib/auth.tsx index 12554e32..dbd534a5 100644 --- a/apps/ui/src/lib/auth.tsx +++ b/apps/ui/src/lib/auth.tsx @@ -195,7 +195,6 @@ const PROFILE_QUERY = gql` lastname email id - codeiumAPIKey } } `; diff --git a/apps/ui/src/lib/codeiumClient.ts b/apps/ui/src/lib/codeiumClient.ts deleted file mode 100644 index 26e50862..00000000 --- a/apps/ui/src/lib/codeiumClient.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { - Code, - ConnectError, - PromiseClient, - createPromiseClient, -} from "@bufbuild/connect"; -import { createConnectTransport } from "@bufbuild/connect-web"; -import { PartialMessage } from "@bufbuild/protobuf"; -import { v4 as uuidv4 } from "uuid"; -import { Metadata } from "../proto/exa/codeium_common_pb/codeium_common_pb"; -import { LanguageServerService } from "../proto/exa/language_server_pb/language_server_connect"; -import { - AcceptCompletionRequest, - GetCompletionsRequest, - GetCompletionsResponse, -} from "../proto/exa/language_server_pb/language_server_pb"; - -const EXTENSION_NAME = "chrome"; -const EXTENSION_VERSION = "1.2.18"; -const BASE_URL = "https://server.codeium.com"; - -function languageServerClient(): PromiseClient { - const transport = createConnectTransport({ - baseUrl: BASE_URL, - useBinaryFormat: true, - }); - return createPromiseClient(LanguageServerService, transport); -} - -export interface IdeInfo { - ideName: string; - ideVersion: string; -} - -export class LanguageServerClient { - private requestId = 0; - private sessionId = uuidv4(); - - client: PromiseClient = languageServerClient(); - apiKey: string; - - private abortController?: AbortController; - - constructor(apiKey: string) { - this.apiKey = apiKey; - } - - getHeaders(apiKey: string | undefined): Record { - if (apiKey === undefined) { - return {}; - } - const Authorization = `Basic ${apiKey}-${this.sessionId}`; - return { Authorization }; - } - - async getCompletions( - request: GetCompletionsRequest - ): Promise { - this.abortController?.abort(); - this.abortController = new AbortController(); - const signal = this.abortController.signal; - try { - const getCompletionsPromise = this.client.getCompletions(request, { - signal, - headers: this.getHeaders(request.metadata?.apiKey), - }); - return await getCompletionsPromise; - } catch (err) { - if (signal.aborted) { - return; - } - console.log(err); - return; - } - } - - getMetadata(ideInfo: IdeInfo, apiKey: string): Metadata { - return new Metadata({ - ideName: ideInfo.ideName, - ideVersion: ideInfo.ideVersion, - extensionName: EXTENSION_NAME, - extensionVersion: EXTENSION_VERSION, - apiKey, - locale: navigator.language, - sessionId: this.sessionId, - requestId: BigInt(++this.requestId), - userAgent: navigator.userAgent, - url: window.location.href, - }); - } - - async acceptedLastCompletion( - // acceptCompletionRequest: PartialMessage - ideInfo: IdeInfo, - apiKey: string, - completionId: string - ): Promise { - try { - const request = new AcceptCompletionRequest({ - metadata: this.getMetadata(ideInfo, apiKey), - completionId, - }); - await this.client.acceptCompletion(request, { - headers: this.getHeaders(request.metadata?.apiKey), - }); - } catch (err) { - console.log((err as Error).message); - } - } -} diff --git a/apps/ui/src/lib/monacoCompletionProvider.ts b/apps/ui/src/lib/monacoCompletionProvider.ts deleted file mode 100755 index 14cc79b9..00000000 --- a/apps/ui/src/lib/monacoCompletionProvider.ts +++ /dev/null @@ -1,266 +0,0 @@ -import { monaco } from "react-monaco-editor"; -import { v4 as uuidv4 } from "uuid"; -import { LanguageServerClient } from "./codeiumClient"; -import { - numUtf8BytesToNumCodeUnits, - TextAndOffsets, - computeTextAndOffsets, -} from "./notebook"; -import { - CompletionItem, - GetCompletionsRequest, -} from "../proto/exa/language_server_pb/language_server_pb"; -import { Language } from "../proto/exa/codeium_common_pb/codeium_common_pb"; - -class MonacoRange { - startLineNumber: number; - startColumn: number; - endLineNumber: number; - endColumn: number; - - constructor(start: monaco.IPosition, end: monaco.IPosition) { - this.startLineNumber = start.lineNumber; - this.startColumn = start.column; - this.endLineNumber = end.lineNumber; - this.endColumn = end.column; - } -} - -function getValueAndStartOffset(model: monaco.editor.ITextModel | string): { - value: string; - utf16Offset: number; -} { - const originalValue = typeof model === "string" ? model : model.getValue(); - return { value: originalValue, utf16Offset: 0 }; -} - -function createInlineCompletionItem( - completionItem: CompletionItem, - document: monaco.editor.ITextModel, - additionalUtf8ByteOffset: number, - apiKey: string, - editor?: monaco.editor.ICodeEditor -): monaco.languages.InlineCompletion | undefined { - if (!completionItem.completion || !completionItem.range) { - return undefined; - } - - // Create and return inlineCompletionItem. - const { value: text, utf16Offset } = getValueAndStartOffset(document); - const startPosition = document.getPositionAt( - utf16Offset + - numUtf8BytesToNumCodeUnits( - text, - Number(completionItem.range.startOffset) - additionalUtf8ByteOffset - ) - ); - const endPosition = document.getPositionAt( - utf16Offset + - numUtf8BytesToNumCodeUnits( - text, - Number(completionItem.range.endOffset) - additionalUtf8ByteOffset - ) - ); - const range = new MonacoRange(startPosition, endPosition); - let completionText = completionItem.completion.text; - let callback: (() => void) | undefined = undefined; - if ( - editor && - completionItem.suffix && - completionItem.suffix.text.length > 0 - ) { - // Add suffix to the completion text. - completionText += completionItem.suffix.text; - // Create callback to move cursor after accept. - // Note that this is a hack to get around Monaco's API limitations. - // There's no need to convert to code units since we only use simple characters. - const deltaCursorOffset = Number(completionItem.suffix.deltaCursorOffset); - callback = () => { - const selection = editor.getSelection(); - if (selection === null) { - console.warn("Unexpected, no selection"); - return; - } - const newPosition = document.getPositionAt( - document.getOffsetAt(selection.getPosition()) + deltaCursorOffset - ); - editor.setSelection(new MonacoRange(newPosition, newPosition)); - }; - } - - const inlineCompletionItem: monaco.languages.InlineCompletion = { - insertText: completionText, - range, - command: { - id: "codeium.acceptCompletion", - title: "Accept Completion", - arguments: [apiKey, completionItem.completion.completionId, callback], - }, - }; - return inlineCompletionItem; -} - -export class MonacoCompletionProvider - implements monaco.languages.InlineCompletionsProvider -{ - modelUriToEditor = new Map(); - client: LanguageServerClient; - constructor(readonly apiKey: string) { - this.client = new LanguageServerClient(apiKey); - } - - private ideinfo = { - ideName: "monaco", - ideVersion: `unknown-${window.location.hostname}`, - }; - - private absolutePath(model: monaco.editor.ITextModel): string | undefined { - // Given we are using path, note the docs on fsPath: https://microsoft.github.io/monaco-editor/api/classes/monaco.Uri.html#fsPath - return model.uri.path; - // TODO(prem): Adopt some site-specific convention. - } - - private computeTextAndOffsets( - model: monaco.editor.ITextModel, - position: monaco.Position - ): TextAndOffsets { - return computeTextAndOffsets({ - textModels: [model], - currentTextModel: model, - utf16CodeUnitOffset: - model.getOffsetAt(position) - getValueAndStartOffset(model).utf16Offset, - getText: (model) => getValueAndStartOffset(model).value, - getLanguage: (model) => Language.PYTHON, - }); - } - - async provideInlineCompletions( - model: monaco.editor.ITextModel, - position: monaco.Position - ): Promise { - const apiKey = this.apiKey; - if (apiKey === undefined) { - return; - } - - const { text, utf8ByteOffset, additionalUtf8ByteOffset } = - this.computeTextAndOffsets(model, position); - const numUtf8Bytes = additionalUtf8ByteOffset + utf8ByteOffset; - try { - const request = new GetCompletionsRequest({ - metadata: this.client.getMetadata(this.ideinfo, apiKey), - document: { - text: text, - editorLanguage: "python", - language: Language.PYTHON, - cursorOffset: BigInt(numUtf8Bytes), - lineEnding: "\n", - relativePath: undefined, - absolutePath: this.absolutePath(model), - }, - editorOptions: { - tabSize: BigInt(model.getOptions().tabSize), - insertSpaces: model.getOptions().insertSpaces, - }, - }); - const response = await this.client.getCompletions(request); - if (response === undefined) { - return { items: [] }; - } - const items = response.completionItems - .map((completionItem) => - createInlineCompletionItem( - completionItem, - model, - additionalUtf8ByteOffset, - apiKey, - this.modelUriToEditor.get(model.uri.toString()) - ) - ) - .filter( - (item): item is monaco.languages.InlineCompletion => - item !== undefined - ); - return { items }; - } catch (e) { - console.log(e); - return { items: [] }; - } - } - - handleItemDidShow(): void { - // Do nothing. - } - - freeInlineCompletions(): void { - // Do nothing. - } - - async acceptedLastCompletion( - apiKey: string, - completionId: string - ): Promise { - await this.client.acceptedLastCompletion( - this.ideinfo, - apiKey, - completionId - ); - } -} - -export const openTokenPage = () => { - const PROFILE_URL = "https://www.codeium.com/profile"; - const params = new URLSearchParams({ - response_type: "token", - redirect_uri: "chrome-show-auth-token", - scope: "openid profile email", - prompt: "login", - redirect_parameters_type: "query", - state: uuidv4(), - }); - window.open(`${PROFILE_URL}?${params}`); -}; - -export async function registerUser( - token: string -): Promise<{ api_key: string; name: string; error?: any }> { - const url = new URL("register_user/", "https://api.codeium.com"); - const response = await fetch(url.toString(), { - body: JSON.stringify({ firebase_id_token: token }), - method: "POST", - headers: { - "Content-Type": "application/json", - }, - }); - if (!response.ok) { - return { api_key: "", name: "", error: response.status }; - } - const user = await response.json(); - return user as { api_key: string; name: string }; -} - -export function registerCompletion(apiKey: string) { - const completionProvider = new MonacoCompletionProvider(apiKey); - try { - const { dispose } = monaco.languages.registerInlineCompletionsProvider( - { pattern: "**" }, - completionProvider - ); - monaco.editor.registerCommand( - "codeium.acceptCompletion", - ( - _: unknown, - apiKey: string, - completionId: string, - callback?: () => void - ) => { - callback?.(); - completionProvider.acceptedLastCompletion(apiKey, completionId); - } - ); - return dispose; - } catch (e) { - console.log(e); - return null; - } -} diff --git a/apps/ui/src/lib/notebook.ts b/apps/ui/src/lib/notebook.ts deleted file mode 100644 index 6fc47372..00000000 --- a/apps/ui/src/lib/notebook.ts +++ /dev/null @@ -1,125 +0,0 @@ -import { Language } from "../proto/exa/codeium_common_pb/codeium_common_pb"; - -export interface TextAndOffsets { - // The smart concatenation of all notebook cells, or just the text of the main document. - text: string; - // The offset into the current cell/document. - utf8ByteOffset: number; - // Any additional offset induced by the smart concatenation. - additionalUtf8ByteOffset: number; -} - -export function numUtf8BytesForCodePoint(codePointValue: number): number { - if (codePointValue < 0x80) { - return 1; - } - if (codePointValue < 0x800) { - return 2; - } - if (codePointValue < 0x10000) { - return 3; - } - return 4; -} - -/** - * Calculates for some prefix of the given text, how many bytes the UTF-8 - * representation would be. Undefined behavior if the number of code units - * doesn't correspond to a valid UTF-8 sequence. - * @param text - Text to examine. - * @param numCodeUnits The number of code units to look at. - * @returns The number of bytes. - */ - -export function numUtf8BytesToNumCodeUnits( - text: string, - numUtf8Bytes?: number -): number { - if (numUtf8Bytes === 0) { - return 0; - } - let curNumCodeUnits = 0; - let curNumUtf8Bytes = 0; - for (const codePoint of text) { - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - curNumUtf8Bytes += numUtf8BytesForCodePoint(codePoint.codePointAt(0)!); - curNumCodeUnits += codePoint.length; - if (numUtf8Bytes !== undefined && curNumUtf8Bytes >= numUtf8Bytes) { - break; - } - } - return curNumCodeUnits; -} - -export function numCodeUnitsToNumUtf8Bytes( - text: string, - numCodeUnits?: number -): number { - if (numCodeUnits === 0) { - return 0; - } - let curNumUtf8Bytes = 0; - let curNumCodeUnits = 0; - for (const codePoint of text) { - curNumCodeUnits += codePoint.length; - // TODO(prem): Is the ! safe here? - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - curNumUtf8Bytes += numUtf8BytesForCodePoint(codePoint.codePointAt(0)!); - if (numCodeUnits !== undefined && curNumCodeUnits >= numCodeUnits) { - break; - } - } - return curNumUtf8Bytes; -} - -const NOTEBOOK_LANGUAGES = { - [Language.PYTHON]: "python", - [Language.SQL]: "sql", - [Language.R]: "", // Not supported by GFM. - [Language.MARKDOWN]: "markdown", - [Language.SCALA]: "", // Not supported by GFM. -} as const; -type AllowedLanguages = keyof typeof NOTEBOOK_LANGUAGES; - -function isAllowedLanguage(language: Language) { - return Object.prototype.hasOwnProperty.call(NOTEBOOK_LANGUAGES, language); -} - -// In Jupyter, we can have cells which are neither Markdown nor Python, so we -// need to define both functions in the interface. -export interface MaybeNotebook { - readonly textModels: T[]; - readonly currentTextModel: T; - // The offset into the value of getText(currentTextModel) at which to trigger a completion. - readonly utf16CodeUnitOffset: number; - getText(model: T): string; - // idx is the position in the textModels array, or undefined if it's the currentTextModel. - getLanguage(model: T, idx: number | undefined): Language; -} - -// Note: Assumes that all notebooks are Python. -export function computeTextAndOffsets( - maybeNotebook: MaybeNotebook -): TextAndOffsets { - const textModels = maybeNotebook.textModels ?? []; - const modelLanguage = maybeNotebook.getLanguage( - maybeNotebook.currentTextModel, - undefined - ); - - let additionalUtf8ByteOffset = 0; - - const currentModelText = maybeNotebook.getText( - maybeNotebook.currentTextModel - ); - const text = currentModelText; - const utf8ByteOffset = numCodeUnitsToNumUtf8Bytes( - currentModelText, - maybeNotebook.utf16CodeUnitOffset - ); - return { - text, - utf8ByteOffset, - additionalUtf8ByteOffset, - }; -} diff --git a/apps/ui/src/lib/store/repoSlice.ts b/apps/ui/src/lib/store/repoSlice.ts index bb382a11..3a4e3a87 100644 --- a/apps/ui/src/lib/store/repoSlice.ts +++ b/apps/ui/src/lib/store/repoSlice.ts @@ -29,9 +29,7 @@ export interface RepoSlice { repoLoaded: boolean; collaborators: any[]; shareOpen: boolean; - settingOpen: boolean; setShareOpen: (open: boolean) => void; - setSettingOpen: (open: boolean) => void; loadError: any; role: "OWNER" | "COLLABORATOR" | "GUEST"; isPublic: boolean; @@ -50,9 +48,7 @@ export const createRepoSlice: StateCreator = ( collaborators: [], isPublic: false, shareOpen: false, - settingOpen: false, setShareOpen: (open: boolean) => set({ shareOpen: open }), - setSettingOpen: (open: boolean) => set({ settingOpen: open }), setRepo: (repoId: string) => set( diff --git a/apps/ui/src/lib/store/settingSlice.ts b/apps/ui/src/lib/store/settingSlice.ts index 2c8edb3e..03727650 100644 --- a/apps/ui/src/lib/store/settingSlice.ts +++ b/apps/ui/src/lib/store/settingSlice.ts @@ -21,10 +21,6 @@ export interface SettingSlice { setContextualZoom: (b: boolean) => void; showLineNumbers?: boolean; setShowLineNumbers: (b: boolean) => void; - autoCompletion?: boolean; - setAutoCompletion: (b: boolean) => void; - isCustomToken?: boolean; - setIsCustomToken: (b: boolean) => void; } export const createSettingSlice: StateCreator = ( @@ -147,22 +143,4 @@ export const createSettingSlice: StateCreator = ( JSON.stringify({ ...updatedParams }) ); }, - autoCompletion: localStorage.getItem("autoCompletion") - ? JSON.parse(localStorage.getItem("autoCompletion")!) - : false, - setAutoCompletion: (b: boolean) => { - // set it - set({ autoCompletion: b }); - // also write to local storage - localStorage.setItem("autoCompletion", JSON.stringify(b)); - }, - isCustomToken: localStorage.getItem("isCustomToken") - ? JSON.parse(localStorage.getItem("isCustomToken")!) - : false, - setIsCustomToken: (b: boolean) => { - // set it - set({ isCustomToken: b }); - // also write to local storage - localStorage.setItem("isCustomToken", JSON.stringify(b)); - }, }); diff --git a/apps/ui/src/lib/store/yjsSlice.ts b/apps/ui/src/lib/store/yjsSlice.ts index 7861388b..52b82138 100644 --- a/apps/ui/src/lib/store/yjsSlice.ts +++ b/apps/ui/src/lib/store/yjsSlice.ts @@ -1,39 +1,14 @@ import { createStore, StateCreator, StoreApi } from "zustand"; -import { devtools } from "zustand/middleware"; import { produce } from "immer"; -import { createContext } from "react"; -import { MonacoCompletionProvider } from "../monacoCompletionProvider"; -import { monaco } from "react-monaco-editor"; // import { IndexeddbPersistence } from "y-indexeddb"; import { Doc, Transaction } from "yjs"; import * as Y from "yjs"; import { WebsocketProvider } from "../utils/y-websocket"; -import { createRuntimeSlice, RuntimeSlice } from "./runtimeSlice"; -import { ApolloClient } from "@apollo/client"; import { addAwarenessStyle } from "../utils/utils"; -import { Annotation } from "../parser"; import { MyState, Pod } from "."; -export async function registerUser( - token: string -): Promise<{ api_key: string; name: string }> { - const url = new URL("register_user/", "https://api.codeium.com"); - const response = await fetch(url.toString(), { - body: JSON.stringify({ firebase_id_token: token }), - method: "POST", - headers: { - "Content-Type": "application/json", - }, - }); - if (!response.ok) { - throw new Error(response.statusText); - } - const user = await response.json(); - return user as { api_key: string; name: string }; -} - export interface YjsSlice { addError: (error: { type: string; msg: string }) => void; clearError: () => void; diff --git a/compose/dev/.env.example b/compose/dev/.env.example index 6631d0e5..e6bd16b2 100644 --- a/compose/dev/.env.example +++ b/compose/dev/.env.example @@ -7,4 +7,3 @@ JWT_SECRET=mysecret # Optional configs. GOOGLE_CLIENT_ID= -CODEIUM_API_KEY= diff --git a/compose/dev/compose.yml b/compose/dev/compose.yml index 39f166e4..8b420916 100644 --- a/compose/dev/compose.yml +++ b/compose/dev/compose.yml @@ -139,7 +139,6 @@ services: environment: TEST: "123" VITE_APP_GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} - VITE_APP_CODEIUM_API_KEY: ${CODEIUM_API_KEY} VITE_APP_YJS_WS_URL: "ws://localhost:4233/socket" VITE_APP_API_URL: "http://localhost:4000/graphql" # Native spawner diff --git a/packages/prisma/prisma/migrations/20230907232232_remove_codeium_key/migration.sql b/packages/prisma/prisma/migrations/20230907232232_remove_codeium_key/migration.sql new file mode 100644 index 00000000..3455e17c --- /dev/null +++ b/packages/prisma/prisma/migrations/20230907232232_remove_codeium_key/migration.sql @@ -0,0 +1,8 @@ +/* + Warnings: + + - You are about to drop the column `codeiumAPIKey` on the `User` table. All the data in the column will be lost. + +*/ +-- AlterTable +ALTER TABLE "User" DROP COLUMN "codeiumAPIKey"; diff --git a/packages/prisma/prisma/schema.prisma b/packages/prisma/prisma/schema.prisma index 45aecf1e..427a48fe 100755 --- a/packages/prisma/prisma/schema.prisma +++ b/packages/prisma/prisma/schema.prisma @@ -51,8 +51,6 @@ model User { sharedRepos Repo[] @relation("COLLABORATOR") stars Repo[] @relation("STAR") UserRepoData UserRepoData[] - - codeiumAPIKey String? @default("") } model UserRepoData { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index aa46046e..aaa28a7a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -433,24 +433,6 @@ importers: '@benrbray/prosemirror-math': specifier: ^0.2.2 version: 0.2.2(katex@0.13.0)(prosemirror-commands@1.5.2)(prosemirror-gapcursor@1.3.2)(prosemirror-history@1.3.2)(prosemirror-inputrules@1.2.1)(prosemirror-keymap@1.2.2)(prosemirror-model@1.19.3)(prosemirror-state@1.4.3)(prosemirror-transform@1.7.5)(prosemirror-view@1.31.7) - '@bufbuild/buf': - specifier: ^1.26.1 - version: 1.26.1 - '@bufbuild/connect': - specifier: ^0.9.1 - version: 0.9.1(@bufbuild/protobuf@1.2.1) - '@bufbuild/connect-web': - specifier: ^0.9.1 - version: 0.9.1(@bufbuild/protobuf@1.2.1) - '@bufbuild/protobuf': - specifier: ^1.2.1 - version: 1.2.1 - '@bufbuild/protoc-gen-connect-es': - specifier: ^0.13.0 - version: 0.13.0(@bufbuild/connect@0.9.1)(@bufbuild/protoc-gen-es@1.3.0) - '@bufbuild/protoc-gen-es': - specifier: ^1.3.0 - version: 1.3.0(@bufbuild/protobuf@1.2.1) '@emotion/react': specifier: ^11.11.1 version: 11.11.1(@types/react@18.2.15)(react@18.2.0) @@ -1534,146 +1516,6 @@ packages: prosemirror-view: 1.31.7 dev: false - /@bufbuild/buf-darwin-arm64@1.26.1: - resolution: {integrity: sha512-nmyWiT/59RFja0ZuXFxjNGoAMDPTApU66CZUUevkFVWbNB9nzeQDjx2vsJyACY64k5fTgZiaelSiyppwObQknw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf-darwin-x64@1.26.1: - resolution: {integrity: sha512-jl5WmUv30OW8JiRLid9+mVx1XVH0XttpUfkQfmqDFdUHGfdy4XWYK8kr84YyWu0SiMTIt1mPXkqG5UM3x+tdIQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf-linux-aarch64@1.26.1: - resolution: {integrity: sha512-EedR2KDW/yDIxQKWuq1Y/g7IuwTgvelqylGVO7muMxt2JWShobyUaU6GIU8JB4yhIbqRQYCL2KqBsvDJbJtCUw==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf-linux-x64@1.26.1: - resolution: {integrity: sha512-5iFL+MmWqR4cBLVNpgsjRecdHgcTxFaIkVYlQV9q8acbaJn5rgOIjUr1tzcBao9YsL3rdBhHvKkgnQ9gi1IiTw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf-win32-arm64@1.26.1: - resolution: {integrity: sha512-/ayymSD12gBetN98ErkH0CBGRLTmtYAp4fmbPuvq8zuJcL0eiAnK6d7ZFjTc+vDMuKY/aelQN7dj9WhzdYAQSQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf-win32-x64@1.26.1: - resolution: {integrity: sha512-k9Dy3Z9P96wYR43lUhUo0jbjMSo001+MRBlsadEYiw85POqx6RWVaGyHLrxC2Ly7g+aGMisey050OjqfCWtKTA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: false - optional: true - - /@bufbuild/buf@1.26.1: - resolution: {integrity: sha512-NyYx4T//3ndtFYV3BfqX9Xrm1NZEx3eChXniAKc/osCVViFooC5nuLQUbyqglMonH0w39RohiURMXN+e/oEB4g==} - engines: {node: '>=12'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@bufbuild/buf-darwin-arm64': 1.26.1 - '@bufbuild/buf-darwin-x64': 1.26.1 - '@bufbuild/buf-linux-aarch64': 1.26.1 - '@bufbuild/buf-linux-x64': 1.26.1 - '@bufbuild/buf-win32-arm64': 1.26.1 - '@bufbuild/buf-win32-x64': 1.26.1 - dev: false - - /@bufbuild/connect-web@0.9.1(@bufbuild/protobuf@1.2.1): - resolution: {integrity: sha512-rQU2Aob68F9Olk5udbNO8qGdh49Iv374WJjjAYatqVDXhKIKIL0+2nUoYadjOnKS0D/hYETMotNuMvCuoLfgVQ==} - peerDependencies: - '@bufbuild/protobuf': ^1.2.0 - dependencies: - '@bufbuild/connect': 0.9.1(@bufbuild/protobuf@1.2.1) - '@bufbuild/protobuf': 1.2.1 - dev: false - - /@bufbuild/connect@0.9.1(@bufbuild/protobuf@1.2.1): - resolution: {integrity: sha512-4O/PSMLWd3oQkwBuJBGBzFtPsnFC5dTRPGHFNFODna9wZJ6r45ccsOWsA4qXBL7gW2EKw93zRa0KVuge2dCOQQ==} - peerDependencies: - '@bufbuild/protobuf': ^1.2.0 - dependencies: - '@bufbuild/protobuf': 1.2.1 - dev: false - - /@bufbuild/protobuf@1.2.1: - resolution: {integrity: sha512-cwwGvLGqvoaOZmoP5+i4v/rbW+rHkguvTehuZyM2p/xpmaNSdT2h3B7kHw33aiffv35t1XrYHIkdJSEkSEMJuA==} - dev: false - - /@bufbuild/protobuf@1.3.0: - resolution: {integrity: sha512-G372ods0pLt46yxVRsnP/e2btVPuuzArcMPFpIDeIwiGPuuglEs9y75iG0HMvZgncsj5TvbYRWqbVyOe3PLCWQ==} - dev: false - - /@bufbuild/protoc-gen-connect-es@0.13.0(@bufbuild/connect@0.9.1)(@bufbuild/protoc-gen-es@1.3.0): - resolution: {integrity: sha512-4HbxWQ799ZLszJJIJsuVMFwkBx8DJ4VEhNDNtKpPJFsTdVUOp1LyFGY66Yjfj9vcuOeH44bS0ALE5pRP3rCxXA==} - engines: {node: '>=16.0.0'} - hasBin: true - peerDependencies: - '@bufbuild/connect': 0.13.0 - '@bufbuild/protoc-gen-es': ^1.2.1 - peerDependenciesMeta: - '@bufbuild/connect': - optional: true - '@bufbuild/protoc-gen-es': - optional: true - dependencies: - '@bufbuild/connect': 0.9.1(@bufbuild/protobuf@1.2.1) - '@bufbuild/protobuf': 1.3.0 - '@bufbuild/protoc-gen-es': 1.3.0(@bufbuild/protobuf@1.2.1) - '@bufbuild/protoplugin': 1.3.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@bufbuild/protoc-gen-es@1.3.0(@bufbuild/protobuf@1.2.1): - resolution: {integrity: sha512-XxGZwpXMYlwoSyJwCTFb7SZ2xKmv2iCRM022t1wszhY3kNL7rjpyj+3GbpCOjaM1T7NAoLnW0Hyb/M0b0XDb3Q==} - engines: {node: '>=14'} - hasBin: true - peerDependencies: - '@bufbuild/protobuf': 1.3.0 - peerDependenciesMeta: - '@bufbuild/protobuf': - optional: true - dependencies: - '@bufbuild/protobuf': 1.2.1 - '@bufbuild/protoplugin': 1.3.0 - transitivePeerDependencies: - - supports-color - dev: false - - /@bufbuild/protoplugin@1.3.0: - resolution: {integrity: sha512-zye8CfJb9VWzaHR/f1qcEkddaRh9De+u6fORsj92Ten8EJUcyhiY5BivET+RMTissAKXKrp/f2zSBCV0dlFxPw==} - dependencies: - '@bufbuild/protobuf': 1.3.0 - '@typescript/vfs': 1.5.0 - typescript: 4.5.2 - transitivePeerDependencies: - - supports-color - dev: false - /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -6221,14 +6063,6 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript/vfs@1.5.0: - resolution: {integrity: sha512-AJS307bPgbsZZ9ggCT3wwpg3VbTKMFNHfaY/uF0ahSkYYrPF2dSSKDNIDIQAHm9qJqbLvCsSJH7yN4Vs/CsMMg==} - dependencies: - debug: 4.3.4 - transitivePeerDependencies: - - supports-color - dev: false - /@vitejs/plugin-react-swc@3.3.2(vite@4.4.5): resolution: {integrity: sha512-VJFWY5sfoZerQRvJrh518h3AcQt6f/yTuWn4/TRB+dqmYU0NX1qz7qM5Wfd+gOQqUzQW4gxKqKN3KpE/P3+zrA==} peerDependencies: @@ -13062,12 +12896,6 @@ packages: for-each: 0.3.3 is-typed-array: 1.1.12 - /typescript@4.5.2: - resolution: {integrity: sha512-5BlMof9H1yGt0P8/WF+wPNw6GfctgGjXp5hkblpyT+8rkASSmkUKMXrxR0Xg8ThVCi/JnHQiKXeBaEwCeQwMFw==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: false - /typescript@4.5.4: resolution: {integrity: sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==} engines: {node: '>=4.2.0'}