Commit Graph

60 Commits

Author SHA1 Message Date
fluzzi32 744e730672 feat(auth,cli): add SSO/OIDC authentication and provider management
- Introduce `conn sso` CLI suite for managing Identity Providers (IdP).
- Implement `login_sso` and `get_sso_providers` in gRPC AuthService.
- Add auto-provisioning for users logging in via SSO.
- Support JWT validation via shared secrets (HS256) or JWKS (RS256).
- Add domain restriction (`allowed_domains`) and env-var secret resolution.
- Increase JWT session expiration from 8 to 12 hours.
- Add shell autocompletion for SSO commands and configured providers.
- Bump version to 6.0.3.
2026-06-04 18:33:26 -03:00
fluzzi32 2b8e637298 added AI support for yaml/run 2026-06-01 17:49:19 -03:00
fluzzi32 f5e09a55ab feat(cli): agregar comando connpy login --status 2026-05-28 12:48:38 -03:00
fluzzi32 0adaaad971 feat(multiuser): implementar sistema multiusuario gRPC y configuración compartida de IA/MCP
- Servidor gRPC: Agregar interceptores de autenticación y UserRegistry para aislar sesiones por usuario.
- Contexto de Hilos: Corregir propagación de ContextVar _current_user a hilos secundarios en ExecutionServicer.
- Configuración Compartida: Implementar herencia y deep merge de settings de IA ('ai') y servidores MCP en configfile.
- Hot-Reload: Recarga automática en caliente de la configuración compartida global ante cambios en disco.
- CLI: Agregar comandos e interfaces de usuario para autenticación (login) y administración de usuarios.
- Pruebas: Desarrollar tests unitarios completos (test_shared_ai.py) y resolver regresiones en la suite existente.
2026-05-28 09:27:54 -03:00
fluzzi32 3be9935541 support fro multiple litellm auth methods 2026-05-21 18:20:24 -03:00
fluzzi32 dce9982454 feat(ai): enhance session management, inquirer theme, and gRPC MCP support
- AI & Session Management:
  - Add random suffix to session IDs to ensure uniqueness.
  - Implement optional pagination/limit in session listing (default 20).
  - Add `--all` flag to `ai` CLI commands to view all sessions.
  - Keep active session ID and path synced correctly during clean session startups.

- CLI UI/UX:
  - Add a custom `ConnpyTheme` for inquirer prompts that dynamically translates
    active hex style colors to terminal ANSI/blessed escapes.

- gRPC & Services:
  - Implement remote MCP server listing (`list_mcp_servers` RPC and services).
  - Stream responder updates (`__RESPONDER__`) to toggle headers dynamically between
    "Network Engineer" and "Network Architect" on remote/web clients.
  - Fix remote client deadlock risk by ensuring `final_mark` is sent on exceptions.
  - Hydrate client-side chat history correctly on initial streaming request.

- Testing:
  - Add integration tests for AI gRPC services and MCP server listing.
2026-05-20 12:27:02 -03:00
fluzzi32 12543c683e 1. Persistence Setup: Optimized the dockerfile to manually create the /root/.config/conn/.folder file
pointing to /config. This avoids running the conn command during the build process and ensures a
      cleaner setup.
   2. Copilot UI Fix: Resolved a double-escaping bug in the terminal bottom bar. Device prompts (like
      6WIND-PE1>) will now render correctly instead of showing HTML entities like >.
   3. AI Model Update: Updated the default engineer model in connpy/ai.py to
      gemini/gemini-3.1-flash-lite, removing the deprecated -preview suffix.
   4. Standardized Timeouts: Unified all default timeouts to 20 seconds across the board. This includes
      direct execution (run/test), modern playbooks (v2), and classic task-based playbooks (v1).
   5. Documentation Update: Regenerated the full documentation site in the docs/ directory using pdoc to
      reflect the latest changes.
   6. Cleanup: Removed all debug prints from connpy/core.py and restored the docker/logs/.gitignore
      file.
2026-05-13 14:16:14 -03:00
fluzzi32 2666a3db1f feat(v6): integrate MCP support, async copilot streaming, and enhanced terminal UI logic 2026-05-12 12:20:50 -03:00
fluzzi32 dba7e24dda feat(copilot): stabilize concurrency and enhance terminal context management
- AI Concurrency:
  - Implemented a dedicated background event loop (ConnpyAILoop) in a separate thread for AI tasks to ensure thread safety and event loop affinity.
  - Added 'run_ai_async' utility to funnel all LiteLLM calls through the dedicated loop.
  - Implemented global 'cleanup()' for safe closure of sync/async LiteLLM sessions.

- gRPC & Remote Sessions:
  - Enhanced 'NodeServicer' to identify command blocks within the terminal buffer using prompt regex/byte tracking.
  - Added support for selective context retrieval via 'context_start_pos' in the gRPC Interact stream.
  - Synchronized remote Copilot behavior by enriching questions with session history (last 5 queries) in 'NodeStub'.
  - Optimized token usage by cleaning 'node_info' metadata before AI transmission.

- Terminal Context & Core:
  - Modified 'node.connect' to always initialize 'mylog' (BytesIO) buffer regardless of disk logging configuration, ensuring Copilot context availability.
  - Integrated 'ai.cleanup()' in CLI (connapp) and Server (api) exit points for graceful shutdowns.
  - Suppressed LiteLLM internal streaming coroutine warnings during task cancellation.
2026-05-11 12:30:43 -03:00
fluzzi32 7967c413c9 feat: simplify node selection, enhance gRPC execution logic, and improve CLI aggregate summaries 2026-04-30 14:18:41 -03:00
fluzzi32 1c814eb9fd refactor: Major upgrade to v5.1b6 - AWS SSM support & Distributed Architecture
Core & Protocols:
- Native AWS SSM support added (aws ssm start-session).
- Improved Pexpect logic for ssm, kubectl, and docker.
- Cleaned connection success messages (omitting ports for non-IP protocols).

gRPC Layer:
- Migrated gRPC modules to 'connpy/grpc_layer/'.
- Implemented dynamic node naming (e.g. ssm-i-xxxx@aws) for accurate server-side logging.
- Added automatic sys.path resolution for gRPC generated modules.
- Enhanced InteractNode response with initial connection status.

Printer & Concurrency:
- Implemented ThreadLocalStream for isolated thread-safe output.
- Self-healing Console objects to prevent 'closed file' errors in test/async environments.
- Capture clean plugin output in remote executions.

AI & Services:
- Improved tool registration and debug visualization.
- Restored native dictionary returns for AI tools to fix Web UI rendering.
- Increased backup retention to 100 copies in SyncService.
- Silenced noisy auto-sync CLI messages.

Quality & Docs:
- Total tests: 267 (all passing).
- New test suites for gRPC layer and printer concurrency.
- Updated .gitignore to exclude internal planning docs.
- Full technical documentation regenerated with pdoc.
2026-04-24 19:23:00 -03:00
fluzzi32 cb926c2b85 feat: major architectural refactor to 5.1b1 - Service Layer, gRPC & Agent evolution (fragmented secrets) 2026-04-17 18:42:08 -03:00
fluzzi32 85b23526cd feat: implement AI session management, fix UI rendering, and release 5.0b6
- Bump version to 5.0b6 and regenerate HTML documentation via pdoc3.
- Add persistent AI chat sessions (list, resume, delete) stored locally.
- Fix 'rich' library console rendering and routing 'error()' to stderr.
- Update Architect UI color theme to medium_purple.
- Sanitize caching metadata (cache_control) for compatibility with non-Anthropic models.
- Fix .folder config path redirection mapping and fzf-wrapper compatibility.
- Ensure context plugin correctly filters node lists upon load.
- Inject config instance directly into API components instead of instantiating globally.
- Fix edge-case in plugin loading preventing startup when folder is missing.
- Add comprehensive test coverage for printer module and AI sessions.
2026-04-06 15:52:09 -03:00
fluzzi32 24f98885c0 feat: fast completion caches, embedded OAuth client, and robust context plugin
- Refactored completion.py to use text caches for near-instant tab-completion.
- Integrated self-healing cache generation in configfile.py for nodes, folders, and profiles.
- Updated bash/zsh completion generation to call completion.py directly via python3.
- Embedded Google OAuth client config in sync.py with split secrets to bypass GitHub scanning.
- Refactored context plugin with property-based configuration and improved safety (default 'all' context, regex fallback).
- Updated unit tests for completion caching and validated context plugin improvements.
- Bumped version to 5.0b4 and regenerated documentation.
2026-04-04 09:20:01 -03:00
fluzzi32 d8f7d4db87 feat: migrate config to YAML, add dual-caching and 0ms fzf wrapper
- Migrated configuration backend from JSON to YAML for better readability.
- Added automatic dual-caching (.config.cache.json) to preserve fast load times with YAML.
- Implemented a new 0ms latency fzf wrapper for bash and zsh (--fzf-wrapper).
- Updated sync plugin to support the new YAML config format and clear caches on extraction.
- Refactored 'completion.py' to gracefully handle fallback config formats.
- Added new test modules (test_capture, test_context, test_sync) covering core plugins.
- Updated existing unit tests to handle YAML config creation and parsing.
- Bumped version to 5.0b3 and regenerated HTML documentation.
2026-04-03 18:47:55 -03:00
fluzzi32 cf95befb43 test: add comprehensive unit tests and fix bare excepts
- Added comprehensive unit test suite covering AI, core, plugins, completion, API, and hooks using pytest.
- Replaced bare 'except:' clauses across the codebase with specific exception handling (e.g., ValueError, KeyError, OSError) to prevent swallowing system exit calls.
- Fixed Python 3.8+ AST compatibility in plugins.py (support for ast.Constant).
- Removed deprecated pkg_resources import from __init__.py.
- Fixed missing 'printer' import in configfile.py that caused NameErrors during save failures.
2026-04-03 17:11:45 -03:00
fluzzi32 257cb05cc1 feat: complete overhaul of AI subsystem with multi-agent litellm architecture
- Refactored AI module to use litellm, supporting Anthropic, Google, OpenAI, etc.
- Introduced 'Engineer' (execution) and 'Architect' (strategic) AI agents.
- Added real-time streaming responses and interactive chat mode via 'rich'.
- Added CLI arguments for model/key overrides (--engineer-model, --architect-model).
- Replaced 'openai' with 'litellm' in requirements.txt and setup.cfg.
- Updated nodes.run() to support an 'on_complete' callback for live node-status streaming.
- Fixed an undefined variable bug (config.profiles -> self.profiles) in configfile.py.
- Updated README and docstrings with new AI plugin tool registration API.
- Regenerated HTML documentation using pdoc3.
- Bumped version to 5.0b1 for beta release.
2026-04-03 15:11:37 -03:00
fluzzi32 c5e70c6070 add capture feature, change printing mechanics for all app, bug fixes 2025-08-04 11:34:22 -03:00
fluzzi32 485580693d minor bug fixes, add new tags, add bulk using file 2025-05-09 17:44:29 -03:00
fluzzi32 c27b2589c2 add contexts and api plugins 2024-07-02 16:53:07 -03:00
fluzzi32 e2570eba24 add kubectl and docker support 2024-06-17 15:58:28 -03:00
fluzzi32 1fa47d2248 fix bug list nodes 2024-06-10 15:45:04 -03:00
fluzzi32 8ca6d6bcd9 Implement hooking system for classes and methods. Cleanup of code 2024-05-03 17:32:45 -03:00
fluzzi32 af7aac4a05 Update hooks functionality 2024-04-22 18:17:11 -03:00
fluzzi32 76a73fa427 add hooks and sync to google 2024-04-17 16:27:02 -03:00
fluzzi32 75f5ff6833 add update plugin, better completion for plugins 2023-12-19 18:26:09 -03:00
fluzzi32 79172be898 documentation and completion for plugins 2023-12-15 12:27:51 -03:00
fluzzi32 3a4fcfe77b bug fix 2023-12-14 18:36:22 -03:00
fluzzi32 b995bd04fd Add new plugin feature beta1 2023-12-14 16:56:59 -03:00
fluzzi32 6517d75465 Add new jumphost feature to nodes
bug fix when adding a node without name
2023-12-01 18:30:29 -03:00
fluzzi32 b7e21806df bug fixes 2023-12-01 13:40:49 -03:00
fluzzi32 1a336963cb add sftp option 2023-11-03 11:59:00 -03:00
fluzzi32 f4ff035da3 Fix:
- Fix not allowing to use some regex symbols when passing arguments.
    - Fix AI requests timing out when list of nodes is big.
    - Fix error when forwarding connpy run commands to a file

Features:
    - Improve AI response time changing list of devices to list of OS,
      reducing the lenght of request.
    - Update GPT model to last one.
    - Add filtering option to list command, Also format can be passed to
      format the output as needed.
    - Allow to use regular expresions to match nodes in: run command
      (using yaml file or directly), remove command.
    - When there is a connectivity error, now it shows the error number
      plus the protocol error.
2023-10-26 17:33:44 -03:00
fluzzi32 0254cf6ccb Fix completion and save logs during session 2023-10-05 15:21:17 -03:00
fluzzi32 64ea3718f0 Add more export functionalities 2023-09-21 17:28:09 -03:00
fluzzi32 d08b2e5a2a fix export import with path, add pyfzf as required 2023-09-13 11:17:56 -03:00
fluzzi32 d77778bdcc Add bulk edit with regex and export/import folder 2023-09-12 12:33:33 -03:00
fluzzi32 ef34961222 bug fix chat history in ai 2023-07-31 12:18:10 -03:00
fluzzi32 b4b28110b1 Add More AI functions, migrate AI to openai new function support 2023-07-11 19:33:21 -03:00
fluzzi32 e2ac9855f5 add new AI feature. Add tags feature, used tags: OS for AI, screen_length_command for automation, prompt for automation. fixes 2023-05-05 13:41:32 -03:00
fluzzi32 3779997398 add api debug option 2023-04-15 22:38:52 -03:00
fluzzi32 480944be4c bug fixes 2023-04-14 18:30:58 -03:00
fluzzi32 0445d53bb6 add api 2023-04-14 11:44:56 -03:00
fluzzi32 f2793e6098 starting api 2023-04-06 18:47:29 -03:00
fluzzi32 b4e9501bdb Add fuzzy non case sensistive search 2023-03-21 18:23:29 -03:00
fluzzi32 e1eaa3c6ad bug fixes, add reconnect 2023-01-05 16:39:22 -03:00
fluzzi32 5d48f11608 bug fixes, preparing for unittesting 2022-06-10 13:24:26 -03:00
fluzzi32 fb51bd195e fix github actions publish - pick 'publish' branch, fix typos 2022-05-26 11:33:35 -03:00
fluzzi32 3b26827c70 fix edit bug, tune run/test automation, prepare for testing 2022-05-19 16:11:41 -03:00
fluzzi32 6b661f301a new version add automation in cmd 2022-05-11 14:25:43 -03:00