agentgram 0.0.0-stage โ†’ 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rumuze (https://rumuze.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,202 @@
1
- # Temporary Holding Version
1
+ # โšก AgentGram
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **Turn your Telegram into a live AI Agent Control Room & Ops Mission Control**
4
+ > Control [OpenCode](https://opencode.ai), AI coding agents, and terminal operations on your machine or VPS directly from your phone via Telegram.
5
+
6
+ [![npm version](https://img.shields.io/npm/v/agentgram.svg?style=flat-square&logo=npm&color=CB3837)](https://www.npmjs.com/package/agentgram)
7
+ [![npm package size](https://img.shields.io/badge/package%20size-52%20kB-22c55e?style=flat-square&logo=npm)](https://www.npmjs.com/package/agentgram)
8
+ [![dependencies](https://img.shields.io/badge/dependencies-0%20(zero)-success.svg?style=flat-square)](https://www.npmjs.com/package/agentgram)
9
+ [![CI Matrix](https://img.shields.io/github/actions/workflow/status/rumuze/agentgram/ci.yml?branch=main&label=CI%20matrix&style=flat-square&logo=githubactions&logoColor=white)](https://github.com/rumuze/agentgram/actions)
10
+ [![GitHub release](https://img.shields.io/github/v/release/rumuze/agentgram?style=flat-square&color=3b82f6&logo=github)](https://github.com/rumuze/agentgram/releases/latest)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat-square)](LICENSE)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-blue.svg?style=flat-square&logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-18%20..%2026-green.svg?style=flat-square&logo=node.js&logoColor=white)](https://nodejs.org)
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/agentgram"><b>๐Ÿ“ฆ View on NPM</b></a> โ€ข
17
+ <a href="https://github.com/rumuze/agentgram/releases/latest"><b>๐Ÿท๏ธ Releases</b></a> โ€ข
18
+ <a href="#-quick-start"><b>๐Ÿš€ Quick Start</b></a> โ€ข
19
+ <a href="#-telegram-experience"><b>๐Ÿ“ฑ Features</b></a> โ€ข
20
+ <a href="#-frequently-asked-questions-faq"><b>โ“ FAQ</b></a>
21
+ </p>
22
+
23
+ ---
24
+
25
+ ## ๐ŸŒŸ Why AgentGram?
26
+
27
+ Developers shouldn't be chained to their desks waiting for an AI agent to finish modifying code, executing test suites, or running remote deployment scripts.
28
+
29
+ **AgentGram** turns your phone into a mobile developer cockpit:
30
+ * ๐Ÿ“ฒ **Live Streaming Mission Control:** Real-time progress updates inside a dynamic message (updates smoothly every ~2.5s with tools, steps, and output tails).
31
+ * ๐Ÿ”˜ **One-Tap Permission Buttons:** Approve or reject file edits and commands with `[ โœ… Allow Once ]`, `[ โ™พ๏ธ Always Allow ]`, or `[ โ›” Reject ]`.
32
+ * โšก **Auto Mode:** Enable full autonomy for routine tasks; safety policies automatically intercept destructive commands.
33
+ * ๐Ÿ›ก๏ธ **Enterprise Prompt Injection Shield:** Multi-layer defense against role hijacking, jailbreaks, delimiter evasion, and malicious prompt injections.
34
+ * ๐Ÿ”Œ **Pluggable Hexagonal Architecture:** Out-of-the-box support for **Telegram** and **OpenCode** as defaults, plus plug-and-play adapters for alternative channels (**Terminal Console**, **Webhooks**, **Slack/Discord**) and coding engines (**Claude Code**, **Aider**, **Shell CLI**).
35
+ * ๐ŸŒ **Multi-Machine & Server Ops:** Run operations, SSH jump-host connections, deploy scripts (`pinpoint-go`), and remote log diagnostics directly from your phone.
36
+ * โšก **Zero Runtime Dependencies:** 100% Pure Node.js & TypeScript with zero external runtime dependencies. Ultra-lightweight and blazingly fast!
37
+
38
+ ---
39
+
40
+ ## ๐Ÿ—๏ธ Architecture
41
+
42
+ ```mermaid
43
+ flowchart LR
44
+ User["๐Ÿ“ฑ Telegram / Console / Webhook"] <-->|IChannelAdapter| ControlRoom["โšก AgentGram Control Room"]
45
+ ControlRoom <-->|IAgentEngine| Engine["๐Ÿค– OpenCode / Claude Code / Shell"]
46
+ Engine <-->|Sandboxed Execution| Project["๐Ÿ“‚ Project Files & Git"]
47
+ ControlRoom <-->|Authorized Ops / SSH| Remote["๐Ÿ–ฅ๏ธ Remote VPS / Server"]
48
+ ```
49
+
50
+ ### The Live Experience
51
+
52
+ ```text
53
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
54
+ โ”‚ โšก AgentGram ยท Live Mission Control โ”‚
55
+ โ”‚ โ”‚
56
+ โ”‚ Agent: ๐Ÿง  build (OpenCode) | Mode: ๐Ÿ”’ build โ”‚
57
+ โ”‚ Channel: ๐Ÿ“ก Telegram Bot โ”‚
58
+ โ”‚ Status: ๐ŸŸข Executing bash (npm test) โ”‚
59
+ โ”‚ Step: 4/12 ยท โณ 14s ยท ๐Ÿ“ 3 files modified โ”‚
60
+ โ”‚ โ”‚
61
+ โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
62
+ โ”‚ > PASS tests/auth.test.js โ”‚
63
+ โ”‚ > PASS tests/api.test.js โ”‚
64
+ โ”‚ > All 14 tests passing โ”‚
65
+ โ”‚ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ โ”‚
66
+ โ”‚ โ”‚
67
+ โ”‚ [ โน Stop ] [ ๐Ÿ“ค Diff ] [ ๐Ÿ”’ Mode ] โ”‚
68
+ โ”‚ [ ๐Ÿ“ Projects ] [ ๐ŸŒ Language ] โ”‚
69
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
70
+ ```
71
+
72
+ ---
73
+
74
+ ## ๐Ÿš€ Quick Start
75
+
76
+ ### 1. Instant Run via NPX (Zero Install)
77
+
78
+ Run immediately in any repository without installing globally:
79
+
80
+ ```bash
81
+ # Launch interactive pairing wizard (takes 30 seconds)
82
+ npx agentgram init
83
+
84
+ # Start the live control room
85
+ npx agentgram start
86
+
87
+ # Or run in background as a detached daemon
88
+ npx agentgram start --daemon
89
+ ```
90
+
91
+ ### 2. Global Installation
92
+
93
+ Install globally across your development machine or VPS:
94
+
95
+ ```bash
96
+ npm install -g agentgram
97
+
98
+ # Initialize pairing in any repo
99
+ agentgram init
100
+
101
+ # Start control room
102
+ agentgram start
103
+ ```
104
+
105
+ ### 3. Running as a Persistent System Service (Auto-Start on Boot)
106
+
107
+ Want AgentGram to run 24/7 on your machine or cloud VPS?
108
+
109
+ ```bash
110
+ # On macOS (installs to ~/Library/LaunchAgents/com.agentgram.plist)
111
+ # On Linux (installs to ~/.config/systemd/user/agentgram.service)
112
+ npx agentgram service install
113
+
114
+ # Check service status
115
+ npx agentgram service status
116
+ ```
117
+
118
+ ### 4. Via Docker Compose (Headless Cloud VPS)
119
+
120
+ Run 24/7 on any cloud server or VPS:
121
+
122
+ ```bash
123
+ git clone https://github.com/rumuze/agentgram.git && cd agentgram
124
+ TG_BOT_TOKEN="your_bot_token" TG_ALLOWED_CHAT_ID="your_chat_id" docker compose up -d
125
+ ```
126
+
127
+ ---
128
+
129
+ ## ๐ŸŽฎ Telegram Controls & Commands
130
+
131
+ Once connected, your Telegram chat becomes your project mission control:
132
+
133
+ | Command / Control | Description |
134
+ |---|---|
135
+ | **Live Status Card** | Edits automatically every ~2.5s showing active tools, steps, and output tails |
136
+ | **Interactive Approvals** | Commands requiring approval render inline buttons: `[ โœ… Allow Once ]`, `[ โ™พ๏ธ Always Allow ]`, `[ โ›” Reject ]` |
137
+ | **Interactive Questions** | Agent questions appear as clickable buttons (single-choice, multi-select, or custom text) |
138
+ | `/mode` | Switch execution mode: `read` (read-only diagnosis), `build` (interactive approval), or `auto` (autonomous execution) |
139
+ | `/agents` | Switch active agent persona on the fly (e.g. `build`, `delegate`, `code-review`) |
140
+ | `/models` | Switch LLM provider and model dynamically |
141
+ | `/diff` | Get a condensed git diff summary of unstaged and staged changes |
142
+ | `/usage` | View token usage, quota renewal countdowns, and rate limits |
143
+ | `/stop` | Immediately interrupt and terminate the running agent process |
144
+ | `/lang` | Toggle between English and Arabic UI |
145
+
146
+ ---
147
+
148
+ ## ๐Ÿ”’ Security Sandboxing & Prompt Injection Shield
149
+
150
+ AgentGram is engineered with enterprise zero-trust principles:
151
+
152
+ 1. **๐Ÿ›ก๏ธ Advanced Prompt Injection Defense:**
153
+ - **Role Hijacking & Jailbreak Defense:** Detects and blocks imperative prompt overrides ("ignore previous instructions", "disregard prior directives", "DAN mode", "system override:", and Arabic variants "ุชุฌุงู‡ู„ ุงู„ุชุนู„ูŠู…ุงุช ุงู„ุณุงุจู‚ุฉ", "ุฃู†ุช ุงู„ุขู† ููŠ ูˆุถุน ุงู„ู…ุทูˆุฑ").
154
+ - **System Boundary Isolation:** Blocks delimiter evasion and token spoofing (`</untrusted-report>`, `<system>`, `<|im_start|>`, `[INST] <<SYS>>`).
155
+ - **Unicode & Obfuscation Stripping:** Normalizes Unicode (NFKC) and strips zero-width/invisible evasion characters (`\u200B`, `\u200C`, `\uFEFF`, `\u2060`) and BiDi overrides (`\u202E`). Recursively inspects base64 payloads.
156
+ - **Data Exfiltration Defense:** Blocks markdown image (`![exfil](https://.../?token=)`) and HTML link exfiltration vectors.
157
+ 2. **๐Ÿ” Cryptographic Quarantine Envelopes:**
158
+ - External error logs, server alerts, and untrusted inputs are wrapped inside isolated blocks (`<untrusted-report id="...">`) signed with cryptographically random nonces (`secrets.token_hex(8)`).
159
+ 3. **๐Ÿšซ Execution Blocklist:**
160
+ - Irreversible destructive host wiping is blocked by default (`rm -rf /`, `rm -rf ~`, `mkfs`, `shutdown`, `dd if=`).
161
+ 4. **๐Ÿ‘ค Single Chat ID Lock:** Every message and inline callback query validates `chat.id == ALLOWED_CHAT_ID`. Unknown users are ignored.
162
+ 5. **๐Ÿ”’ Loopback & Token Isolation:** OpenCode server runs strictly on `127.0.0.1` with a per-session randomized high-entropy password; bot token is saved with strict `0600` file permissions.
163
+
164
+ ---
165
+
166
+ ## ๐Ÿ› ๏ธ CLI Reference
167
+
168
+ ```text
169
+ agentgram <command> [options]
170
+ npx agentgram <command> [options]
171
+
172
+ COMMANDS:
173
+ init Interactive setup wizard & automatic Telegram pairing
174
+ start Start the control room for the current project
175
+ stop Stop running background daemon
176
+ status Display current daemon, server, and workspace status
177
+ service install Install as persistent background service (macOS launchd / Linux systemd)
178
+ service uninstall Remove persistent background service
179
+ service status Check persistent background service status
180
+ help Display help message
181
+
182
+ OPTIONS:
183
+ --dir <path> Set target project directory (defaults to current working directory)
184
+ --daemon, -d Run in background as a detached process
185
+ --channel <name> Communication channel: telegram (default), console
186
+ --engine <name> AI coding engine: opencode (default), shell, claude, aider
187
+ --version, -v Show version number
188
+ ```
189
+
190
+ ---
191
+
192
+ ## ๐Ÿค Contributing & Community
193
+
194
+ Contributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md).
195
+
196
+ ---
197
+
198
+ ## ๐Ÿ“„ License
199
+
200
+ Distributed under the **MIT License**. See [LICENSE](LICENSE) for more details.
201
+
202
+ Developed with โค๏ธ by **[Rumuze](https://rumuze.com)**.