nonebot-plugin-codex 0.1.5__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 (27) hide show
  1. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/PKG-INFO +4 -1
  2. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/README.md +3 -0
  3. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/pyproject.toml +1 -1
  4. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/__init__.py +15 -0
  5. nonebot_plugin_codex-0.1.6/src/nonebot_plugin_codex/native_client.py +799 -0
  6. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/service.py +439 -39
  7. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/telegram.py +481 -73
  8. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/telegram_commands.py +6 -1
  9. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/telegram_rendering.py +14 -1
  10. nonebot_plugin_codex-0.1.6/tests/test_native_client.py +1734 -0
  11. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_service.py +393 -3
  12. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_telegram_commands.py +4 -2
  13. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_telegram_handlers.py +636 -11
  14. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_telegram_rendering.py +11 -0
  15. nonebot_plugin_codex-0.1.5/src/nonebot_plugin_codex/native_client.py +0 -437
  16. nonebot_plugin_codex-0.1.5/tests/test_native_client.py +0 -401
  17. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/LICENSE +0 -0
  18. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/config.py +0 -0
  19. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/protocol_io.py +0 -0
  20. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/src/nonebot_plugin_codex/runtime.py +0 -0
  21. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/__init__.py +0 -0
  22. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/conftest.py +0 -0
  23. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_config.py +0 -0
  24. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_plugin_entry.py +0 -0
  25. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_plugin_meta.py +0 -0
  26. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_release_notes.py +0 -0
  27. {nonebot_plugin_codex-0.1.5 → nonebot_plugin_codex-0.1.6}/tests/test_runtime.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-codex
3
- Version: 0.1.5
3
+ Version: 0.1.6
4
4
  Summary: Telegram bridge plugin for driving Codex from NoneBot
5
5
  Author-Email: ttiee <469784630@qq.com>
6
6
  License: GPL-3.0-or-later
@@ -66,6 +66,7 @@ _✨ 在 Telegram 里驱动 Codex CLI 的 NoneBot 插件 ✨_
66
66
  - **聊天即入口**:`/codex` 连接后,普通文本消息可直接续聊当前会话。
67
67
  - **双模式工作流**:持续对话用 `resume`,一次性任务用 `exec`。
68
68
  - **细粒度会话隔离**:不同聊天各自持有模型、权限、工作目录与历史绑定。
69
+ - **稳健流式展示**:同一聊天内按 chat 级节流更新;超长流式回复会保留 agent 标题,取消时补发已生成全文。
69
70
  - **目录浏览能力**:支持在 Telegram 内切换目录、设定 Home、查看隐藏目录。
70
71
  - **历史会话恢复**:可浏览 native 与 exec 历史,并尽量恢复原始工作目录。
71
72
  - **兼容迁移**:可以沿用旧配置文件与 Codex 历史目录,减少迁移成本。
@@ -222,6 +223,7 @@ codex_stream_read_limit = 8388608
222
223
  | `/cd [path]` | 切换目录或打开目录浏览器 |
223
224
  | `/home` | 将工作目录重置到 Home |
224
225
  | `/sessions` | 打开历史会话浏览器 |
226
+ | `/compact` | 压缩当前 `resume` 会话上下文 |
225
227
 
226
228
  ## 模式说明
227
229
 
@@ -232,6 +234,7 @@ codex_stream_read_limit = 8388608
232
234
  - 优先使用 `codex app-server`
233
235
  - 为同一聊天维持 native thread
234
236
  - 更适合连续编码、持续追问和多轮调试
237
+ - 支持在 Telegram 中用 `/compact` 压缩较早对话上下文
235
238
 
236
239
  ### `exec`
237
240
 
@@ -53,6 +53,7 @@ _✨ 在 Telegram 里驱动 Codex CLI 的 NoneBot 插件 ✨_
53
53
  - **聊天即入口**:`/codex` 连接后,普通文本消息可直接续聊当前会话。
54
54
  - **双模式工作流**:持续对话用 `resume`,一次性任务用 `exec`。
55
55
  - **细粒度会话隔离**:不同聊天各自持有模型、权限、工作目录与历史绑定。
56
+ - **稳健流式展示**:同一聊天内按 chat 级节流更新;超长流式回复会保留 agent 标题,取消时补发已生成全文。
56
57
  - **目录浏览能力**:支持在 Telegram 内切换目录、设定 Home、查看隐藏目录。
57
58
  - **历史会话恢复**:可浏览 native 与 exec 历史,并尽量恢复原始工作目录。
58
59
  - **兼容迁移**:可以沿用旧配置文件与 Codex 历史目录,减少迁移成本。
@@ -209,6 +210,7 @@ codex_stream_read_limit = 8388608
209
210
  | `/cd [path]` | 切换目录或打开目录浏览器 |
210
211
  | `/home` | 将工作目录重置到 Home |
211
212
  | `/sessions` | 打开历史会话浏览器 |
213
+ | `/compact` | 压缩当前 `resume` 会话上下文 |
212
214
 
213
215
  ## 模式说明
214
216
 
@@ -219,6 +221,7 @@ codex_stream_read_limit = 8388608
219
221
  - 优先使用 `codex app-server`
220
222
  - 为同一聊天维持 native thread
221
223
  - 更适合连续编码、持续追问和多轮调试
224
+ - 支持在 Telegram 中用 `/compact` 压缩较早对话上下文
222
225
 
223
226
  ### `exec`
224
227
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nonebot-plugin-codex"
3
- version = "0.1.5"
3
+ version = "0.1.6"
4
4
  description = "Telegram bridge plugin for driving Codex from NoneBot"
5
5
  authors = [
6
6
  { name = "ttiee", email = "469784630@qq.com" },
@@ -102,6 +102,7 @@ if _runtime_ready:
102
102
  cd_cmd = on_command("cd", priority=10, block=True)
103
103
  home_cmd = on_command("home", priority=10, block=True)
104
104
  sessions_cmd = on_command("sessions", priority=10, block=True)
105
+ compact_cmd = on_command("compact", priority=10, block=True)
105
106
  follow_up = on_message(priority=20, block=True, rule=handlers.is_active_follow_up)
106
107
  browser_callback = on_type(
107
108
  CallbackQueryEvent,
@@ -133,6 +134,12 @@ if _runtime_ready:
133
134
  block=True,
134
135
  rule=handlers.is_workspace_callback,
135
136
  )
137
+ status_callback = on_type(
138
+ CallbackQueryEvent,
139
+ priority=10,
140
+ block=True,
141
+ rule=handlers.is_status_callback,
142
+ )
136
143
 
137
144
  @codex_cmd.handle()
138
145
  async def _handle_codex(
@@ -218,6 +225,10 @@ if _runtime_ready:
218
225
  async def _handle_sessions(bot: Bot, event: MessageEvent) -> None:
219
226
  await handlers.handle_sessions(bot, event)
220
227
 
228
+ @compact_cmd.handle()
229
+ async def _handle_compact(bot: Bot, event: MessageEvent) -> None:
230
+ await handlers.handle_compact(bot, event)
231
+
221
232
  @browser_callback.handle()
222
233
  async def _handle_browser_callback(bot: Bot, event: CallbackQueryEvent) -> None:
223
234
  await handlers.handle_browser_callback(bot, event)
@@ -242,6 +253,10 @@ if _runtime_ready:
242
253
  ) -> None:
243
254
  await handlers.handle_workspace_callback(bot, event)
244
255
 
256
+ @status_callback.handle()
257
+ async def _handle_status_callback(bot: Bot, event: CallbackQueryEvent) -> None:
258
+ await handlers.handle_status_callback(bot, event)
259
+
245
260
  @follow_up.handle()
246
261
  async def _handle_follow_up(bot: Bot, event: MessageEvent) -> None:
247
262
  await handlers.handle_follow_up(bot, event)