Commit Graph

216 Commits

Author SHA1 Message Date
fluzzi32 05fb9951c6 update readme 2026-05-13 14:49:04 -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 3ad4f6da1f add utils file 2026-05-12 13:19:35 -03:00
fluzzi32 5c4e2116c8 refactor to support future command center 2026-05-12 13:19:06 -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 1103393be6 minor bugs 2026-05-09 19:45:19 -03:00
fluzzi32 a08d84139d remoto con fixes de todo 2026-05-08 21:53:57 -03:00
fluzzi32 d62af8b037 copilot remoto con bugs 2026-05-08 18:45:42 -03:00
fluzzi32 14a298dd4d context ai 2026-05-07 17:30:43 -03:00
fluzzi32 61552cffa9 add stream 2026-05-07 16:43:32 -03:00
fluzzi32 c4d704f473 first implementation phase 1 and 2 2026-05-07 15:17:00 -03:00
fluzzi32 f6078b6fde update version 2026-05-05 18:25:33 -03:00
fluzzi32 37db74f47d refactor(core): stabilize gRPC streaming, plugin invocation, and CLI UX
- Implement threaded plugin execution with Queue-based streaming in PluginService
- Refactor remote logger to preserve ANSI colors and fix TTY line endings (\r\n)
- Intelligent terminal filtering: disable SSM screen-clearing filter after success
- Sanitize SSH-only flags in core.py when using SFTP protocol
- Rewrite completion tree with pre/post-node states and flag deduplication
- Update gRPC unit tests to match new streaming response structure
2026-05-05 18:24:31 -03:00
fluzzi32 16868828c6 Fix stream ai bug 2026-05-01 23:54:24 -03:00
fluzzi32 a192bd1912 connpy v6.0.0b4: AI Stability, Remote Sync & UI Polish (Clean Commit) 2026-05-01 18:55:25 -03:00
fluzzi32 c81f6e049f feat: advanced jumphost capabilities and core bug fixes
- **Core/Jumphost**: Implement native jumphost support for `ssm`, `kubectl`, and `docker` protocols via transparent ProxyCommands.
- **Core/Tags**: Introduce `ssh_options` tag to pass custom arguments (e.g., `-i key.pem`) inside nested SSM SSH tunnels.
- **Core/Tags**: Introduce `nc_command` tag to override default `nc` behavior in Docker/Kube tunnels (crucial for IOS-XRd VRF netns isolation).
- **Core/Async**: Fix a critical bug where interactive terminal sessions disconnected immediately due to premature `asyncio.FIRST_COMPLETED` task resolution when logs or idletime were disabled.
- **Services/Node**: Fix logic error in `validate_parent_folder` that prevented the creation of new nested subfolders (CLI was incorrectly checking for the subfolder's own existence instead of the parent's).
- **CLI/Help**: Update documentation to include the new `region`, `profile`, `ssh_options`, and `nc_command` well-known tags.
2026-04-30 19:25:17 -03:00
fluzzi32 918fc9a07c up version 2026-04-30 14:32:45 -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 96049b4028 feat: Implement Smart Tunnel async architecture (v6.0.0b1)
- Replaced blocking pexpect interact with asyncio-based multiplexing.
- Implemented LocalStream and RemoteStream for agnostic I/O handling.
- Real-time SIGWINCH window resizing support.
- 'Ghost buffer' mitigation for clean, artifact-free session handovers.
- Upgraded _logclean into a mini terminal emulator to accurately process ANSI, backspaces, and inline clears.
- Continuous auto-saving for logs without blocking the main thread.
- Bumped version to 6.0.0b1 and regenerated pdoc documentation.
2026-04-27 15:12:28 -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 287acde1e4 chore: release v5.1b5 (optimize startup, fix ai panel) 2026-04-20 12:28:43 -03:00
fluzzi32 5f01d0c757 fix: resolve protobuf version conflict and stabilize API startup (v5.1b4) 2026-04-17 21:10:49 -03:00
fluzzi32 f30e8a991f fix: stabilize API startup and bump version to 5.1b3 2026-04-17 21:04:42 -03:00
fluzzi32 4dd822a921 chore: sync version and build fixes to v5.1b2 2026-04-17 20:05:18 -03:00
fluzzi32 d8c572d2b6 build: update dependencies in requirements.txt and setup.cfg for v5.1b1 2026-04-17 19:45:18 -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 af85051eb7 fix(config): implement atomic save, validation and recovery for config files and update pdoc 2026-04-04 10:55:05 -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 5d8c372f23 docs: bump version to 5.0b2 and regenerate documentation 2026-04-03 17:14:16 -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 7de6003435 Merge branch 'main' into publish 2026-04-03 15:13:11 -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 7aefcacd23 Merge branch 'main' into publish 2025-08-13 16:08:28 -03:00
fluzzi32 b2c414485c publish prod version with capture 2025-08-13 16:07:32 -03:00
fluzzi32 100f18f45c Merge branch 'capture' into publish 2025-08-04 11:34:46 -03:00
fluzzi32 c5e70c6070 add capture feature, change printing mechanics for all app, bug fixes 2025-08-04 11:34:22 -03:00
fluzzi32 67df9cf8b6 Merge branch 'main' into publish 2025-07-11 22:32:46 -03:00
fluzzi32 29a6a01015 fix ai 2025-07-11 22:31:42 -03:00
fluzzi32 a7da41abf0 Merge branch 'main' into publish 2025-05-09 17:44:44 -03:00
fluzzi32 485580693d minor bug fixes, add new tags, add bulk using file 2025-05-09 17:44:29 -03:00
fluzzi32 74c11bb5c0 Merge branch 'main' into publish 2025-01-30 18:08:50 -03:00
fluzzi32 3cb6734547 bug fix docker 2025-01-30 17:39:56 -03:00
fluzzi32 b1367562df Merge branch 'main' into publish 2024-07-21 18:40:29 -03:00
fluzzi32 6d53b68d1f change to openai 4o mini and improvements to ai code for new model 2024-07-21 18:39:46 -03:00
fluzzi32 e9a9cc270f Merge branch 'main' into publish 2024-07-15 15:44:46 -03:00
fluzzi32 fcf8ed6859 Add features:
- New protocols: Docker and Kubectl
 - Add contexts to filter the number of nodes
 - Add option to modify the api using plugins
 - Minor bug fixes
2024-07-15 15:38:01 -03:00
fluzzi32 5987919032 Merge branch 'protocols' into publish 2024-07-05 17:50:05 -03:00