gauntlet/schema/backend.proto

285 lines
6.5 KiB
Protocol Buffer

syntax = "proto3";
import "shared.proto";
service RpcBackend {
// search
rpc Search (RpcSearchRequest) returns (RpcSearchResponse);
// ui
rpc RequestViewRender (RpcRequestViewRenderRequest) returns (RpcRequestViewRenderResponse);
rpc RequestRunCommand (RpcRequestRunCommandRequest) returns (RpcRequestRunCommandResponse);
rpc RequestRunGeneratedCommand (RpcRequestRunGeneratedCommandRequest) returns (RpcRequestRunGeneratedCommandResponse);
rpc SendViewEvent (RpcSendViewEventRequest) returns (RpcSendViewEventResponse);
rpc SendKeyboardEvent (RpcSendKeyboardEventRequest) returns (RpcSendKeyboardEventResponse);
rpc SendOpenEvent (RpcSendOpenEventRequest) returns (RpcSendOpenEventResponse);
// settings
rpc Plugins (RpcPluginsRequest) returns (RpcPluginsResponse);
rpc SetPluginState(RpcSetPluginStateRequest) returns (RpcSetPluginStateResponse);
rpc SetEntrypointState (RpcSetEntrypointStateRequest) returns (RpcSetEntrypointStateResponse);
rpc SetPreferenceValue (RpcSetPreferenceValueRequest) returns (RpcSetPreferenceValueResponse);
rpc DownloadPlugin (RpcDownloadPluginRequest) returns (RpcDownloadPluginResponse);
rpc DownloadStatus (RpcDownloadStatusRequest) returns (RpcDownloadStatusResponse);
rpc OpenSettingsWindow (RpcOpenSettingsWindowRequest) returns (RpcOpenSettingsWindowResponse);
rpc OpenSettingsWindowPreferences (RpcOpenSettingsWindowPreferencesRequest) returns (RpcOpenSettingsWindowPreferencesResponse);
rpc RemovePlugin (RpcRemovePluginRequest) returns (RpcRemovePluginResponse);
// dev tools
rpc SaveLocalPlugin (RpcSaveLocalPluginRequest) returns (RpcSaveLocalPluginResponse);
}
message RpcSearchRequest {
string text = 1;
}
message RpcSearchResponse {
repeated RpcSearchResult results = 1;
}
message RpcRequestViewRenderRequest {
string plugin_id = 1;
RpcEventRenderView event = 2;
}
message RpcRequestViewRenderResponse {
map<string, RpcRequestViewRenderResponseAction> action_shortcuts = 1;
}
message RpcRequestViewRenderResponseAction {
string key = 1;
RpcRequestViewRenderResponseActionKind kind = 2;
}
enum RpcRequestViewRenderResponseActionKind {
MAIN = 0;
ALTERNATIVE = 1;
}
message RpcRequestRunCommandRequest {
string plugin_id = 1;
RpcEventRunCommand event = 2;
}
message RpcRequestRunCommandResponse {
}
message RpcRequestRunGeneratedCommandRequest {
string plugin_id = 1;
RpcEventRunGeneratedCommand event = 2;
}
message RpcRequestRunGeneratedCommandResponse {
}
message RpcSendViewEventRequest {
string plugin_id = 1;
RpcEventViewEvent event = 2;
}
message RpcSendViewEventResponse {
}
message RpcSendKeyboardEventRequest {
string plugin_id = 1;
RpcEventKeyboardEvent event = 2;
}
message RpcSendKeyboardEventResponse {
}
message RpcSendOpenEventRequest {
string plugin_id = 1;
string href = 2;
}
message RpcSendOpenEventResponse {
}
message RpcPluginsRequest {
}
message RpcPluginsResponse {
repeated RpcPlugin plugins = 1;
}
message RpcSetPluginStateRequest {
string plugin_id = 1;
bool enabled = 2;
}
message RpcSetPluginStateResponse {
}
message RpcSetEntrypointStateRequest {
string plugin_id = 1;
string entrypoint_id = 2;
bool enabled = 3;
}
message RpcSetEntrypointStateResponse {
}
message RpcSetPreferenceValueRequest {
string plugin_id = 1;
string entrypoint_id = 2;
string preference_name = 3;
RpcPluginPreferenceUserData preference_value = 4;
}
message RpcSetPreferenceValueResponse {
}
message RpcDownloadPluginRequest {
string plugin_id = 1;
}
message RpcDownloadPluginResponse {
}
message RpcSaveLocalPluginRequest {
string path = 1;
}
message RpcSaveLocalPluginResponse {
}
message RpcDownloadStatusRequest {
}
message RpcDownloadStatusResponse {
map<string, RpcDownloadStatusValue> status_per_plugin = 1;
}
message RpcOpenSettingsWindowRequest {
}
message RpcOpenSettingsWindowResponse {
}
message RpcOpenSettingsWindowPreferencesRequest {
string plugin_id = 1;
string entrypoint_id = 2;
}
message RpcOpenSettingsWindowPreferencesResponse {
}
message RpcRemovePluginRequest {
string plugin_id = 1;
}
message RpcRemovePluginResponse {
}
message RpcSearchResult {
string plugin_id = 1;
string plugin_name = 2;
string entrypoint_id = 3;
string entrypoint_name = 4;
RpcEntrypointTypeSearchResult entrypoint_type = 5;
string entrypoint_icon_path = 6;
}
enum RpcEntrypointTypeSearchResult {
SR_COMMAND = 0;
SR_VIEW = 1;
SR_GENERATED_COMMAND = 2;
}
enum RpcEntrypointTypeSettings {
S_COMMAND = 0;
S_VIEW = 1;
S_INLINE_VIEW = 2;
S_COMMAND_GENERATOR = 3;
}
message RpcPlugin {
string plugin_id = 1;
string plugin_name = 2;
string plugin_description = 3;
bool enabled = 4;
repeated RpcEntrypoint entrypoints = 5;
map<string, RpcPluginPreference> preferences = 6;
map<string, RpcPluginPreferenceUserData> preferences_user_data = 7;
}
message RpcEntrypoint {
string entrypoint_id = 1;
string entrypoint_name = 2;
string entrypoint_description = 3;
bool enabled = 4;
RpcEntrypointTypeSettings entrypoint_type = 5;
map<string, RpcPluginPreference> preferences = 6;
map<string, RpcPluginPreferenceUserData> preferences_user_data = 7;
}
message RpcEventRenderView {
string entrypoint_id = 1;
}
message RpcEventRunCommand {
string entrypoint_id = 1;
}
message RpcEventRunGeneratedCommand {
string entrypoint_id = 1;
}
message RpcEventViewEvent {
RpcUiWidgetId widget_id = 1;
string event_name = 2;
repeated RpcUiPropertyValue event_arguments = 3;
}
message RpcEventKeyboardEvent {
string entrypoint_id = 1;
string key = 2;
bool modifier_shift = 3;
bool modifier_control = 4;
bool modifier_alt = 5;
bool modifier_meta = 6;
}
enum RpcDownloadStatus {
InProgress = 0;
Done = 1;
Failed = 2;
}
message RpcDownloadStatusValue {
RpcDownloadStatus status = 1;
string message = 2;
}
// protobuf is shit, hopefully somebody soon comes up with normal format using wasm wit or something
message RpcPluginPreference {
RpcPluginPreferenceValueType type = 1;
RpcUiPropertyValue default = 2;
repeated RpcUiPropertyValue default_list = 3;
bool default_list_exists = 4;
string description = 5;
repeated RpcEnumValue enum_values = 6;
}
message RpcEnumValue {
string label = 1;
string value = 2;
}
message RpcKeyValue {
string key = 1;
string value = 2;
}
message RpcPluginPreferenceUserData {
RpcPluginPreferenceValueType type = 1;
RpcUiPropertyValue value = 2;
repeated RpcUiPropertyValue value_list = 3;
bool value_list_exists = 4;
}
enum RpcPluginPreferenceValueType {
Number = 0;
String = 1;
Enum = 2;
Bool = 3;
ListOfStrings = 4;
ListOfNumbers = 5;
ListOfEnums = 6;
}