telegram-opencode-bridge-bot 0.1.4__tar.gz → 0.1.6__tar.gz

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 (28) hide show
  1. {telegram_opencode_bridge_bot-0.1.4/telegram_opencode_bridge_bot.egg-info → telegram_opencode_bridge_bot-0.1.6}/PKG-INFO +10 -4
  2. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/README.md +9 -3
  3. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/bot.py +48 -6
  4. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/handlers/commands.py +511 -29
  5. telegram_opencode_bridge_bot-0.1.6/handlers/messages.py +818 -0
  6. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/opencode/client.py +60 -0
  7. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/pyproject.toml +1 -1
  8. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6/telegram_opencode_bridge_bot.egg-info}/PKG-INFO +10 -4
  9. telegram_opencode_bridge_bot-0.1.4/handlers/messages.py +0 -482
  10. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/.env.example +0 -0
  11. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/MANIFEST.in +0 -0
  12. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/config.py +0 -0
  13. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/handlers/__init__.py +0 -0
  14. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/list_session_models.py +0 -0
  15. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/opencode/__init__.py +0 -0
  16. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/opencode/server.py +0 -0
  17. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/requirements.txt +0 -0
  18. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/sessions/__init__.py +0 -0
  19. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/sessions/manager.py +0 -0
  20. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/setup.cfg +0 -0
  21. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/telegram_opencode_bridge_bot.egg-info/SOURCES.txt +0 -0
  22. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/telegram_opencode_bridge_bot.egg-info/dependency_links.txt +0 -0
  23. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/telegram_opencode_bridge_bot.egg-info/entry_points.txt +0 -0
  24. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/telegram_opencode_bridge_bot.egg-info/requires.txt +0 -0
  25. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/telegram_opencode_bridge_bot.egg-info/top_level.txt +0 -0
  26. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/utils/__init__.py +0 -0
  27. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/utils/formatting.py +0 -0
  28. {telegram_opencode_bridge_bot-0.1.4 → telegram_opencode_bridge_bot-0.1.6}/utils/security.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: telegram-opencode-bridge-bot
3
- Version: 0.1.4
3
+ Version: 0.1.6
4
4
  Summary: A Telegram bot that bridges messages directly to OpenCode — an AI coding agent running on your machine
5
5
  Author-email: MaheshNagabhairava <maheshnagabhirava12345@gmail.com>
6
6
  License-Expression: MIT
@@ -23,13 +23,15 @@ A lightweight Python bot that bridges your Telegram messages directly to [OpenCo
23
23
 
24
24
  - **Direct OpenCode integration** — routes your messages to OpenCode's HTTP API
25
25
  - **Persistent sessions** — conversations maintain context across messages
26
- - **Session management** — create, switch, list, and share sessions
26
+ - **Session management** — create, delete, switch, list, and share sessions
27
27
  - **Model switching** — change AI models on the fly (`/model`)
28
28
  - **Plan/Build modes** — toggle between read-only analysis and full execution
29
29
  - **Smart formatting** — code blocks with syntax highlighting in Telegram
30
30
  - **Auto message splitting** — handles responses longer than Telegram's 4096 char limit
31
31
  - **Security** — whitelist-based access control + rate limiting
32
32
  - **Workspace Switching** — Switching from one workspace to another
33
+ - **Uploading from Mobile to WorkSpace** - U can upload the documents/images from your mobile to the opencode agent workspace
34
+ - **Workspace Management** — Creation and deletion of the workspace/folder
33
35
 
34
36
  ## 📋 Prerequisites
35
37
 
@@ -45,7 +47,7 @@ A lightweight Python bot that bridges your Telegram messages directly to [OpenCo
45
47
 
46
48
  ### Quick Installation:
47
49
  ```bash
48
- pip install telegram-opencode-bridge-bot==0.1.4
50
+ pip install telegram-opencode-bridge-bot==0.1.6
49
51
  telegram-opencode-bot
50
52
  telegram-opencode-bot --env (use --env flag if u want to re-configure later anytime)
51
53
  ```
@@ -77,7 +79,8 @@ Open Telegram, find your bot, and start asking! 🎉
77
79
  | `/help` | Show all commands |
78
80
  | `/new` | Start a fresh conversation |
79
81
  | `/sessions` | List your recent sessions/conversations and to select a session/conversation |
80
- | `/mode <plan\|build>` | Toggle plan/build mode |
82
+ | `/plan` | plan mode |
83
+ | `/build` | build mode |
81
84
  | `/share` | Share current session/conversation (public URL) |
82
85
  | `/status` | Check connection & session details |
83
86
  | `/id` | Show your Telegram user ID |
@@ -86,6 +89,9 @@ Open Telegram, find your bot, and start asking! 🎉
86
89
  | `/project` | To view the current workspace, sub folder workspaces and to change the workspace |
87
90
  | `/enable` | To enable the streaming |
88
91
  | `/disable` | To disable the streaming |
92
+ | `/create_project` | To create new project/folder/workspace |
93
+ | `/delete_project` | To create new project/folder/workspace |
94
+ | `/delete` | To delete a conversation |
89
95
 
90
96
  ## 🏗️ Architecture
91
97
 
@@ -6,13 +6,15 @@ A lightweight Python bot that bridges your Telegram messages directly to [OpenCo
6
6
 
7
7
  - **Direct OpenCode integration** — routes your messages to OpenCode's HTTP API
8
8
  - **Persistent sessions** — conversations maintain context across messages
9
- - **Session management** — create, switch, list, and share sessions
9
+ - **Session management** — create, delete, switch, list, and share sessions
10
10
  - **Model switching** — change AI models on the fly (`/model`)
11
11
  - **Plan/Build modes** — toggle between read-only analysis and full execution
12
12
  - **Smart formatting** — code blocks with syntax highlighting in Telegram
13
13
  - **Auto message splitting** — handles responses longer than Telegram's 4096 char limit
14
14
  - **Security** — whitelist-based access control + rate limiting
15
15
  - **Workspace Switching** — Switching from one workspace to another
16
+ - **Uploading from Mobile to WorkSpace** - U can upload the documents/images from your mobile to the opencode agent workspace
17
+ - **Workspace Management** — Creation and deletion of the workspace/folder
16
18
 
17
19
  ## 📋 Prerequisites
18
20
 
@@ -28,7 +30,7 @@ A lightweight Python bot that bridges your Telegram messages directly to [OpenCo
28
30
 
29
31
  ### Quick Installation:
30
32
  ```bash
31
- pip install telegram-opencode-bridge-bot==0.1.4
33
+ pip install telegram-opencode-bridge-bot==0.1.6
32
34
  telegram-opencode-bot
33
35
  telegram-opencode-bot --env (use --env flag if u want to re-configure later anytime)
34
36
  ```
@@ -60,7 +62,8 @@ Open Telegram, find your bot, and start asking! 🎉
60
62
  | `/help` | Show all commands |
61
63
  | `/new` | Start a fresh conversation |
62
64
  | `/sessions` | List your recent sessions/conversations and to select a session/conversation |
63
- | `/mode <plan\|build>` | Toggle plan/build mode |
65
+ | `/plan` | plan mode |
66
+ | `/build` | build mode |
64
67
  | `/share` | Share current session/conversation (public URL) |
65
68
  | `/status` | Check connection & session details |
66
69
  | `/id` | Show your Telegram user ID |
@@ -69,6 +72,9 @@ Open Telegram, find your bot, and start asking! 🎉
69
72
  | `/project` | To view the current workspace, sub folder workspaces and to change the workspace |
70
73
  | `/enable` | To enable the streaming |
71
74
  | `/disable` | To disable the streaming |
75
+ | `/create_project` | To create new project/folder/workspace |
76
+ | `/delete_project` | To create new project/folder/workspace |
77
+ | `/delete` | To delete a conversation |
72
78
 
73
79
  ## 🏗️ Architecture
74
80
 
@@ -41,19 +41,23 @@ from handlers.commands import (
41
41
  help_command,
42
42
  new_command,
43
43
  sessions_command,
44
- mode_command,
44
+ delete_command,
45
+ plan_command,
46
+ build_command,
45
47
  share_command,
46
48
  status_command,
47
49
  id_command,
48
50
  models_command,
49
51
  stop_command,
50
52
  project_command,
53
+ create_project_command,
54
+ delete_project_command,
51
55
  enable_command,
52
56
  disable_command,
53
57
  set_bot_commands,
54
58
  callback_handler,
55
59
  )
56
- from handlers.messages import handle_message
60
+ from handlers.messages import handle_message, handle_document
57
61
 
58
62
  # ── Logging Setup ──────────────────────────────────────────
59
63
  logging.basicConfig(
@@ -105,8 +109,16 @@ def build_authorized_handlers(authorizer: UserAuthorizer, rate_limiter: RateLimi
105
109
  await sessions_command(update, context)
106
110
 
107
111
  @authorized(authorizer, rate_limiter)
108
- async def _mode(update, context):
109
- await mode_command(update, context)
112
+ async def _delete(update, context):
113
+ await delete_command(update, context)
114
+
115
+ @authorized(authorizer, rate_limiter)
116
+ async def _plan(update, context):
117
+ await plan_command(update, context)
118
+
119
+ @authorized(authorizer, rate_limiter)
120
+ async def _build(update, context):
121
+ await build_command(update, context)
110
122
 
111
123
  @authorized(authorizer, rate_limiter)
112
124
  async def _share(update, context):
@@ -132,6 +144,14 @@ def build_authorized_handlers(authorizer: UserAuthorizer, rate_limiter: RateLimi
132
144
  async def _project(update, context):
133
145
  await project_command(update, context)
134
146
 
147
+ @authorized(authorizer, rate_limiter)
148
+ async def _create_project(update, context):
149
+ await create_project_command(update, context)
150
+
151
+ @authorized(authorizer, rate_limiter)
152
+ async def _delete_project(update, context):
153
+ await delete_project_command(update, context)
154
+
135
155
  @authorized(authorizer, rate_limiter)
136
156
  async def _enable(update, context):
137
157
  await enable_command(update, context)
@@ -148,22 +168,31 @@ def build_authorized_handlers(authorizer: UserAuthorizer, rate_limiter: RateLimi
148
168
  async def _message(update, context):
149
169
  await handle_message(update, context)
150
170
 
171
+ @authorized(authorizer, rate_limiter)
172
+ async def _document(update, context):
173
+ await handle_document(update, context)
174
+
151
175
  return {
152
176
  "start": _start,
153
177
  "help": _help,
154
178
  "new": _new,
155
179
  "sessions": _sessions,
180
+ "delete": _delete,
156
181
  "models": _models,
157
182
  "stop": _stop,
158
183
  "project": _project,
184
+ "create_project": _create_project,
185
+ "delete_project": _delete_project,
159
186
  "enable": _enable,
160
187
  "disable": _disable,
161
- "mode": _mode,
188
+ "plan": _plan,
189
+ "build": _build,
162
190
  "share": _share,
163
191
  "status": _status,
164
192
  "id": _id,
165
193
  "callback": _callback,
166
194
  "message": _message,
195
+ "document": _document,
167
196
  }
168
197
 
169
198
 
@@ -440,12 +469,16 @@ def main():
440
469
  application.add_handler(CommandHandler("help", handlers["help"], block=False))
441
470
  application.add_handler(CommandHandler("new", handlers["new"], block=False))
442
471
  application.add_handler(CommandHandler("sessions", handlers["sessions"], block=False))
472
+ application.add_handler(CommandHandler("delete", handlers["delete"], block=False))
443
473
  application.add_handler(CommandHandler("models", handlers["models"], block=False))
444
474
  application.add_handler(CommandHandler("stop", handlers["stop"], block=False))
445
475
  application.add_handler(CommandHandler("project", handlers["project"], block=False))
476
+ application.add_handler(CommandHandler("create_project", handlers["create_project"], block=False))
477
+ application.add_handler(CommandHandler("delete_project", handlers["delete_project"], block=False))
446
478
  application.add_handler(CommandHandler("enable", handlers["enable"], block=False))
447
479
  application.add_handler(CommandHandler("disable", handlers["disable"], block=False))
448
- application.add_handler(CommandHandler("mode", handlers["mode"], block=False))
480
+ application.add_handler(CommandHandler("plan", handlers["plan"], block=False))
481
+ application.add_handler(CommandHandler("build", handlers["build"], block=False))
449
482
  application.add_handler(CommandHandler("share", handlers["share"], block=False))
450
483
  application.add_handler(CommandHandler("status", handlers["status"], block=False))
451
484
  application.add_handler(CommandHandler("id", handlers["id"], block=False))
@@ -462,6 +495,15 @@ def main():
462
495
  )
463
496
  )
464
497
 
498
+ # ── Register document handler (catches file uploads) ──
499
+ application.add_handler(
500
+ MessageHandler(
501
+ (filters.Document.ALL | filters.PHOTO) & ~filters.COMMAND,
502
+ handlers["document"],
503
+ block=False,
504
+ )
505
+ )
506
+
465
507
  # ── Start polling ─────────────────────────────────────
466
508
  logger.info("Starting bot with long polling...")
467
509
  application.run_polling(