Skip to content

Commit b65091d

Browse files
committedDec 11, 2023
Switch to pnpm, integrate protos
1 parent 8696776 commit b65091d

11 files changed

+8240
-23448
lines changed
 

‎.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ yarn-debug.log*
1212
yarn-error.log*
1313
/.changelog
1414
.npm/
15-
dist
15+
dist
16+
17+
src/api/proto

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Exafunction
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

‎buf.gen.yaml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# buf.gen.yaml defines a local generation template.
2+
# For details, see https://docs.buf.build/configuration/v1/buf-gen-yaml
3+
version: v1
4+
plugins:
5+
- plugin: buf.build/bufbuild/es:v1.4.2
6+
out: src/api/proto
7+
opt:
8+
- target=ts
9+
- import_extension=none
10+
- plugin: buf.build/connectrpc/es:v1.1.3
11+
out: src/api/proto
12+
opt:
13+
- target=ts
14+
- import_extension=none

‎buf.lock

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Generated by buf. DO NOT EDIT.
2+
version: v1
3+
deps:
4+
- remote: buf.build
5+
owner: envoyproxy
6+
repository: protoc-gen-validate
7+
commit: 71881f09a0c5420a9545a07987a86728
8+
digest: shake256:d320bbf06653b1b2b45a1f95bfa82bf7b998221a777a042708c50d6f86a30d1a85b50c5704c597142d9b308280efe1295d39d76d1abea5f7046d3df4c8cc3cef

‎buf.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: v1
2+
deps:
3+
- buf.build/envoyproxy/protoc-gen-validate
4+
build:
5+
excludes:
6+
- node_modules
7+
lint:
8+
use:
9+
- DEFAULT
10+
except:
11+
- PACKAGE_VERSION_SUFFIX
12+
allow_comment_ignores: true
13+
breaking:
14+
except:
15+
- FILE_NO_DELETE
+166
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
// Copyright Exafunction, Inc.
2+
3+
syntax = "proto3";
4+
5+
package exa.codeium_common_pb;
6+
7+
import "google/protobuf/duration.proto";
8+
import "google/protobuf/timestamp.proto";
9+
import "validate/validate.proto";
10+
11+
option go_package = "github.com/Exafunction/Exafunction/exa/codeium_common_pb";
12+
13+
enum ExperimentKey {
14+
UNSPECIFIED = 0;
15+
JUPYTER_FORMAT = 77;
16+
}
17+
18+
// Next ID: 12, Previous field: entropy.
19+
message Completion {
20+
string completion_id = 1;
21+
string text = 2;
22+
string prefix = 3;
23+
string stop = 4;
24+
double score = 5;
25+
repeated uint64 tokens = 6;
26+
repeated string decoded_tokens = 7;
27+
repeated double probabilities = 8;
28+
repeated double adjusted_probabilities = 9;
29+
uint64 generated_length = 10;
30+
}
31+
32+
// Authentication source for users on the cloud service.
33+
enum AuthSource {
34+
AUTH_SOURCE_CODEIUM = 0;
35+
}
36+
37+
// Next ID: 15, Previous field: url.
38+
message Metadata {
39+
string ide_name = 1 [(validate.rules).string.min_len = 1];
40+
string ide_version = 7 [(validate.rules).string.min_len = 1];
41+
string extension_name = 12;
42+
string extension_version = 2 [(validate.rules).string.min_len = 1];
43+
string api_key = 3 [(validate.rules).string.uuid = true];
44+
// Regex derived from https://stackoverflow.com/a/48300605.
45+
// TODO(prem): Should this be mandatory?
46+
string locale = 4 [(validate.rules).string = {
47+
ignore_empty: true,
48+
pattern: "^[A-Za-z]{2,4}([_-][A-Za-z]{4})?([_-]([A-Za-z]{2}|[0-9]{3}))?$"
49+
}];
50+
// UID identifying a single session for the given user.
51+
string session_id = 10;
52+
53+
// Used purely in language server to cancel in flight requests.
54+
// If request_id is 0, then the request is not cancelable.
55+
// This should be a strictly monotonically increasing number
56+
// for the duration of a session.
57+
uint64 request_id = 9;
58+
59+
// Browser-specific information.
60+
string user_agent = 13;
61+
string url = 14 [(validate.rules).string = {
62+
ignore_empty: true,
63+
uri: true
64+
}];
65+
66+
// Authentication source information.
67+
AuthSource auth_source = 15;
68+
}
69+
70+
// Next ID: 3, Previous field: insert_spaces.
71+
message EditorOptions {
72+
uint64 tab_size = 1 [(validate.rules).uint64.gt = 0];
73+
bool insert_spaces = 2;
74+
}
75+
76+
message Event {
77+
EventType event_type = 1;
78+
string event_json = 2;
79+
int64 timestamp_unix_ms = 3;
80+
}
81+
82+
enum EventType {
83+
EVENT_TYPE_UNSPECIFIED = 0;
84+
EVENT_TYPE_ENABLE_CODEIUM = 1;
85+
EVENT_TYPE_DISABLE_CODEIUM = 2;
86+
EVENT_TYPE_SHOW_PREVIOUS_COMPLETION = 3;
87+
EVENT_TYPE_SHOW_NEXT_COMPLETION = 4;
88+
}
89+
90+
enum CompletionSource {
91+
COMPLETION_SOURCE_UNSPECIFIED = 0;
92+
COMPLETION_SOURCE_TYPING_AS_SUGGESTED = 1;
93+
COMPLETION_SOURCE_CACHE = 2;
94+
COMPLETION_SOURCE_NETWORK = 3;
95+
}
96+
97+
// Every time this list is updated, we should be redeploying the API server
98+
// since it uses the string representation for BQ.
99+
enum Language {
100+
LANGUAGE_UNSPECIFIED = 0;
101+
LANGUAGE_C = 1;
102+
LANGUAGE_CLOJURE = 2;
103+
LANGUAGE_COFFEESCRIPT = 3;
104+
LANGUAGE_CPP = 4;
105+
LANGUAGE_CSHARP = 5;
106+
LANGUAGE_CSS = 6;
107+
LANGUAGE_CUDACPP = 7;
108+
LANGUAGE_DOCKERFILE = 8;
109+
LANGUAGE_GO = 9;
110+
LANGUAGE_GROOVY = 10;
111+
LANGUAGE_HANDLEBARS = 11;
112+
LANGUAGE_HASKELL = 12;
113+
LANGUAGE_HCL = 13;
114+
LANGUAGE_HTML = 14;
115+
LANGUAGE_INI = 15;
116+
LANGUAGE_JAVA = 16;
117+
LANGUAGE_JAVASCRIPT = 17;
118+
LANGUAGE_JSON = 18;
119+
LANGUAGE_JULIA = 19;
120+
LANGUAGE_KOTLIN = 20;
121+
LANGUAGE_LATEX = 21;
122+
LANGUAGE_LESS = 22;
123+
LANGUAGE_LUA = 23;
124+
LANGUAGE_MAKEFILE = 24;
125+
LANGUAGE_MARKDOWN = 25;
126+
LANGUAGE_OBJECTIVEC = 26;
127+
LANGUAGE_OBJECTIVECPP = 27;
128+
LANGUAGE_PERL = 28;
129+
LANGUAGE_PHP = 29;
130+
LANGUAGE_PLAINTEXT = 30;
131+
LANGUAGE_PROTOBUF = 31;
132+
LANGUAGE_PBTXT = 32;
133+
LANGUAGE_PYTHON = 33;
134+
LANGUAGE_R = 34;
135+
LANGUAGE_RUBY = 35;
136+
LANGUAGE_RUST = 36;
137+
LANGUAGE_SASS = 37;
138+
LANGUAGE_SCALA = 38;
139+
LANGUAGE_SCSS = 39;
140+
LANGUAGE_SHELL = 40;
141+
LANGUAGE_SQL = 41;
142+
LANGUAGE_STARLARK = 42;
143+
LANGUAGE_SWIFT = 43;
144+
LANGUAGE_TSX = 44;
145+
LANGUAGE_TYPESCRIPT = 45;
146+
LANGUAGE_VISUALBASIC = 46;
147+
LANGUAGE_VUE = 47;
148+
LANGUAGE_XML = 48;
149+
LANGUAGE_XSL = 49;
150+
LANGUAGE_YAML = 50;
151+
LANGUAGE_SVELTE = 51;
152+
LANGUAGE_TOML = 52;
153+
LANGUAGE_DART = 53;
154+
LANGUAGE_RST = 54;
155+
LANGUAGE_OCAML = 55;
156+
LANGUAGE_CMAKE = 56;
157+
LANGUAGE_PASCAL = 57;
158+
LANGUAGE_ELIXIR = 58;
159+
LANGUAGE_FSHARP = 59;
160+
LANGUAGE_LISP = 60;
161+
LANGUAGE_MATLAB = 61;
162+
LANGUAGE_POWERSHELL = 62;
163+
LANGUAGE_SOLIDITY = 63;
164+
LANGUAGE_ADA = 64;
165+
LANGUAGE_OCAML_INTERFACE = 65;
166+
}

0 commit comments

Comments
 (0)
Please sign in to comment.