UNPKG

@valtown/codemirror-codeium

Version:

codemirror integration for codeium

746 lines 26 kB
// Copyright Exafunction, Inc. import { Message, proto3, protoInt64 } from "@bufbuild/protobuf"; import { Completion, CompletionSource, EditorOptions, ExperimentKey, Language, Metadata } from "../codeium_common_pb/codeium_common_pb"; /** * @generated from enum exa.language_server_pb.CodeiumState */ export var CodeiumState; (function (CodeiumState) { /** * @generated from enum value: CODEIUM_STATE_UNSPECIFIED = 0; */ CodeiumState[CodeiumState["UNSPECIFIED"] = 0] = "UNSPECIFIED"; /** * @generated from enum value: CODEIUM_STATE_INACTIVE = 1; */ CodeiumState[CodeiumState["INACTIVE"] = 1] = "INACTIVE"; /** * @generated from enum value: CODEIUM_STATE_PROCESSING = 2; */ CodeiumState[CodeiumState["PROCESSING"] = 2] = "PROCESSING"; /** * @generated from enum value: CODEIUM_STATE_SUCCESS = 3; */ CodeiumState[CodeiumState["SUCCESS"] = 3] = "SUCCESS"; /** * @generated from enum value: CODEIUM_STATE_WARNING = 4; */ CodeiumState[CodeiumState["WARNING"] = 4] = "WARNING"; /** * @generated from enum value: CODEIUM_STATE_ERROR = 5; */ CodeiumState[CodeiumState["ERROR"] = 5] = "ERROR"; })(CodeiumState || (CodeiumState = {})); // Retrieve enum metadata with: proto3.getEnumType(CodeiumState) proto3.util.setEnumType(CodeiumState, "exa.language_server_pb.CodeiumState", [ { no: 0, name: "CODEIUM_STATE_UNSPECIFIED" }, { no: 1, name: "CODEIUM_STATE_INACTIVE" }, { no: 2, name: "CODEIUM_STATE_PROCESSING" }, { no: 3, name: "CODEIUM_STATE_SUCCESS" }, { no: 4, name: "CODEIUM_STATE_WARNING" }, { no: 5, name: "CODEIUM_STATE_ERROR" }, ]); /** * @generated from enum exa.language_server_pb.LineType */ export var LineType; (function (LineType) { /** * @generated from enum value: LINE_TYPE_UNSPECIFIED = 0; */ LineType[LineType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; /** * @generated from enum value: LINE_TYPE_SINGLE = 1; */ LineType[LineType["SINGLE"] = 1] = "SINGLE"; /** * @generated from enum value: LINE_TYPE_MULTI = 2; */ LineType[LineType["MULTI"] = 2] = "MULTI"; })(LineType || (LineType = {})); // Retrieve enum metadata with: proto3.getEnumType(LineType) proto3.util.setEnumType(LineType, "exa.language_server_pb.LineType", [ { no: 0, name: "LINE_TYPE_UNSPECIFIED" }, { no: 1, name: "LINE_TYPE_SINGLE" }, { no: 2, name: "LINE_TYPE_MULTI" }, ]); /** * @generated from enum exa.language_server_pb.CompletionPartType */ export var CompletionPartType; (function (CompletionPartType) { /** * @generated from enum value: COMPLETION_PART_TYPE_UNSPECIFIED = 0; */ CompletionPartType[CompletionPartType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; /** * Single-line completion parts that appear within an existing line of text. * * @generated from enum value: COMPLETION_PART_TYPE_INLINE = 1; */ CompletionPartType[CompletionPartType["INLINE"] = 1] = "INLINE"; /** * Possibly multi-line completion parts that appear below an existing line of text. * * @generated from enum value: COMPLETION_PART_TYPE_BLOCK = 2; */ CompletionPartType[CompletionPartType["BLOCK"] = 2] = "BLOCK"; /** * Like COMPLETION_PART_TYPE_INLINE, but overwrites the existing text. * * @generated from enum value: COMPLETION_PART_TYPE_INLINE_MASK = 3; */ CompletionPartType[CompletionPartType["INLINE_MASK"] = 3] = "INLINE_MASK"; })(CompletionPartType || (CompletionPartType = {})); // Retrieve enum metadata with: proto3.getEnumType(CompletionPartType) proto3.util.setEnumType(CompletionPartType, "exa.language_server_pb.CompletionPartType", [ { no: 0, name: "COMPLETION_PART_TYPE_UNSPECIFIED" }, { no: 1, name: "COMPLETION_PART_TYPE_INLINE" }, { no: 2, name: "COMPLETION_PART_TYPE_BLOCK" }, { no: 3, name: "COMPLETION_PART_TYPE_INLINE_MASK" }, ]); /** * @generated from message exa.language_server_pb.MultilineConfig */ export class MultilineConfig extends Message { /** * Multiline model threshold. 0-1, higher = more single line, lower = more multiline, * 0.0 = only_multiline, default is 0.5 * * @generated from field: float threshold = 1; */ threshold = 0; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.MultilineConfig"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "threshold", kind: "scalar", T: 2 /* ScalarType.FLOAT */ }, ]); static fromBinary(bytes, options) { return new MultilineConfig().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new MultilineConfig().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new MultilineConfig().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(MultilineConfig, a, b); } } /** * Next ID: 9, Previous field: disable_cache. * * @generated from message exa.language_server_pb.GetCompletionsRequest */ export class GetCompletionsRequest extends Message { /** * @generated from field: exa.codeium_common_pb.Metadata metadata = 1; */ metadata; /** * @generated from field: exa.language_server_pb.Document document = 2; */ document; /** * @generated from field: exa.codeium_common_pb.EditorOptions editor_options = 3; */ editorOptions; /** * @generated from field: repeated exa.language_server_pb.Document other_documents = 5; */ otherDocuments = []; /** * @generated from field: exa.language_server_pb.ExperimentConfig experiment_config = 7; */ experimentConfig; /** * @generated from field: string model_name = 10; */ modelName = ""; /** * @generated from field: exa.language_server_pb.MultilineConfig multiline_config = 13; */ multilineConfig; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.GetCompletionsRequest"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "metadata", kind: "message", T: Metadata }, { no: 2, name: "document", kind: "message", T: Document }, { no: 3, name: "editor_options", kind: "message", T: EditorOptions }, { no: 5, name: "other_documents", kind: "message", T: Document, repeated: true }, { no: 7, name: "experiment_config", kind: "message", T: ExperimentConfig }, { no: 10, name: "model_name", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 13, name: "multiline_config", kind: "message", T: MultilineConfig }, ]); static fromBinary(bytes, options) { return new GetCompletionsRequest().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new GetCompletionsRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new GetCompletionsRequest().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(GetCompletionsRequest, a, b); } } /** * Next ID: 5, Previous field: latency_info. * * @generated from message exa.language_server_pb.GetCompletionsResponse */ export class GetCompletionsResponse extends Message { /** * @generated from field: exa.language_server_pb.State state = 1; */ state; /** * @generated from field: repeated exa.language_server_pb.CompletionItem completion_items = 2; */ completionItems = []; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.GetCompletionsResponse"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "state", kind: "message", T: State }, { no: 2, name: "completion_items", kind: "message", T: CompletionItem, repeated: true }, ]); static fromBinary(bytes, options) { return new GetCompletionsResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new GetCompletionsResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new GetCompletionsResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(GetCompletionsResponse, a, b); } } /** * Next ID: 3, Previous field: completion_id. * * @generated from message exa.language_server_pb.AcceptCompletionRequest */ export class AcceptCompletionRequest extends Message { /** * @generated from field: exa.codeium_common_pb.Metadata metadata = 1; */ metadata; /** * @generated from field: string completion_id = 2; */ completionId = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.AcceptCompletionRequest"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "metadata", kind: "message", T: Metadata }, { no: 2, name: "completion_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes, options) { return new AcceptCompletionRequest().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new AcceptCompletionRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new AcceptCompletionRequest().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(AcceptCompletionRequest, a, b); } } /** * Next ID: 1, Previous field: N/A. * * @generated from message exa.language_server_pb.AcceptCompletionResponse */ export class AcceptCompletionResponse extends Message { constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.AcceptCompletionResponse"; static fields = proto3.util.newFieldList(() => []); static fromBinary(bytes, options) { return new AcceptCompletionResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new AcceptCompletionResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new AcceptCompletionResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(AcceptCompletionResponse, a, b); } } /** * Next ID: 1, Previous field: N/A. * * @generated from message exa.language_server_pb.GetAuthTokenRequest */ export class GetAuthTokenRequest extends Message { constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.GetAuthTokenRequest"; static fields = proto3.util.newFieldList(() => []); static fromBinary(bytes, options) { return new GetAuthTokenRequest().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new GetAuthTokenRequest().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new GetAuthTokenRequest().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(GetAuthTokenRequest, a, b); } } /** * Next ID: 3, Previous field: uuid. * * @generated from message exa.language_server_pb.GetAuthTokenResponse */ export class GetAuthTokenResponse extends Message { /** * @generated from field: string auth_token = 1; */ authToken = ""; /** * @generated from field: string uuid = 2; */ uuid = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.GetAuthTokenResponse"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "auth_token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "uuid", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes, options) { return new GetAuthTokenResponse().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new GetAuthTokenResponse().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new GetAuthTokenResponse().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(GetAuthTokenResponse, a, b); } } /** * @generated from message exa.language_server_pb.DocumentPosition */ export class DocumentPosition extends Message { /** * 0-indexed. Measured in UTF-8 bytes. * * @generated from field: uint64 row = 1; */ row = protoInt64.zero; /** * 0-indexed. Measured in UTF-8 bytes. * * @generated from field: uint64 col = 2; */ col = protoInt64.zero; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.DocumentPosition"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "row", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "col", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes, options) { return new DocumentPosition().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new DocumentPosition().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new DocumentPosition().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(DocumentPosition, a, b); } } /** * Next ID: 9, Previous field: cursor_position. * * @generated from message exa.language_server_pb.Document */ export class Document extends Message { /** * @generated from field: string absolute_path = 1; */ absolutePath = ""; /** * Path relative to the root of the workspace. * * @generated from field: string relative_path = 2; */ relativePath = ""; /** * @generated from field: string text = 3; */ text = ""; /** * Language ID provided by the editor. * * @generated from field: string editor_language = 4; */ editorLanguage = ""; /** * Language enum standardized across editors. * * @generated from field: exa.codeium_common_pb.Language language = 5; */ language = Language.UNSPECIFIED; /** * Measured in number of UTF-8 bytes. * * @generated from field: uint64 cursor_offset = 6; */ cursorOffset = protoInt64.zero; /** * May be present instead of cursor_offset. * * @generated from field: exa.language_server_pb.DocumentPosition cursor_position = 8; */ cursorPosition; /** * \n or \r\n, if known. * * @generated from field: string line_ending = 7; */ lineEnding = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.Document"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "absolute_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "relative_path", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 3, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 4, name: "editor_language", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "language", kind: "enum", T: proto3.getEnumType(Language) }, { no: 6, name: "cursor_offset", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 8, name: "cursor_position", kind: "message", T: DocumentPosition }, { no: 7, name: "line_ending", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes, options) { return new Document().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new Document().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new Document().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(Document, a, b); } } /** * @generated from message exa.language_server_pb.ExperimentConfig */ export class ExperimentConfig extends Message { /** * @generated from field: repeated exa.codeium_common_pb.ExperimentKey force_enable_experiments = 1; */ forceEnableExperiments = []; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.ExperimentConfig"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "force_enable_experiments", kind: "enum", T: proto3.getEnumType(ExperimentKey), repeated: true }, ]); static fromBinary(bytes, options) { return new ExperimentConfig().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new ExperimentConfig().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new ExperimentConfig().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(ExperimentConfig, a, b); } } /** * Next ID: 3, Previous field: message. * * @generated from message exa.language_server_pb.State */ export class State extends Message { /** * @generated from field: exa.language_server_pb.CodeiumState state = 1; */ state = CodeiumState.UNSPECIFIED; /** * @generated from field: string message = 2; */ message = ""; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.State"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "state", kind: "enum", T: proto3.getEnumType(CodeiumState) }, { no: 2, name: "message", kind: "scalar", T: 9 /* ScalarType.STRING */ }, ]); static fromBinary(bytes, options) { return new State().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new State().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new State().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(State, a, b); } } /** * Next ID: 5, Previous field: end_position. * * @generated from message exa.language_server_pb.Range */ export class Range extends Message { /** * @generated from field: uint64 start_offset = 1; */ startOffset = protoInt64.zero; /** * @generated from field: uint64 end_offset = 2; */ endOffset = protoInt64.zero; /** * @generated from field: exa.language_server_pb.DocumentPosition start_position = 3; */ startPosition; /** * @generated from field: exa.language_server_pb.DocumentPosition end_position = 4; */ endPosition; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.Range"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "start_offset", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 2, name: "end_offset", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "start_position", kind: "message", T: DocumentPosition }, { no: 4, name: "end_position", kind: "message", T: DocumentPosition }, ]); static fromBinary(bytes, options) { return new Range().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new Range().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new Range().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(Range, a, b); } } /** * @generated from message exa.language_server_pb.Suffix */ export class Suffix extends Message { /** * Text to insert after the cursor when accepting the completion. * * @generated from field: string text = 1; */ text = ""; /** * Cursor position delta (as signed offset) from the end of the inserted * completion (including the suffix). * * @generated from field: int64 delta_cursor_offset = 2; */ deltaCursorOffset = protoInt64.zero; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.Suffix"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "delta_cursor_offset", kind: "scalar", T: 3 /* ScalarType.INT64 */ }, ]); static fromBinary(bytes, options) { return new Suffix().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new Suffix().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new Suffix().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(Suffix, a, b); } } /** * Represents a contiguous part of the completion text that is not * already in the document. * Next ID: 4, Previous field: prefix. * * @generated from message exa.language_server_pb.CompletionPart */ export class CompletionPart extends Message { /** * @generated from field: string text = 1; */ text = ""; /** * Offset in the original document where the part starts. For block * parts, this is always the end of the line before the block. * * @generated from field: uint64 offset = 2; */ offset = protoInt64.zero; /** * @generated from field: exa.language_server_pb.CompletionPartType type = 3; */ type = CompletionPartType.UNSPECIFIED; /** * The section of the original line that came before this part. Only valid for * COMPLETION_PART_TYPE_INLINE. * * @generated from field: string prefix = 4; */ prefix = ""; /** * In the case of COMPLETION_PART_TYPE_BLOCK, represents the line it is below. * * @generated from field: uint64 line = 5; */ line = protoInt64.zero; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.CompletionPart"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "text", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 2, name: "offset", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, { no: 3, name: "type", kind: "enum", T: proto3.getEnumType(CompletionPartType) }, { no: 4, name: "prefix", kind: "scalar", T: 9 /* ScalarType.STRING */ }, { no: 5, name: "line", kind: "scalar", T: 4 /* ScalarType.UINT64 */ }, ]); static fromBinary(bytes, options) { return new CompletionPart().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new CompletionPart().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new CompletionPart().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(CompletionPart, a, b); } } /** * Next ID: 9, Previous field: completion_parts. * * @generated from message exa.language_server_pb.CompletionItem */ export class CompletionItem extends Message { /** * @generated from field: exa.codeium_common_pb.Completion completion = 1; */ completion; /** * @generated from field: exa.language_server_pb.Suffix suffix = 5; */ suffix; /** * @generated from field: exa.language_server_pb.Range range = 2; */ range; /** * @generated from field: exa.codeium_common_pb.CompletionSource source = 3; */ source = CompletionSource.UNSPECIFIED; /** * @generated from field: repeated exa.language_server_pb.CompletionPart completion_parts = 8; */ completionParts = []; constructor(data) { super(); proto3.util.initPartial(data, this); } static runtime = proto3; static typeName = "exa.language_server_pb.CompletionItem"; static fields = proto3.util.newFieldList(() => [ { no: 1, name: "completion", kind: "message", T: Completion }, { no: 5, name: "suffix", kind: "message", T: Suffix }, { no: 2, name: "range", kind: "message", T: Range }, { no: 3, name: "source", kind: "enum", T: proto3.getEnumType(CompletionSource) }, { no: 8, name: "completion_parts", kind: "message", T: CompletionPart, repeated: true }, ]); static fromBinary(bytes, options) { return new CompletionItem().fromBinary(bytes, options); } static fromJson(jsonValue, options) { return new CompletionItem().fromJson(jsonValue, options); } static fromJsonString(jsonString, options) { return new CompletionItem().fromJsonString(jsonString, options); } static equals(a, b) { return proto3.util.equals(CompletionItem, a, b); } } //# sourceMappingURL=language_server_pb.js.map