{"id":51920598,"url":"https://github.com/magicxor/pacos-agy-acp","last_synced_at":"2026-07-27T17:30:42.511Z","repository":{"id":363444944,"uuid":"1260825993","full_name":"magicxor/pacos-agy-acp","owner":"magicxor","description":"AI-powered .NET Telegram bot that drives the agy (Google Antigravity) CLI agent via a Rust ACP adapter.","archived":false,"fork":false,"pushed_at":"2026-07-20T21:42:02.000Z","size":619,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-07-20T23:26:45.222Z","etag":null,"topics":["acp","agy","agy-acp","agy-cli","ai-chatbot","bot","cli","console-application","csharp","docker","dotnet","gemini","google-ai","markdown","stdin","telegram","telegram-bot"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magicxor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-06-05T23:14:17.000Z","updated_at":"2026-07-20T21:40:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/magicxor/pacos-agy-acp","commit_stats":null,"previous_names":["magicxor/pacos-agy-acp"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/magicxor/pacos-agy-acp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicxor%2Fpacos-agy-acp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicxor%2Fpacos-agy-acp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicxor%2Fpacos-agy-acp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicxor%2Fpacos-agy-acp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magicxor","download_url":"https://codeload.github.com/magicxor/pacos-agy-acp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magicxor%2Fpacos-agy-acp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35960005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-27T02:00:06.776Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["acp","agy","agy-acp","agy-cli","ai-chatbot","bot","cli","console-application","csharp","docker","dotnet","gemini","google-ai","markdown","stdin","telegram","telegram-bot"],"created_at":"2026-07-27T17:30:42.014Z","updated_at":"2026-07-27T17:30:42.506Z","avatar_url":"https://github.com/magicxor.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pacos Telegram Bot\r\n\r\n[![master branch - test, build, push, deploy](https://github.com/magicxor/pacos-agy-acp/actions/workflows/on_master_push.yml/badge.svg)](https://github.com/magicxor/pacos-agy-acp/actions/workflows/on_master_push.yml)\r\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/magicxor/pacos-agy-acp)\r\n\r\nPacos is a .NET-based Telegram bot designed to interact in group chats. It drives the agy (Google Antigravity) CLI agent through the `agy-acp` ACP adapter to produce chat responses, run tools, and deliver generated files.\r\n\r\n*The alpaca was scientifically described by Carl Linnaeus in his System of Nature (1758) under the Latin name Camelus pacos.*\r\n\r\n![scr1](https://user-images.githubusercontent.com/8275793/231939658-5b52f5c3-2dba-4313-9756-4d8b16d14627.jpg)\r\n\r\n## Features\r\n\r\n- **AI-Powered Chat**: Responds to mentions (e.g., \"pacos\", \"пакос\") or direct messages by driving the agy agent over ACP. Each chat gets its own working directory holding a persona steering file (`AGENTS.md`) and a set of agy Agent Skills (`.agents/skills/\u003cskill\u003e/SKILL.md`) that carry the tool-specific instructions and are loaded on demand instead of on every turn.\r\n- **Image Generation**: Generate or modify images via the `!drawx \u003cprompt\u003e` command. An optional source image can be supplied with the command or by replying to a message that contains one.\r\n- **File Delivery**: The agent can return generated files (images, documents, etc.) by moving them into a per-turn output directory via the filemcp MCP server, which the bot then forwards back to the user.\r\n- **Chat Management**:\r\n    - **Reset History**: Users can clear the agent's session for a specific chat with the `!resetx` command.\r\n- **Language Identification**: Detects the language of incoming messages to tailor responses (using `NTextCat` with `Core14.profile.xml`).\r\n- **Sandboxed Execution**: An enforced agy permission policy (written at startup) denies all shell commands and restricts the agent's file access to its per-chat workspace and the brain staging dir; file delivery is handled by the filemcp MCP server, not the shell. The real isolation boundary is the container (non-root user, restricted volume).\r\n- **Asynchronous Processing**: Handles incoming Telegram updates and agent interactions asynchronously using a background task queue to ensure responsiveness.\r\n\r\n## Core Technologies\r\n\r\n- **Framework**: .NET (Worker Service)\r\n- **Telegram API**: [Telegram.Bot](https://github.com/TelegramBots/telegram.bot) library\r\n- **AI Agent**: agy ([Google Antigravity CLI](https://antigravity.google/docs/cli-using)), driven via the `agy-acp` [ACP adapter](https://github.com/openabdev/openab)\r\n- **Logging**: NLog (configured via `nlog.config`)\r\n- **Configuration**: Standard .NET configuration (e.g., `appsettings.json`, environment variables)\r\n- **Language Detection**: `NTextCat`\r\n\r\n## Configuration\r\n\r\nThe bot reads its settings from environment variables or an `appsettings.json` file under the `Pacos` section.\r\n\r\n**Required:**\r\n\r\n- `TelegramBotApiKey`: Your Telegram Bot API token.\r\n- `AllowedChatIds`: An array of Telegram chat IDs where the bot is permitted to operate.\r\n- `ChatModel`: The model name written into the agy permission policy (e.g. `Gemini 3.5 Flash (High)`).\r\n\r\n**Optional:**\r\n\r\n- `FallbackChatModel`: Model retried once when the primary model fails with a quota error (HTTP 429 / RESOURCE_EXHAUSTED). Pick one billed against a different quota pool than `ChatModel` (e.g. `Claude Sonnet 4.6 (Thinking)` when the primary is a Gemini model); the value must exactly match a label from `agy models`. Empty disables the fallback.\r\n- `AgyAcpCommand`: Executable used to spawn the agy-acp adapter (default: `agy-acp`).\r\n- `AgyAcpArgs`: Extra command-line arguments passed to the agy-acp process.\r\n- `WorkingDirectoryRoot`: Root directory under which per-chat working directories are created (default: a folder under the system temp directory).\r\n- `AgyExtraArgs`: Extra arguments forwarded to every underlying `agy` invocation (via `AGY_EXTRA_ARGS`).\r\n- `GeminiApiKey`: Optional Gemini API key passed to the agy subprocess for non-interactive auth. When empty, agy relies on its own persisted OAuth credentials (e.g. `~/.gemini`).\r\n- `PromptTimeoutSeconds`: Hard timeout for a single prompt round-trip to agy-acp (default: `300`).\r\n- `SessionIdleTimeoutMinutes`: When a chat has been idle (no prompt to the agent) for longer than this, the next prompt starts a fresh session instead of resuming — and paying the tokens for — the stale conversation (default: `180`; `0` disables).\r\n- `AgyCommandRuleMode`: Which set of agy command-permission rules to write (`denyall` (default) or `off`).\r\n\r\n## Setup and Running\r\n\r\n1.  Ensure you have the .NET SDK and the `agy` / `agy-acp` executables available on `PATH`.\r\n2.  Configure the required settings (see **Configuration** section).\r\n3.  Create `Core14.profile.xml` (for NTextCat language identification) in the application's root directory.\r\n4.  Run the application:\r\n    ```bash\r\n    dotnet run\r\n    ```\r\n\r\nWhen running in Docker, the agy state directory (`/home/agent/.gemini`) should be backed by a named volume so the agent's OAuth credentials and state persist across deployments (see the deploy workflow).\r\n\r\n## Bot Commands\r\n\r\n- `pacos, \u003cmessage\u003e`: Engage in a conversation with the agent.\r\n- `!drawx \u003cprompt\u003e`: Generate an image based on the provided text prompt (optionally using an attached or replied-to image as the source).\r\n- `!resetx`: Reset the agent's session for the current chat.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicxor%2Fpacos-agy-acp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagicxor%2Fpacos-agy-acp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagicxor%2Fpacos-agy-acp/lists"}