wechatbridge-cli 1.8.0__tar.gz → 1.9.0__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 (29) hide show
  1. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/PKG-INFO +8 -4
  2. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/README.md +7 -3
  3. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_codex.py +15 -6
  4. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_hardening.py +1031 -0
  5. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/__init__.py +1 -1
  6. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/agy.py +180 -48
  7. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/codex.py +72 -93
  8. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/config.py +9 -0
  9. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/dsh.py +55 -49
  10. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/grok.py +58 -10
  11. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/main.py +202 -15
  12. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/price.py +22 -1
  13. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/runner_common.py +304 -3
  14. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/PKG-INFO +8 -4
  15. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/LICENSE +0 -0
  16. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/pyproject.toml +0 -0
  17. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/setup.cfg +0 -0
  18. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_codex_auth.py +0 -0
  19. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_dsh.py +0 -0
  20. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_grok_auth.py +0 -0
  21. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/tests/test_price.py +0 -0
  22. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/__main__.py +0 -0
  23. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/ilink.py +0 -0
  24. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge/update_check.py +0 -0
  25. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/SOURCES.txt +0 -0
  26. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/dependency_links.txt +0 -0
  27. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/entry_points.txt +0 -0
  28. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/requires.txt +0 -0
  29. {wechatbridge_cli-1.8.0 → wechatbridge_cli-1.9.0}/wechatbridge_cli.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wechatbridge-cli
3
- Version: 1.8.0
3
+ Version: 1.9.0
4
4
  Summary: Bridge WeChat messages to agy, Grok Build, or Codex CLIs — text/image/file/voice in, CLI replies and generated files back.
5
5
  Author: WeChatBridge contributors
6
6
  License: MIT
@@ -196,6 +196,9 @@ Key variables (all have defaults):
196
196
  | `WECHATBRIDGE_MAX_OUTBOUND_BYTES` | `104857600` | max file size sent back to WeChat (100 MB) |
197
197
  | `WECHATBRIDGE_MAX_INBOUND_BYTES` | `20971520` | max inbound image/file after download (20 MB) |
198
198
  | `WECHATBRIDGE_MAX_CONCURRENT` | `4` | global concurrent process slots; same user serial (queue does not hold a slot); extras get a busy reply (on small RAM hosts, lower this to avoid concurrent CLI memory spikes; see [Memory limits](#memory-limits)) |
199
+ | `WECHATBRIDGE_QUEUE_NOTICE` | `true` | one-shot "queued" notice when the user's previous message is still running; set `0`/`false`/`no` to disable |
200
+ | `WECHATBRIDGE_PROGRESS_NOTICE` | `true` | one-shot "still working" notice after a message runs past `WECHATBRIDGE_PROGRESS_NOTICE_DELAY`; set `0`/`false`/`no` to disable |
201
+ | `WECHATBRIDGE_PROGRESS_NOTICE_DELAY` | `30` | seconds before the progress notice fires |
199
202
  | `WECHATBRIDGE_CONFIRM_TOKEN` | `y` | reply this token to approve a gated dangerous prompt |
200
203
  | `WECHATBRIDGE_ENABLE_MCP` | `true` | enable the `/mcp` help text command |
201
204
  | `WECHATBRIDGE_ENABLE_SUBAGENT` | `true` | enable the `/agent` prompt-rewrite command |
@@ -317,11 +320,12 @@ See [`deploy/wechatbridge-windows.md`](deploy/wechatbridge-windows.md).
317
320
  | `/clear` or `/new` | start a new conversation (agy/grok: drops continue flag; codex: clears thread ID; dsh: clears window memory or persistent session ID) |
318
321
  | `/model <name>` | set model (all backends validate against a live list: agy/grok via CLI `models`; codex via `codex debug models` [then `--bundled`]; unknown name or list-fetch failure refuse and do not write prefs; see `/models`) |
319
322
  | `/models` | list models — agy/grok/codex all query the live CLI (codex: `debug models`; falls back to a built-in reference note only if the live list cannot be fetched) |
320
- | `/fast` | set low reasoning effort (**on only** — not a toggle; no “off” command) |
321
- | `/planning` | set planning mode (**on only** — not a toggle) |
322
- | `/add-dir <path>` | **agy:** pass `--add-dir` on later runs if path is allowed. **grok:** recorded only; not passed to the CLI yet |
323
+ | `/fast` | fast-mode toggle: low reasoning effort (accepts `on`/`off`; a second bare `/fast` turns it off) |
324
+ | `/planning` | planning-mode toggle (accepts `on`/`off`; a second bare `/planning` turns it off) |
325
+ | `/add-dir <path>` | **agy/codex:** pass `--add-dir` on later runs if path is allowed. **grok:** recorded only; not passed to the CLI yet. No-arg shows the current list, `/add-dir clear` empties it (dsh unsupported) |
323
326
  | `/agents` | list agents via the active CLI |
324
327
  | `/persona <text>` | set persona (`show` / `clear` / `reset` subcommands) |
328
+ | `/price <link/token/keyword>` | JD/Taobao coupon & price lookup (requires `JDUNION_*` or `DATAOKE_*` keys) |
325
329
  | `/version` | show current version, instance name, and backend; if a newer version is available, show upgrade hint |
326
330
  | `/mcp` | short MCP **usage hint** text (can disable with `WECHATBRIDGE_ENABLE_MCP`) |
327
331
  | `/agent <name> <task>` | craft a "invoke subagent …" prompt and run the CLI (can disable with `WECHATBRIDGE_ENABLE_SUBAGENT`) |
@@ -164,6 +164,9 @@ Key variables (all have defaults):
164
164
  | `WECHATBRIDGE_MAX_OUTBOUND_BYTES` | `104857600` | max file size sent back to WeChat (100 MB) |
165
165
  | `WECHATBRIDGE_MAX_INBOUND_BYTES` | `20971520` | max inbound image/file after download (20 MB) |
166
166
  | `WECHATBRIDGE_MAX_CONCURRENT` | `4` | global concurrent process slots; same user serial (queue does not hold a slot); extras get a busy reply (on small RAM hosts, lower this to avoid concurrent CLI memory spikes; see [Memory limits](#memory-limits)) |
167
+ | `WECHATBRIDGE_QUEUE_NOTICE` | `true` | one-shot "queued" notice when the user's previous message is still running; set `0`/`false`/`no` to disable |
168
+ | `WECHATBRIDGE_PROGRESS_NOTICE` | `true` | one-shot "still working" notice after a message runs past `WECHATBRIDGE_PROGRESS_NOTICE_DELAY`; set `0`/`false`/`no` to disable |
169
+ | `WECHATBRIDGE_PROGRESS_NOTICE_DELAY` | `30` | seconds before the progress notice fires |
167
170
  | `WECHATBRIDGE_CONFIRM_TOKEN` | `y` | reply this token to approve a gated dangerous prompt |
168
171
  | `WECHATBRIDGE_ENABLE_MCP` | `true` | enable the `/mcp` help text command |
169
172
  | `WECHATBRIDGE_ENABLE_SUBAGENT` | `true` | enable the `/agent` prompt-rewrite command |
@@ -285,11 +288,12 @@ See [`deploy/wechatbridge-windows.md`](deploy/wechatbridge-windows.md).
285
288
  | `/clear` or `/new` | start a new conversation (agy/grok: drops continue flag; codex: clears thread ID; dsh: clears window memory or persistent session ID) |
286
289
  | `/model <name>` | set model (all backends validate against a live list: agy/grok via CLI `models`; codex via `codex debug models` [then `--bundled`]; unknown name or list-fetch failure refuse and do not write prefs; see `/models`) |
287
290
  | `/models` | list models — agy/grok/codex all query the live CLI (codex: `debug models`; falls back to a built-in reference note only if the live list cannot be fetched) |
288
- | `/fast` | set low reasoning effort (**on only** — not a toggle; no “off” command) |
289
- | `/planning` | set planning mode (**on only** — not a toggle) |
290
- | `/add-dir <path>` | **agy:** pass `--add-dir` on later runs if path is allowed. **grok:** recorded only; not passed to the CLI yet |
291
+ | `/fast` | fast-mode toggle: low reasoning effort (accepts `on`/`off`; a second bare `/fast` turns it off) |
292
+ | `/planning` | planning-mode toggle (accepts `on`/`off`; a second bare `/planning` turns it off) |
293
+ | `/add-dir <path>` | **agy/codex:** pass `--add-dir` on later runs if path is allowed. **grok:** recorded only; not passed to the CLI yet. No-arg shows the current list, `/add-dir clear` empties it (dsh unsupported) |
291
294
  | `/agents` | list agents via the active CLI |
292
295
  | `/persona <text>` | set persona (`show` / `clear` / `reset` subcommands) |
296
+ | `/price <link/token/keyword>` | JD/Taobao coupon & price lookup (requires `JDUNION_*` or `DATAOKE_*` keys) |
293
297
  | `/version` | show current version, instance name, and backend; if a newer version is available, show upgrade hint |
294
298
  | `/mcp` | short MCP **usage hint** text (can disable with `WECHATBRIDGE_ENABLE_MCP`) |
295
299
  | `/agent <name> <task>` | craft a "invoke subagent …" prompt and run the CLI (can disable with `WECHATBRIDGE_ENABLE_SUBAGENT`) |
@@ -1145,20 +1145,29 @@ class TestCodexRunFakeCli(unittest.IsolatedAsyncioTestCase):
1145
1145
 
1146
1146
  def test_fallback_scan_timeout(self):
1147
1147
  """When snapshot takes >2s, fallback scan returns empty."""
1148
- from wechatbridge import codex as codex_mod
1149
- original = codex_mod._snapshot_regular_files
1148
+ # Patch the shared implementation actually invoked by the post-scan
1149
+ # (runner_common.collect_session_fallback_artifacts calls its own
1150
+ # module-level _snapshot_regular_files); patching the thin codex
1151
+ # re-export would only slow the pre-run snapshot.
1152
+ from wechatbridge import runner_common as runner_common_mod
1153
+ original = runner_common_mod._snapshot_regular_files
1154
+ calls = []
1150
1155
 
1151
1156
  def slow_snapshot(roots):
1152
1157
  import time
1158
+ calls.append(list(roots))
1153
1159
  time.sleep(2.5)
1154
1160
  return {"/fake/file.txt": 1.0}
1155
1161
 
1156
- codex_mod._snapshot_regular_files = slow_snapshot
1157
- try:
1162
+ with mock.patch.object(
1163
+ runner_common_mod, "_snapshot_regular_files", slow_snapshot
1164
+ ):
1158
1165
  display, artifacts = self._run("hi", "u-scan-timeout", mode="ok")
1159
1166
  self.assertEqual(artifacts, [], "slow snapshot -> empty")
1160
- finally:
1161
- codex_mod._snapshot_regular_files = original
1167
+ self.assertIs(runner_common_mod._snapshot_regular_files, original)
1168
+ # 证明 patch 命中的是后置 fallback 扫描(pre-snapshot 走 codex 的
1169
+ # _rc_snapshot_regular_files 别名,不受影响)。
1170
+ self.assertEqual(len(calls), 1)
1162
1171
 
1163
1172
  def test_fallback_scan_not_on_failure(self):
1164
1173
  """Fallback scan must NOT run when process fails."""