zed.proto

   1syntax = "proto3";
   2package zed.messages;
   3
   4// Looking for a number? Search "// current max"
   5
   6message PeerId {
   7    uint32 owner_id = 1;
   8    uint32 id = 2;
   9}
  10
  11message Envelope {
  12    uint32 id = 1;
  13    optional uint32 responding_to = 2;
  14    optional PeerId original_sender_id = 3;
  15    optional uint32 ack_id = 266;
  16
  17    oneof payload {
  18        Hello hello = 4;
  19        Ack ack = 5;
  20        Error error = 6;
  21        Ping ping = 7;
  22        Test test = 8;
  23        EndStream end_stream = 165;
  24
  25        CreateRoom create_room = 9;
  26        CreateRoomResponse create_room_response = 10;
  27        JoinRoom join_room = 11;
  28        JoinRoomResponse join_room_response = 12;
  29        RejoinRoom rejoin_room = 13;
  30        RejoinRoomResponse rejoin_room_response = 14;
  31        LeaveRoom leave_room = 15;
  32        Call call = 16;
  33        IncomingCall incoming_call = 17;
  34        CallCanceled call_canceled = 18;
  35        CancelCall cancel_call = 19;
  36        DeclineCall decline_call = 20;
  37        UpdateParticipantLocation update_participant_location = 21;
  38        RoomUpdated room_updated = 22;
  39
  40        ShareProject share_project = 23;
  41        ShareProjectResponse share_project_response = 24;
  42        UnshareProject unshare_project = 25;
  43        JoinProject join_project = 26;
  44        JoinProjectResponse join_project_response = 27;
  45        LeaveProject leave_project = 28;
  46        AddProjectCollaborator add_project_collaborator = 29;
  47        UpdateProjectCollaborator update_project_collaborator = 30;
  48        RemoveProjectCollaborator remove_project_collaborator = 31;
  49
  50        GetDefinition get_definition = 32;
  51        GetDefinitionResponse get_definition_response = 33;
  52        GetDeclaration get_declaration = 237;
  53        GetDeclarationResponse get_declaration_response = 238;
  54        GetTypeDefinition get_type_definition = 34;
  55        GetTypeDefinitionResponse get_type_definition_response = 35;
  56
  57        GetReferences get_references = 36;
  58        GetReferencesResponse get_references_response = 37;
  59        GetDocumentHighlights get_document_highlights = 38;
  60        GetDocumentHighlightsResponse get_document_highlights_response = 39;
  61        GetProjectSymbols get_project_symbols = 40;
  62        GetProjectSymbolsResponse get_project_symbols_response = 41;
  63        OpenBufferForSymbol open_buffer_for_symbol = 42;
  64        OpenBufferForSymbolResponse open_buffer_for_symbol_response = 43;
  65
  66        UpdateProject update_project = 44;
  67        UpdateWorktree update_worktree = 45;
  68
  69        CreateProjectEntry create_project_entry = 46;
  70        RenameProjectEntry rename_project_entry = 47;
  71        CopyProjectEntry copy_project_entry = 48;
  72        DeleteProjectEntry delete_project_entry = 49;
  73        ProjectEntryResponse project_entry_response = 50;
  74        ExpandProjectEntry expand_project_entry = 51;
  75        ExpandProjectEntryResponse expand_project_entry_response = 52;
  76        ExpandAllForProjectEntry expand_all_for_project_entry = 291;
  77        ExpandAllForProjectEntryResponse expand_all_for_project_entry_response = 292;
  78        UpdateDiagnosticSummary update_diagnostic_summary = 53;
  79        StartLanguageServer start_language_server = 54;
  80        UpdateLanguageServer update_language_server = 55;
  81
  82        OpenBufferById open_buffer_by_id = 56;
  83        OpenBufferByPath open_buffer_by_path = 57;
  84        OpenBufferResponse open_buffer_response = 58;
  85        CreateBufferForPeer create_buffer_for_peer = 59;
  86        UpdateBuffer update_buffer = 60;
  87        UpdateBufferFile update_buffer_file = 61;
  88        SaveBuffer save_buffer = 62;
  89        BufferSaved buffer_saved = 63;
  90        BufferReloaded buffer_reloaded = 64;
  91        ReloadBuffers reload_buffers = 65;
  92        ReloadBuffersResponse reload_buffers_response = 66;
  93        SynchronizeBuffers synchronize_buffers = 67;
  94        SynchronizeBuffersResponse synchronize_buffers_response = 68;
  95        FormatBuffers format_buffers = 69;
  96        FormatBuffersResponse format_buffers_response = 70;
  97        GetCompletions get_completions = 71;
  98        GetCompletionsResponse get_completions_response = 72;
  99        ResolveCompletionDocumentation resolve_completion_documentation = 73;
 100        ResolveCompletionDocumentationResponse resolve_completion_documentation_response = 74;
 101        ApplyCompletionAdditionalEdits apply_completion_additional_edits = 75;
 102        ApplyCompletionAdditionalEditsResponse apply_completion_additional_edits_response = 76;
 103        GetCodeActions get_code_actions = 77;
 104        GetCodeActionsResponse get_code_actions_response = 78;
 105        GetHover get_hover = 79;
 106        GetHoverResponse get_hover_response = 80;
 107        ApplyCodeAction apply_code_action = 81;
 108        ApplyCodeActionResponse apply_code_action_response = 82;
 109        PrepareRename prepare_rename = 83;
 110        PrepareRenameResponse prepare_rename_response = 84;
 111        PerformRename perform_rename = 85;
 112        PerformRenameResponse perform_rename_response = 86;
 113
 114        UpdateContacts update_contacts = 89;
 115        UpdateInviteInfo update_invite_info = 90;
 116        ShowContacts show_contacts = 91;
 117
 118        GetUsers get_users = 92;
 119        FuzzySearchUsers fuzzy_search_users = 93;
 120        UsersResponse users_response = 94;
 121        RequestContact request_contact = 95;
 122        RespondToContactRequest respond_to_contact_request = 96;
 123        RemoveContact remove_contact = 97;
 124
 125        Follow follow = 98;
 126        FollowResponse follow_response = 99;
 127        UpdateFollowers update_followers = 100;
 128        Unfollow unfollow = 101;
 129        GetPrivateUserInfo get_private_user_info = 102;
 130        GetPrivateUserInfoResponse get_private_user_info_response = 103;
 131        UpdateUserPlan update_user_plan = 234;
 132        UpdateDiffBases update_diff_bases = 104;
 133        AcceptTermsOfService accept_terms_of_service = 239;
 134        AcceptTermsOfServiceResponse accept_terms_of_service_response = 240;
 135
 136        OnTypeFormatting on_type_formatting = 105;
 137        OnTypeFormattingResponse on_type_formatting_response = 106;
 138
 139        UpdateWorktreeSettings update_worktree_settings = 107;
 140
 141        InlayHints inlay_hints = 108;
 142        InlayHintsResponse inlay_hints_response = 109;
 143        ResolveInlayHint resolve_inlay_hint = 110;
 144        ResolveInlayHintResponse resolve_inlay_hint_response = 111;
 145        RefreshInlayHints refresh_inlay_hints = 112;
 146
 147        CreateChannel create_channel = 113;
 148        CreateChannelResponse create_channel_response = 114;
 149        InviteChannelMember invite_channel_member = 115;
 150        RemoveChannelMember remove_channel_member = 116;
 151        RespondToChannelInvite respond_to_channel_invite = 117;
 152        UpdateChannels update_channels = 118;
 153        JoinChannel join_channel = 119;
 154        DeleteChannel delete_channel = 120;
 155        GetChannelMembers get_channel_members = 121;
 156        GetChannelMembersResponse get_channel_members_response = 122;
 157        SetChannelMemberRole set_channel_member_role = 123;
 158        RenameChannel rename_channel = 124;
 159        RenameChannelResponse rename_channel_response = 125;
 160        SubscribeToChannels subscribe_to_channels = 207;
 161
 162        JoinChannelBuffer join_channel_buffer = 126;
 163        JoinChannelBufferResponse join_channel_buffer_response = 127;
 164        UpdateChannelBuffer update_channel_buffer = 128;
 165        LeaveChannelBuffer leave_channel_buffer = 129;
 166        UpdateChannelBufferCollaborators update_channel_buffer_collaborators = 130;
 167        RejoinChannelBuffers rejoin_channel_buffers = 131;
 168        RejoinChannelBuffersResponse rejoin_channel_buffers_response = 132;
 169        AckBufferOperation ack_buffer_operation = 133;
 170
 171        JoinChannelChat join_channel_chat = 134;
 172        JoinChannelChatResponse join_channel_chat_response = 135;
 173        LeaveChannelChat leave_channel_chat = 136;
 174        SendChannelMessage send_channel_message = 137;
 175        SendChannelMessageResponse send_channel_message_response = 138;
 176        ChannelMessageSent channel_message_sent = 139;
 177        GetChannelMessages get_channel_messages = 140;
 178        GetChannelMessagesResponse get_channel_messages_response = 141;
 179        RemoveChannelMessage remove_channel_message = 142;
 180        AckChannelMessage ack_channel_message = 143;
 181        GetChannelMessagesById get_channel_messages_by_id = 144;
 182
 183        MoveChannel move_channel = 147;
 184        SetChannelVisibility set_channel_visibility = 148;
 185
 186        AddNotification add_notification = 149;
 187        GetNotifications get_notifications = 150;
 188        GetNotificationsResponse get_notifications_response = 151;
 189        DeleteNotification delete_notification = 152;
 190        MarkNotificationRead mark_notification_read = 153;
 191        LspExtExpandMacro lsp_ext_expand_macro = 154;
 192        LspExtExpandMacroResponse lsp_ext_expand_macro_response = 155;
 193        SetRoomParticipantRole set_room_participant_role = 156;
 194
 195        UpdateUserChannels update_user_channels = 157;
 196
 197        GetImplementation get_implementation = 162;
 198        GetImplementationResponse get_implementation_response = 163;
 199
 200        CountLanguageModelTokens count_language_model_tokens = 230;
 201        CountLanguageModelTokensResponse count_language_model_tokens_response = 231;
 202        GetCachedEmbeddings get_cached_embeddings = 189;
 203        GetCachedEmbeddingsResponse get_cached_embeddings_response = 190;
 204        ComputeEmbeddings compute_embeddings = 191;
 205        ComputeEmbeddingsResponse compute_embeddings_response = 192;
 206
 207        UpdateChannelMessage update_channel_message = 170;
 208        ChannelMessageUpdate channel_message_update = 171;
 209
 210        BlameBuffer blame_buffer = 172;
 211        BlameBufferResponse blame_buffer_response = 173;
 212
 213        UpdateNotification update_notification = 174;
 214
 215        MultiLspQuery multi_lsp_query = 175;
 216        MultiLspQueryResponse multi_lsp_query_response = 176;
 217        RestartLanguageServers restart_language_servers = 208;
 218
 219        RejoinRemoteProjects rejoin_remote_projects = 186;
 220        RejoinRemoteProjectsResponse rejoin_remote_projects_response = 187;
 221
 222        OpenNewBuffer open_new_buffer = 196;
 223
 224        GetSupermavenApiKey get_supermaven_api_key = 198;
 225        GetSupermavenApiKeyResponse get_supermaven_api_key_response = 199;
 226
 227        TaskContextForLocation task_context_for_location = 203;
 228        TaskContext task_context = 204;
 229
 230        LinkedEditingRange linked_editing_range = 209;
 231        LinkedEditingRangeResponse linked_editing_range_response = 210;
 232
 233        AdvertiseContexts advertise_contexts = 211;
 234        OpenContext open_context = 212;
 235        OpenContextResponse open_context_response = 213;
 236        CreateContext create_context = 232;
 237        CreateContextResponse create_context_response = 233;
 238        UpdateContext update_context = 214;
 239        SynchronizeContexts synchronize_contexts = 215;
 240        SynchronizeContextsResponse synchronize_contexts_response = 216;
 241
 242        GetSignatureHelp get_signature_help = 217;
 243        GetSignatureHelpResponse get_signature_help_response = 218;
 244
 245        ListRemoteDirectory list_remote_directory = 219;
 246        ListRemoteDirectoryResponse list_remote_directory_response = 220;
 247        AddWorktree add_worktree = 222;
 248        AddWorktreeResponse add_worktree_response = 223;
 249
 250        GetLlmToken get_llm_token = 235;
 251        GetLlmTokenResponse get_llm_token_response = 236;
 252        RefreshLlmToken refresh_llm_token = 259;
 253
 254        LspExtSwitchSourceHeader lsp_ext_switch_source_header = 241;
 255        LspExtSwitchSourceHeaderResponse lsp_ext_switch_source_header_response = 242;
 256
 257        FindSearchCandidates find_search_candidates = 243;
 258        FindSearchCandidatesResponse find_search_candidates_response = 244;
 259
 260        CloseBuffer close_buffer = 245;
 261
 262        ShutdownRemoteServer shutdown_remote_server = 257;
 263
 264        RemoveWorktree remove_worktree = 258;
 265
 266        LanguageServerLog language_server_log = 260;
 267
 268        Toast toast = 261;
 269        HideToast hide_toast = 262;
 270
 271        OpenServerSettings open_server_settings = 263;
 272
 273        GetPermalinkToLine get_permalink_to_line = 264;
 274        GetPermalinkToLineResponse get_permalink_to_line_response = 265;
 275
 276        FlushBufferedMessages flush_buffered_messages = 267;
 277
 278        LanguageServerPromptRequest language_server_prompt_request = 268;
 279        LanguageServerPromptResponse language_server_prompt_response = 269;
 280
 281        GitBranchesResponse git_branches_response = 271;
 282
 283        UpdateGitBranch update_git_branch = 272;
 284
 285        ListToolchains list_toolchains = 273;
 286        ListToolchainsResponse list_toolchains_response = 274;
 287        ActivateToolchain activate_toolchain = 275;
 288        ActiveToolchain active_toolchain = 276;
 289        ActiveToolchainResponse active_toolchain_response = 277;
 290
 291        GetPathMetadata get_path_metadata = 278;
 292        GetPathMetadataResponse get_path_metadata_response = 279;
 293
 294        GetPanicFiles get_panic_files = 280;
 295        GetPanicFilesResponse get_panic_files_response = 281;
 296
 297        CancelLanguageServerWork cancel_language_server_work = 282;
 298
 299        LspExtOpenDocs lsp_ext_open_docs = 283;
 300        LspExtOpenDocsResponse lsp_ext_open_docs_response = 284;
 301
 302        SyncExtensions sync_extensions = 285;
 303        SyncExtensionsResponse sync_extensions_response = 286;
 304        InstallExtension install_extension = 287;
 305
 306        OpenUnstagedDiff open_unstaged_diff = 288;
 307        OpenUnstagedDiffResponse open_unstaged_diff_response = 289;
 308
 309        RegisterBufferWithLanguageServers register_buffer_with_language_servers = 290;
 310
 311        Stage stage = 293;
 312        Unstage unstage = 294;
 313        Commit commit = 295;
 314        OpenCommitMessageBuffer open_commit_message_buffer = 296;
 315
 316        OpenUncommittedDiff open_uncommitted_diff = 297;
 317        OpenUncommittedDiffResponse open_uncommitted_diff_response = 298;
 318
 319        SetIndexText set_index_text = 299;
 320
 321        GitShow git_show = 300;
 322        GitReset git_reset = 301;
 323        GitCommitDetails git_commit_details = 302;
 324        GitCheckoutFiles git_checkout_files = 303;
 325
 326
 327        Push push = 304;
 328        Fetch fetch = 305;
 329        GetRemotes get_remotes = 306;
 330        GetRemotesResponse get_remotes_response = 307;
 331        Pull pull = 308;
 332
 333        ApplyCodeActionKind apply_code_action_kind = 309;
 334        ApplyCodeActionKindResponse apply_code_action_kind_response = 310;
 335
 336        RemoteMessageResponse remote_message_response = 311;
 337
 338        GitGetBranches git_get_branches = 312;
 339        GitCreateBranch git_create_branch = 313;
 340        GitChangeBranch git_change_branch = 314;
 341
 342        CheckForPushedCommits check_for_pushed_commits = 315;
 343        CheckForPushedCommitsResponse check_for_pushed_commits_response = 316;
 344
 345        AskPassRequest ask_pass_request = 317;
 346        AskPassResponse ask_pass_response = 318;
 347
 348        GitDiff git_diff = 319;
 349        GitDiffResponse git_diff_response = 320;
 350        GitInit git_init = 321;
 351
 352        CodeLens code_lens = 322;
 353        GetCodeLens get_code_lens = 323;
 354        GetCodeLensResponse get_code_lens_response = 324;
 355        RefreshCodeLens refresh_code_lens = 325;
 356
 357        ToggleBreakpoint toggle_breakpoint = 326;
 358        BreakpointsForFile breakpoints_for_file = 327;
 359
 360        UpdateRepository update_repository = 328;
 361        RemoveRepository remove_repository = 329;
 362
 363        GetDocumentSymbols get_document_symbols = 330;
 364        GetDocumentSymbolsResponse get_document_symbols_response = 331; // current max
 365    }
 366
 367    reserved 87 to 88;
 368    reserved 158 to 161;
 369    reserved 164;
 370    reserved 166 to 169;
 371    reserved 177 to 185;
 372    reserved 188;
 373    reserved 193 to 195;
 374    reserved 197;
 375    reserved 200 to 202;
 376    reserved 205 to 206;
 377    reserved 221;
 378    reserved 224 to 229;
 379    reserved 246;
 380    reserved 270;
 381    reserved 247 to 254;
 382    reserved 255 to 256;
 383}
 384
 385// Messages
 386
 387message Hello {
 388    PeerId peer_id = 1;
 389}
 390
 391message Ping {}
 392
 393message Ack {}
 394
 395message Error {
 396    string message = 1;
 397    ErrorCode code = 2;
 398    repeated string tags = 3;
 399}
 400
 401enum ErrorCode {
 402    Internal = 0;
 403    NoSuchChannel = 1;
 404    Disconnected = 2;
 405    SignedOut = 3;
 406    UpgradeRequired = 4;
 407    Forbidden = 5;
 408    NeedsCla = 7;
 409    NotARootChannel = 8;
 410    BadPublicNesting = 9;
 411    CircularNesting = 10;
 412    WrongMoveTarget = 11;
 413    UnsharedItem = 12;
 414    NoSuchProject = 13;
 415    DevServerProjectPathDoesNotExist = 16;
 416    RemoteUpgradeRequired = 17;
 417    RateLimitExceeded = 18;
 418    CommitFailed = 19;
 419    reserved 6;
 420    reserved 14 to 15;
 421}
 422
 423message EndStream {}
 424
 425message Test {
 426    uint64 id = 1;
 427}
 428
 429message CreateRoom {}
 430
 431message CreateRoomResponse {
 432    Room room = 1;
 433    optional LiveKitConnectionInfo live_kit_connection_info = 2;
 434}
 435
 436message JoinRoom {
 437    uint64 id = 1;
 438}
 439
 440message JoinRoomResponse {
 441    Room room = 1;
 442    optional uint64 channel_id = 2;
 443    optional LiveKitConnectionInfo live_kit_connection_info = 3;
 444}
 445
 446message RejoinRoom {
 447    uint64 id = 1;
 448    repeated UpdateProject reshared_projects = 2;
 449    repeated RejoinProject rejoined_projects = 3;
 450}
 451message RejoinRemoteProjects {
 452    repeated RejoinProject rejoined_projects = 1;
 453}
 454
 455message RejoinRemoteProjectsResponse {
 456    repeated RejoinedProject rejoined_projects = 1;
 457}
 458
 459message RejoinProject {
 460    uint64 id = 1;
 461    repeated RejoinWorktree worktrees = 2;
 462    repeated RejoinRepository repositories = 3;
 463}
 464
 465message RejoinWorktree {
 466    uint64 id = 1;
 467    uint64 scan_id = 2;
 468}
 469
 470message RejoinRepository {
 471    uint64 id = 1;
 472    uint64 scan_id = 2;
 473}
 474
 475message RejoinRoomResponse {
 476    Room room = 1;
 477    repeated ResharedProject reshared_projects = 2;
 478    repeated RejoinedProject rejoined_projects = 3;
 479}
 480
 481message ResharedProject {
 482    uint64 id = 1;
 483    repeated Collaborator collaborators = 2;
 484}
 485
 486message RejoinedProject {
 487    uint64 id = 1;
 488    repeated WorktreeMetadata worktrees = 2;
 489    repeated Collaborator collaborators = 3;
 490    repeated LanguageServer language_servers = 4;
 491}
 492
 493message LeaveRoom {}
 494
 495message Room {
 496    uint64 id = 1;
 497    repeated Participant participants = 2;
 498    repeated PendingParticipant pending_participants = 3;
 499    repeated Follower followers = 4;
 500    string livekit_room = 5;
 501}
 502
 503message Participant {
 504    uint64 user_id = 1;
 505    PeerId peer_id = 2;
 506    repeated ParticipantProject projects = 3;
 507    ParticipantLocation location = 4;
 508    uint32 participant_index = 5;
 509    ChannelRole role = 6;
 510    reserved 7;
 511}
 512
 513message PendingParticipant {
 514    uint64 user_id = 1;
 515    uint64 calling_user_id = 2;
 516    optional uint64 initial_project_id = 3;
 517}
 518
 519message ParticipantProject {
 520    uint64 id = 1;
 521    repeated string worktree_root_names = 2;
 522}
 523
 524message Follower {
 525    PeerId leader_id = 1;
 526    PeerId follower_id = 2;
 527    uint64 project_id = 3;
 528}
 529
 530message ParticipantLocation {
 531    oneof variant {
 532        SharedProject shared_project = 1;
 533        UnsharedProject unshared_project = 2;
 534        External external = 3;
 535    }
 536
 537    message SharedProject {
 538        uint64 id = 1;
 539    }
 540
 541    message UnsharedProject {}
 542
 543    message External {}
 544}
 545
 546message Call {
 547    uint64 room_id = 1;
 548    uint64 called_user_id = 2;
 549    optional uint64 initial_project_id = 3;
 550}
 551
 552message IncomingCall {
 553    uint64 room_id = 1;
 554    uint64 calling_user_id = 2;
 555    repeated uint64 participant_user_ids = 3;
 556    optional ParticipantProject initial_project = 4;
 557}
 558
 559message CallCanceled {
 560    uint64 room_id = 1;
 561}
 562
 563message CancelCall {
 564    uint64 room_id = 1;
 565    uint64 called_user_id = 2;
 566}
 567
 568message DeclineCall {
 569    uint64 room_id = 1;
 570}
 571
 572message UpdateParticipantLocation {
 573    uint64 room_id = 1;
 574    ParticipantLocation location = 2;
 575}
 576
 577message RoomUpdated {
 578    Room room = 1;
 579}
 580
 581message LiveKitConnectionInfo {
 582    string server_url = 1;
 583    string token = 2;
 584    bool can_publish = 3;
 585}
 586
 587message ShareProject {
 588    uint64 room_id = 1;
 589    repeated WorktreeMetadata worktrees = 2;
 590    reserved 3;
 591    bool is_ssh_project = 4;
 592}
 593
 594message ShareProjectResponse {
 595    uint64 project_id = 1;
 596}
 597
 598message UnshareProject {
 599    uint64 project_id = 1;
 600}
 601
 602message UpdateProject {
 603    uint64 project_id = 1;
 604    repeated WorktreeMetadata worktrees = 2;
 605}
 606
 607message JoinProject {
 608    uint64 project_id = 1;
 609}
 610
 611message ListRemoteDirectoryConfig {
 612    bool is_dir = 1;
 613}
 614
 615message ListRemoteDirectory {
 616    uint64 dev_server_id = 1;
 617    string path = 2;
 618    ListRemoteDirectoryConfig config = 3;
 619}
 620
 621message EntryInfo {
 622    bool is_dir = 1;
 623}
 624
 625message ListRemoteDirectoryResponse {
 626    repeated string entries = 1;
 627    repeated EntryInfo entry_info = 2;
 628}
 629
 630message JoinProjectResponse {
 631    uint64 project_id = 5;
 632    uint32 replica_id = 1;
 633    repeated WorktreeMetadata worktrees = 2;
 634    repeated Collaborator collaborators = 3;
 635    repeated LanguageServer language_servers = 4;
 636    ChannelRole role = 6;
 637    reserved 7;
 638}
 639
 640message LeaveProject {
 641    uint64 project_id = 1;
 642}
 643
 644message UpdateWorktree {
 645    uint64 project_id = 1;
 646    uint64 worktree_id = 2;
 647    string root_name = 3;
 648    repeated Entry updated_entries = 4;
 649    repeated uint64 removed_entries = 5;
 650    repeated RepositoryEntry updated_repositories = 6; // deprecated
 651    repeated uint64 removed_repositories = 7; // deprecated
 652    uint64 scan_id = 8;
 653    bool is_last_update = 9;
 654    string abs_path = 10;
 655}
 656
 657message UpdateWorktreeSettings {
 658    uint64 project_id = 1;
 659    uint64 worktree_id = 2;
 660    string path = 3;
 661    optional string content = 4;
 662    optional LocalSettingsKind kind = 5;
 663}
 664
 665enum LocalSettingsKind {
 666    Settings = 0;
 667    Tasks = 1;
 668    Editorconfig = 2;
 669}
 670
 671message CreateProjectEntry {
 672    uint64 project_id = 1;
 673    uint64 worktree_id = 2;
 674    string path = 3;
 675    bool is_directory = 4;
 676}
 677
 678message RenameProjectEntry {
 679    uint64 project_id = 1;
 680    uint64 entry_id = 2;
 681    string new_path = 3;
 682}
 683
 684message CopyProjectEntry {
 685    uint64 project_id = 1;
 686    uint64 entry_id = 2;
 687    string new_path = 3;
 688    optional string relative_worktree_source_path = 4;
 689}
 690
 691message DeleteProjectEntry {
 692    uint64 project_id = 1;
 693    uint64 entry_id = 2;
 694    bool use_trash = 3;
 695}
 696
 697message ExpandProjectEntry {
 698    uint64 project_id = 1;
 699    uint64 entry_id = 2;
 700}
 701
 702message ExpandProjectEntryResponse {
 703    uint64 worktree_scan_id = 1;
 704}
 705
 706message ExpandAllForProjectEntry {
 707    uint64 project_id = 1;
 708    uint64 entry_id = 2;
 709}
 710
 711message ExpandAllForProjectEntryResponse {
 712    uint64 worktree_scan_id = 1;
 713}
 714
 715message ProjectEntryResponse {
 716    optional Entry entry = 1;
 717    uint64 worktree_scan_id = 2;
 718}
 719
 720message AddProjectCollaborator {
 721    uint64 project_id = 1;
 722    Collaborator collaborator = 2;
 723}
 724
 725message UpdateProjectCollaborator {
 726    uint64 project_id = 1;
 727    PeerId old_peer_id = 2;
 728    PeerId new_peer_id = 3;
 729}
 730
 731message RemoveProjectCollaborator {
 732    uint64 project_id = 1;
 733    PeerId peer_id = 2;
 734}
 735
 736message UpdateChannelBufferCollaborators {
 737    uint64 channel_id = 1;
 738    repeated Collaborator collaborators = 2;
 739}
 740
 741message GetDefinition {
 742     uint64 project_id = 1;
 743     uint64 buffer_id = 2;
 744     Anchor position = 3;
 745     repeated VectorClockEntry version = 4;
 746}
 747
 748message GetDefinitionResponse {
 749    repeated LocationLink links = 1;
 750}
 751
 752message GetDeclaration {
 753     uint64 project_id = 1;
 754     uint64 buffer_id = 2;
 755     Anchor position = 3;
 756     repeated VectorClockEntry version = 4;
 757}
 758
 759message GetDeclarationResponse {
 760    repeated LocationLink links = 1;
 761}
 762
 763message GetTypeDefinition {
 764     uint64 project_id = 1;
 765     uint64 buffer_id = 2;
 766     Anchor position = 3;
 767     repeated VectorClockEntry version = 4;
 768 }
 769
 770message GetTypeDefinitionResponse {
 771    repeated LocationLink links = 1;
 772}
 773message GetImplementation {
 774     uint64 project_id = 1;
 775     uint64 buffer_id = 2;
 776     Anchor position = 3;
 777     repeated VectorClockEntry version = 4;
 778 }
 779
 780message GetImplementationResponse {
 781    repeated LocationLink links = 1;
 782}
 783
 784message GetReferences {
 785     uint64 project_id = 1;
 786     uint64 buffer_id = 2;
 787     Anchor position = 3;
 788     repeated VectorClockEntry version = 4;
 789 }
 790
 791message GetReferencesResponse {
 792    repeated Location locations = 1;
 793}
 794
 795message GetDocumentHighlights {
 796     uint64 project_id = 1;
 797     uint64 buffer_id = 2;
 798     Anchor position = 3;
 799     repeated VectorClockEntry version = 4;
 800 }
 801
 802message GetDocumentHighlightsResponse {
 803    repeated DocumentHighlight highlights = 1;
 804}
 805
 806message Location {
 807    uint64 buffer_id = 1;
 808    Anchor start = 2;
 809    Anchor end = 3;
 810}
 811
 812message LocationLink {
 813    optional Location origin = 1;
 814    Location target = 2;
 815}
 816
 817message DocumentHighlight {
 818    Kind kind = 1;
 819    Anchor start = 2;
 820    Anchor end = 3;
 821
 822    enum Kind {
 823        Text = 0;
 824        Read = 1;
 825        Write = 2;
 826    }
 827}
 828
 829message GetProjectSymbols {
 830    uint64 project_id = 1;
 831    string query = 2;
 832}
 833
 834message GetProjectSymbolsResponse {
 835    repeated Symbol symbols = 4;
 836}
 837
 838message Symbol {
 839    uint64 source_worktree_id = 1;
 840    uint64 worktree_id = 2;
 841    string language_server_name = 3;
 842    string name = 4;
 843    int32 kind = 5;
 844    string path = 6;
 845    // Cannot use generate anchors for unopened files,
 846    // so we are forced to use point coords instead
 847    PointUtf16 start = 7;
 848    PointUtf16 end = 8;
 849    bytes signature = 9;
 850    uint64 language_server_id = 10;
 851}
 852
 853message GetDocumentSymbols {
 854    uint64 project_id = 1;
 855    uint64 buffer_id = 2;
 856    repeated VectorClockEntry version = 3;
 857}
 858
 859message GetDocumentSymbolsResponse {
 860    repeated DocumentSymbol symbols = 1;
 861}
 862
 863message DocumentSymbol {
 864    string name = 1;
 865    int32 kind = 2;
 866    // Cannot use generate anchors for unopened files,
 867    // so we are forced to use point coords instead
 868    PointUtf16 start = 3;
 869    PointUtf16 end = 4;
 870    PointUtf16 selection_start = 5;
 871    PointUtf16 selection_end = 6;
 872    repeated DocumentSymbol children = 7;
 873}
 874
 875message OpenBufferForSymbol {
 876    uint64 project_id = 1;
 877    Symbol symbol = 2;
 878}
 879
 880message OpenBufferForSymbolResponse {
 881    uint64 buffer_id = 1;
 882}
 883
 884message OpenBufferByPath {
 885    uint64 project_id = 1;
 886    uint64 worktree_id = 2;
 887    string path = 3;
 888}
 889
 890message OpenBufferById {
 891    uint64 project_id = 1;
 892    uint64 id = 2;
 893}
 894
 895message OpenNewBuffer {
 896    uint64 project_id = 1;
 897}
 898
 899message OpenBufferResponse {
 900    uint64 buffer_id = 1;
 901}
 902
 903message CreateBufferForPeer {
 904    uint64 project_id = 1;
 905    PeerId peer_id = 2;
 906    oneof variant {
 907        BufferState state = 3;
 908        BufferChunk chunk = 4;
 909    }
 910}
 911
 912message UpdateBuffer {
 913    uint64 project_id = 1;
 914    uint64 buffer_id = 2;
 915    repeated Operation operations = 3;
 916}
 917
 918message UpdateChannelBuffer {
 919    uint64 channel_id = 1;
 920    repeated Operation operations = 2;
 921}
 922
 923message UpdateBufferFile {
 924    uint64 project_id = 1;
 925    uint64 buffer_id = 2;
 926    File file = 3;
 927}
 928
 929message SaveBuffer {
 930    uint64 project_id = 1;
 931    uint64 buffer_id = 2;
 932    repeated VectorClockEntry version = 3;
 933    optional ProjectPath new_path = 4;
 934}
 935
 936message CloseBuffer {
 937    uint64 project_id = 1;
 938    uint64 buffer_id = 2;
 939}
 940
 941message ProjectPath {
 942    uint64 worktree_id = 1;
 943    string path = 2;
 944}
 945
 946message BufferSaved {
 947    uint64 project_id = 1;
 948    uint64 buffer_id = 2;
 949    repeated VectorClockEntry version = 3;
 950    Timestamp mtime = 4;
 951    reserved 5;
 952}
 953
 954message BufferReloaded {
 955    uint64 project_id = 1;
 956    uint64 buffer_id = 2;
 957    repeated VectorClockEntry version = 3;
 958    Timestamp mtime = 4;
 959    reserved 5;
 960    LineEnding line_ending = 6;
 961}
 962
 963message ReloadBuffers {
 964    uint64 project_id = 1;
 965    repeated uint64 buffer_ids = 2;
 966}
 967
 968message ReloadBuffersResponse {
 969    ProjectTransaction transaction = 1;
 970}
 971
 972message SynchronizeBuffers {
 973    uint64 project_id = 1;
 974    repeated BufferVersion buffers = 2;
 975}
 976
 977message SynchronizeBuffersResponse {
 978    repeated BufferVersion buffers = 1;
 979}
 980
 981message BufferVersion {
 982    uint64 id = 1;
 983    repeated VectorClockEntry version = 2;
 984}
 985
 986message ChannelBufferVersion {
 987    uint64 channel_id = 1;
 988    repeated VectorClockEntry version = 2;
 989    uint64 epoch = 3;
 990}
 991
 992message ApplyCodeActionKind {
 993    uint64 project_id = 1;
 994    string kind = 2;
 995    repeated uint64 buffer_ids = 3;
 996}
 997
 998message ApplyCodeActionKindResponse {
 999    ProjectTransaction transaction = 1;
1000}
1001
1002enum FormatTrigger {
1003    Save = 0;
1004    Manual = 1;
1005}
1006
1007message FormatBuffers {
1008    uint64 project_id = 1;
1009    FormatTrigger trigger = 2;
1010    repeated uint64 buffer_ids = 3;
1011}
1012
1013message FormatBuffersResponse {
1014    ProjectTransaction transaction = 1;
1015}
1016
1017message GetCompletions {
1018    uint64 project_id = 1;
1019    uint64 buffer_id = 2;
1020    Anchor position = 3;
1021    repeated VectorClockEntry version = 4;
1022}
1023
1024message GetCompletionsResponse {
1025    repeated Completion completions = 1;
1026    repeated VectorClockEntry version = 2;
1027}
1028
1029message ApplyCompletionAdditionalEdits {
1030    uint64 project_id = 1;
1031    uint64 buffer_id = 2;
1032    Completion completion = 3;
1033}
1034
1035message ApplyCompletionAdditionalEditsResponse {
1036    Transaction transaction = 1;
1037}
1038
1039message Completion {
1040    Anchor old_start = 1;
1041    Anchor old_end = 2;
1042    string new_text = 3;
1043    uint64 server_id = 4;
1044    bytes lsp_completion = 5;
1045    bool resolved = 6;
1046    Source source = 7;
1047    optional bytes lsp_defaults = 8;
1048    optional Anchor buffer_word_start = 9;
1049    optional Anchor buffer_word_end = 10;
1050
1051    enum Source {
1052        Lsp = 0;
1053        Custom = 1;
1054        BufferWord = 2;
1055    }
1056}
1057
1058message GetCodeActions {
1059    uint64 project_id = 1;
1060    uint64 buffer_id = 2;
1061    Anchor start = 3;
1062    Anchor end = 4;
1063    repeated VectorClockEntry version = 5;
1064}
1065
1066message GetCodeActionsResponse {
1067    repeated CodeAction actions = 1;
1068    repeated VectorClockEntry version = 2;
1069}
1070
1071message GetSignatureHelp {
1072    uint64 project_id = 1;
1073    uint64 buffer_id = 2;
1074    Anchor position = 3;
1075    repeated VectorClockEntry version = 4;
1076}
1077
1078message GetSignatureHelpResponse {
1079    optional SignatureHelp signature_help = 1;
1080}
1081
1082message SignatureHelp {
1083    repeated SignatureInformation signatures = 1;
1084    optional uint32 active_signature = 2;
1085    optional uint32 active_parameter = 3;
1086}
1087
1088message SignatureInformation {
1089    string label = 1;
1090    optional Documentation documentation = 2;
1091    repeated ParameterInformation parameters = 3;
1092    optional uint32 active_parameter = 4;
1093}
1094
1095message Documentation {
1096    oneof content {
1097        string value = 1;
1098        MarkupContent markup_content = 2;
1099    }
1100}
1101
1102enum MarkupKind {
1103    PlainText = 0;
1104    Markdown = 1;
1105}
1106
1107message ParameterInformation {
1108    oneof label {
1109        string simple = 1;
1110        LabelOffsets label_offsets = 2;
1111    }
1112    optional Documentation documentation = 3;
1113}
1114
1115message LabelOffsets {
1116    uint32 start = 1;
1117    uint32 end = 2;
1118}
1119
1120message GetHover {
1121    uint64 project_id = 1;
1122    uint64 buffer_id = 2;
1123    Anchor position = 3;
1124    repeated VectorClockEntry version = 5;
1125}
1126
1127message GetHoverResponse {
1128    optional Anchor start = 1;
1129    optional Anchor end = 2;
1130    repeated HoverBlock contents = 3;
1131}
1132
1133message HoverBlock {
1134    string text = 1;
1135    optional string language = 2;
1136    bool is_markdown = 3;
1137}
1138
1139message ApplyCodeAction {
1140    uint64 project_id = 1;
1141    uint64 buffer_id = 2;
1142    CodeAction action = 3;
1143}
1144
1145message ApplyCodeActionResponse {
1146    ProjectTransaction transaction = 1;
1147}
1148
1149message PrepareRename {
1150    uint64 project_id = 1;
1151    uint64 buffer_id = 2;
1152    Anchor position = 3;
1153    repeated VectorClockEntry version = 4;
1154}
1155
1156message PrepareRenameResponse {
1157    bool can_rename = 1;
1158    Anchor start = 2;
1159    Anchor end = 3;
1160    repeated VectorClockEntry version = 4;
1161    bool only_unprepared_rename_supported = 5;
1162}
1163
1164message PerformRename {
1165    uint64 project_id = 1;
1166    uint64 buffer_id = 2;
1167    Anchor position = 3;
1168    string new_name = 4;
1169    repeated VectorClockEntry version = 5;
1170}
1171
1172message OnTypeFormatting {
1173    uint64 project_id = 1;
1174    uint64 buffer_id = 2;
1175    Anchor position = 3;
1176    string trigger = 4;
1177    repeated VectorClockEntry version = 5;
1178}
1179
1180message OnTypeFormattingResponse {
1181    Transaction transaction = 1;
1182}
1183
1184
1185message LinkedEditingRange {
1186    uint64 project_id = 1;
1187    uint64 buffer_id = 2;
1188    Anchor position = 3;
1189    repeated VectorClockEntry version = 4;
1190}
1191
1192message AnchorRange {
1193    Anchor start = 1;
1194    Anchor end = 2;
1195}
1196
1197message LinkedEditingRangeResponse {
1198    repeated AnchorRange items = 1;
1199    repeated VectorClockEntry version = 4;
1200}
1201
1202message InlayHints {
1203    uint64 project_id = 1;
1204    uint64 buffer_id = 2;
1205    Anchor start = 3;
1206    Anchor end = 4;
1207    repeated VectorClockEntry version = 5;
1208}
1209
1210message InlayHintsResponse {
1211    repeated InlayHint hints = 1;
1212    repeated VectorClockEntry version = 2;
1213}
1214
1215message InlayHint {
1216    Anchor position = 1;
1217    InlayHintLabel label = 2;
1218    optional string kind = 3;
1219    bool padding_left = 4;
1220    bool padding_right = 5;
1221    InlayHintTooltip tooltip = 6;
1222    ResolveState resolve_state = 7;
1223}
1224
1225message InlayHintLabel {
1226    oneof label {
1227        string value = 1;
1228        InlayHintLabelParts label_parts = 2;
1229    }
1230}
1231
1232message InlayHintLabelParts {
1233    repeated InlayHintLabelPart parts = 1;
1234}
1235
1236message InlayHintLabelPart {
1237    string value = 1;
1238    InlayHintLabelPartTooltip tooltip = 2;
1239    optional string location_url = 3;
1240    PointUtf16 location_range_start = 4;
1241    PointUtf16 location_range_end = 5;
1242    optional uint64 language_server_id = 6;
1243}
1244
1245message InlayHintTooltip {
1246    oneof content {
1247        string value = 1;
1248        MarkupContent markup_content = 2;
1249    }
1250}
1251
1252message InlayHintLabelPartTooltip {
1253    oneof content {
1254        string value = 1;
1255        MarkupContent markup_content = 2;
1256    }
1257}
1258
1259message ResolveState {
1260    State state = 1;
1261    LspResolveState lsp_resolve_state = 2;
1262
1263    enum State {
1264        Resolved = 0;
1265        CanResolve = 1;
1266        Resolving = 2;
1267    }
1268
1269    message LspResolveState {
1270        optional string value = 1;
1271        uint64 server_id = 2;
1272    }
1273}
1274
1275// This type is used to resolve more than just
1276// the documentation, but for backwards-compatibility
1277// reasons we can't rename the type.
1278message ResolveCompletionDocumentation {
1279    uint64 project_id = 1;
1280    uint64 language_server_id = 2;
1281    bytes lsp_completion = 3;
1282    uint64 buffer_id = 4;
1283}
1284
1285message ResolveCompletionDocumentationResponse {
1286    string documentation = 1;
1287    bool documentation_is_markdown = 2;
1288    Anchor old_start = 3;
1289    Anchor old_end = 4;
1290    string new_text = 5;
1291    bytes lsp_completion = 6;
1292}
1293
1294message ResolveInlayHint {
1295    uint64 project_id = 1;
1296    uint64 buffer_id = 2;
1297    uint64 language_server_id = 3;
1298    InlayHint hint = 4;
1299}
1300
1301message ResolveInlayHintResponse {
1302    InlayHint hint = 1;
1303}
1304
1305message RefreshInlayHints {
1306    uint64 project_id = 1;
1307}
1308
1309message CodeLens {
1310    bytes lsp_lens = 1;
1311}
1312
1313message GetCodeLens {
1314    uint64 project_id = 1;
1315    uint64 buffer_id = 2;
1316    repeated VectorClockEntry version = 3;
1317}
1318
1319message GetCodeLensResponse {
1320    repeated CodeAction lens_actions = 1;
1321    repeated VectorClockEntry version = 2;
1322}
1323
1324message RefreshCodeLens {
1325    uint64 project_id = 1;
1326}
1327
1328message MarkupContent {
1329    bool is_markdown = 1;
1330    string value = 2;
1331}
1332
1333message PerformRenameResponse {
1334    ProjectTransaction transaction = 2;
1335}
1336
1337message SearchQuery {
1338    string query = 2;
1339    bool regex = 3;
1340    bool whole_word = 4;
1341    bool case_sensitive = 5;
1342    string files_to_include = 6;
1343    string files_to_exclude = 7;
1344    bool include_ignored = 8;
1345}
1346
1347message FindSearchCandidates {
1348    uint64 project_id = 1;
1349    SearchQuery query = 2;
1350    uint64 limit = 3;
1351}
1352
1353message FindSearchCandidatesResponse {
1354    repeated uint64 buffer_ids = 1;
1355}
1356
1357message CodeAction {
1358    uint64 server_id = 1;
1359    Anchor start = 2;
1360    Anchor end = 3;
1361    bytes lsp_action = 4;
1362    Kind kind = 5;
1363    bool resolved = 6;
1364    enum Kind {
1365        Action = 0;
1366        Command = 1;
1367        CodeLens = 2;
1368    }
1369}
1370
1371message ProjectTransaction {
1372    repeated uint64 buffer_ids = 1;
1373    repeated Transaction transactions = 2;
1374}
1375
1376message Transaction {
1377    LamportTimestamp id = 1;
1378    repeated LamportTimestamp edit_ids = 2;
1379    repeated VectorClockEntry start = 3;
1380}
1381
1382message LamportTimestamp {
1383    uint32 replica_id = 1;
1384    uint32 value = 2;
1385}
1386
1387message LanguageServer {
1388    uint64 id = 1;
1389    string name = 2;
1390    optional uint64 worktree_id = 3;
1391}
1392
1393message StartLanguageServer {
1394    uint64 project_id = 1;
1395    LanguageServer server = 2;
1396}
1397
1398message UpdateDiagnosticSummary {
1399    uint64 project_id = 1;
1400    uint64 worktree_id = 2;
1401    DiagnosticSummary summary = 3;
1402}
1403
1404message DiagnosticSummary {
1405    string path = 1;
1406    uint64 language_server_id = 2;
1407    uint32 error_count = 3;
1408    uint32 warning_count = 4;
1409}
1410
1411message UpdateLanguageServer {
1412    uint64 project_id = 1;
1413    uint64 language_server_id = 2;
1414    oneof variant {
1415        LspWorkStart work_start = 3;
1416        LspWorkProgress work_progress = 4;
1417        LspWorkEnd work_end = 5;
1418        LspDiskBasedDiagnosticsUpdating disk_based_diagnostics_updating = 6;
1419        LspDiskBasedDiagnosticsUpdated disk_based_diagnostics_updated = 7;
1420    }
1421}
1422
1423message LspWorkStart {
1424    string token = 1;
1425    optional string title = 4;
1426    optional string message = 2;
1427    optional uint32 percentage = 3;
1428    optional bool is_cancellable = 5;
1429}
1430
1431message LspWorkProgress {
1432    string token = 1;
1433    optional string message = 2;
1434    optional uint32 percentage = 3;
1435    optional bool is_cancellable = 4;
1436}
1437
1438message LspWorkEnd {
1439    string token = 1;
1440}
1441
1442message LspDiskBasedDiagnosticsUpdating {}
1443
1444message LspDiskBasedDiagnosticsUpdated {}
1445
1446message LanguageServerLog {
1447    uint64 project_id = 1;
1448    uint64 language_server_id = 2;
1449    oneof log_type {
1450        uint32 log_message_type = 3;
1451        LspLogTrace log_trace = 4;
1452    }
1453    string message = 5;
1454}
1455
1456message LspLogTrace {
1457    optional string message = 1;
1458}
1459
1460message UpdateChannels {
1461    repeated Channel channels = 1;
1462    repeated uint64 delete_channels = 4;
1463    repeated Channel channel_invitations = 5;
1464    repeated uint64 remove_channel_invitations = 6;
1465    repeated ChannelParticipants channel_participants = 7;
1466    repeated ChannelMessageId latest_channel_message_ids = 8;
1467    repeated ChannelBufferVersion latest_channel_buffer_versions = 9;
1468
1469    reserved 10 to 15;
1470}
1471
1472message UpdateUserChannels {
1473    repeated ChannelMessageId observed_channel_message_id = 1;
1474    repeated ChannelBufferVersion observed_channel_buffer_version = 2;
1475    repeated ChannelMembership channel_memberships = 3;
1476}
1477
1478message ChannelMembership {
1479    uint64 channel_id = 1;
1480    ChannelRole role = 2;
1481}
1482
1483message ChannelMessageId {
1484    uint64 channel_id = 1;
1485    uint64 message_id = 2;
1486}
1487
1488message ChannelPermission {
1489    uint64 channel_id = 1;
1490    ChannelRole role = 3;
1491}
1492
1493message ChannelParticipants {
1494    uint64 channel_id = 1;
1495    repeated uint64 participant_user_ids = 2;
1496}
1497
1498message JoinChannel {
1499    uint64 channel_id = 1;
1500}
1501
1502message DeleteChannel {
1503    uint64 channel_id = 1;
1504}
1505
1506message GetChannelMembers {
1507    uint64 channel_id = 1;
1508    string query = 2;
1509    uint64 limit = 3;
1510}
1511
1512message GetChannelMembersResponse {
1513    repeated ChannelMember members = 1;
1514    repeated User users = 2;
1515}
1516
1517message ChannelMember {
1518    uint64 user_id = 1;
1519    Kind kind = 3;
1520    ChannelRole role = 4;
1521
1522    enum Kind {
1523        Member = 0;
1524        Invitee = 1;
1525    }
1526}
1527
1528message SubscribeToChannels {}
1529
1530message CreateChannel {
1531    string name = 1;
1532    optional uint64 parent_id = 2;
1533}
1534
1535message CreateChannelResponse {
1536    Channel channel = 1;
1537    optional uint64 parent_id = 2;
1538}
1539
1540message InviteChannelMember {
1541    uint64 channel_id = 1;
1542    uint64 user_id = 2;
1543    ChannelRole role = 4;
1544}
1545
1546message RemoveChannelMember {
1547    uint64 channel_id = 1;
1548    uint64 user_id = 2;
1549}
1550
1551enum ChannelRole {
1552    Admin = 0;
1553    Member = 1;
1554    Guest = 2;
1555    Banned = 3;
1556    Talker = 4;
1557}
1558
1559message SetChannelMemberRole {
1560    uint64 channel_id = 1;
1561    uint64 user_id = 2;
1562    ChannelRole role = 3;
1563}
1564
1565message SetChannelVisibility {
1566    uint64 channel_id = 1;
1567    ChannelVisibility visibility = 2;
1568}
1569
1570message RenameChannel {
1571    uint64 channel_id = 1;
1572    string name = 2;
1573}
1574
1575message RenameChannelResponse {
1576    Channel channel = 1;
1577}
1578
1579message JoinChannelChat {
1580    uint64 channel_id = 1;
1581}
1582
1583message JoinChannelChatResponse {
1584    repeated ChannelMessage messages = 1;
1585    bool done = 2;
1586}
1587
1588message LeaveChannelChat {
1589    uint64 channel_id = 1;
1590}
1591
1592message SendChannelMessage {
1593    uint64 channel_id = 1;
1594    string body = 2;
1595    Nonce nonce = 3;
1596    repeated ChatMention mentions = 4;
1597    optional uint64 reply_to_message_id = 5;
1598}
1599
1600message RemoveChannelMessage {
1601    uint64 channel_id = 1;
1602    uint64 message_id = 2;
1603}
1604
1605message UpdateChannelMessage {
1606    uint64 channel_id = 1;
1607    uint64 message_id = 2;
1608    Nonce nonce = 4;
1609    string body = 5;
1610    repeated ChatMention mentions = 6;
1611}
1612
1613message AckChannelMessage {
1614    uint64 channel_id = 1;
1615    uint64 message_id = 2;
1616}
1617
1618message SendChannelMessageResponse {
1619    ChannelMessage message = 1;
1620}
1621
1622message ChannelMessageSent {
1623    uint64 channel_id = 1;
1624    ChannelMessage message = 2;
1625}
1626
1627message ChannelMessageUpdate {
1628    uint64 channel_id = 1;
1629    ChannelMessage message = 2;
1630}
1631
1632message GetChannelMessages {
1633    uint64 channel_id = 1;
1634    uint64 before_message_id = 2;
1635}
1636
1637message GetChannelMessagesResponse {
1638    repeated ChannelMessage messages = 1;
1639    bool done = 2;
1640}
1641
1642message GetChannelMessagesById {
1643    repeated uint64 message_ids = 1;
1644}
1645
1646message MoveChannel {
1647    uint64 channel_id = 1;
1648    uint64 to = 2;
1649}
1650
1651message JoinChannelBuffer {
1652    uint64 channel_id = 1;
1653}
1654
1655message ChannelMessage {
1656    uint64 id = 1;
1657    string body = 2;
1658    uint64 timestamp = 3;
1659    uint64 sender_id = 4;
1660    Nonce nonce = 5;
1661    repeated ChatMention mentions = 6;
1662    optional uint64 reply_to_message_id = 7;
1663    optional uint64 edited_at = 8;
1664}
1665
1666message ChatMention {
1667    Range range = 1;
1668    uint64 user_id = 2;
1669}
1670
1671message RejoinChannelBuffers {
1672    repeated ChannelBufferVersion buffers = 1;
1673}
1674
1675message RejoinChannelBuffersResponse {
1676    repeated RejoinedChannelBuffer buffers = 1;
1677}
1678
1679message AckBufferOperation {
1680    uint64 buffer_id = 1;
1681    uint64 epoch = 2;
1682    repeated VectorClockEntry version = 3;
1683}
1684
1685message JoinChannelBufferResponse {
1686    uint64 buffer_id = 1;
1687    uint32 replica_id = 2;
1688    string base_text = 3;
1689    repeated Operation operations = 4;
1690    repeated Collaborator collaborators = 5;
1691    uint64 epoch = 6;
1692}
1693
1694message RejoinedChannelBuffer {
1695    uint64 channel_id = 1;
1696    repeated VectorClockEntry version = 2;
1697    repeated Operation operations = 3;
1698    repeated Collaborator collaborators = 4;
1699}
1700
1701message LeaveChannelBuffer {
1702    uint64 channel_id = 1;
1703}
1704
1705message RespondToChannelInvite {
1706    uint64 channel_id = 1;
1707    bool accept = 2;
1708}
1709
1710message GetUsers {
1711    repeated uint64 user_ids = 1;
1712}
1713
1714message FuzzySearchUsers {
1715    string query = 1;
1716}
1717
1718message UsersResponse {
1719    repeated User users = 1;
1720}
1721
1722message RequestContact {
1723    uint64 responder_id = 1;
1724}
1725
1726message RemoveContact {
1727    uint64 user_id = 1;
1728}
1729
1730message RespondToContactRequest {
1731    uint64 requester_id = 1;
1732    ContactRequestResponse response = 2;
1733}
1734
1735enum ContactRequestResponse {
1736    Accept = 0;
1737    Decline = 1;
1738    Block = 2;
1739    Dismiss = 3;
1740}
1741
1742message UpdateContacts {
1743    repeated Contact contacts = 1;
1744    repeated uint64 remove_contacts = 2;
1745    repeated IncomingContactRequest incoming_requests = 3;
1746    repeated uint64 remove_incoming_requests = 4;
1747    repeated uint64 outgoing_requests = 5;
1748    repeated uint64 remove_outgoing_requests = 6;
1749}
1750
1751message UpdateInviteInfo {
1752    string url = 1;
1753    uint32 count = 2;
1754}
1755
1756message ShowContacts {}
1757
1758message IncomingContactRequest {
1759    uint64 requester_id = 1;
1760}
1761
1762message UpdateDiagnostics {
1763    uint32 replica_id = 1;
1764    uint32 lamport_timestamp = 2;
1765    uint64 server_id = 3;
1766    repeated Diagnostic diagnostics = 4;
1767}
1768
1769message Follow {
1770    uint64 room_id = 1;
1771    optional uint64 project_id = 2;
1772    PeerId leader_id = 3;
1773}
1774
1775message FollowResponse {
1776    View active_view = 3;
1777    // TODO: Remove after version 0.145.x stabilizes.
1778    optional ViewId active_view_id = 1;
1779    repeated View views = 2;
1780}
1781
1782message UpdateFollowers {
1783    uint64 room_id = 1;
1784    optional uint64 project_id = 2;
1785    reserved 3;
1786    oneof variant {
1787        View create_view = 5;
1788        // TODO: Remove after version 0.145.x stabilizes.
1789        UpdateActiveView update_active_view = 4;
1790        UpdateView update_view = 6;
1791    }
1792}
1793
1794message Unfollow {
1795    uint64 room_id = 1;
1796    optional uint64 project_id = 2;
1797    PeerId leader_id = 3;
1798}
1799
1800message GetPrivateUserInfo {}
1801
1802message GetPrivateUserInfoResponse {
1803    string metrics_id = 1;
1804    bool staff = 2;
1805    repeated string flags = 3;
1806    optional uint64 accepted_tos_at = 4;
1807}
1808
1809enum Plan {
1810    Free = 0;
1811    ZedPro = 1;
1812}
1813
1814message UpdateUserPlan {
1815    Plan plan = 1;
1816}
1817
1818message AcceptTermsOfService {}
1819
1820message AcceptTermsOfServiceResponse {
1821    uint64 accepted_tos_at = 1;
1822}
1823
1824// Entities
1825
1826message ViewId {
1827    PeerId creator = 1;
1828    uint64 id = 2;
1829}
1830
1831message UpdateActiveView {
1832    optional ViewId id = 1;
1833    optional PeerId leader_id = 2;
1834    View view = 3;
1835}
1836
1837enum PanelId {
1838    AssistantPanel = 0;
1839    DebugPanel = 1;
1840}
1841
1842message UpdateView {
1843    ViewId id = 1;
1844    optional PeerId leader_id = 2;
1845
1846    oneof variant {
1847        Editor editor = 3;
1848    }
1849
1850    message Editor {
1851        repeated ExcerptInsertion inserted_excerpts = 1;
1852        repeated uint64 deleted_excerpts = 2;
1853        repeated Selection selections = 3;
1854        optional Selection pending_selection = 4;
1855        EditorAnchor scroll_top_anchor = 5;
1856        float scroll_x = 6;
1857        float scroll_y = 7;
1858    }
1859}
1860
1861message View {
1862    ViewId id = 1;
1863    optional PeerId leader_id = 2;
1864    optional PanelId panel_id = 6;
1865
1866    oneof variant {
1867        Editor editor = 3;
1868        ChannelView channel_view = 4;
1869        ContextEditor context_editor = 5;
1870    }
1871
1872    message Editor {
1873        bool singleton = 1;
1874        optional string title = 2;
1875        repeated Excerpt excerpts = 3;
1876        repeated Selection selections = 4;
1877        optional Selection pending_selection = 5;
1878        EditorAnchor scroll_top_anchor = 6;
1879        float scroll_x = 7;
1880        float scroll_y = 8;
1881    }
1882
1883    message ChannelView {
1884        uint64 channel_id = 1;
1885        Editor editor = 2;
1886    }
1887
1888    message ContextEditor {
1889        string context_id = 1;
1890        Editor editor = 2;
1891    }
1892}
1893
1894
1895message Collaborator {
1896    PeerId peer_id = 1;
1897    uint32 replica_id = 2;
1898    uint64 user_id = 3;
1899    bool is_host = 4;
1900}
1901
1902message User {
1903    uint64 id = 1;
1904    string github_login = 2;
1905    string avatar_url = 3;
1906    optional string email = 4;
1907    optional string name = 5;
1908}
1909
1910message File {
1911    uint64 worktree_id = 1;
1912    optional uint64 entry_id = 2;
1913    string path = 3;
1914    Timestamp mtime = 4;
1915    bool is_deleted = 5;
1916}
1917
1918message Entry {
1919    uint64 id = 1;
1920    bool is_dir = 2;
1921    string path = 3;
1922    uint64 inode = 4;
1923    Timestamp mtime = 5;
1924    bool is_ignored = 7;
1925    bool is_external = 8;
1926    reserved 6;
1927    reserved 9;
1928    bool is_fifo = 10;
1929    optional uint64 size = 11;
1930    optional string canonical_path = 12;
1931}
1932
1933message RepositoryEntry {
1934    uint64 work_directory_id = 1;
1935    reserved 2;
1936    repeated StatusEntry updated_statuses = 3;
1937    repeated string removed_statuses = 4;
1938    repeated string current_merge_conflicts = 5;
1939    optional Branch branch_summary = 6;
1940}
1941
1942message UpdateRepository {
1943    uint64 project_id = 1;
1944    uint64 id = 2;
1945    string abs_path = 3;
1946    repeated uint64 entry_ids = 4;
1947    optional Branch branch_summary = 5;
1948    repeated StatusEntry updated_statuses = 6;
1949    repeated string removed_statuses = 7;
1950    repeated string current_merge_conflicts = 8;
1951    uint64 scan_id = 9;
1952}
1953
1954message RemoveRepository {
1955    uint64 project_id = 1;
1956    uint64 id = 2;
1957}
1958
1959message StatusEntry {
1960    string repo_path = 1;
1961    // Can be removed once collab's min version is >=0.171.0.
1962    GitStatus simple_status = 2;
1963    GitFileStatus status = 3;
1964}
1965
1966enum GitStatus {
1967    Added = 0;
1968    Modified = 1;
1969    Conflict = 2;
1970    Deleted = 3;
1971    Updated = 4;
1972    TypeChanged = 5;
1973    Renamed = 6;
1974    Copied = 7;
1975    Unmodified = 8;
1976}
1977
1978message GitFileStatus {
1979    oneof variant {
1980        Untracked untracked = 1;
1981        Ignored ignored = 2;
1982        Unmerged unmerged = 3;
1983        Tracked tracked = 4;
1984    }
1985
1986    message Untracked {}
1987    message Ignored {}
1988    message Unmerged {
1989        GitStatus first_head = 1;
1990        GitStatus second_head = 2;
1991    }
1992    message Tracked {
1993        GitStatus index_status = 1;
1994        GitStatus worktree_status = 2;
1995    }
1996}
1997
1998message BufferState {
1999    uint64 id = 1;
2000    optional File file = 2;
2001    string base_text = 3;
2002    LineEnding line_ending = 5;
2003    repeated VectorClockEntry saved_version = 6;
2004    Timestamp saved_mtime = 8;
2005
2006    reserved 7;
2007    reserved 4;
2008}
2009
2010message BufferChunk {
2011    uint64 buffer_id = 1;
2012    repeated Operation operations = 2;
2013    bool is_last = 3;
2014}
2015
2016enum LineEnding {
2017    Unix = 0;
2018    Windows = 1;
2019}
2020
2021message Selection {
2022    uint64 id = 1;
2023    EditorAnchor start = 2;
2024    EditorAnchor end = 3;
2025    bool reversed = 4;
2026}
2027
2028message EditorAnchor {
2029    uint64 excerpt_id = 1;
2030    Anchor anchor = 2;
2031}
2032
2033enum CursorShape {
2034    CursorBar = 0;
2035    CursorBlock = 1;
2036    CursorUnderscore = 2;
2037    CursorHollow = 3;
2038}
2039
2040message ExcerptInsertion {
2041    Excerpt excerpt = 1;
2042    optional uint64 previous_excerpt_id = 2;
2043}
2044
2045message Excerpt {
2046    uint64 id = 1;
2047    uint64 buffer_id = 2;
2048    Anchor context_start = 3;
2049    Anchor context_end = 4;
2050    Anchor primary_start = 5;
2051    Anchor primary_end = 6;
2052}
2053
2054message Anchor {
2055    uint32 replica_id = 1;
2056    uint32 timestamp = 2;
2057    uint64 offset = 3;
2058    Bias bias = 4;
2059    optional uint64 buffer_id = 5;
2060}
2061
2062enum Bias {
2063    Left = 0;
2064    Right = 1;
2065}
2066
2067message Diagnostic {
2068    Anchor start = 1;
2069    Anchor end = 2;
2070    optional string source = 3;
2071    Severity severity = 4;
2072    string message = 5;
2073    optional string code = 6;
2074    uint64 group_id = 7;
2075    bool is_primary = 8;
2076
2077    reserved 9;
2078
2079    bool is_disk_based = 10;
2080    bool is_unnecessary = 11;
2081
2082    enum Severity {
2083        None = 0;
2084        Error = 1;
2085        Warning = 2;
2086        Information = 3;
2087        Hint = 4;
2088    }
2089    optional string data = 12;
2090}
2091
2092message Operation {
2093    oneof variant {
2094        Edit edit = 1;
2095        Undo undo = 2;
2096        UpdateSelections update_selections = 3;
2097        UpdateDiagnostics update_diagnostics = 4;
2098        UpdateCompletionTriggers update_completion_triggers = 5;
2099    }
2100
2101    message Edit {
2102        uint32 replica_id = 1;
2103        uint32 lamport_timestamp = 2;
2104        repeated VectorClockEntry version = 3;
2105        repeated Range ranges = 4;
2106        repeated string new_text = 5;
2107    }
2108
2109    message Undo {
2110        uint32 replica_id = 1;
2111        uint32 lamport_timestamp = 2;
2112        repeated VectorClockEntry version = 3;
2113        repeated UndoCount counts = 4;
2114    }
2115
2116    message UpdateSelections {
2117        uint32 replica_id = 1;
2118        uint32 lamport_timestamp = 2;
2119        repeated Selection selections = 3;
2120        bool line_mode = 4;
2121        CursorShape cursor_shape = 5;
2122    }
2123
2124    message UpdateCompletionTriggers {
2125        uint32 replica_id = 1;
2126        uint32 lamport_timestamp = 2;
2127        repeated string triggers = 3;
2128        uint64 language_server_id = 4;
2129    }
2130}
2131
2132message UndoMapEntry {
2133    uint32 replica_id = 1;
2134    uint32 local_timestamp = 2;
2135    repeated UndoCount counts = 3;
2136}
2137
2138message UndoCount {
2139    uint32 replica_id = 1;
2140    uint32 lamport_timestamp = 2;
2141    uint32 count = 3;
2142}
2143
2144message VectorClockEntry {
2145    uint32 replica_id = 1;
2146    uint32 timestamp = 2;
2147}
2148
2149message Timestamp {
2150    uint64 seconds = 1;
2151    uint32 nanos = 2;
2152}
2153
2154message Range {
2155    uint64 start = 1;
2156    uint64 end = 2;
2157}
2158
2159message PointUtf16 {
2160    uint32 row = 1;
2161    uint32 column = 2;
2162}
2163
2164message Nonce {
2165    uint64 upper_half = 1;
2166    uint64 lower_half = 2;
2167}
2168
2169enum ChannelVisibility {
2170    Public = 0;
2171    Members = 1;
2172}
2173
2174message Channel {
2175    uint64 id = 1;
2176    string name = 2;
2177    ChannelVisibility visibility = 3;
2178    repeated uint64 parent_path = 5;
2179}
2180
2181message Contact {
2182    uint64 user_id = 1;
2183    bool online = 2;
2184    bool busy = 3;
2185}
2186
2187message WorktreeMetadata {
2188    uint64 id = 1;
2189    string root_name = 2;
2190    bool visible = 3;
2191    string abs_path = 4;
2192}
2193
2194message UpdateDiffBases {
2195    uint64 project_id = 1;
2196    uint64 buffer_id = 2;
2197
2198    enum Mode {
2199        // No collaborator is using the unstaged diff.
2200        HEAD_ONLY = 0;
2201        // No collaborator is using the diff from HEAD.
2202        INDEX_ONLY = 1;
2203        // Both the unstaged and uncommitted diffs are demanded,
2204        // and the contents of the index and HEAD are the same for this path.
2205        INDEX_MATCHES_HEAD = 2;
2206        // Both the unstaged and uncommitted diffs are demanded,
2207        // and the contents of the index and HEAD differ for this path,
2208        // where None means the path doesn't exist in that state of the repo.
2209        INDEX_AND_HEAD = 3;
2210    }
2211
2212    optional string staged_text = 3;
2213    optional string committed_text = 4;
2214    Mode mode = 5;
2215}
2216
2217message OpenUnstagedDiff {
2218    uint64 project_id = 1;
2219    uint64 buffer_id = 2;
2220}
2221
2222message OpenUnstagedDiffResponse {
2223    optional string staged_text = 1;
2224}
2225
2226message OpenUncommittedDiff {
2227    uint64 project_id = 1;
2228    uint64 buffer_id = 2;
2229}
2230
2231message OpenUncommittedDiffResponse {
2232    enum Mode {
2233        INDEX_MATCHES_HEAD = 0;
2234        INDEX_AND_HEAD = 1;
2235    }
2236    optional string staged_text = 1;
2237    optional string committed_text = 2;
2238    Mode mode = 3;
2239}
2240
2241message SetIndexText {
2242    uint64 project_id = 1;
2243    reserved 2;
2244    uint64 work_directory_id = 3;
2245    string path = 4;
2246    optional string text = 5;
2247}
2248
2249message GetNotifications {
2250    optional uint64 before_id = 1;
2251}
2252
2253message AddNotification {
2254    Notification notification = 1;
2255}
2256
2257message GetNotificationsResponse {
2258    repeated Notification notifications = 1;
2259    bool done = 2;
2260}
2261
2262message DeleteNotification {
2263    uint64 notification_id = 1;
2264}
2265
2266message UpdateNotification {
2267    Notification notification = 1;
2268}
2269
2270message MarkNotificationRead {
2271    uint64 notification_id = 1;
2272}
2273
2274message Notification {
2275    uint64 id = 1;
2276    uint64 timestamp = 2;
2277    string kind = 3;
2278    optional uint64 entity_id = 4;
2279    string content = 5;
2280    bool is_read = 6;
2281    optional bool response = 7;
2282}
2283
2284message LspExtExpandMacro {
2285    uint64 project_id = 1;
2286    uint64 buffer_id = 2;
2287    Anchor position = 3;
2288}
2289
2290message LspExtExpandMacroResponse {
2291    string name = 1;
2292    string expansion = 2;
2293}
2294
2295message LspExtOpenDocs {
2296    uint64 project_id = 1;
2297    uint64 buffer_id = 2;
2298    Anchor position = 3;
2299}
2300
2301message LspExtOpenDocsResponse {
2302    optional string web = 1;
2303    optional string local = 2;
2304}
2305
2306message LspExtSwitchSourceHeader {
2307    uint64 project_id = 1;
2308    uint64 buffer_id = 2;
2309}
2310
2311message LspExtSwitchSourceHeaderResponse {
2312    string target_file = 1;
2313}
2314
2315message SetRoomParticipantRole {
2316    uint64 room_id = 1;
2317    uint64 user_id = 2;
2318    ChannelRole role = 3;
2319}
2320
2321enum LanguageModelRole {
2322    LanguageModelUser = 0;
2323    LanguageModelAssistant = 1;
2324    LanguageModelSystem = 2;
2325    reserved 3;
2326}
2327
2328message CountLanguageModelTokens {
2329    LanguageModelProvider provider = 1;
2330    string request = 2;
2331}
2332
2333message CountLanguageModelTokensResponse {
2334    uint32 token_count = 1;
2335}
2336
2337enum LanguageModelProvider {
2338    Anthropic = 0;
2339    OpenAI = 1;
2340    Google = 2;
2341    Zed = 3;
2342}
2343
2344message GetCachedEmbeddings {
2345    string model = 1;
2346    repeated bytes digests = 2;
2347}
2348
2349message GetCachedEmbeddingsResponse {
2350    repeated Embedding embeddings = 1;
2351}
2352
2353message ComputeEmbeddings {
2354    string model = 1;
2355    repeated string texts = 2;
2356}
2357
2358message ComputeEmbeddingsResponse {
2359    repeated Embedding embeddings = 1;
2360}
2361
2362message Embedding {
2363    bytes digest = 1;
2364    repeated float dimensions = 2;
2365}
2366
2367message BlameBuffer {
2368    uint64 project_id = 1;
2369    uint64 buffer_id = 2;
2370    repeated VectorClockEntry version = 3;
2371}
2372
2373message BlameEntry {
2374    bytes sha = 1;
2375
2376    uint32 start_line = 2;
2377    uint32 end_line = 3;
2378    uint32 original_line_number = 4;
2379
2380    optional string author = 5;
2381    optional string author_mail = 6;
2382    optional int64 author_time = 7;
2383    optional string author_tz = 8;
2384
2385    optional string committer = 9;
2386    optional string committer_mail = 10;
2387    optional int64 committer_time = 11;
2388    optional string committer_tz = 12;
2389
2390    optional string summary = 13;
2391    optional string previous = 14;
2392
2393    string filename = 15;
2394}
2395
2396message CommitMessage {
2397    bytes oid = 1;
2398    string message = 2;
2399}
2400
2401message CommitPermalink {
2402    bytes oid = 1;
2403    string permalink = 2;
2404}
2405
2406message BlameBufferResponse {
2407    message BlameResponse {
2408        repeated BlameEntry entries = 1;
2409        repeated CommitMessage messages = 2;
2410        optional string remote_url = 4;
2411        reserved 3;
2412    }
2413
2414    optional BlameResponse blame_response = 5;
2415
2416    reserved 1 to 4;
2417}
2418
2419message MultiLspQuery {
2420    uint64 project_id = 1;
2421    uint64 buffer_id = 2;
2422    repeated VectorClockEntry version = 3;
2423    oneof strategy {
2424        AllLanguageServers all = 4;
2425    }
2426    oneof request {
2427        GetHover get_hover = 5;
2428        GetCodeActions get_code_actions = 6;
2429        GetSignatureHelp get_signature_help = 7;
2430        GetCodeLens get_code_lens = 8;
2431    }
2432}
2433
2434message AllLanguageServers {}
2435
2436message RestartLanguageServers {
2437    uint64 project_id = 1;
2438    repeated uint64 buffer_ids = 2;
2439}
2440
2441message MultiLspQueryResponse {
2442    repeated LspResponse responses = 1;
2443}
2444
2445message LspResponse {
2446    oneof response {
2447        GetHoverResponse get_hover_response = 1;
2448        GetCodeActionsResponse get_code_actions_response = 2;
2449        GetSignatureHelpResponse get_signature_help_response = 3;
2450        GetCodeLensResponse get_code_lens_response = 4;
2451    }
2452}
2453
2454message GetSupermavenApiKey {}
2455
2456message GetSupermavenApiKeyResponse {
2457    string api_key = 1;
2458}
2459
2460message TaskContextForLocation {
2461    uint64 project_id = 1;
2462    Location location = 2;
2463    map<string, string> task_variables = 3;
2464}
2465
2466message TaskContext {
2467    optional string cwd = 1;
2468    map<string, string> task_variables = 2;
2469    map<string, string> project_env = 3;
2470}
2471
2472message Shell {
2473    message WithArguments {
2474        string program = 1;
2475        repeated string args = 2;
2476    }
2477
2478    oneof shell_type {
2479        System system = 1;
2480        string program = 2;
2481        WithArguments with_arguments = 3;
2482    }
2483}
2484
2485message System {}
2486
2487enum RevealStrategy {
2488    RevealAlways = 0;
2489    RevealNever = 1;
2490}
2491
2492enum HideStrategy {
2493    HideAlways = 0;
2494    HideNever = 1;
2495    HideOnSuccess = 2;
2496}
2497
2498message ContextMessageStatus {
2499    oneof variant {
2500        Done done = 1;
2501        Pending pending = 2;
2502        Error error = 3;
2503        Canceled canceled = 4;
2504    }
2505
2506    message Done {}
2507
2508    message Pending {}
2509
2510    message Error {
2511        string message = 1;
2512    }
2513
2514    message Canceled {}
2515}
2516
2517message ContextMessage {
2518    LamportTimestamp id = 1;
2519    Anchor start = 2;
2520    LanguageModelRole role = 3;
2521    ContextMessageStatus status = 4;
2522}
2523
2524message SlashCommandOutputSection {
2525    AnchorRange range = 1;
2526    string icon_name = 2;
2527    string label = 3;
2528    optional string metadata = 4;
2529}
2530
2531message ThoughtProcessOutputSection {
2532    AnchorRange range = 1;
2533}
2534
2535message ContextOperation {
2536    oneof variant {
2537        InsertMessage insert_message = 1;
2538        UpdateMessage update_message = 2;
2539        UpdateSummary update_summary = 3;
2540        BufferOperation buffer_operation = 5;
2541        SlashCommandStarted slash_command_started = 6;
2542        SlashCommandOutputSectionAdded slash_command_output_section_added = 7;
2543        SlashCommandCompleted slash_command_completed = 8;
2544        ThoughtProcessOutputSectionAdded thought_process_output_section_added = 9;
2545    }
2546
2547    reserved 4;
2548
2549    message InsertMessage {
2550        ContextMessage message = 1;
2551        repeated VectorClockEntry version = 2;
2552    }
2553
2554    message UpdateMessage {
2555        LamportTimestamp message_id = 1;
2556        LanguageModelRole role = 2;
2557        ContextMessageStatus status = 3;
2558        LamportTimestamp timestamp = 4;
2559        repeated VectorClockEntry version = 5;
2560    }
2561
2562    message UpdateSummary {
2563        string summary = 1;
2564        bool done = 2;
2565        LamportTimestamp timestamp = 3;
2566        repeated VectorClockEntry version = 4;
2567    }
2568
2569    message SlashCommandStarted {
2570        LamportTimestamp id = 1;
2571        AnchorRange output_range = 2;
2572        string name = 3;
2573        repeated VectorClockEntry version = 4;
2574    }
2575
2576    message SlashCommandOutputSectionAdded {
2577        LamportTimestamp timestamp = 1;
2578        SlashCommandOutputSection section = 2;
2579        repeated VectorClockEntry version = 3;
2580    }
2581
2582    message SlashCommandCompleted {
2583        LamportTimestamp id = 1;
2584        LamportTimestamp timestamp = 3;
2585        optional string error_message = 4;
2586        repeated VectorClockEntry version = 5;
2587    }
2588
2589    message ThoughtProcessOutputSectionAdded {
2590        LamportTimestamp timestamp = 1;
2591        ThoughtProcessOutputSection section = 2;
2592        repeated VectorClockEntry version = 3;
2593    }
2594
2595    message BufferOperation {
2596        Operation operation = 1;
2597    }
2598}
2599
2600message Context {
2601    repeated ContextOperation operations = 1;
2602}
2603
2604message ContextMetadata {
2605    string context_id = 1;
2606    optional string summary = 2;
2607}
2608
2609message AdvertiseContexts {
2610    uint64 project_id = 1;
2611    repeated ContextMetadata contexts = 2;
2612}
2613
2614message OpenContext {
2615    uint64 project_id = 1;
2616    string context_id = 2;
2617}
2618
2619message OpenContextResponse {
2620    Context context = 1;
2621}
2622
2623message CreateContext {
2624    uint64 project_id = 1;
2625}
2626
2627message CreateContextResponse {
2628    string context_id = 1;
2629    Context context = 2;
2630}
2631
2632message UpdateContext {
2633    uint64 project_id = 1;
2634    string context_id = 2;
2635    ContextOperation operation = 3;
2636}
2637
2638message ContextVersion {
2639    string context_id = 1;
2640    repeated VectorClockEntry context_version = 2;
2641    repeated VectorClockEntry buffer_version = 3;
2642}
2643
2644message SynchronizeContexts {
2645    uint64 project_id = 1;
2646    repeated ContextVersion contexts = 2;
2647}
2648
2649message SynchronizeContextsResponse {
2650    repeated ContextVersion contexts = 1;
2651}
2652
2653message GetLlmToken {}
2654
2655message GetLlmTokenResponse {
2656    string token = 1;
2657}
2658
2659message RefreshLlmToken {}
2660
2661// Remote debugging
2662
2663enum BreakpointKind {
2664    Standard = 0;
2665    Log = 1;
2666}
2667
2668enum BreakpointState {
2669    Enabled = 0;
2670    Disabled = 1;
2671}
2672
2673
2674message Breakpoint {
2675    Anchor position = 1;
2676    BreakpointState state = 2;
2677    BreakpointKind kind = 3;
2678    optional string message = 4;
2679}
2680
2681message BreakpointsForFile {
2682    uint64 project_id = 1;
2683    string path = 2;
2684    repeated Breakpoint breakpoints = 3;
2685}
2686
2687message ToggleBreakpoint {
2688    uint64 project_id = 1;
2689    string path = 2;
2690    Breakpoint breakpoint = 3;
2691}
2692
2693enum DebuggerThreadItem {
2694    Console = 0;
2695    LoadedSource = 1;
2696    Modules = 2;
2697    Variables = 3;
2698}
2699
2700message DebuggerSetVariableState {
2701    string name = 1;
2702    DapScope scope = 2;
2703    string value = 3;
2704    uint64 stack_frame_id = 4;
2705    optional string evaluate_name = 5;
2706    uint64 parent_variables_reference = 6;
2707}
2708
2709message VariableListOpenEntry {
2710    oneof entry {
2711        DebuggerOpenEntryScope scope = 1;
2712        DebuggerOpenEntryVariable variable = 2;
2713    }
2714}
2715
2716message DebuggerOpenEntryScope {
2717    string name = 1;
2718}
2719
2720message DebuggerOpenEntryVariable {
2721    string scope_name = 1;
2722    string name = 2;
2723    uint64 depth = 3;
2724}
2725
2726message VariableListEntrySetState {
2727    uint64 depth = 1;
2728    DebuggerSetVariableState state = 2;
2729}
2730
2731message VariableListEntryVariable {
2732    uint64 depth = 1;
2733    DapScope scope = 2;
2734    DapVariable variable = 3;
2735    bool has_children = 4;
2736    uint64 container_reference = 5;
2737}
2738
2739message DebuggerScopeVariableIndex {
2740    repeated uint64 fetched_ids = 1;
2741    repeated DebuggerVariableContainer variables = 2;
2742}
2743
2744message DebuggerVariableContainer {
2745    uint64 container_reference = 1;
2746    DapVariable variable = 2;
2747    uint64 depth = 3;
2748}
2749
2750enum DapThreadStatus {
2751    Running = 0;
2752    Stopped = 1;
2753    Exited = 2;
2754    Ended = 3;
2755}
2756
2757message VariableListScopes {
2758    uint64 stack_frame_id = 1;
2759    repeated DapScope scopes = 2;
2760}
2761
2762message VariableListVariables {
2763    uint64 stack_frame_id = 1;
2764    uint64 scope_id = 2;
2765    DebuggerScopeVariableIndex variables = 3;
2766}
2767
2768
2769enum VariablesArgumentsFilter {
2770    Indexed = 0;
2771    Named = 1;
2772}
2773
2774message ValueFormat {
2775    optional bool hex = 1;
2776}
2777
2778message VariablesRequest {
2779    uint64 project_id = 1;
2780    uint64 client_id = 2;
2781    uint64 variables_reference = 3;
2782    optional VariablesArgumentsFilter filter = 4;
2783    optional uint64 start = 5;
2784    optional uint64 count = 6;
2785    optional ValueFormat format = 7;
2786}
2787
2788enum SteppingGranularity {
2789    Statement = 0;
2790    Line = 1;
2791    Instruction = 2;
2792}
2793
2794message DapLocationsRequest {
2795    uint64 project_id = 1;
2796    uint64 session_id = 2;
2797    uint64 location_reference = 3;
2798}
2799
2800message DapLocationsResponse {
2801    DapSource source = 1;
2802    uint64 line = 2;
2803    optional uint64 column = 3;
2804    optional uint64 end_line = 4;
2805    optional uint64 end_column = 5;
2806}
2807
2808enum DapEvaluateContext {
2809    Repl = 0;
2810    Watch = 1;
2811    Hover = 2;
2812    Clipboard = 3;
2813    EvaluateVariables = 4;
2814    EvaluateUnknown = 5;
2815}
2816
2817message DapEvaluateRequest {
2818    uint64 project_id = 1;
2819    uint64 client_id = 2;
2820    string expression = 3;
2821    optional uint64 frame_id = 4;
2822    optional DapEvaluateContext context = 5;
2823}
2824
2825message DapEvaluateResponse {
2826    string result = 1;
2827    optional string evaluate_type = 2;
2828    uint64 variable_reference = 3;
2829    optional uint64 named_variables = 4;
2830    optional uint64 indexed_variables = 5;
2831    optional string memory_reference = 6;
2832}
2833
2834
2835message DapCompletionRequest {
2836    uint64 project_id = 1;
2837    uint64 client_id = 2;
2838    string query = 3;
2839    optional uint64 frame_id = 4;
2840    optional uint64 line = 5;
2841    uint64 column = 6;
2842}
2843
2844enum DapCompletionItemType {
2845    Method = 0;
2846    Function = 1;
2847    Constructor = 2;
2848    Field = 3;
2849    Variable = 4;
2850    Class = 5;
2851    Interface = 6;
2852    Module = 7;
2853    Property = 8;
2854    Unit = 9;
2855    Value = 10;
2856    Enum = 11;
2857    Keyword = 12;
2858    Snippet = 13;
2859    Text = 14;
2860    Color = 15;
2861    CompletionItemFile = 16;
2862    Reference = 17;
2863    Customcolor = 19;
2864}
2865
2866message DapCompletionItem {
2867    string label = 1;
2868    optional string text = 2;
2869    optional string sort_text = 3;
2870    optional string detail = 4;
2871    optional DapCompletionItemType typ = 5;
2872    optional uint64 start = 6;
2873    optional uint64 length = 7;
2874    optional uint64 selection_start = 8;
2875    optional uint64 selection_length = 9;
2876}
2877
2878message DapCompletionResponse {
2879    uint64 client_id = 1;
2880    repeated DapCompletionItem completions = 2;
2881}
2882
2883message DapScopesRequest {
2884    uint64 project_id = 1;
2885    uint64 client_id = 2;
2886    uint64 stack_frame_id = 3;
2887}
2888
2889message DapScopesResponse {
2890    repeated DapScope scopes = 1;
2891}
2892
2893message DapSetVariableValueRequest {
2894    uint64 project_id = 1;
2895    uint64 client_id = 2;
2896    string name = 3;
2897    string value = 4;
2898    uint64 variables_reference = 5;
2899}
2900
2901message DapSetVariableValueResponse {
2902    uint64 client_id = 1;
2903    string value = 2;
2904    optional string variable_type = 3;
2905    optional uint64 variables_reference = 4;
2906    optional uint64 named_variables = 5;
2907    optional uint64 indexed_variables = 6;
2908    optional string memory_reference = 7;
2909}
2910
2911message DapPauseRequest {
2912    uint64 project_id = 1;
2913    uint64 client_id = 2;
2914    uint64 thread_id = 3;
2915}
2916
2917message DapDisconnectRequest {
2918    uint64 project_id = 1;
2919    uint64 client_id = 2;
2920    optional bool restart = 3;
2921    optional bool terminate_debuggee = 4;
2922    optional bool suspend_debuggee = 5;
2923}
2924
2925message DapTerminateThreadsRequest {
2926    uint64 project_id = 1;
2927    uint64 client_id = 2;
2928    repeated uint64 thread_ids = 3;
2929}
2930
2931message DapThreadsRequest {
2932    uint64 project_id = 1;
2933    uint64 client_id = 2;
2934}
2935
2936message DapThreadsResponse {
2937    repeated DapThread threads = 1;
2938}
2939
2940message DapTerminateRequest {
2941    uint64 project_id = 1;
2942    uint64 client_id = 2;
2943    optional bool restart = 3;
2944}
2945
2946message DapRestartRequest {
2947    uint64 project_id = 1;
2948    uint64 client_id = 2;
2949    bytes raw_args = 3;
2950}
2951
2952message DapRestartStackFrameRequest {
2953    uint64 project_id = 1;
2954    uint64 client_id = 2;
2955    uint64 stack_frame_id = 3;
2956}
2957
2958message ToggleIgnoreBreakpoints {
2959    uint64 project_id = 1;
2960    uint32 session_id = 2;
2961}
2962
2963message IgnoreBreakpointState {
2964    uint64 project_id = 1;
2965    uint64 session_id = 2;
2966    bool ignore = 3;
2967}
2968
2969message DapNextRequest {
2970    uint64 project_id = 1;
2971    uint64 client_id = 2;
2972    uint64 thread_id = 3;
2973    optional bool single_thread = 4;
2974    optional SteppingGranularity granularity = 5;
2975}
2976
2977message DapStepInRequest {
2978    uint64 project_id = 1;
2979    uint64 client_id = 2;
2980    uint64 thread_id = 3;
2981    optional uint64 target_id = 4;
2982    optional bool single_thread = 5;
2983    optional SteppingGranularity granularity = 6;
2984}
2985
2986message DapStepOutRequest {
2987    uint64 project_id = 1;
2988    uint64 client_id = 2;
2989    uint64 thread_id = 3;
2990    optional bool single_thread = 4;
2991    optional SteppingGranularity granularity = 5;
2992}
2993
2994message DapStepBackRequest {
2995    uint64 project_id = 1;
2996    uint64 client_id = 2;
2997    uint64 thread_id = 3;
2998    optional bool single_thread = 4;
2999    optional SteppingGranularity granularity = 5;
3000}
3001
3002message DapContinueRequest {
3003    uint64 project_id = 1;
3004    uint64 client_id = 2;
3005    uint64 thread_id = 3;
3006    optional bool single_thread = 4;
3007}
3008
3009message DapContinueResponse {
3010    uint64 client_id = 1;
3011    optional bool all_threads_continued = 2;
3012}
3013
3014message DapModulesRequest {
3015    uint64 project_id = 1;
3016    uint64 client_id = 2;
3017}
3018
3019message DapModulesResponse {
3020    uint64 client_id = 1;
3021    repeated DapModule modules = 2;
3022}
3023
3024message DapLoadedSourcesRequest {
3025    uint64 project_id = 1;
3026    uint64 client_id = 2;
3027}
3028
3029message DapLoadedSourcesResponse {
3030    uint64 client_id = 1;
3031    repeated DapSource sources = 2;
3032}
3033
3034message DapStackTraceRequest {
3035    uint64 project_id = 1;
3036    uint64 client_id = 2;
3037    uint64 thread_id = 3;
3038    optional uint64 start_frame = 4;
3039    optional uint64 stack_trace_levels = 5;
3040}
3041
3042message DapStackTraceResponse {
3043    repeated DapStackFrame frames = 1;
3044}
3045
3046message DapStackFrame {
3047    uint64 id = 1;
3048    string name = 2;
3049    optional DapSource source = 3;
3050    uint64 line = 4;
3051    uint64 column = 5;
3052    optional uint64 end_line = 6;
3053    optional uint64 end_column = 7;
3054    optional bool can_restart = 8;
3055    optional string instruction_pointer_reference = 9;
3056    optional DapModuleId module_id = 10;
3057    optional DapStackPresentationHint presentation_hint = 11;
3058}
3059
3060message DebuggerLoadedSourceList {
3061    uint64 client_id = 1;
3062    repeated DapSource sources = 2;
3063}
3064
3065message DapVariables {
3066    uint64 client_id = 1;
3067    repeated DapVariable variables = 2;
3068}
3069
3070// Remote Debugging: Dap Types
3071message DapVariable {
3072    string name = 1;
3073    string value = 2;
3074    optional string type = 3;
3075    // optional DapVariablePresentationHint presentation_hint = 4;
3076    optional string evaluate_name = 5;
3077    uint64 variables_reference = 6;
3078    optional uint64 named_variables = 7;
3079    optional uint64 indexed_variables = 8;
3080    optional string memory_reference = 9;
3081}
3082
3083message DapThread {
3084    uint64 id = 1;
3085    string name = 2;
3086}
3087
3088message DapScope {
3089    string name = 1;
3090    optional DapScopePresentationHint presentation_hint = 2;
3091    uint64 variables_reference = 3;
3092    optional uint64 named_variables = 4;
3093    optional uint64 indexed_variables = 5;
3094    bool expensive = 6;
3095    optional DapSource source = 7;
3096    optional uint64 line = 8;
3097    optional uint64 column = 9;
3098    optional uint64 end_line = 10;
3099    optional uint64 end_column = 11;
3100}
3101
3102message DapSource {
3103    optional string name = 1;
3104    optional string path = 2;
3105    optional uint64 source_reference = 3;
3106    optional DapSourcePresentationHint presentation_hint = 4;
3107    optional string origin = 5;
3108    repeated DapSource sources = 6;
3109    optional bytes adapter_data = 7;
3110    repeated DapChecksum checksums = 8;
3111}
3112
3113enum DapOutputCategory {
3114    ConsoleOutput = 0;
3115    Important = 1;
3116    Stdout = 2;
3117    Stderr = 3;
3118    Unknown = 4;
3119}
3120
3121enum DapOutputEventGroup {
3122    Start = 0;
3123    StartCollapsed = 1;
3124    End = 2;
3125}
3126
3127message DapOutputEvent {
3128    string output = 1;
3129    optional DapOutputCategory category = 2;
3130    optional uint64 variables_reference = 3;
3131    optional DapOutputEventGroup group = 4;
3132    optional DapSource source = 5;
3133    optional uint32 line = 6;
3134    optional uint32 column = 7;
3135}
3136
3137enum DapChecksumAlgorithm {
3138    CHECKSUM_ALGORITHM_UNSPECIFIED = 0;
3139    MD5 = 1;
3140    SHA1 = 2;
3141    SHA256 = 3;
3142    TIMESTAMP = 4;
3143}
3144
3145message DapChecksum {
3146    DapChecksumAlgorithm algorithm = 1;
3147    string checksum = 2;
3148}
3149
3150enum DapScopePresentationHint {
3151    Arguments = 0;
3152    Locals = 1;
3153    Registers = 2;
3154    ReturnValue = 3;
3155    ScopeUnknown = 4;
3156}
3157
3158enum DapSourcePresentationHint {
3159    SourceNormal = 0;
3160    Emphasize = 1;
3161    Deemphasize = 2;
3162    SourceUnknown = 3;
3163}
3164
3165enum DapStackPresentationHint {
3166    StackNormal = 0;
3167    Label = 1;
3168    Subtle = 2;
3169    StackUnknown = 3;
3170}
3171
3172message DapModule {
3173    DapModuleId id = 1;
3174    string name = 2;
3175    optional string path = 3;
3176    optional bool is_optimized = 4;
3177    optional bool is_user_code = 5;
3178    optional string version = 6;
3179    optional string symbol_status = 7;
3180    optional string symbol_file_path = 8;
3181    optional string date_time_stamp = 9;
3182    optional string address_range = 10;
3183}
3184
3185message DapModuleId {
3186    oneof id {
3187        uint32 number = 1;
3188        string string = 2;
3189    }
3190}
3191
3192// Remote FS
3193
3194message AddWorktree {
3195    string path = 1;
3196    uint64 project_id = 2;
3197    bool visible = 3;
3198}
3199
3200message AddWorktreeResponse {
3201    uint64 worktree_id = 1;
3202    string canonicalized_path = 2;
3203}
3204
3205message GetPathMetadata {
3206    uint64 project_id = 1;
3207    string path = 2;
3208}
3209
3210message GetPathMetadataResponse {
3211    bool exists = 1;
3212    string path = 2;
3213    bool is_dir = 3;
3214}
3215
3216message ShutdownRemoteServer {}
3217
3218message RemoveWorktree {
3219    uint64 worktree_id = 1;
3220}
3221
3222message Toast {
3223    uint64 project_id = 1;
3224    string notification_id = 2;
3225    string message = 3;
3226}
3227
3228message HideToast {
3229    uint64 project_id = 1;
3230    string notification_id = 2;
3231}
3232
3233message OpenServerSettings {
3234    uint64 project_id = 1;
3235}
3236
3237message GetPermalinkToLine {
3238    uint64 project_id = 1;
3239    uint64 buffer_id = 2;
3240    Range selection = 3;
3241}
3242
3243message GetPermalinkToLineResponse {
3244    string permalink = 1;
3245}
3246message FlushBufferedMessages {}
3247message FlushBufferedMessagesResponse {}
3248
3249message LanguageServerPromptRequest {
3250    uint64 project_id = 1;
3251
3252    oneof level {
3253        Info info = 2;
3254        Warning warning = 3;
3255        Critical critical = 4;
3256    }
3257
3258    message Info {}
3259    message Warning {}
3260    message Critical {}
3261
3262    string message = 5;
3263    repeated string actions = 6;
3264    string lsp_name = 7;
3265}
3266
3267message LanguageServerPromptResponse {
3268    optional uint64 action_response = 1;
3269}
3270
3271message ListToolchains {
3272    uint64 project_id = 1;
3273    uint64 worktree_id = 2;
3274    string language_name = 3;
3275}
3276
3277message Toolchain {
3278    string name = 1;
3279    string path = 2;
3280    string raw_json = 3;
3281}
3282
3283message ToolchainGroup {
3284    uint64 start_index = 1;
3285    string name = 2;
3286}
3287
3288message ListToolchainsResponse {
3289    repeated Toolchain toolchains = 1;
3290    bool has_values = 2;
3291    repeated ToolchainGroup groups = 3;
3292}
3293
3294message ActivateToolchain {
3295    uint64 project_id = 1;
3296    uint64 worktree_id = 2;
3297    Toolchain toolchain = 3;
3298    string language_name = 4;
3299}
3300
3301message ActiveToolchain {
3302    uint64 project_id = 1;
3303    uint64 worktree_id = 2;
3304    string language_name = 3;
3305}
3306
3307message ActiveToolchainResponse {
3308    optional Toolchain toolchain = 1;
3309}
3310
3311message CommitSummary {
3312    string sha = 1;
3313    string subject = 2;
3314    int64 commit_timestamp = 3;
3315}
3316
3317message Branch {
3318    bool is_head = 1;
3319    string name = 2;
3320    optional uint64 unix_timestamp = 3;
3321    optional GitUpstream upstream = 4;
3322    optional CommitSummary most_recent_commit = 5;
3323}
3324message GitUpstream {
3325    string ref_name = 1;
3326    optional UpstreamTracking tracking = 2;
3327}
3328message UpstreamTracking {
3329    uint64 ahead = 1;
3330    uint64 behind = 2;
3331}
3332
3333message GitBranches {
3334    uint64 project_id = 1;
3335    ProjectPath repository = 2;
3336}
3337
3338message GitBranchesResponse {
3339    repeated Branch branches = 1;
3340}
3341
3342message UpdateGitBranch {
3343    uint64 project_id = 1;
3344    string branch_name = 2;
3345    ProjectPath repository = 3;
3346}
3347
3348message GetPanicFiles {
3349}
3350
3351message GitShow {
3352    uint64 project_id = 1;
3353    reserved 2;
3354    uint64 work_directory_id = 3;
3355    string commit = 4;
3356}
3357
3358message GitCommitDetails {
3359    string sha = 1;
3360    string message = 2;
3361    int64 commit_timestamp = 3;
3362    string committer_email = 4;
3363    string committer_name = 5;
3364}
3365
3366message GitReset {
3367    uint64 project_id = 1;
3368    reserved 2;
3369    uint64 work_directory_id = 3;
3370    string commit = 4;
3371    ResetMode mode = 5;
3372    enum ResetMode {
3373        SOFT = 0;
3374        MIXED = 1;
3375    }
3376}
3377
3378message GitCheckoutFiles {
3379    uint64 project_id = 1;
3380    reserved 2;
3381    uint64 work_directory_id = 3;
3382    string commit = 4;
3383    repeated string paths = 5;
3384}
3385
3386message GetPanicFilesResponse {
3387    repeated string file_contents = 2;
3388}
3389
3390message CancelLanguageServerWork {
3391    uint64 project_id = 1;
3392
3393    oneof work {
3394        Buffers buffers = 2;
3395        LanguageServerWork language_server_work = 3;
3396    }
3397
3398    message Buffers {
3399        repeated uint64 buffer_ids = 2;
3400    }
3401
3402    message LanguageServerWork {
3403        uint64 language_server_id = 1;
3404        optional string token = 2;
3405    }
3406}
3407
3408message Extension {
3409    string id = 1;
3410    string version = 2;
3411    bool dev = 3;
3412}
3413
3414message SyncExtensions {
3415    repeated Extension extensions = 1;
3416}
3417
3418message SyncExtensionsResponse {
3419    string tmp_dir = 1;
3420    repeated Extension missing_extensions = 2;
3421}
3422
3423message InstallExtension {
3424    Extension extension = 1;
3425    string tmp_dir = 2;
3426}
3427
3428message RegisterBufferWithLanguageServers{
3429    uint64 project_id = 1;
3430    uint64 buffer_id = 2;
3431}
3432
3433message Stage {
3434    uint64 project_id = 1;
3435    reserved 2;
3436    uint64 work_directory_id = 3;
3437    repeated string paths = 4;
3438}
3439
3440message Unstage {
3441    uint64 project_id = 1;
3442    reserved 2;
3443    uint64 work_directory_id = 3;
3444    repeated string paths = 4;
3445}
3446
3447message Commit {
3448    uint64 project_id = 1;
3449    reserved 2;
3450    uint64 work_directory_id = 3;
3451    optional string name = 4;
3452    optional string email = 5;
3453    string message = 6;
3454}
3455
3456message OpenCommitMessageBuffer {
3457    uint64 project_id = 1;
3458    reserved 2;
3459    uint64 work_directory_id = 3;
3460}
3461
3462message Push {
3463    uint64 project_id = 1;
3464    reserved 2;
3465    uint64 work_directory_id = 3;
3466    string remote_name = 4;
3467    string branch_name = 5;
3468    optional PushOptions options = 6;
3469    uint64 askpass_id = 7;
3470
3471    enum PushOptions {
3472        SET_UPSTREAM = 0;
3473        FORCE = 1;
3474    }
3475}
3476
3477message Fetch {
3478    uint64 project_id = 1;
3479    reserved 2;
3480    uint64 work_directory_id = 3;
3481    uint64 askpass_id = 4;
3482}
3483
3484message GetRemotes {
3485    uint64 project_id = 1;
3486    reserved 2;
3487    uint64 work_directory_id = 3;
3488    optional string branch_name = 4;
3489}
3490
3491message GetRemotesResponse {
3492    repeated Remote remotes = 1;
3493
3494    message Remote {
3495        string name = 1;
3496    }
3497}
3498
3499message Pull {
3500    uint64 project_id = 1;
3501    reserved 2;
3502    uint64 work_directory_id = 3;
3503    string remote_name = 4;
3504    string branch_name = 5;
3505    uint64 askpass_id = 6;
3506}
3507
3508message RemoteMessageResponse {
3509    string stdout = 1;
3510    string stderr = 2;
3511}
3512
3513message AskPassRequest {
3514    uint64 project_id = 1;
3515    reserved 2;
3516    uint64 work_directory_id = 3;
3517    uint64 askpass_id = 4;
3518    string prompt = 5;
3519}
3520
3521message AskPassResponse {
3522    string response = 1;
3523}
3524
3525message GitGetBranches {
3526    uint64 project_id = 1;
3527    reserved 2;
3528    uint64 work_directory_id = 3;
3529}
3530
3531message GitCreateBranch {
3532    uint64 project_id = 1;
3533    reserved 2;
3534    uint64 work_directory_id = 3;
3535    string branch_name = 4;
3536}
3537
3538message GitChangeBranch {
3539    uint64 project_id = 1;
3540    reserved 2;
3541    uint64 work_directory_id = 3;
3542    string branch_name = 4;
3543}
3544
3545message CheckForPushedCommits {
3546    uint64 project_id = 1;
3547    reserved 2;
3548    uint64 work_directory_id = 3;
3549}
3550
3551message CheckForPushedCommitsResponse {
3552  repeated string pushed_to = 1;
3553}
3554
3555message GitDiff {
3556    uint64 project_id = 1;
3557    reserved 2;
3558    uint64 work_directory_id = 3;
3559    DiffType diff_type = 4;
3560
3561    enum DiffType {
3562        HEAD_TO_WORKTREE = 0;
3563        HEAD_TO_INDEX = 1;
3564    }
3565}
3566
3567message GitDiffResponse {
3568    string diff = 1;
3569}
3570
3571message GitInit {
3572    uint64 project_id = 1;
3573    string abs_path = 2;
3574    string fallback_branch_name = 3;
3575}