@locusai/telegram 0.8.1

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.
Files changed (3) hide show
  1. package/README.md +133 -0
  2. package/bin/telegram.js +42348 -0
  3. package/package.json +41 -0
package/README.md ADDED
@@ -0,0 +1,133 @@
1
+ # @locusai/telegram
2
+
3
+ Telegram bot for [Locus](https://locusai.dev) - remote control your AI agents from Telegram.
4
+
5
+ ## Setup
6
+
7
+ ### 1. Create a Telegram Bot
8
+
9
+ 1. Open Telegram and message [@BotFather](https://t.me/BotFather)
10
+ 2. Send `/newbot` and follow the prompts
11
+ 3. Copy the bot token you receive
12
+
13
+ ### 2. Get Your Chat ID
14
+
15
+ 1. Message your new bot in Telegram
16
+ 2. Visit `https://api.telegram.org/bot<YOUR_TOKEN>/getUpdates`
17
+ 3. Find your `chat.id` in the response
18
+
19
+ ### 3. Configure
20
+
21
+ You can configure the bot via environment variables or the Locus settings file.
22
+
23
+ **Environment variables** (`.env` file in the package directory):
24
+
25
+ ```bash
26
+ LOCUS_TELEGRAM_TOKEN="your-bot-token"
27
+ LOCUS_TELEGRAM_CHAT_ID="your-chat-id"
28
+ LOCUS_API_KEY="your-locus-api-key"
29
+ LOCUS_PROJECT_PATH="/path/to/your/project"
30
+ ```
31
+
32
+ **Settings file** (`.locus/settings.json` in your project):
33
+
34
+ ```json
35
+ {
36
+ "apiKey": "your-locus-api-key",
37
+ "telegram": {
38
+ "botToken": "your-bot-token",
39
+ "chatId": 123456789,
40
+ "agentCount": 1,
41
+ "testMode": false
42
+ }
43
+ }
44
+ ```
45
+
46
+ ### 4. Start the Bot
47
+
48
+ ```bash
49
+ # From the package directory
50
+ bun run start
51
+
52
+ # Or in development mode (auto-reload)
53
+ bun run dev
54
+ ```
55
+
56
+ ## Commands
57
+
58
+ ### Planning
59
+
60
+ | Command | Description |
61
+ |---------|-------------|
62
+ | `/plan <directive>` | Start a planning meeting |
63
+ | `/plans` | List pending plans |
64
+ | `/approve <id>` | Approve a plan |
65
+ | `/reject <id> <feedback>` | Reject a plan with feedback |
66
+ | `/cancel <id>` | Cancel a plan |
67
+
68
+ ### Tasks
69
+
70
+ | Command | Description |
71
+ |---------|-------------|
72
+ | `/tasks` | List active tasks |
73
+ | `/rejecttask <id> <feedback>` | Reject an IN_REVIEW task |
74
+
75
+ ### Execution
76
+
77
+ | Command | Description |
78
+ |---------|-------------|
79
+ | `/run` | Start agents on sprint tasks |
80
+ | `/stop` | Stop all running processes |
81
+ | `/exec <prompt>` | One-shot AI execution |
82
+
83
+ ### Status
84
+
85
+ | Command | Description |
86
+ |---------|-------------|
87
+ | `/status` | Show running processes |
88
+ | `/agents` | List agent worktrees |
89
+
90
+ ### System
91
+
92
+ | Command | Description |
93
+ |---------|-------------|
94
+ | `/start` | Welcome message |
95
+ | `/help` | Show available commands |
96
+
97
+ ## Configuration Options
98
+
99
+ | Option | Env Variable | Settings Key | Description |
100
+ |--------|-------------|--------------|-------------|
101
+ | Bot Token | `LOCUS_TELEGRAM_TOKEN` | `telegram.botToken` | Telegram bot token from BotFather |
102
+ | Chat ID | `LOCUS_TELEGRAM_CHAT_ID` | `telegram.chatId` | Authorized Telegram chat ID |
103
+ | Project Path | `LOCUS_PROJECT_PATH` | — | Path to the Locus project directory |
104
+ | API Key | `LOCUS_API_KEY` | `apiKey` | Locus API key |
105
+ | API Base URL | — | `apiUrl` | Custom API URL |
106
+ | Provider | — | `provider` | AI provider (`claude` or `codex`) |
107
+ | Model | — | `model` | AI model override |
108
+ | Agent Count | — | `telegram.agentCount` | Number of agents to spawn with `/run` |
109
+ | Test Mode | `LOCUS_TEST_MODE` | `telegram.testMode` | Use local CLI source instead of published binary |
110
+
111
+ ## Security
112
+
113
+ The bot only responds to the configured chat ID. All messages from other chats are silently ignored.
114
+
115
+ ## Development
116
+
117
+ ```bash
118
+ # Start with auto-reload
119
+ bun run dev
120
+
121
+ # Build
122
+ bun run build
123
+
124
+ # Lint
125
+ bun run lint
126
+
127
+ # Type check
128
+ bun run typecheck
129
+ ```
130
+
131
+ ## License
132
+
133
+ MIT