Files
connpy/connpy/proto/connpy.proto
T
fluzzi32 0adaaad971 feat(multiuser): implementar sistema multiusuario gRPC y configuración compartida de IA/MCP
- Servidor gRPC: Agregar interceptores de autenticación y UserRegistry para aislar sesiones por usuario.
- Contexto de Hilos: Corregir propagación de ContextVar _current_user a hilos secundarios en ExecutionServicer.
- Configuración Compartida: Implementar herencia y deep merge de settings de IA ('ai') y servidores MCP en configfile.
- Hot-Reload: Recarga automática en caliente de la configuración compartida global ante cambios en disco.
- CLI: Agregar comandos e interfaces de usuario para autenticación (login) y administración de usuarios.
- Pruebas: Desarrollar tests unitarios completos (test_shared_ai.py) y resolver regresiones en la suite existente.
2026-05-28 09:27:54 -03:00

320 lines
8.6 KiB
Protocol Buffer

syntax = "proto3";
package connpy;
import "google/protobuf/struct.proto";
import "google/protobuf/empty.proto";
service NodeService {
rpc list_nodes (FilterRequest) returns (ValueResponse) {}
rpc list_folders (FilterRequest) returns (ValueResponse) {}
rpc get_node_details (IdRequest) returns (StructResponse) {}
rpc explode_unique (IdRequest) returns (ValueResponse) {}
rpc generate_cache (google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc add_node (NodeRequest) returns (google.protobuf.Empty) {}
rpc update_node (NodeRequest) returns (google.protobuf.Empty) {}
rpc delete_node (DeleteRequest) returns (google.protobuf.Empty) {}
rpc move_node (MoveRequest) returns (google.protobuf.Empty) {}
rpc bulk_add (BulkRequest) returns (google.protobuf.Empty) {}
rpc validate_parent_folder (IdRequest) returns (google.protobuf.Empty) {}
rpc set_reserved_names (ListRequest) returns (google.protobuf.Empty) {}
rpc interact_node (stream InteractRequest) returns (stream InteractResponse) {}
rpc full_replace (FullReplaceRequest) returns (google.protobuf.Empty) {}
rpc get_inventory (google.protobuf.Empty) returns (FullReplaceRequest) {}
}
service ProfileService {
rpc list_profiles (FilterRequest) returns (ValueResponse) {}
rpc get_profile (ProfileRequest) returns (StructResponse) {}
rpc add_profile (NodeRequest) returns (google.protobuf.Empty) {}
rpc resolve_node_data (StructRequest) returns (StructResponse) {}
rpc delete_profile (IdRequest) returns (google.protobuf.Empty) {}
rpc update_profile (NodeRequest) returns (google.protobuf.Empty) {}
}
service ConfigService {
rpc get_settings (google.protobuf.Empty) returns (StructResponse) {}
rpc get_default_dir (google.protobuf.Empty) returns (StringResponse) {}
rpc set_config_folder (StringRequest) returns (google.protobuf.Empty) {}
rpc update_setting (UpdateRequest) returns (google.protobuf.Empty) {}
rpc encrypt_password (StringRequest) returns (StringResponse) {}
rpc apply_theme_from_file (StringRequest) returns (StructResponse) {}
}
service PluginService {
rpc list_plugins (google.protobuf.Empty) returns (ValueResponse) {}
rpc add_plugin (PluginRequest) returns (google.protobuf.Empty) {}
rpc delete_plugin (IdRequest) returns (google.protobuf.Empty) {}
rpc enable_plugin (IdRequest) returns (google.protobuf.Empty) {}
rpc disable_plugin (IdRequest) returns (google.protobuf.Empty) {}
}
service ExecutionService {
rpc run_commands (RunRequest) returns (stream NodeRunResult) {}
rpc test_commands (TestRequest) returns (stream NodeRunResult) {}
rpc run_cli_script (ScriptRequest) returns (StructResponse) {}
rpc run_yaml_playbook (ScriptRequest) returns (StructResponse) {}
}
service ImportExportService {
rpc export_to_file (ExportRequest) returns (google.protobuf.Empty) {}
rpc import_from_file (StringRequest) returns (google.protobuf.Empty) {}
rpc set_reserved_names (ListRequest) returns (google.protobuf.Empty) {}
}
service AIService {
rpc ask (stream AskRequest) returns (stream AIResponse) {}
rpc confirm (StringRequest) returns (BoolResponse) {}
rpc ask_copilot (CopilotRequest) returns (CopilotResponse) {}
rpc list_sessions (google.protobuf.Empty) returns (ValueResponse) {}
rpc delete_session (StringRequest) returns (google.protobuf.Empty) {}
rpc configure_provider (ProviderRequest) returns (google.protobuf.Empty) {}
rpc configure_mcp (MCPRequest) returns (google.protobuf.Empty) {}
rpc list_mcp_servers (google.protobuf.Empty) returns (ValueResponse) {}
rpc load_session_data (StringRequest) returns (StructResponse) {}
}
service SystemService {
rpc start_api (IntRequest) returns (google.protobuf.Empty) {}
rpc debug_api (IntRequest) returns (google.protobuf.Empty) {}
rpc stop_api (google.protobuf.Empty) returns (google.protobuf.Empty) {}
rpc restart_api (IntRequest) returns (google.protobuf.Empty) {}
rpc get_api_status (google.protobuf.Empty) returns (BoolResponse) {}
}
// Request and Response Messages
message InteractRequest {
string id = 1;
bool sftp = 2;
bool debug = 3;
bytes stdin_data = 4;
int32 cols = 5;
int32 rows = 6;
string connection_params_json = 7;
// Copilot fields
string copilot_question = 8;
string copilot_action = 9;
string copilot_context_buffer = 10;
string copilot_node_info_json = 13;
}
message InteractResponse {
bytes stdout_data = 1;
bool success = 2;
string error_message = 3;
// Copilot fields
bool copilot_prompt = 4;
string copilot_buffer_preview = 5;
string copilot_response_json = 6;
string copilot_node_info_json = 7;
string copilot_stream_chunk = 8;
string copilot_injected_command = 9;
}
message FilterRequest {
string filter_str = 1;
string format_str = 2;
}
message ValueResponse {
google.protobuf.Value data = 1;
}
message IdRequest {
string id = 1;
}
message NodeRequest {
string id = 1;
google.protobuf.Struct data = 2;
bool is_folder = 3;
}
message DeleteRequest {
string id = 1;
bool is_folder = 2;
}
message MessageValue {
string value = 1;
}
message MoveRequest {
string src_id = 1;
string dst_id = 2;
bool copy = 3;
}
message BulkRequest {
repeated string ids = 1;
repeated string hosts = 2;
google.protobuf.Struct common_data = 3;
}
message StructResponse {
google.protobuf.Struct data = 1;
}
message ProfileRequest {
string name = 1;
bool resolve = 2;
}
message StructRequest {
google.protobuf.Struct data = 1;
}
message StringRequest {
string value = 1;
}
message StringResponse {
string value = 1;
}
message UpdateRequest {
string key = 1;
google.protobuf.Value value = 2;
}
message PluginRequest {
string name = 1;
string source_file = 2;
bool update = 3;
}
message RunRequest {
repeated string nodes = 1;
repeated string commands = 2;
string folder = 3;
string prompt = 4;
int32 parallel = 5;
google.protobuf.Struct vars = 6;
int32 timeout = 7;
string name = 8;
}
message TestRequest {
repeated string nodes = 1;
repeated string commands = 2;
repeated string expected = 3;
string folder = 4;
string prompt = 5;
int32 parallel = 6;
google.protobuf.Struct vars = 7;
int32 timeout = 8;
string name = 9;
}
message ScriptRequest {
string param1 = 1; // nodes_filter or playbook_path
string param2 = 2; // script_path or ""
int32 parallel = 3;
}
message ExportRequest {
string file_path = 1;
repeated string folders = 2;
}
message ListRequest {
repeated string items = 1;
}
message AskRequest {
string input_text = 1;
bool dryrun = 2;
google.protobuf.Value chat_history = 3;
string session_id = 4;
bool debug = 5;
string engineer_model = 6;
string engineer_api_key = 7;
string architect_model = 8;
string architect_api_key = 9;
bool trust = 10;
string confirmation_answer = 11;
bool interrupt = 12;
google.protobuf.Struct engineer_auth = 13;
google.protobuf.Struct architect_auth = 14;
}
message AIResponse {
string text_chunk = 1;
bool is_final = 2;
google.protobuf.Struct full_result = 3;
string status_update = 4;
string debug_message = 5;
bool requires_confirmation = 6;
string important_message = 7;
}
message BoolResponse {
bool value = 1;
}
message ProviderRequest {
string provider = 1;
string model = 2;
string api_key = 3;
google.protobuf.Struct auth = 4;
}
message IntRequest {
int32 value = 1;
}
message NodeRunResult {
string unique_id = 1;
string output = 2;
int32 status = 3;
google.protobuf.Struct test_result = 4;
}
message FullReplaceRequest {
google.protobuf.Struct connections = 1;
google.protobuf.Struct profiles = 2;
}
message CopilotRequest {
string terminal_buffer = 1;
string user_question = 2;
string node_info_json = 3;
}
message CopilotResponse {
repeated string commands = 1;
string guide = 2;
string risk_level = 3;
string error = 4;
}
message MCPRequest {
string name = 1;
string url = 2;
bool enabled = 3;
string auto_load_on_os = 4;
bool remove = 5;
}
service AuthService {
rpc login (LoginRequest) returns (LoginResponse) {}
rpc change_password (ChangePasswordRequest) returns (google.protobuf.Empty) {}
}
message LoginRequest {
string username = 1;
string password = 2;
}
message LoginResponse {
string token = 1;
string username = 2;
int64 expires_at = 3;
}
message ChangePasswordRequest {
string old_password = 1;
string new_password = 2;
}