vibego 0.2.9__py3-none-any.whl → 0.2.10__py3-none-any.whl

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.

Potentially problematic release.


This version of vibego might be problematic. Click here for more details.

bot.py CHANGED
@@ -4450,7 +4450,14 @@ def _extract_codex_payload(data: dict, *, event_timestamp: Optional[str]) -> Opt
4450
4450
  return None
4451
4451
 
4452
4452
 
4453
- def _extract_claudecode_payload(data: dict, *, event_timestamp: Optional[str]) -> Optional[Tuple[str, str, Optional[Dict[str, Any]]]]:
4453
+ def _extract_claudecode_payload(
4454
+ data: dict, *, event_timestamp: Optional[str]
4455
+ ) -> Optional[Tuple[str, str, Optional[Dict[str, Any]]]]:
4456
+ # Claude Code 在启动时会输出 isSidechain=true 的欢迎语,此类事件直接忽略
4457
+ sidechain_flag = data.get("isSidechain")
4458
+ if isinstance(sidechain_flag, bool) and sidechain_flag:
4459
+ return None
4460
+
4454
4461
  event_type = data.get("type")
4455
4462
 
4456
4463
  if event_type == "assistant":
@@ -4463,20 +4470,11 @@ def _extract_claudecode_payload(data: dict, *, event_timestamp: Optional[str]) -
4463
4470
  if not isinstance(item, dict):
4464
4471
  continue
4465
4472
  item_type = item.get("type")
4466
- if item_type in {"thinking", "tool_use"}:
4467
- continue
4468
- if item_type == "tool_result":
4469
- tool_output = item.get("output")
4470
- if isinstance(tool_output, str) and tool_output.strip():
4471
- fragments.append(tool_output.strip())
4472
- content_value = item.get("content")
4473
- if isinstance(content_value, str) and content_value.strip():
4474
- fragments.append(content_value.strip())
4473
+ if item_type != "text":
4475
4474
  continue
4476
- if item_type in {"text", "output_text", "markdown"}:
4477
- text_value = item.get("text") or item.get("markdown")
4478
- if isinstance(text_value, str) and text_value.strip():
4479
- fragments.append(text_value)
4475
+ text_value = item.get("text")
4476
+ if isinstance(text_value, str) and text_value.strip():
4477
+ fragments.append(text_value)
4480
4478
  if fragments:
4481
4479
  combined = "\n\n".join(fragments)
4482
4480
  metadata: Optional[Dict[str, Any]] = None
master.py CHANGED
@@ -1716,13 +1716,8 @@ async def _notify_restart_success(bot: Bot) -> None:
1716
1716
  except Exception as exc:
1717
1717
  log.error("发送重启成功通知失败: %s", exc, extra={"chat": chat_id})
1718
1718
  else:
1719
+ # 重启成功后不再附带项目列表,避免高频重启时产生额外噪音
1719
1720
  log.info("重启成功通知已发送", extra={"chat": chat_id})
1720
- try:
1721
- manager = await _ensure_manager()
1722
- except Exception as ensure_exc:
1723
- log.error("发送项目概览前获取 manager 失败: %s", ensure_exc)
1724
- else:
1725
- await _send_projects_overview_to_chat(bot, chat_id, manager)
1726
1721
  finally:
1727
1722
  _safe_remove(RESTART_SIGNAL_PATH)
1728
1723
 
scripts/start.sh CHANGED
@@ -102,6 +102,57 @@ ensure_codex_installed() {
102
102
 
103
103
  ensure_codex_installed
104
104
 
105
+ select_python_binary() {
106
+ # 选择满足 CPython <=3.13 的解释器,避免 PyO3 依赖构建失败
107
+ local candidates=()
108
+ local chosen=""
109
+ local name
110
+ if [[ -n "${VIBEGO_PYTHON:-}" ]]; then
111
+ candidates+=("$VIBEGO_PYTHON")
112
+ fi
113
+ for name in python3.13 python3.12 python3.11 python3.10 python3.9 python3; do
114
+ if [[ "${VIBEGO_PYTHON:-}" == "$name" ]]; then
115
+ continue
116
+ fi
117
+ candidates+=("$name")
118
+ done
119
+
120
+ for name in "${candidates[@]}"; do
121
+ if [[ -z "$name" ]]; then
122
+ continue
123
+ fi
124
+ if ! command -v "$name" >/dev/null 2>&1; then
125
+ continue
126
+ fi
127
+ local version_raw
128
+ version_raw=$("$name" -c 'import sys; print(f"{sys.version_info[0]}.{sys.version_info[1]}")' 2>/dev/null) || continue
129
+ local major="${version_raw%%.*}"
130
+ local minor="${version_raw#*.}"
131
+ if [[ "$major" != "3" ]]; then
132
+ log_info "跳过 ${name} (版本 ${version_raw}):非 CPython 3.x"
133
+ continue
134
+ fi
135
+ if [[ "$minor" =~ ^[0-9]+$ ]] && (( minor > 13 )); then
136
+ log_info "跳过 ${name} (版本 ${version_raw}):高于 3.13"
137
+ continue
138
+ fi
139
+ if [[ "$minor" =~ ^[0-9]+$ ]] && (( minor < 9 )); then
140
+ log_info "跳过 ${name} (版本 ${version_raw}):低于 3.9,可能缺少官方轮子"
141
+ continue
142
+ fi
143
+ chosen="$name"
144
+ log_info "使用 Python 解释器:${chosen} (版本 ${version_raw})"
145
+ break
146
+ done
147
+
148
+ if [[ -z "$chosen" ]]; then
149
+ log_error "未找到满足 <=3.13 的 Python 解释器,可通过设置 VIBEGO_PYTHON 指定路径"
150
+ exit 1
151
+ fi
152
+
153
+ printf '%s' "$chosen"
154
+ }
155
+
105
156
  if pgrep -f "python.*master.py" >/dev/null 2>&1; then
106
157
  log_info "检测到历史 master 实例,正在终止..."
107
158
  pkill -f "python.*master.py" || true
@@ -119,7 +170,8 @@ if pgrep -f "python.*master.py" >/dev/null 2>&1; then
119
170
  fi
120
171
 
121
172
  # 创建并启用虚拟环境
122
- python3 -m venv .venv
173
+ PYTHON_BIN="$(select_python_binary)"
174
+ "$PYTHON_BIN" -m venv .venv
123
175
  source .venv/bin/activate
124
176
 
125
177
  # 安装依赖
@@ -131,11 +183,11 @@ fi
131
183
  pip install -r "$REQUIREMENTS_FILE"
132
184
 
133
185
  # 后台启动 master,日志落在 vibe.log
134
- nohup python3 master.py >> /dev/null 2>&1 &
186
+ nohup python master.py >> /dev/null 2>&1 &
135
187
  log_info "master 已后台启动,日志写入 vibe.log"
136
188
 
137
189
  # 健康检查:等待 master 上线并验证关键 worker
138
- if ! python3 scripts/master_healthcheck.py --project hyphavibebotbackend; then
190
+ if ! python scripts/master_healthcheck.py --project hyphavibebotbackend; then
139
191
  log_error "master 健康检查失败,请查看 logs/start.log / vibe.log"
140
192
  exit 1
141
193
  fi
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibego
3
- Version: 0.2.9
3
+ Version: 0.2.10
4
4
  Summary: vibego CLI:用于初始化与管理 Telegram Master Bot 的工具
5
5
  Author: Hypha
6
6
  License-Expression: LicenseRef-Proprietary
@@ -1,13 +1,13 @@
1
- bot.py,sha256=4MV72uB4S_D7A6Akm4isN_NPH9CUOUMQi0EWACiAsbQ,250226
1
+ bot.py,sha256=q_aRgSBen4XThKdExfa-6NeX9R_Mgs0UjXYx32rsGzo,249827
2
2
  logging_setup.py,sha256=gvxHi8mUwK3IhXJrsGNTDo-DR6ngkyav1X-tvlBF_IE,4613
3
- master.py,sha256=q_CNNW8L_N4kp7LRQR16XGhboPk-0ocH28D23f40U7k,106675
3
+ master.py,sha256=Qz2NTapUexVvpQz8Y_pVhKd-uXkqp3M6oclzfAzIuGs,106497
4
4
  project_repository.py,sha256=UcthtSGOJK0cTE5bQCneo3xkomRG-kyc1N1QVqxeHIs,17577
5
5
  scripts/__init__.py,sha256=LVrXUkvWKoc6Sb47X5G0gbIxu5aJ2ARW-qJ14vwi5vM,65
6
6
  scripts/log_writer.py,sha256=8euoMlRo7cbtHApbcEoJnwzLABxti-ovJWFLRN1oDQw,3843
7
7
  scripts/master_healthcheck.py,sha256=-X0VVsZ0AXaOb7izxTO_oyu23g_1jsirNdGIcP8nrSI,8321
8
8
  scripts/requirements.txt,sha256=QSt30DSSSHtfucTFPpc7twk9kLS5rVLNTcvDiagxrZg,62
9
9
  scripts/run_bot.sh,sha256=rM2Op_l4mP9asT3VoTwGQuHocwaxiGyQp2l1PLegsY4,4481
10
- scripts/start.sh,sha256=lYCzQcgN_TC1rAhaboKrtnLJQEjBDb3PFQLfaF_j8TA,4047
10
+ scripts/start.sh,sha256=tb_h90-nU4po3asUc3D7YBwvDXmxeWGgPwxTEBpI8Ow,5641
11
11
  scripts/start_tmux_codex.sh,sha256=4ko72SK7EDJmzXVuLBOz1_S1lLEmgIpLAVuD7mZhpdk,4018
12
12
  scripts/stop_all.sh,sha256=FOz07gi2CI9sMHxBb8XkqHtxRYs3jt1RYgGrEi-htVg,4086
13
13
  scripts/stop_bot.sh,sha256=b9vvrke5jeyO18SEBFZxQD09Gf65BgGzeKtpM8sa60Y,3677
@@ -429,8 +429,8 @@ vibego_cli/config.py,sha256=33WSORCfUIxrDtgASPEbVqVLBVNHh-RSFLpNy7tfc0s,2992
429
429
  vibego_cli/deps.py,sha256=1nRXI7Dd-S1hYE8DligzK5fIluQWETRUj4_OKL0DikQ,1419
430
430
  vibego_cli/main.py,sha256=e2W5Pb9U9rfmF-jNX9uIA3222lhM0GgcvSdFTDBZd2s,12086
431
431
  vibego_cli/data/worker_requirements.txt,sha256=QSt30DSSSHtfucTFPpc7twk9kLS5rVLNTcvDiagxrZg,62
432
- vibego-0.2.9.dist-info/METADATA,sha256=Fkdl2D7I5PvrsV8QDsbnC8Fd2NTm-D6TfkGaLx3T4oA,10474
433
- vibego-0.2.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
- vibego-0.2.9.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
435
- vibego-0.2.9.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
436
- vibego-0.2.9.dist-info/RECORD,,
432
+ vibego-0.2.10.dist-info/METADATA,sha256=CzxFnVhczBzeTQ1aK8jjhhoYJT85g6QtQy_rU4aDoaQ,10475
433
+ vibego-0.2.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
434
+ vibego-0.2.10.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
435
+ vibego-0.2.10.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
436
+ vibego-0.2.10.dist-info/RECORD,,