diff --git a/connpy/ai.py b/connpy/ai.py index 0e82be0..7b25313 100755 --- a/connpy/ai.py +++ b/connpy/ai.py @@ -1,4 +1,6 @@ import os +import secrets + import sys import json import re @@ -165,8 +167,8 @@ class ai: # Session Management self.sessions_dir = os.path.join(self.config.defaultdir, "ai_sessions") os.makedirs(self.sessions_dir, exist_ok=True) - self.session_id = None - self.session_path = None + self.session_id = getattr(self.config, "session_id", None) + self.session_path = os.path.join(self.sessions_dir, f"{self.session_id}.json") if self.session_id else None # Prompts base agnósticos architect_instructions = "" @@ -877,16 +879,27 @@ class ai: continue return sorted(sessions, key=lambda x: x["created_at"], reverse=True) - def list_sessions(self): + def list_sessions(self, limit=20): """Prints a list of sessions using printer.table.""" sessions = self._get_sessions() if not sessions: printer.info("No saved AI sessions found.") return + total = len(sessions) + if limit and total > limit: + sessions = sessions[:limit] + columns = ["ID", "Title", "Created At", "Model"] rows = [[s["id"], s["title"], s["created_at"], s["model"]] for s in sessions] - printer.table("AI Persisted Sessions", columns, rows) + + title = "AI Persisted Sessions" + if limit and total > limit: + title += f" (Showing last {limit} of {total})" + + printer.table(title, columns, rows) + if limit and total > limit: + printer.info(f"Use '--list --all' (if supported) or check the sessions directory to see all {total} sessions.") def load_session_data(self, session_id): """Loads a session's raw data by ID.""" @@ -917,8 +930,10 @@ class ai: return sessions[0]["id"] if sessions else None def _generate_session_id(self, query): - """Generates a unique session ID based on timestamp.""" - return datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + """Generates a unique session ID based on timestamp and a random suffix.""" + ts = datetime.datetime.now().strftime("%Y%m%d-%H%M%S") + suffix = secrets.token_hex(2) + return f"{ts}-{suffix}" def save_session(self, history, title=None, model=None): """Saves current history to the session file.""" @@ -927,6 +942,8 @@ class ai: first_user_msg = next((m["content"] for m in history if m["role"] == "user"), "new-session") self.session_id = self._generate_session_id(first_user_msg) self.session_path = os.path.join(self.sessions_dir, f"{self.session_id}.json") + elif not self.session_path: + self.session_path = os.path.join(self.sessions_dir, f"{self.session_id}.json") # If it's a new file, we might want to set a better title if not os.path.exists(self.session_path) and not title: @@ -970,10 +987,15 @@ class ai: if chat_history is None: chat_history = [] # Load session if provided and history is empty - if session_id and not chat_history: - session_data = self.load_session_data(session_id) - if session_data: - chat_history = session_data.get("history", []) + if session_id: + # Force the session_id even if it doesn't exist yet + self.session_id = session_id + self.session_path = os.path.join(self.sessions_dir, f"{session_id}.json") + + if not chat_history: + session_data = self.load_session_data(session_id) + if session_data: + chat_history = session_data.get("history", []) # If we loaded history, the caller might need it back # But typically ask() is called in a loop with an external history object @@ -1058,8 +1080,8 @@ class ai: label = "[architect][bold]Architect[/bold][/architect]" if current_brain == "architect" else "[engineer][bold]Engineer[/bold][/engineer]" if status: - # Notify responder identity ONLY for web/remote clients (StatusBridge has is_web) - if getattr(status, "is_web", False): + # Notify responder identity for web/remote clients + if getattr(status, "is_web", False) or getattr(status, "is_remote", False): status.update(f"__RESPONDER__:{current_brain}") status.update(f"{label} is thinking... (step {iteration})") diff --git a/connpy/cli/ai_handler.py b/connpy/cli/ai_handler.py index 0f5ce57..5e70885 100644 --- a/connpy/cli/ai_handler.py +++ b/connpy/cli/ai_handler.py @@ -15,13 +15,22 @@ class AIHandler: def dispatch(self, args): if args.list_sessions: - sessions = self.app.services.ai.list_sessions() + limit = 20 if not getattr(args, "all", False) else None + sessions, total = self.app.services.ai.list_sessions(limit=limit) if not sessions: printer.info("No saved AI sessions found.") return + columns = ["ID", "Title", "Created At", "Model"] rows = [[s["id"], s["title"], s["created_at"], s["model"]] for s in sessions] - printer.table("AI Persisted Sessions", columns, rows) + + title = "AI Persisted Sessions" + if limit and total > limit: + title += f" (Showing last {limit} of {total})" + + printer.table(title, columns, rows) + if limit and total > limit: + printer.info(f"Use '--list --all' to see all {total} sessions.") return if args.delete_session: @@ -102,7 +111,7 @@ class AIHandler: if history: mdprint(f"[debug]Analyzing {len(history)} previous messages...[/debug]\n") else: - printer.error(f"Could not load session {session_id}. Starting clean.") + printer.info(f"Session '{session_id}' not found. Starting clean.") if not history: mdprint(Rule(style="engineer")) @@ -116,7 +125,7 @@ class AIHandler: if user_query.lower() in ['exit', 'quit', 'bye', 'cancel']: break with console.status("[ai_status]Agent is thinking...") as status: - result = self.app.myai.ask(user_query, chat_history=history, status=status, debug=args.debug, trust=args.trust, **self.ai_overrides) + result = self.app.myai.ask(user_query, chat_history=history, status=status, debug=args.debug, trust=args.trust, session_id=session_id, **self.ai_overrides) new_history = result.get("chat_history") if new_history is not None: @@ -147,8 +156,7 @@ class AIHandler: action = mcp_args[0].lower() if action == "list": - settings = self.app.services.config_svc.get_settings() - mcp_servers = settings.get("ai", {}).get("mcp_servers", {}) + mcp_servers = self.app.services.ai.list_mcp_servers() if not mcp_servers: printer.info("No MCP servers configured.") else: @@ -213,8 +221,7 @@ class AIHandler: from .forms import Forms self.app.cli_forms = Forms(self.app) - settings = self.app.services.config_svc.get_settings() - mcp_servers = settings.get("ai", {}).get("mcp_servers", {}) + mcp_servers = self.app.services.ai.list_mcp_servers() result = self.app.cli_forms.mcp_wizard(mcp_servers) if not result: diff --git a/connpy/cli/helpers.py b/connpy/cli/helpers.py index ef45c14..62c425a 100644 --- a/connpy/cli/helpers.py +++ b/connpy/cli/helpers.py @@ -1,10 +1,81 @@ import os import inquirer +from inquirer.themes import Default, term + try: from pyfzf.pyfzf import FzfPrompt except ImportError: FzfPrompt = None +def hex_to_blessed(hex_str): + """Convert hex color string to blessed/ansi format.""" + if not hex_str or not isinstance(hex_str, str): + return term.normal + + # Check for bold prefix + prefix = "" + if hex_str.startswith('bold '): + prefix = term.bold + hex_str = hex_str.replace('bold ', '').strip() + + # If it's a standard color name + if not hex_str.startswith('#'): + return prefix + getattr(term, hex_str, term.normal) + + # Parse hex + try: + h = hex_str.lstrip('#') + if len(h) == 3: + h = ''.join([c*2 for c in h]) + r = int(h[0:2], 16) + g = int(h[2:4], 16) + b = int(h[4:6], 16) + + # Try RGB, fallback to standard cyan if it fails or returns empty + try: + c = term.color_rgb(r, g, b) + if not c: # Some terms return empty for RGB + return prefix + term.cyan + return prefix + c + except: + return prefix + term.cyan + except: + return prefix + term.normal + +# Custom inquirer theme matching connpy colors +class ConnpyTheme(Default): + def __init__(self): + super().__init__() + try: + from ..printer import _global_active_styles + # Use user_prompt as primary accent, fallback to info/cyan + accent = _global_active_styles.get("user_prompt", _global_active_styles.get("info", "cyan")) + accent_color = hex_to_blessed(accent) + + self.Question.mark_color = accent_color + self.List.selection_color = accent_color + self.List.selection_cursor = ">" + except: + # Absolute fallback to standard cyan + self.Question.mark_color = term.cyan + self.List.selection_color = term.bold_cyan + self.List.selection_cursor = ">" + +def get_theme(): + """Returns a fresh instance of the theme with current colors.""" + return ConnpyTheme() + +class ThemeProxy: + """Proxy to ensure theme colors are resolved at runtime.""" + def __getattr__(self, name): + return getattr(get_theme(), name) + def __iter__(self): + return iter(get_theme()) + def __getitem__(self, item): + return get_theme()[item] + +theme = ThemeProxy() + def get_config_dir(): home = os.path.expanduser("~") defaultdir = os.path.join(home, '.config/conn') @@ -56,7 +127,7 @@ def choose(app, list_, name, action): return answer[0] else: questions = [inquirer.List(name, message="Pick {} to {}:".format(name,action), choices=list_, carousel=True)] - answer = inquirer.prompt(questions) + answer = inquirer.prompt(questions, theme=theme) if answer == None: return None else: diff --git a/connpy/connapp.py b/connpy/connapp.py index 41a3f8d..7215850 100755 --- a/connpy/connapp.py +++ b/connpy/connapp.py @@ -281,6 +281,7 @@ class connapp: aiparser.add_argument("--debug", action="store_true", help="Show AI reasoning and tool calls") aiparser.add_argument("-y", "--trust", action="store_true", help="Trust AI to execute unsafe commands without confirmation") aiparser.add_argument("--list", "--list-sessions", dest="list_sessions", action="store_true", help="List saved AI sessions") + aiparser.add_argument("--all", action="store_true", help="Show all sessions without limit") aiparser.add_argument("--session", nargs=1, help="Resume a specific AI session by ID") aiparser.add_argument("--resume", action="store_true", help="Resume the most recent AI session") aiparser.add_argument("--delete", "--delete-session", dest="delete_session", nargs=1, help="Delete an AI session by ID") diff --git a/connpy/grpc_layer/connpy_pb2.py b/connpy/grpc_layer/connpy_pb2.py index 2c33451..dfff7ea 100644 --- a/connpy/grpc_layer/connpy_pb2.py +++ b/connpy/grpc_layer/connpy_pb2.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE -# source: connpy/proto/connpy.proto +# source: connpy.proto # Protobuf Python Version: 6.31.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor @@ -15,7 +15,7 @@ _runtime_version.ValidateProtobufRuntimeVersion( 31, 1, '', - 'connpy/proto/connpy.proto' + 'connpy.proto' ) # @@protoc_insertion_point(imports) @@ -26,91 +26,91 @@ from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19\x63onnpy/proto/connpy.proto\x12\x06\x63onnpy\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xfc\x01\n\x0fInteractRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04sftp\x18\x02 \x01(\x08\x12\r\n\x05\x64\x65\x62ug\x18\x03 \x01(\x08\x12\x12\n\nstdin_data\x18\x04 \x01(\x0c\x12\x0c\n\x04\x63ols\x18\x05 \x01(\x05\x12\x0c\n\x04rows\x18\x06 \x01(\x05\x12\x1e\n\x16\x63onnection_params_json\x18\x07 \x01(\t\x12\x18\n\x10\x63opilot_question\x18\x08 \x01(\t\x12\x16\n\x0e\x63opilot_action\x18\t \x01(\t\x12\x1e\n\x16\x63opilot_context_buffer\x18\n \x01(\t\x12\x1e\n\x16\x63opilot_node_info_json\x18\r \x01(\t\"\x86\x02\n\x10InteractResponse\x12\x13\n\x0bstdout_data\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\rerror_message\x18\x03 \x01(\t\x12\x16\n\x0e\x63opilot_prompt\x18\x04 \x01(\x08\x12\x1e\n\x16\x63opilot_buffer_preview\x18\x05 \x01(\t\x12\x1d\n\x15\x63opilot_response_json\x18\x06 \x01(\t\x12\x1e\n\x16\x63opilot_node_info_json\x18\x07 \x01(\t\x12\x1c\n\x14\x63opilot_stream_chunk\x18\x08 \x01(\t\x12 \n\x18\x63opilot_injected_command\x18\t \x01(\t\"7\n\rFilterRequest\x12\x12\n\nfilter_str\x18\x01 \x01(\t\x12\x12\n\nformat_str\x18\x02 \x01(\t\"5\n\rValueResponse\x12$\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.Value\"\x17\n\tIdRequest\x12\n\n\x02id\x18\x01 \x01(\t\"S\n\x0bNodeRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x11\n\tis_folder\x18\x03 \x01(\x08\".\n\rDeleteRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tis_folder\x18\x02 \x01(\x08\"\x1d\n\x0cMessageValue\x12\r\n\x05value\x18\x01 \x01(\t\";\n\x0bMoveRequest\x12\x0e\n\x06src_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64st_id\x18\x02 \x01(\t\x12\x0c\n\x04\x63opy\x18\x03 \x01(\x08\"W\n\x0b\x42ulkRequest\x12\x0b\n\x03ids\x18\x01 \x03(\t\x12\r\n\x05hosts\x18\x02 \x03(\t\x12,\n\x0b\x63ommon_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"7\n\x0eStructResponse\x12%\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"/\n\x0eProfileRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07resolve\x18\x02 \x01(\x08\"6\n\rStructRequest\x12%\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x1e\n\rStringRequest\x12\r\n\x05value\x18\x01 \x01(\t\"\x1f\n\x0eStringResponse\x12\r\n\x05value\x18\x01 \x01(\t\"C\n\rUpdateRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\"B\n\rPluginRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\x0e\n\x06update\x18\x03 \x01(\x08\"\xa5\x01\n\nRunRequest\x12\r\n\x05nodes\x18\x01 \x03(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x0e\n\x06\x66older\x18\x03 \x01(\t\x12\x0e\n\x06prompt\x18\x04 \x01(\t\x12\x10\n\x08parallel\x18\x05 \x01(\x05\x12%\n\x04vars\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0f\n\x07timeout\x18\x07 \x01(\x05\x12\x0c\n\x04name\x18\x08 \x01(\t\"\xb8\x01\n\x0bTestRequest\x12\r\n\x05nodes\x18\x01 \x03(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x10\n\x08\x65xpected\x18\x03 \x03(\t\x12\x0e\n\x06\x66older\x18\x04 \x01(\t\x12\x0e\n\x06prompt\x18\x05 \x01(\t\x12\x10\n\x08parallel\x18\x06 \x01(\x05\x12%\n\x04vars\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0f\n\x07timeout\x18\x08 \x01(\x05\x12\x0c\n\x04name\x18\t \x01(\t\"A\n\rScriptRequest\x12\x0e\n\x06param1\x18\x01 \x01(\t\x12\x0e\n\x06param2\x18\x02 \x01(\t\x12\x10\n\x08parallel\x18\x03 \x01(\x05\"3\n\rExportRequest\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x0f\n\x07\x66olders\x18\x02 \x03(\t\"\x1c\n\x0bListRequest\x12\r\n\x05items\x18\x01 \x03(\t\"\xa6\x02\n\nAskRequest\x12\x12\n\ninput_text\x18\x01 \x01(\t\x12\x0e\n\x06\x64ryrun\x18\x02 \x01(\x08\x12,\n\x0c\x63hat_history\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\r\n\x05\x64\x65\x62ug\x18\x05 \x01(\x08\x12\x16\n\x0e\x65ngineer_model\x18\x06 \x01(\t\x12\x18\n\x10\x65ngineer_api_key\x18\x07 \x01(\t\x12\x17\n\x0f\x61rchitect_model\x18\x08 \x01(\t\x12\x19\n\x11\x61rchitect_api_key\x18\t \x01(\t\x12\r\n\x05trust\x18\n \x01(\x08\x12\x1b\n\x13\x63onfirmation_answer\x18\x0b \x01(\t\x12\x11\n\tinterrupt\x18\x0c \x01(\x08\"\xc8\x01\n\nAIResponse\x12\x12\n\ntext_chunk\x18\x01 \x01(\t\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12,\n\x0b\x66ull_result\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\rstatus_update\x18\x04 \x01(\t\x12\x15\n\rdebug_message\x18\x05 \x01(\t\x12\x1d\n\x15requires_confirmation\x18\x06 \x01(\x08\x12\x19\n\x11important_message\x18\x07 \x01(\t\"\x1d\n\x0c\x42oolResponse\x12\r\n\x05value\x18\x01 \x01(\x08\"C\n\x0fProviderRequest\x12\x10\n\x08provider\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0f\n\x07\x61pi_key\x18\x03 \x01(\t\"\x1b\n\nIntRequest\x12\r\n\x05value\x18\x01 \x01(\x05\"p\n\rNodeRunResult\x12\x11\n\tunique_id\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\x05\x12,\n\x0btest_result\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"m\n\x12\x46ullReplaceRequest\x12,\n\x0b\x63onnections\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08profiles\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"X\n\x0e\x43opilotRequest\x12\x17\n\x0fterminal_buffer\x18\x01 \x01(\t\x12\x15\n\ruser_question\x18\x02 \x01(\t\x12\x16\n\x0enode_info_json\x18\x03 \x01(\t\"U\n\x0f\x43opilotResponse\x12\x10\n\x08\x63ommands\x18\x01 \x03(\t\x12\r\n\x05guide\x18\x02 \x01(\t\x12\x12\n\nrisk_level\x18\x03 \x01(\t\x12\r\n\x05\x65rror\x18\x04 \x01(\t\"a\n\nMCPRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x03 \x01(\x08\x12\x17\n\x0f\x61uto_load_on_os\x18\x04 \x01(\t\x12\x0e\n\x06remove\x18\x05 \x01(\x08\x32\xe1\x07\n\x0bNodeService\x12<\n\nlist_nodes\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12>\n\x0clist_folders\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12?\n\x10get_node_details\x12\x11.connpy.IdRequest\x1a\x16.connpy.StructResponse\"\x00\x12<\n\x0e\x65xplode_unique\x12\x11.connpy.IdRequest\x1a\x15.connpy.ValueResponse\"\x00\x12\x42\n\x0egenerate_cache\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x08\x61\x64\x64_node\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\x0bupdate_node\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12>\n\x0b\x64\x65lete_node\x12\x15.connpy.DeleteRequest\x1a\x16.google.protobuf.Empty\"\x00\x12:\n\tmove_node\x12\x13.connpy.MoveRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x08\x62ulk_add\x12\x13.connpy.BulkRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x45\n\x16validate_parent_folder\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x12set_reserved_names\x12\x13.connpy.ListRequest\x1a\x16.google.protobuf.Empty\"\x00\x12H\n\rinteract_node\x12\x17.connpy.InteractRequest\x1a\x18.connpy.InteractResponse\"\x00(\x01\x30\x01\x12\x44\n\x0c\x66ull_replace\x12\x1a.connpy.FullReplaceRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x45\n\rget_inventory\x12\x16.google.protobuf.Empty\x1a\x1a.connpy.FullReplaceRequest\"\x00\x32\x96\x03\n\x0eProfileService\x12?\n\rlist_profiles\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12?\n\x0bget_profile\x12\x16.connpy.ProfileRequest\x1a\x16.connpy.StructResponse\"\x00\x12<\n\x0b\x61\x64\x64_profile\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x11resolve_node_data\x12\x15.connpy.StructRequest\x1a\x16.connpy.StructResponse\"\x00\x12=\n\x0e\x64\x65lete_profile\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12?\n\x0eupdate_profile\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\xae\x03\n\rConfigService\x12@\n\x0cget_settings\x12\x16.google.protobuf.Empty\x1a\x16.connpy.StructResponse\"\x00\x12\x43\n\x0fget_default_dir\x12\x16.google.protobuf.Empty\x1a\x16.connpy.StringResponse\"\x00\x12\x44\n\x11set_config_folder\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x41\n\x0eupdate_setting\x12\x15.connpy.UpdateRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x10\x65ncrypt_password\x12\x15.connpy.StringRequest\x1a\x16.connpy.StringResponse\"\x00\x12H\n\x15\x61pply_theme_from_file\x12\x15.connpy.StringRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xca\x02\n\rPluginService\x12?\n\x0clist_plugins\x12\x16.google.protobuf.Empty\x1a\x15.connpy.ValueResponse\"\x00\x12=\n\nadd_plugin\x12\x15.connpy.PluginRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\rdelete_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\renable_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\x0e\x64isable_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\x9b\x02\n\x10\x45xecutionService\x12=\n\x0crun_commands\x12\x12.connpy.RunRequest\x1a\x15.connpy.NodeRunResult\"\x00\x30\x01\x12?\n\rtest_commands\x12\x13.connpy.TestRequest\x1a\x15.connpy.NodeRunResult\"\x00\x30\x01\x12\x41\n\x0erun_cli_script\x12\x15.connpy.ScriptRequest\x1a\x16.connpy.StructResponse\"\x00\x12\x44\n\x11run_yaml_playbook\x12\x15.connpy.ScriptRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xe2\x01\n\x13ImportExportService\x12\x41\n\x0e\x65xport_to_file\x12\x15.connpy.ExportRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x10import_from_file\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x12set_reserved_names\x12\x13.connpy.ListRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\x8f\x04\n\tAIService\x12\x33\n\x03\x61sk\x12\x12.connpy.AskRequest\x1a\x12.connpy.AIResponse\"\x00(\x01\x30\x01\x12\x38\n\x07\x63onfirm\x12\x15.connpy.StringRequest\x1a\x14.connpy.BoolResponse\"\x00\x12@\n\x0b\x61sk_copilot\x12\x16.connpy.CopilotRequest\x1a\x17.connpy.CopilotResponse\"\x00\x12@\n\rlist_sessions\x12\x16.google.protobuf.Empty\x1a\x15.connpy.ValueResponse\"\x00\x12\x41\n\x0e\x64\x65lete_session\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12G\n\x12\x63onfigure_provider\x12\x17.connpy.ProviderRequest\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\rconfigure_mcp\x12\x12.connpy.MCPRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x11load_session_data\x12\x15.connpy.StringRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xc2\x02\n\rSystemService\x12\x39\n\tstart_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\tdebug_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\x08stop_api\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12;\n\x0brestart_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12@\n\x0eget_api_status\x12\x16.google.protobuf.Empty\x1a\x14.connpy.BoolResponse\"\x00\x62\x06proto3') +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x0c\x63onnpy.proto\x12\x06\x63onnpy\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1bgoogle/protobuf/empty.proto\"\xfc\x01\n\x0fInteractRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04sftp\x18\x02 \x01(\x08\x12\r\n\x05\x64\x65\x62ug\x18\x03 \x01(\x08\x12\x12\n\nstdin_data\x18\x04 \x01(\x0c\x12\x0c\n\x04\x63ols\x18\x05 \x01(\x05\x12\x0c\n\x04rows\x18\x06 \x01(\x05\x12\x1e\n\x16\x63onnection_params_json\x18\x07 \x01(\t\x12\x18\n\x10\x63opilot_question\x18\x08 \x01(\t\x12\x16\n\x0e\x63opilot_action\x18\t \x01(\t\x12\x1e\n\x16\x63opilot_context_buffer\x18\n \x01(\t\x12\x1e\n\x16\x63opilot_node_info_json\x18\r \x01(\t\"\x86\x02\n\x10InteractResponse\x12\x13\n\x0bstdout_data\x18\x01 \x01(\x0c\x12\x0f\n\x07success\x18\x02 \x01(\x08\x12\x15\n\rerror_message\x18\x03 \x01(\t\x12\x16\n\x0e\x63opilot_prompt\x18\x04 \x01(\x08\x12\x1e\n\x16\x63opilot_buffer_preview\x18\x05 \x01(\t\x12\x1d\n\x15\x63opilot_response_json\x18\x06 \x01(\t\x12\x1e\n\x16\x63opilot_node_info_json\x18\x07 \x01(\t\x12\x1c\n\x14\x63opilot_stream_chunk\x18\x08 \x01(\t\x12 \n\x18\x63opilot_injected_command\x18\t \x01(\t\"7\n\rFilterRequest\x12\x12\n\nfilter_str\x18\x01 \x01(\t\x12\x12\n\nformat_str\x18\x02 \x01(\t\"5\n\rValueResponse\x12$\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x16.google.protobuf.Value\"\x17\n\tIdRequest\x12\n\n\x02id\x18\x01 \x01(\t\"S\n\x0bNodeRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12%\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x11\n\tis_folder\x18\x03 \x01(\x08\".\n\rDeleteRequest\x12\n\n\x02id\x18\x01 \x01(\t\x12\x11\n\tis_folder\x18\x02 \x01(\x08\"\x1d\n\x0cMessageValue\x12\r\n\x05value\x18\x01 \x01(\t\";\n\x0bMoveRequest\x12\x0e\n\x06src_id\x18\x01 \x01(\t\x12\x0e\n\x06\x64st_id\x18\x02 \x01(\t\x12\x0c\n\x04\x63opy\x18\x03 \x01(\x08\"W\n\x0b\x42ulkRequest\x12\x0b\n\x03ids\x18\x01 \x03(\t\x12\r\n\x05hosts\x18\x02 \x03(\t\x12,\n\x0b\x63ommon_data\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\"7\n\x0eStructResponse\x12%\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"/\n\x0eProfileRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07resolve\x18\x02 \x01(\x08\"6\n\rStructRequest\x12%\n\x04\x64\x61ta\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"\x1e\n\rStringRequest\x12\r\n\x05value\x18\x01 \x01(\t\"\x1f\n\x0eStringResponse\x12\r\n\x05value\x18\x01 \x01(\t\"C\n\rUpdateRequest\x12\x0b\n\x03key\x18\x01 \x01(\t\x12%\n\x05value\x18\x02 \x01(\x0b\x32\x16.google.protobuf.Value\"B\n\rPluginRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0bsource_file\x18\x02 \x01(\t\x12\x0e\n\x06update\x18\x03 \x01(\x08\"\xa5\x01\n\nRunRequest\x12\r\n\x05nodes\x18\x01 \x03(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x0e\n\x06\x66older\x18\x03 \x01(\t\x12\x0e\n\x06prompt\x18\x04 \x01(\t\x12\x10\n\x08parallel\x18\x05 \x01(\x05\x12%\n\x04vars\x18\x06 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0f\n\x07timeout\x18\x07 \x01(\x05\x12\x0c\n\x04name\x18\x08 \x01(\t\"\xb8\x01\n\x0bTestRequest\x12\r\n\x05nodes\x18\x01 \x03(\t\x12\x10\n\x08\x63ommands\x18\x02 \x03(\t\x12\x10\n\x08\x65xpected\x18\x03 \x03(\t\x12\x0e\n\x06\x66older\x18\x04 \x01(\t\x12\x0e\n\x06prompt\x18\x05 \x01(\t\x12\x10\n\x08parallel\x18\x06 \x01(\x05\x12%\n\x04vars\x18\x07 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x0f\n\x07timeout\x18\x08 \x01(\x05\x12\x0c\n\x04name\x18\t \x01(\t\"A\n\rScriptRequest\x12\x0e\n\x06param1\x18\x01 \x01(\t\x12\x0e\n\x06param2\x18\x02 \x01(\t\x12\x10\n\x08parallel\x18\x03 \x01(\x05\"3\n\rExportRequest\x12\x11\n\tfile_path\x18\x01 \x01(\t\x12\x0f\n\x07\x66olders\x18\x02 \x03(\t\"\x1c\n\x0bListRequest\x12\r\n\x05items\x18\x01 \x03(\t\"\xa6\x02\n\nAskRequest\x12\x12\n\ninput_text\x18\x01 \x01(\t\x12\x0e\n\x06\x64ryrun\x18\x02 \x01(\x08\x12,\n\x0c\x63hat_history\x18\x03 \x01(\x0b\x32\x16.google.protobuf.Value\x12\x12\n\nsession_id\x18\x04 \x01(\t\x12\r\n\x05\x64\x65\x62ug\x18\x05 \x01(\x08\x12\x16\n\x0e\x65ngineer_model\x18\x06 \x01(\t\x12\x18\n\x10\x65ngineer_api_key\x18\x07 \x01(\t\x12\x17\n\x0f\x61rchitect_model\x18\x08 \x01(\t\x12\x19\n\x11\x61rchitect_api_key\x18\t \x01(\t\x12\r\n\x05trust\x18\n \x01(\x08\x12\x1b\n\x13\x63onfirmation_answer\x18\x0b \x01(\t\x12\x11\n\tinterrupt\x18\x0c \x01(\x08\"\xc8\x01\n\nAIResponse\x12\x12\n\ntext_chunk\x18\x01 \x01(\t\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12,\n\x0b\x66ull_result\x18\x03 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x15\n\rstatus_update\x18\x04 \x01(\t\x12\x15\n\rdebug_message\x18\x05 \x01(\t\x12\x1d\n\x15requires_confirmation\x18\x06 \x01(\x08\x12\x19\n\x11important_message\x18\x07 \x01(\t\"\x1d\n\x0c\x42oolResponse\x12\r\n\x05value\x18\x01 \x01(\x08\"C\n\x0fProviderRequest\x12\x10\n\x08provider\x18\x01 \x01(\t\x12\r\n\x05model\x18\x02 \x01(\t\x12\x0f\n\x07\x61pi_key\x18\x03 \x01(\t\"\x1b\n\nIntRequest\x12\r\n\x05value\x18\x01 \x01(\x05\"p\n\rNodeRunResult\x12\x11\n\tunique_id\x18\x01 \x01(\t\x12\x0e\n\x06output\x18\x02 \x01(\t\x12\x0e\n\x06status\x18\x03 \x01(\x05\x12,\n\x0btest_result\x18\x04 \x01(\x0b\x32\x17.google.protobuf.Struct\"m\n\x12\x46ullReplaceRequest\x12,\n\x0b\x63onnections\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\x12)\n\x08profiles\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"X\n\x0e\x43opilotRequest\x12\x17\n\x0fterminal_buffer\x18\x01 \x01(\t\x12\x15\n\ruser_question\x18\x02 \x01(\t\x12\x16\n\x0enode_info_json\x18\x03 \x01(\t\"U\n\x0f\x43opilotResponse\x12\x10\n\x08\x63ommands\x18\x01 \x03(\t\x12\r\n\x05guide\x18\x02 \x01(\t\x12\x12\n\nrisk_level\x18\x03 \x01(\t\x12\r\n\x05\x65rror\x18\x04 \x01(\t\"a\n\nMCPRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0f\n\x07\x65nabled\x18\x03 \x01(\x08\x12\x17\n\x0f\x61uto_load_on_os\x18\x04 \x01(\t\x12\x0e\n\x06remove\x18\x05 \x01(\x08\x32\xe1\x07\n\x0bNodeService\x12<\n\nlist_nodes\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12>\n\x0clist_folders\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12?\n\x10get_node_details\x12\x11.connpy.IdRequest\x1a\x16.connpy.StructResponse\"\x00\x12<\n\x0e\x65xplode_unique\x12\x11.connpy.IdRequest\x1a\x15.connpy.ValueResponse\"\x00\x12\x42\n\x0egenerate_cache\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x08\x61\x64\x64_node\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\x0bupdate_node\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12>\n\x0b\x64\x65lete_node\x12\x15.connpy.DeleteRequest\x1a\x16.google.protobuf.Empty\"\x00\x12:\n\tmove_node\x12\x13.connpy.MoveRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\x08\x62ulk_add\x12\x13.connpy.BulkRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x45\n\x16validate_parent_folder\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x12set_reserved_names\x12\x13.connpy.ListRequest\x1a\x16.google.protobuf.Empty\"\x00\x12H\n\rinteract_node\x12\x17.connpy.InteractRequest\x1a\x18.connpy.InteractResponse\"\x00(\x01\x30\x01\x12\x44\n\x0c\x66ull_replace\x12\x1a.connpy.FullReplaceRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x45\n\rget_inventory\x12\x16.google.protobuf.Empty\x1a\x1a.connpy.FullReplaceRequest\"\x00\x32\x96\x03\n\x0eProfileService\x12?\n\rlist_profiles\x12\x15.connpy.FilterRequest\x1a\x15.connpy.ValueResponse\"\x00\x12?\n\x0bget_profile\x12\x16.connpy.ProfileRequest\x1a\x16.connpy.StructResponse\"\x00\x12<\n\x0b\x61\x64\x64_profile\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x44\n\x11resolve_node_data\x12\x15.connpy.StructRequest\x1a\x16.connpy.StructResponse\"\x00\x12=\n\x0e\x64\x65lete_profile\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12?\n\x0eupdate_profile\x12\x13.connpy.NodeRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\xae\x03\n\rConfigService\x12@\n\x0cget_settings\x12\x16.google.protobuf.Empty\x1a\x16.connpy.StructResponse\"\x00\x12\x43\n\x0fget_default_dir\x12\x16.google.protobuf.Empty\x1a\x16.connpy.StringResponse\"\x00\x12\x44\n\x11set_config_folder\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x41\n\x0eupdate_setting\x12\x15.connpy.UpdateRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x10\x65ncrypt_password\x12\x15.connpy.StringRequest\x1a\x16.connpy.StringResponse\"\x00\x12H\n\x15\x61pply_theme_from_file\x12\x15.connpy.StringRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xca\x02\n\rPluginService\x12?\n\x0clist_plugins\x12\x16.google.protobuf.Empty\x1a\x15.connpy.ValueResponse\"\x00\x12=\n\nadd_plugin\x12\x15.connpy.PluginRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\rdelete_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\renable_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\x0e\x64isable_plugin\x12\x11.connpy.IdRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\x9b\x02\n\x10\x45xecutionService\x12=\n\x0crun_commands\x12\x12.connpy.RunRequest\x1a\x15.connpy.NodeRunResult\"\x00\x30\x01\x12?\n\rtest_commands\x12\x13.connpy.TestRequest\x1a\x15.connpy.NodeRunResult\"\x00\x30\x01\x12\x41\n\x0erun_cli_script\x12\x15.connpy.ScriptRequest\x1a\x16.connpy.StructResponse\"\x00\x12\x44\n\x11run_yaml_playbook\x12\x15.connpy.ScriptRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xe2\x01\n\x13ImportExportService\x12\x41\n\x0e\x65xport_to_file\x12\x15.connpy.ExportRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x10import_from_file\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x12set_reserved_names\x12\x13.connpy.ListRequest\x1a\x16.google.protobuf.Empty\"\x00\x32\xd4\x04\n\tAIService\x12\x33\n\x03\x61sk\x12\x12.connpy.AskRequest\x1a\x12.connpy.AIResponse\"\x00(\x01\x30\x01\x12\x38\n\x07\x63onfirm\x12\x15.connpy.StringRequest\x1a\x14.connpy.BoolResponse\"\x00\x12@\n\x0b\x61sk_copilot\x12\x16.connpy.CopilotRequest\x1a\x17.connpy.CopilotResponse\"\x00\x12@\n\rlist_sessions\x12\x16.google.protobuf.Empty\x1a\x15.connpy.ValueResponse\"\x00\x12\x41\n\x0e\x64\x65lete_session\x12\x15.connpy.StringRequest\x1a\x16.google.protobuf.Empty\"\x00\x12G\n\x12\x63onfigure_provider\x12\x17.connpy.ProviderRequest\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\rconfigure_mcp\x12\x12.connpy.MCPRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x43\n\x10list_mcp_servers\x12\x16.google.protobuf.Empty\x1a\x15.connpy.ValueResponse\"\x00\x12\x44\n\x11load_session_data\x12\x15.connpy.StringRequest\x1a\x16.connpy.StructResponse\"\x00\x32\xc2\x02\n\rSystemService\x12\x39\n\tstart_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12\x39\n\tdebug_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12<\n\x08stop_api\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00\x12;\n\x0brestart_api\x12\x12.connpy.IntRequest\x1a\x16.google.protobuf.Empty\"\x00\x12@\n\x0eget_api_status\x12\x16.google.protobuf.Empty\x1a\x14.connpy.BoolResponse\"\x00\x62\x06proto3') _globals = globals() _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals) -_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'connpy.proto.connpy_pb2', _globals) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'connpy_pb2', _globals) if not _descriptor._USE_C_DESCRIPTORS: DESCRIPTOR._loaded_options = None - _globals['_INTERACTREQUEST']._serialized_start=97 - _globals['_INTERACTREQUEST']._serialized_end=349 - _globals['_INTERACTRESPONSE']._serialized_start=352 - _globals['_INTERACTRESPONSE']._serialized_end=614 - _globals['_FILTERREQUEST']._serialized_start=616 - _globals['_FILTERREQUEST']._serialized_end=671 - _globals['_VALUERESPONSE']._serialized_start=673 - _globals['_VALUERESPONSE']._serialized_end=726 - _globals['_IDREQUEST']._serialized_start=728 - _globals['_IDREQUEST']._serialized_end=751 - _globals['_NODEREQUEST']._serialized_start=753 - _globals['_NODEREQUEST']._serialized_end=836 - _globals['_DELETEREQUEST']._serialized_start=838 - _globals['_DELETEREQUEST']._serialized_end=884 - _globals['_MESSAGEVALUE']._serialized_start=886 - _globals['_MESSAGEVALUE']._serialized_end=915 - _globals['_MOVEREQUEST']._serialized_start=917 - _globals['_MOVEREQUEST']._serialized_end=976 - _globals['_BULKREQUEST']._serialized_start=978 - _globals['_BULKREQUEST']._serialized_end=1065 - _globals['_STRUCTRESPONSE']._serialized_start=1067 - _globals['_STRUCTRESPONSE']._serialized_end=1122 - _globals['_PROFILEREQUEST']._serialized_start=1124 - _globals['_PROFILEREQUEST']._serialized_end=1171 - _globals['_STRUCTREQUEST']._serialized_start=1173 - _globals['_STRUCTREQUEST']._serialized_end=1227 - _globals['_STRINGREQUEST']._serialized_start=1229 - _globals['_STRINGREQUEST']._serialized_end=1259 - _globals['_STRINGRESPONSE']._serialized_start=1261 - _globals['_STRINGRESPONSE']._serialized_end=1292 - _globals['_UPDATEREQUEST']._serialized_start=1294 - _globals['_UPDATEREQUEST']._serialized_end=1361 - _globals['_PLUGINREQUEST']._serialized_start=1363 - _globals['_PLUGINREQUEST']._serialized_end=1429 - _globals['_RUNREQUEST']._serialized_start=1432 - _globals['_RUNREQUEST']._serialized_end=1597 - _globals['_TESTREQUEST']._serialized_start=1600 - _globals['_TESTREQUEST']._serialized_end=1784 - _globals['_SCRIPTREQUEST']._serialized_start=1786 - _globals['_SCRIPTREQUEST']._serialized_end=1851 - _globals['_EXPORTREQUEST']._serialized_start=1853 - _globals['_EXPORTREQUEST']._serialized_end=1904 - _globals['_LISTREQUEST']._serialized_start=1906 - _globals['_LISTREQUEST']._serialized_end=1934 - _globals['_ASKREQUEST']._serialized_start=1937 - _globals['_ASKREQUEST']._serialized_end=2231 - _globals['_AIRESPONSE']._serialized_start=2234 - _globals['_AIRESPONSE']._serialized_end=2434 - _globals['_BOOLRESPONSE']._serialized_start=2436 - _globals['_BOOLRESPONSE']._serialized_end=2465 - _globals['_PROVIDERREQUEST']._serialized_start=2467 - _globals['_PROVIDERREQUEST']._serialized_end=2534 - _globals['_INTREQUEST']._serialized_start=2536 - _globals['_INTREQUEST']._serialized_end=2563 - _globals['_NODERUNRESULT']._serialized_start=2565 - _globals['_NODERUNRESULT']._serialized_end=2677 - _globals['_FULLREPLACEREQUEST']._serialized_start=2679 - _globals['_FULLREPLACEREQUEST']._serialized_end=2788 - _globals['_COPILOTREQUEST']._serialized_start=2790 - _globals['_COPILOTREQUEST']._serialized_end=2878 - _globals['_COPILOTRESPONSE']._serialized_start=2880 - _globals['_COPILOTRESPONSE']._serialized_end=2965 - _globals['_MCPREQUEST']._serialized_start=2967 - _globals['_MCPREQUEST']._serialized_end=3064 - _globals['_NODESERVICE']._serialized_start=3067 - _globals['_NODESERVICE']._serialized_end=4060 - _globals['_PROFILESERVICE']._serialized_start=4063 - _globals['_PROFILESERVICE']._serialized_end=4469 - _globals['_CONFIGSERVICE']._serialized_start=4472 - _globals['_CONFIGSERVICE']._serialized_end=4902 - _globals['_PLUGINSERVICE']._serialized_start=4905 - _globals['_PLUGINSERVICE']._serialized_end=5235 - _globals['_EXECUTIONSERVICE']._serialized_start=5238 - _globals['_EXECUTIONSERVICE']._serialized_end=5521 - _globals['_IMPORTEXPORTSERVICE']._serialized_start=5524 - _globals['_IMPORTEXPORTSERVICE']._serialized_end=5750 - _globals['_AISERVICE']._serialized_start=5753 - _globals['_AISERVICE']._serialized_end=6280 - _globals['_SYSTEMSERVICE']._serialized_start=6283 - _globals['_SYSTEMSERVICE']._serialized_end=6605 + _globals['_INTERACTREQUEST']._serialized_start=84 + _globals['_INTERACTREQUEST']._serialized_end=336 + _globals['_INTERACTRESPONSE']._serialized_start=339 + _globals['_INTERACTRESPONSE']._serialized_end=601 + _globals['_FILTERREQUEST']._serialized_start=603 + _globals['_FILTERREQUEST']._serialized_end=658 + _globals['_VALUERESPONSE']._serialized_start=660 + _globals['_VALUERESPONSE']._serialized_end=713 + _globals['_IDREQUEST']._serialized_start=715 + _globals['_IDREQUEST']._serialized_end=738 + _globals['_NODEREQUEST']._serialized_start=740 + _globals['_NODEREQUEST']._serialized_end=823 + _globals['_DELETEREQUEST']._serialized_start=825 + _globals['_DELETEREQUEST']._serialized_end=871 + _globals['_MESSAGEVALUE']._serialized_start=873 + _globals['_MESSAGEVALUE']._serialized_end=902 + _globals['_MOVEREQUEST']._serialized_start=904 + _globals['_MOVEREQUEST']._serialized_end=963 + _globals['_BULKREQUEST']._serialized_start=965 + _globals['_BULKREQUEST']._serialized_end=1052 + _globals['_STRUCTRESPONSE']._serialized_start=1054 + _globals['_STRUCTRESPONSE']._serialized_end=1109 + _globals['_PROFILEREQUEST']._serialized_start=1111 + _globals['_PROFILEREQUEST']._serialized_end=1158 + _globals['_STRUCTREQUEST']._serialized_start=1160 + _globals['_STRUCTREQUEST']._serialized_end=1214 + _globals['_STRINGREQUEST']._serialized_start=1216 + _globals['_STRINGREQUEST']._serialized_end=1246 + _globals['_STRINGRESPONSE']._serialized_start=1248 + _globals['_STRINGRESPONSE']._serialized_end=1279 + _globals['_UPDATEREQUEST']._serialized_start=1281 + _globals['_UPDATEREQUEST']._serialized_end=1348 + _globals['_PLUGINREQUEST']._serialized_start=1350 + _globals['_PLUGINREQUEST']._serialized_end=1416 + _globals['_RUNREQUEST']._serialized_start=1419 + _globals['_RUNREQUEST']._serialized_end=1584 + _globals['_TESTREQUEST']._serialized_start=1587 + _globals['_TESTREQUEST']._serialized_end=1771 + _globals['_SCRIPTREQUEST']._serialized_start=1773 + _globals['_SCRIPTREQUEST']._serialized_end=1838 + _globals['_EXPORTREQUEST']._serialized_start=1840 + _globals['_EXPORTREQUEST']._serialized_end=1891 + _globals['_LISTREQUEST']._serialized_start=1893 + _globals['_LISTREQUEST']._serialized_end=1921 + _globals['_ASKREQUEST']._serialized_start=1924 + _globals['_ASKREQUEST']._serialized_end=2218 + _globals['_AIRESPONSE']._serialized_start=2221 + _globals['_AIRESPONSE']._serialized_end=2421 + _globals['_BOOLRESPONSE']._serialized_start=2423 + _globals['_BOOLRESPONSE']._serialized_end=2452 + _globals['_PROVIDERREQUEST']._serialized_start=2454 + _globals['_PROVIDERREQUEST']._serialized_end=2521 + _globals['_INTREQUEST']._serialized_start=2523 + _globals['_INTREQUEST']._serialized_end=2550 + _globals['_NODERUNRESULT']._serialized_start=2552 + _globals['_NODERUNRESULT']._serialized_end=2664 + _globals['_FULLREPLACEREQUEST']._serialized_start=2666 + _globals['_FULLREPLACEREQUEST']._serialized_end=2775 + _globals['_COPILOTREQUEST']._serialized_start=2777 + _globals['_COPILOTREQUEST']._serialized_end=2865 + _globals['_COPILOTRESPONSE']._serialized_start=2867 + _globals['_COPILOTRESPONSE']._serialized_end=2952 + _globals['_MCPREQUEST']._serialized_start=2954 + _globals['_MCPREQUEST']._serialized_end=3051 + _globals['_NODESERVICE']._serialized_start=3054 + _globals['_NODESERVICE']._serialized_end=4047 + _globals['_PROFILESERVICE']._serialized_start=4050 + _globals['_PROFILESERVICE']._serialized_end=4456 + _globals['_CONFIGSERVICE']._serialized_start=4459 + _globals['_CONFIGSERVICE']._serialized_end=4889 + _globals['_PLUGINSERVICE']._serialized_start=4892 + _globals['_PLUGINSERVICE']._serialized_end=5222 + _globals['_EXECUTIONSERVICE']._serialized_start=5225 + _globals['_EXECUTIONSERVICE']._serialized_end=5508 + _globals['_IMPORTEXPORTSERVICE']._serialized_start=5511 + _globals['_IMPORTEXPORTSERVICE']._serialized_end=5737 + _globals['_AISERVICE']._serialized_start=5740 + _globals['_AISERVICE']._serialized_end=6336 + _globals['_SYSTEMSERVICE']._serialized_start=6339 + _globals['_SYSTEMSERVICE']._serialized_end=6661 # @@protoc_insertion_point(module_scope) diff --git a/connpy/grpc_layer/connpy_pb2_grpc.py b/connpy/grpc_layer/connpy_pb2_grpc.py index 30d99c4..4f155f5 100644 --- a/connpy/grpc_layer/connpy_pb2_grpc.py +++ b/connpy/grpc_layer/connpy_pb2_grpc.py @@ -3,7 +3,7 @@ import grpc import warnings -from . import connpy_pb2 as connpy_dot_proto_dot_connpy__pb2 +from . import connpy_pb2 as connpy__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 GRPC_GENERATED_VERSION = '1.80.0' @@ -19,7 +19,7 @@ except ImportError: if _version_not_supported: raise RuntimeError( f'The grpc package installed is at version {GRPC_VERSION},' - + ' but the generated code in connpy/proto/connpy_pb2_grpc.py depends on' + + ' but the generated code in connpy_pb2_grpc.py depends on' + f' grpcio>={GRPC_GENERATED_VERSION}.' + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}' + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.' @@ -37,23 +37,23 @@ class NodeServiceStub(object): """ self.list_nodes = channel.unary_unary( '/connpy.NodeService/list_nodes', - request_serializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + request_serializer=connpy__pb2.FilterRequest.SerializeToString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.list_folders = channel.unary_unary( '/connpy.NodeService/list_folders', - request_serializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + request_serializer=connpy__pb2.FilterRequest.SerializeToString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.get_node_details = channel.unary_unary( '/connpy.NodeService/get_node_details', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) self.explode_unique = channel.unary_unary( '/connpy.NodeService/explode_unique', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.generate_cache = channel.unary_unary( '/connpy.NodeService/generate_cache', @@ -62,53 +62,53 @@ class NodeServiceStub(object): _registered_method=True) self.add_node = channel.unary_unary( '/connpy.NodeService/add_node', - request_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + request_serializer=connpy__pb2.NodeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.update_node = channel.unary_unary( '/connpy.NodeService/update_node', - request_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + request_serializer=connpy__pb2.NodeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.delete_node = channel.unary_unary( '/connpy.NodeService/delete_node', - request_serializer=connpy_dot_proto_dot_connpy__pb2.DeleteRequest.SerializeToString, + request_serializer=connpy__pb2.DeleteRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.move_node = channel.unary_unary( '/connpy.NodeService/move_node', - request_serializer=connpy_dot_proto_dot_connpy__pb2.MoveRequest.SerializeToString, + request_serializer=connpy__pb2.MoveRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.bulk_add = channel.unary_unary( '/connpy.NodeService/bulk_add', - request_serializer=connpy_dot_proto_dot_connpy__pb2.BulkRequest.SerializeToString, + request_serializer=connpy__pb2.BulkRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.validate_parent_folder = channel.unary_unary( '/connpy.NodeService/validate_parent_folder', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.set_reserved_names = channel.unary_unary( '/connpy.NodeService/set_reserved_names', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ListRequest.SerializeToString, + request_serializer=connpy__pb2.ListRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.interact_node = channel.stream_stream( '/connpy.NodeService/interact_node', - request_serializer=connpy_dot_proto_dot_connpy__pb2.InteractRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.InteractResponse.FromString, + request_serializer=connpy__pb2.InteractRequest.SerializeToString, + response_deserializer=connpy__pb2.InteractResponse.FromString, _registered_method=True) self.full_replace = channel.unary_unary( '/connpy.NodeService/full_replace', - request_serializer=connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.SerializeToString, + request_serializer=connpy__pb2.FullReplaceRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.get_inventory = channel.unary_unary( '/connpy.NodeService/get_inventory', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.FromString, + response_deserializer=connpy__pb2.FullReplaceRequest.FromString, _registered_method=True) @@ -210,23 +210,23 @@ def add_NodeServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'list_nodes': grpc.unary_unary_rpc_method_handler( servicer.list_nodes, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + request_deserializer=connpy__pb2.FilterRequest.FromString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'list_folders': grpc.unary_unary_rpc_method_handler( servicer.list_folders, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + request_deserializer=connpy__pb2.FilterRequest.FromString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'get_node_details': grpc.unary_unary_rpc_method_handler( servicer.get_node_details, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.IdRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), 'explode_unique': grpc.unary_unary_rpc_method_handler( servicer.explode_unique, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + request_deserializer=connpy__pb2.IdRequest.FromString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'generate_cache': grpc.unary_unary_rpc_method_handler( servicer.generate_cache, @@ -235,53 +235,53 @@ def add_NodeServiceServicer_to_server(servicer, server): ), 'add_node': grpc.unary_unary_rpc_method_handler( servicer.add_node, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.FromString, + request_deserializer=connpy__pb2.NodeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'update_node': grpc.unary_unary_rpc_method_handler( servicer.update_node, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.FromString, + request_deserializer=connpy__pb2.NodeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'delete_node': grpc.unary_unary_rpc_method_handler( servicer.delete_node, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.DeleteRequest.FromString, + request_deserializer=connpy__pb2.DeleteRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'move_node': grpc.unary_unary_rpc_method_handler( servicer.move_node, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.MoveRequest.FromString, + request_deserializer=connpy__pb2.MoveRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'bulk_add': grpc.unary_unary_rpc_method_handler( servicer.bulk_add, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.BulkRequest.FromString, + request_deserializer=connpy__pb2.BulkRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'validate_parent_folder': grpc.unary_unary_rpc_method_handler( servicer.validate_parent_folder, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, + request_deserializer=connpy__pb2.IdRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'set_reserved_names': grpc.unary_unary_rpc_method_handler( servicer.set_reserved_names, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ListRequest.FromString, + request_deserializer=connpy__pb2.ListRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'interact_node': grpc.stream_stream_rpc_method_handler( servicer.interact_node, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.InteractRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.InteractResponse.SerializeToString, + request_deserializer=connpy__pb2.InteractRequest.FromString, + response_serializer=connpy__pb2.InteractResponse.SerializeToString, ), 'full_replace': grpc.unary_unary_rpc_method_handler( servicer.full_replace, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.FromString, + request_deserializer=connpy__pb2.FullReplaceRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'get_inventory': grpc.unary_unary_rpc_method_handler( servicer.get_inventory, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.SerializeToString, + response_serializer=connpy__pb2.FullReplaceRequest.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -309,8 +309,8 @@ class NodeService(object): request, target, '/connpy.NodeService/list_nodes', - connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.FilterRequest.SerializeToString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -336,8 +336,8 @@ class NodeService(object): request, target, '/connpy.NodeService/list_folders', - connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.FilterRequest.SerializeToString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -363,8 +363,8 @@ class NodeService(object): request, target, '/connpy.NodeService/get_node_details', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -390,8 +390,8 @@ class NodeService(object): request, target, '/connpy.NodeService/explode_unique', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -444,7 +444,7 @@ class NodeService(object): request, target, '/connpy.NodeService/add_node', - connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + connpy__pb2.NodeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -471,7 +471,7 @@ class NodeService(object): request, target, '/connpy.NodeService/update_node', - connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + connpy__pb2.NodeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -498,7 +498,7 @@ class NodeService(object): request, target, '/connpy.NodeService/delete_node', - connpy_dot_proto_dot_connpy__pb2.DeleteRequest.SerializeToString, + connpy__pb2.DeleteRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -525,7 +525,7 @@ class NodeService(object): request, target, '/connpy.NodeService/move_node', - connpy_dot_proto_dot_connpy__pb2.MoveRequest.SerializeToString, + connpy__pb2.MoveRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -552,7 +552,7 @@ class NodeService(object): request, target, '/connpy.NodeService/bulk_add', - connpy_dot_proto_dot_connpy__pb2.BulkRequest.SerializeToString, + connpy__pb2.BulkRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -579,7 +579,7 @@ class NodeService(object): request, target, '/connpy.NodeService/validate_parent_folder', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.IdRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -606,7 +606,7 @@ class NodeService(object): request, target, '/connpy.NodeService/set_reserved_names', - connpy_dot_proto_dot_connpy__pb2.ListRequest.SerializeToString, + connpy__pb2.ListRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -633,8 +633,8 @@ class NodeService(object): request_iterator, target, '/connpy.NodeService/interact_node', - connpy_dot_proto_dot_connpy__pb2.InteractRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.InteractResponse.FromString, + connpy__pb2.InteractRequest.SerializeToString, + connpy__pb2.InteractResponse.FromString, options, channel_credentials, insecure, @@ -660,7 +660,7 @@ class NodeService(object): request, target, '/connpy.NodeService/full_replace', - connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.SerializeToString, + connpy__pb2.FullReplaceRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -688,7 +688,7 @@ class NodeService(object): target, '/connpy.NodeService/get_inventory', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.FullReplaceRequest.FromString, + connpy__pb2.FullReplaceRequest.FromString, options, channel_credentials, insecure, @@ -711,32 +711,32 @@ class ProfileServiceStub(object): """ self.list_profiles = channel.unary_unary( '/connpy.ProfileService/list_profiles', - request_serializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + request_serializer=connpy__pb2.FilterRequest.SerializeToString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.get_profile = channel.unary_unary( '/connpy.ProfileService/get_profile', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ProfileRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.ProfileRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) self.add_profile = channel.unary_unary( '/connpy.ProfileService/add_profile', - request_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + request_serializer=connpy__pb2.NodeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.resolve_node_data = channel.unary_unary( '/connpy.ProfileService/resolve_node_data', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StructRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.StructRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) self.delete_profile = channel.unary_unary( '/connpy.ProfileService/delete_profile', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.update_profile = channel.unary_unary( '/connpy.ProfileService/update_profile', - request_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + request_serializer=connpy__pb2.NodeRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) @@ -785,32 +785,32 @@ def add_ProfileServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'list_profiles': grpc.unary_unary_rpc_method_handler( servicer.list_profiles, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.FilterRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + request_deserializer=connpy__pb2.FilterRequest.FromString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'get_profile': grpc.unary_unary_rpc_method_handler( servicer.get_profile, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ProfileRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.ProfileRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), 'add_profile': grpc.unary_unary_rpc_method_handler( servicer.add_profile, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.FromString, + request_deserializer=connpy__pb2.NodeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'resolve_node_data': grpc.unary_unary_rpc_method_handler( servicer.resolve_node_data, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StructRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.StructRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), 'delete_profile': grpc.unary_unary_rpc_method_handler( servicer.delete_profile, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, + request_deserializer=connpy__pb2.IdRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'update_profile': grpc.unary_unary_rpc_method_handler( servicer.update_profile, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRequest.FromString, + request_deserializer=connpy__pb2.NodeRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } @@ -839,8 +839,8 @@ class ProfileService(object): request, target, '/connpy.ProfileService/list_profiles', - connpy_dot_proto_dot_connpy__pb2.FilterRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.FilterRequest.SerializeToString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -866,8 +866,8 @@ class ProfileService(object): request, target, '/connpy.ProfileService/get_profile', - connpy_dot_proto_dot_connpy__pb2.ProfileRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.ProfileRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -893,7 +893,7 @@ class ProfileService(object): request, target, '/connpy.ProfileService/add_profile', - connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + connpy__pb2.NodeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -920,8 +920,8 @@ class ProfileService(object): request, target, '/connpy.ProfileService/resolve_node_data', - connpy_dot_proto_dot_connpy__pb2.StructRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.StructRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -947,7 +947,7 @@ class ProfileService(object): request, target, '/connpy.ProfileService/delete_profile', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.IdRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -974,7 +974,7 @@ class ProfileService(object): request, target, '/connpy.ProfileService/update_profile', - connpy_dot_proto_dot_connpy__pb2.NodeRequest.SerializeToString, + connpy__pb2.NodeRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -999,32 +999,32 @@ class ConfigServiceStub(object): self.get_settings = channel.unary_unary( '/connpy.ConfigService/get_settings', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) self.get_default_dir = channel.unary_unary( '/connpy.ConfigService/get_default_dir', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StringResponse.FromString, + response_deserializer=connpy__pb2.StringResponse.FromString, _registered_method=True) self.set_config_folder = channel.unary_unary( '/connpy.ConfigService/set_config_folder', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.update_setting = channel.unary_unary( '/connpy.ConfigService/update_setting', - request_serializer=connpy_dot_proto_dot_connpy__pb2.UpdateRequest.SerializeToString, + request_serializer=connpy__pb2.UpdateRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.encrypt_password = channel.unary_unary( '/connpy.ConfigService/encrypt_password', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StringResponse.FromString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, + response_deserializer=connpy__pb2.StringResponse.FromString, _registered_method=True) self.apply_theme_from_file = channel.unary_unary( '/connpy.ConfigService/apply_theme_from_file', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) @@ -1073,32 +1073,32 @@ def add_ConfigServiceServicer_to_server(servicer, server): 'get_settings': grpc.unary_unary_rpc_method_handler( servicer.get_settings, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), 'get_default_dir': grpc.unary_unary_rpc_method_handler( servicer.get_default_dir, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StringResponse.SerializeToString, + response_serializer=connpy__pb2.StringResponse.SerializeToString, ), 'set_config_folder': grpc.unary_unary_rpc_method_handler( servicer.set_config_folder, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, + request_deserializer=connpy__pb2.StringRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'update_setting': grpc.unary_unary_rpc_method_handler( servicer.update_setting, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.UpdateRequest.FromString, + request_deserializer=connpy__pb2.UpdateRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'encrypt_password': grpc.unary_unary_rpc_method_handler( servicer.encrypt_password, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StringResponse.SerializeToString, + request_deserializer=connpy__pb2.StringRequest.FromString, + response_serializer=connpy__pb2.StringResponse.SerializeToString, ), 'apply_theme_from_file': grpc.unary_unary_rpc_method_handler( servicer.apply_theme_from_file, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.StringRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -1127,7 +1127,7 @@ class ConfigService(object): target, '/connpy.ConfigService/get_settings', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -1154,7 +1154,7 @@ class ConfigService(object): target, '/connpy.ConfigService/get_default_dir', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StringResponse.FromString, + connpy__pb2.StringResponse.FromString, options, channel_credentials, insecure, @@ -1180,7 +1180,7 @@ class ConfigService(object): request, target, '/connpy.ConfigService/set_config_folder', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StringRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1207,7 +1207,7 @@ class ConfigService(object): request, target, '/connpy.ConfigService/update_setting', - connpy_dot_proto_dot_connpy__pb2.UpdateRequest.SerializeToString, + connpy__pb2.UpdateRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1234,8 +1234,8 @@ class ConfigService(object): request, target, '/connpy.ConfigService/encrypt_password', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StringResponse.FromString, + connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StringResponse.FromString, options, channel_credentials, insecure, @@ -1261,8 +1261,8 @@ class ConfigService(object): request, target, '/connpy.ConfigService/apply_theme_from_file', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -1286,26 +1286,26 @@ class PluginServiceStub(object): self.list_plugins = channel.unary_unary( '/connpy.PluginService/list_plugins', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.add_plugin = channel.unary_unary( '/connpy.PluginService/add_plugin', - request_serializer=connpy_dot_proto_dot_connpy__pb2.PluginRequest.SerializeToString, + request_serializer=connpy__pb2.PluginRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.delete_plugin = channel.unary_unary( '/connpy.PluginService/delete_plugin', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.enable_plugin = channel.unary_unary( '/connpy.PluginService/enable_plugin', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.disable_plugin = channel.unary_unary( '/connpy.PluginService/disable_plugin', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + request_serializer=connpy__pb2.IdRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) @@ -1349,26 +1349,26 @@ def add_PluginServiceServicer_to_server(servicer, server): 'list_plugins': grpc.unary_unary_rpc_method_handler( servicer.list_plugins, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'add_plugin': grpc.unary_unary_rpc_method_handler( servicer.add_plugin, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.PluginRequest.FromString, + request_deserializer=connpy__pb2.PluginRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'delete_plugin': grpc.unary_unary_rpc_method_handler( servicer.delete_plugin, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, + request_deserializer=connpy__pb2.IdRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'enable_plugin': grpc.unary_unary_rpc_method_handler( servicer.enable_plugin, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, + request_deserializer=connpy__pb2.IdRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'disable_plugin': grpc.unary_unary_rpc_method_handler( servicer.disable_plugin, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IdRequest.FromString, + request_deserializer=connpy__pb2.IdRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } @@ -1398,7 +1398,7 @@ class PluginService(object): target, '/connpy.PluginService/list_plugins', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -1424,7 +1424,7 @@ class PluginService(object): request, target, '/connpy.PluginService/add_plugin', - connpy_dot_proto_dot_connpy__pb2.PluginRequest.SerializeToString, + connpy__pb2.PluginRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1451,7 +1451,7 @@ class PluginService(object): request, target, '/connpy.PluginService/delete_plugin', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.IdRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1478,7 +1478,7 @@ class PluginService(object): request, target, '/connpy.PluginService/enable_plugin', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.IdRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1505,7 +1505,7 @@ class PluginService(object): request, target, '/connpy.PluginService/disable_plugin', - connpy_dot_proto_dot_connpy__pb2.IdRequest.SerializeToString, + connpy__pb2.IdRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1529,23 +1529,23 @@ class ExecutionServiceStub(object): """ self.run_commands = channel.unary_stream( '/connpy.ExecutionService/run_commands', - request_serializer=connpy_dot_proto_dot_connpy__pb2.RunRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRunResult.FromString, + request_serializer=connpy__pb2.RunRequest.SerializeToString, + response_deserializer=connpy__pb2.NodeRunResult.FromString, _registered_method=True) self.test_commands = channel.unary_stream( '/connpy.ExecutionService/test_commands', - request_serializer=connpy_dot_proto_dot_connpy__pb2.TestRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.NodeRunResult.FromString, + request_serializer=connpy__pb2.TestRequest.SerializeToString, + response_deserializer=connpy__pb2.NodeRunResult.FromString, _registered_method=True) self.run_cli_script = channel.unary_unary( '/connpy.ExecutionService/run_cli_script', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ScriptRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.ScriptRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) self.run_yaml_playbook = channel.unary_unary( '/connpy.ExecutionService/run_yaml_playbook', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ScriptRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.ScriptRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) @@ -1581,23 +1581,23 @@ def add_ExecutionServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'run_commands': grpc.unary_stream_rpc_method_handler( servicer.run_commands, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.RunRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRunResult.SerializeToString, + request_deserializer=connpy__pb2.RunRequest.FromString, + response_serializer=connpy__pb2.NodeRunResult.SerializeToString, ), 'test_commands': grpc.unary_stream_rpc_method_handler( servicer.test_commands, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.TestRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.NodeRunResult.SerializeToString, + request_deserializer=connpy__pb2.TestRequest.FromString, + response_serializer=connpy__pb2.NodeRunResult.SerializeToString, ), 'run_cli_script': grpc.unary_unary_rpc_method_handler( servicer.run_cli_script, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ScriptRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.ScriptRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), 'run_yaml_playbook': grpc.unary_unary_rpc_method_handler( servicer.run_yaml_playbook, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ScriptRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.ScriptRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -1625,8 +1625,8 @@ class ExecutionService(object): request, target, '/connpy.ExecutionService/run_commands', - connpy_dot_proto_dot_connpy__pb2.RunRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.NodeRunResult.FromString, + connpy__pb2.RunRequest.SerializeToString, + connpy__pb2.NodeRunResult.FromString, options, channel_credentials, insecure, @@ -1652,8 +1652,8 @@ class ExecutionService(object): request, target, '/connpy.ExecutionService/test_commands', - connpy_dot_proto_dot_connpy__pb2.TestRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.NodeRunResult.FromString, + connpy__pb2.TestRequest.SerializeToString, + connpy__pb2.NodeRunResult.FromString, options, channel_credentials, insecure, @@ -1679,8 +1679,8 @@ class ExecutionService(object): request, target, '/connpy.ExecutionService/run_cli_script', - connpy_dot_proto_dot_connpy__pb2.ScriptRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.ScriptRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -1706,8 +1706,8 @@ class ExecutionService(object): request, target, '/connpy.ExecutionService/run_yaml_playbook', - connpy_dot_proto_dot_connpy__pb2.ScriptRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.ScriptRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -1730,17 +1730,17 @@ class ImportExportServiceStub(object): """ self.export_to_file = channel.unary_unary( '/connpy.ImportExportService/export_to_file', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ExportRequest.SerializeToString, + request_serializer=connpy__pb2.ExportRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.import_from_file = channel.unary_unary( '/connpy.ImportExportService/import_from_file', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.set_reserved_names = channel.unary_unary( '/connpy.ImportExportService/set_reserved_names', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ListRequest.SerializeToString, + request_serializer=connpy__pb2.ListRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) @@ -1771,17 +1771,17 @@ def add_ImportExportServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'export_to_file': grpc.unary_unary_rpc_method_handler( servicer.export_to_file, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ExportRequest.FromString, + request_deserializer=connpy__pb2.ExportRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'import_from_file': grpc.unary_unary_rpc_method_handler( servicer.import_from_file, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, + request_deserializer=connpy__pb2.StringRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'set_reserved_names': grpc.unary_unary_rpc_method_handler( servicer.set_reserved_names, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ListRequest.FromString, + request_deserializer=connpy__pb2.ListRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), } @@ -1810,7 +1810,7 @@ class ImportExportService(object): request, target, '/connpy.ImportExportService/export_to_file', - connpy_dot_proto_dot_connpy__pb2.ExportRequest.SerializeToString, + connpy__pb2.ExportRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1837,7 +1837,7 @@ class ImportExportService(object): request, target, '/connpy.ImportExportService/import_from_file', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StringRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1864,7 +1864,7 @@ class ImportExportService(object): request, target, '/connpy.ImportExportService/set_reserved_names', - connpy_dot_proto_dot_connpy__pb2.ListRequest.SerializeToString, + connpy__pb2.ListRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -1888,43 +1888,48 @@ class AIServiceStub(object): """ self.ask = channel.stream_stream( '/connpy.AIService/ask', - request_serializer=connpy_dot_proto_dot_connpy__pb2.AskRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.AIResponse.FromString, + request_serializer=connpy__pb2.AskRequest.SerializeToString, + response_deserializer=connpy__pb2.AIResponse.FromString, _registered_method=True) self.confirm = channel.unary_unary( '/connpy.AIService/confirm', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.BoolResponse.FromString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, + response_deserializer=connpy__pb2.BoolResponse.FromString, _registered_method=True) self.ask_copilot = channel.unary_unary( '/connpy.AIService/ask_copilot', - request_serializer=connpy_dot_proto_dot_connpy__pb2.CopilotRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.CopilotResponse.FromString, + request_serializer=connpy__pb2.CopilotRequest.SerializeToString, + response_deserializer=connpy__pb2.CopilotResponse.FromString, _registered_method=True) self.list_sessions = channel.unary_unary( '/connpy.AIService/list_sessions', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + response_deserializer=connpy__pb2.ValueResponse.FromString, _registered_method=True) self.delete_session = channel.unary_unary( '/connpy.AIService/delete_session', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.configure_provider = channel.unary_unary( '/connpy.AIService/configure_provider', - request_serializer=connpy_dot_proto_dot_connpy__pb2.ProviderRequest.SerializeToString, + request_serializer=connpy__pb2.ProviderRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.configure_mcp = channel.unary_unary( '/connpy.AIService/configure_mcp', - request_serializer=connpy_dot_proto_dot_connpy__pb2.MCPRequest.SerializeToString, + request_serializer=connpy__pb2.MCPRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) + self.list_mcp_servers = channel.unary_unary( + '/connpy.AIService/list_mcp_servers', + request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + response_deserializer=connpy__pb2.ValueResponse.FromString, + _registered_method=True) self.load_session_data = channel.unary_unary( '/connpy.AIService/load_session_data', - request_serializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + request_serializer=connpy__pb2.StringRequest.SerializeToString, + response_deserializer=connpy__pb2.StructResponse.FromString, _registered_method=True) @@ -1973,6 +1978,12 @@ class AIServiceServicer(object): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def list_mcp_servers(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def load_session_data(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -1984,43 +1995,48 @@ def add_AIServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'ask': grpc.stream_stream_rpc_method_handler( servicer.ask, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.AskRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.AIResponse.SerializeToString, + request_deserializer=connpy__pb2.AskRequest.FromString, + response_serializer=connpy__pb2.AIResponse.SerializeToString, ), 'confirm': grpc.unary_unary_rpc_method_handler( servicer.confirm, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.BoolResponse.SerializeToString, + request_deserializer=connpy__pb2.StringRequest.FromString, + response_serializer=connpy__pb2.BoolResponse.SerializeToString, ), 'ask_copilot': grpc.unary_unary_rpc_method_handler( servicer.ask_copilot, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.CopilotRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.CopilotResponse.SerializeToString, + request_deserializer=connpy__pb2.CopilotRequest.FromString, + response_serializer=connpy__pb2.CopilotResponse.SerializeToString, ), 'list_sessions': grpc.unary_unary_rpc_method_handler( servicer.list_sessions, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.ValueResponse.SerializeToString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, ), 'delete_session': grpc.unary_unary_rpc_method_handler( servicer.delete_session, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, + request_deserializer=connpy__pb2.StringRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'configure_provider': grpc.unary_unary_rpc_method_handler( servicer.configure_provider, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.ProviderRequest.FromString, + request_deserializer=connpy__pb2.ProviderRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'configure_mcp': grpc.unary_unary_rpc_method_handler( servicer.configure_mcp, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.MCPRequest.FromString, + request_deserializer=connpy__pb2.MCPRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), + 'list_mcp_servers': grpc.unary_unary_rpc_method_handler( + servicer.list_mcp_servers, + request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, + response_serializer=connpy__pb2.ValueResponse.SerializeToString, + ), 'load_session_data': grpc.unary_unary_rpc_method_handler( servicer.load_session_data, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.StringRequest.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.StructResponse.SerializeToString, + request_deserializer=connpy__pb2.StringRequest.FromString, + response_serializer=connpy__pb2.StructResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -2048,8 +2064,8 @@ class AIService(object): request_iterator, target, '/connpy.AIService/ask', - connpy_dot_proto_dot_connpy__pb2.AskRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.AIResponse.FromString, + connpy__pb2.AskRequest.SerializeToString, + connpy__pb2.AIResponse.FromString, options, channel_credentials, insecure, @@ -2075,8 +2091,8 @@ class AIService(object): request, target, '/connpy.AIService/confirm', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.BoolResponse.FromString, + connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.BoolResponse.FromString, options, channel_credentials, insecure, @@ -2102,8 +2118,8 @@ class AIService(object): request, target, '/connpy.AIService/ask_copilot', - connpy_dot_proto_dot_connpy__pb2.CopilotRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.CopilotResponse.FromString, + connpy__pb2.CopilotRequest.SerializeToString, + connpy__pb2.CopilotResponse.FromString, options, channel_credentials, insecure, @@ -2130,7 +2146,7 @@ class AIService(object): target, '/connpy.AIService/list_sessions', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.ValueResponse.FromString, + connpy__pb2.ValueResponse.FromString, options, channel_credentials, insecure, @@ -2156,7 +2172,7 @@ class AIService(object): request, target, '/connpy.AIService/delete_session', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StringRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2183,7 +2199,7 @@ class AIService(object): request, target, '/connpy.AIService/configure_provider', - connpy_dot_proto_dot_connpy__pb2.ProviderRequest.SerializeToString, + connpy__pb2.ProviderRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2210,7 +2226,7 @@ class AIService(object): request, target, '/connpy.AIService/configure_mcp', - connpy_dot_proto_dot_connpy__pb2.MCPRequest.SerializeToString, + connpy__pb2.MCPRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2222,6 +2238,33 @@ class AIService(object): metadata, _registered_method=True) + @staticmethod + def list_mcp_servers(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary( + request, + target, + '/connpy.AIService/list_mcp_servers', + google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, + connpy__pb2.ValueResponse.FromString, + options, + channel_credentials, + insecure, + call_credentials, + compression, + wait_for_ready, + timeout, + metadata, + _registered_method=True) + @staticmethod def load_session_data(request, target, @@ -2237,8 +2280,8 @@ class AIService(object): request, target, '/connpy.AIService/load_session_data', - connpy_dot_proto_dot_connpy__pb2.StringRequest.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.StructResponse.FromString, + connpy__pb2.StringRequest.SerializeToString, + connpy__pb2.StructResponse.FromString, options, channel_credentials, insecure, @@ -2261,12 +2304,12 @@ class SystemServiceStub(object): """ self.start_api = channel.unary_unary( '/connpy.SystemService/start_api', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + request_serializer=connpy__pb2.IntRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.debug_api = channel.unary_unary( '/connpy.SystemService/debug_api', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + request_serializer=connpy__pb2.IntRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.stop_api = channel.unary_unary( @@ -2276,13 +2319,13 @@ class SystemServiceStub(object): _registered_method=True) self.restart_api = channel.unary_unary( '/connpy.SystemService/restart_api', - request_serializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + request_serializer=connpy__pb2.IntRequest.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, _registered_method=True) self.get_api_status = channel.unary_unary( '/connpy.SystemService/get_api_status', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - response_deserializer=connpy_dot_proto_dot_connpy__pb2.BoolResponse.FromString, + response_deserializer=connpy__pb2.BoolResponse.FromString, _registered_method=True) @@ -2324,12 +2367,12 @@ def add_SystemServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'start_api': grpc.unary_unary_rpc_method_handler( servicer.start_api, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.FromString, + request_deserializer=connpy__pb2.IntRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'debug_api': grpc.unary_unary_rpc_method_handler( servicer.debug_api, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.FromString, + request_deserializer=connpy__pb2.IntRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'stop_api': grpc.unary_unary_rpc_method_handler( @@ -2339,13 +2382,13 @@ def add_SystemServiceServicer_to_server(servicer, server): ), 'restart_api': grpc.unary_unary_rpc_method_handler( servicer.restart_api, - request_deserializer=connpy_dot_proto_dot_connpy__pb2.IntRequest.FromString, + request_deserializer=connpy__pb2.IntRequest.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, ), 'get_api_status': grpc.unary_unary_rpc_method_handler( servicer.get_api_status, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - response_serializer=connpy_dot_proto_dot_connpy__pb2.BoolResponse.SerializeToString, + response_serializer=connpy__pb2.BoolResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( @@ -2373,7 +2416,7 @@ class SystemService(object): request, target, '/connpy.SystemService/start_api', - connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + connpy__pb2.IntRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2400,7 +2443,7 @@ class SystemService(object): request, target, '/connpy.SystemService/debug_api', - connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + connpy__pb2.IntRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2454,7 +2497,7 @@ class SystemService(object): request, target, '/connpy.SystemService/restart_api', - connpy_dot_proto_dot_connpy__pb2.IntRequest.SerializeToString, + connpy__pb2.IntRequest.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, @@ -2482,7 +2525,7 @@ class SystemService(object): target, '/connpy.SystemService/get_api_status', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - connpy_dot_proto_dot_connpy__pb2.BoolResponse.FromString, + connpy__pb2.BoolResponse.FromString, options, channel_credentials, insecure, diff --git a/connpy/grpc_layer/server.py b/connpy/grpc_layer/server.py index 5f1c04a..34705eb 100644 --- a/connpy/grpc_layer/server.py +++ b/connpy/grpc_layer/server.py @@ -483,6 +483,7 @@ class ProfileServicer(connpy_pb2_grpc.ProfileServiceServicer): self.service = ProfileService(config) self.node_service = NodeService(config) + @handle_errors def list_profiles(self, request, context): f = request.filter_str if request.filter_str else None @@ -731,6 +732,7 @@ class StatusBridge: self.on_interrupt = self._force_interrupt self.thread = None self.is_web = is_web + self.is_remote = True def _force_interrupt(self): """Forcefully raise KeyboardInterrupt in the target thread.""" @@ -862,9 +864,11 @@ class AIServicer(connpy_pb2_grpc.AIServiceServicer): print(f"AI Task Error: {e}") traceback.print_exc() chunk_queue.put(("status", f"Error: {str(e)}")) + # Crucial: always send final_mark to avoid client deadlock + chunk_queue.put(("final_mark", {"response": f"Error: {str(e)}", "chat_history": history, "error": True})) def request_listener(): - nonlocal bridge, is_web, ai_thread, agent_instance + nonlocal bridge, is_web, ai_thread, agent_instance, history try: for req in request_iterator: if req.interrupt: @@ -878,6 +882,11 @@ class AIServicer(connpy_pb2_grpc.AIServiceServicer): if req.input_text: is_web = "web" in (req.session_id or "").lower() or (req.session_id or "").lower().startswith("ws-") + + # Hydrate history from client if it's the first interaction in this stream + if not history and req.chat_history: + from .utils import from_value + history = from_value(req.chat_history) or [] if not bridge: bridge = StatusBridge(chunk_queue, request_queue=request_queue, is_web=is_web) @@ -948,7 +957,8 @@ class AIServicer(connpy_pb2_grpc.AIServiceServicer): @handle_errors def list_sessions(self, request, context): - return connpy_pb2.ValueResponse(data=to_value(self.service.list_sessions())) + sessions, total = self.service.list_sessions() + return connpy_pb2.ValueResponse(data=to_value(sessions)) @handle_errors def delete_session(self, request, context): @@ -971,6 +981,11 @@ class AIServicer(connpy_pb2_grpc.AIServiceServicer): ) return Empty() + @handle_errors + def list_mcp_servers(self, request, context): + mcp_servers = self.service.list_mcp_servers() + return connpy_pb2.ValueResponse(data=to_value(mcp_servers)) + @handle_errors def load_session_data(self, request, context): return connpy_pb2.StructResponse(data=to_struct(self.service.load_session_data(request.value))) diff --git a/connpy/grpc_layer/stubs.py b/connpy/grpc_layer/stubs.py index 7fa4aea..550af76 100644 --- a/connpy/grpc_layer/stubs.py +++ b/connpy/grpc_layer/stubs.py @@ -758,6 +758,7 @@ class AIStub: full_content = "" header_printed = False + current_responder = "engineer" final_result = {"response": "", "chat_history": []} # Background thread to pull responses from gRPC into a local queue @@ -802,6 +803,10 @@ class AIStub: break if response.status_update: + if response.status_update.startswith("__RESPONDER__:"): + current_responder = response.status_update.split(":")[1].lower() + continue + if response.requires_confirmation: if status: status.stop() @@ -854,7 +859,9 @@ class AIStub: stable_console = RichConsole(theme=connpy_theme, file=get_original_stdout()) # Print header on first chunk - stable_console.print(Rule("[bold engineer]Network Engineer[/bold engineer]", style="engineer")) + alias = "architect" if current_responder == "architect" else "engineer" + role_label = "Network Architect" if current_responder == "architect" else "Network Engineer" + stable_console.print(Rule(f"[bold {alias}]{role_label}[/bold {alias}]", style=alias)) header_printed = True # Initialize parser @@ -906,8 +913,13 @@ class AIStub: return self.stub.confirm(connpy_pb2.StringRequest(value=input_text)).value @handle_errors - def list_sessions(self): - return from_value(self.stub.list_sessions(Empty()).data) + def list_sessions(self, limit=None): + from .utils import from_value + res = self.stub.list_sessions(Empty()) + sessions = from_value(res.data) or [] + if limit and len(sessions) > limit: + return sessions[:limit], len(sessions) + return sessions, len(sessions) @handle_errors def delete_session(self, session_id): @@ -929,6 +941,11 @@ class AIStub: ) self.stub.configure_mcp(req) + @handle_errors + def list_mcp_servers(self): + res = self.stub.list_mcp_servers(Empty()) + return from_value(res.data) or {} + @handle_errors def load_session_data(self, session_id): return from_struct(self.stub.load_session_data(connpy_pb2.StringRequest(value=session_id)).data) diff --git a/connpy/proto/connpy.proto b/connpy/proto/connpy.proto index 4ea99e3..ad06bef 100644 --- a/connpy/proto/connpy.proto +++ b/connpy/proto/connpy.proto @@ -70,6 +70,7 @@ service AIService { 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) {} } diff --git a/connpy/services/ai_service.py b/connpy/services/ai_service.py index a6af2cf..19a5889 100644 --- a/connpy/services/ai_service.py +++ b/connpy/services/ai_service.py @@ -167,11 +167,14 @@ class AIService(BaseService): return await asyncio.wrap_future(future) - def list_sessions(self): - """Return a list of all saved AI sessions.""" + def list_sessions(self, limit=None): + """Return a list of saved AI sessions, optionally limited.""" from connpy.ai import ai agent = ai(self.config) - return agent._get_sessions() + sessions = agent._get_sessions() + if limit and len(sessions) > limit: + return sessions[:limit], len(sessions) + return sessions, len(sessions) def delete_session(self, session_id): """Delete an AI session by ID.""" @@ -228,6 +231,11 @@ class AIService(BaseService): self.config.config["ai"] = ai_settings self.config._saveconfig(self.config.file) + def list_mcp_servers(self) -> dict: + """Get the configured MCP servers.""" + ai_settings = self.config.config.get("ai", {}) + return ai_settings.get("mcp_servers", {}) + def load_session_data(self, session_id): """Load a session's raw data by ID.""" from connpy.ai import ai diff --git a/connpy/tests/test_grpc_layer.py b/connpy/tests/test_grpc_layer.py index 3741834..1290b0b 100644 --- a/connpy/tests/test_grpc_layer.py +++ b/connpy/tests/test_grpc_layer.py @@ -120,6 +120,7 @@ class TestGRPCIntegration: connpy_pb2_grpc.add_ConfigServiceServicer_to_server(server.ConfigServicer(populated_config), srv) connpy_pb2_grpc.add_ExecutionServiceServicer_to_server(server.ExecutionServicer(populated_config), srv) connpy_pb2_grpc.add_ImportExportServiceServicer_to_server(server.ImportExportServicer(populated_config), srv) + connpy_pb2_grpc.add_AIServiceServicer_to_server(server.AIServicer(populated_config), srv) port = srv.add_insecure_port('127.0.0.1:0') srv.start() @@ -143,6 +144,10 @@ class TestGRPCIntegration: def config_stub(self, channel): return stubs.ConfigStub(channel, "localhost") + @pytest.fixture + def ai_stub(self, channel): + return stubs.AIStub(channel, "localhost") + def test_list_nodes_integration(self, node_stub): nodes = node_stub.list_nodes() assert "router1" in nodes @@ -170,6 +175,12 @@ class TestGRPCIntegration: settings = config_stub.get_settings() assert settings["idletime"] == 99 + def test_list_mcp_servers_integration(self, ai_stub): + ai_stub.configure_mcp("test-mcp", url="http://localhost:8080", enabled=True) + servers = ai_stub.list_mcp_servers() + assert "test-mcp" in servers + assert servers["test-mcp"]["url"] == "http://localhost:8080" + def test_add_delete_node_integration(self, node_stub): node_stub.add_node("integration-test-node", {"host": "9.9.9.9"}) assert "integration-test-node" in node_stub.list_nodes()