vibego 0.2.15__py3-none-any.whl → 0.2.18__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 +49 -6
- {vibego-0.2.15.dist-info → vibego-0.2.18.dist-info}/METADATA +1 -1
- {vibego-0.2.15.dist-info → vibego-0.2.18.dist-info}/RECORD +7 -7
- vibego_cli/__init__.py +1 -1
- {vibego-0.2.15.dist-info → vibego-0.2.18.dist-info}/WHEEL +0 -0
- {vibego-0.2.15.dist-info → vibego-0.2.18.dist-info}/entry_points.txt +0 -0
- {vibego-0.2.15.dist-info → vibego-0.2.18.dist-info}/top_level.txt +0 -0
bot.py
CHANGED
|
@@ -391,9 +391,17 @@ async def _send_with_retry(coro_factory, *, attempts: int = SEND_RETRY_ATTEMPTS)
|
|
|
391
391
|
|
|
392
392
|
|
|
393
393
|
def _escape_markdown_v2(text: str) -> str:
|
|
394
|
+
"""转义 MarkdownV2 特殊字符。
|
|
395
|
+
|
|
396
|
+
注意:
|
|
397
|
+
- Text().as_markdown() 会转义所有 MarkdownV2 特殊字符
|
|
398
|
+
- 只移除纯英文单词之间的连字符转义(如 "pre-release")
|
|
399
|
+
- 保留数字、时间戳等其他情况的连字符转义(如 "2025-10-23")
|
|
400
|
+
"""
|
|
394
401
|
escaped = Text(text).as_markdown()
|
|
395
|
-
|
|
396
|
-
escaped =
|
|
402
|
+
# 只移除纯英文字母之间的连字符转义(避免影响数字、时间戳等)
|
|
403
|
+
escaped = re.sub(r"(?<=[a-zA-Z])\\-(?=[a-zA-Z])", "-", escaped)
|
|
404
|
+
# 移除斜杠的转义(Telegram 不需要转义斜杠)
|
|
397
405
|
escaped = escaped.replace("\\/", "/")
|
|
398
406
|
return escaped
|
|
399
407
|
|
|
@@ -1986,8 +1994,11 @@ def _build_status_filter_row(current_status: Optional[str], limit: int) -> list[
|
|
|
1986
1994
|
def _format_task_list_entry(task: TaskRecord) -> str:
|
|
1987
1995
|
indent = " " * max(task.depth, 0)
|
|
1988
1996
|
title_raw = (task.title or "").strip()
|
|
1997
|
+
# 修复:避免双重转义
|
|
1989
1998
|
if not title_raw:
|
|
1990
1999
|
title = "-"
|
|
2000
|
+
elif _IS_MARKDOWN_V2:
|
|
2001
|
+
title = title_raw
|
|
1991
2002
|
else:
|
|
1992
2003
|
title = _escape_markdown_text(title_raw)
|
|
1993
2004
|
type_icon = TASK_TYPE_EMOJIS.get(task.task_type)
|
|
@@ -2037,8 +2048,14 @@ def _format_task_detail(
|
|
|
2037
2048
|
*,
|
|
2038
2049
|
notes: Sequence[TaskNoteRecord],
|
|
2039
2050
|
) -> str:
|
|
2051
|
+
# 修复:仅在非 MarkdownV2 模式下手动转义,避免双重转义
|
|
2052
|
+
# MarkdownV2 模式下由 _prepare_model_payload() 统一处理转义
|
|
2040
2053
|
title_raw = (task.title or "").strip()
|
|
2041
|
-
|
|
2054
|
+
if _IS_MARKDOWN_V2:
|
|
2055
|
+
title_text = title_raw if title_raw else "-"
|
|
2056
|
+
else:
|
|
2057
|
+
title_text = _escape_markdown_text(title_raw) if title_raw else "-"
|
|
2058
|
+
|
|
2042
2059
|
task_id_text = _format_task_command(task.id)
|
|
2043
2060
|
lines: list[str] = [
|
|
2044
2061
|
f"📝 标题:{title_text}",
|
|
@@ -2047,12 +2064,24 @@ def _format_task_detail(
|
|
|
2047
2064
|
f"🚦 优先级:{_format_priority(task.priority)}",
|
|
2048
2065
|
f"📂 类型:{_format_task_type(task.task_type)}",
|
|
2049
2066
|
]
|
|
2050
|
-
|
|
2067
|
+
|
|
2068
|
+
# 修复:描述字段也避免双重转义
|
|
2069
|
+
description_raw = task.description or "暂无"
|
|
2070
|
+
if _IS_MARKDOWN_V2:
|
|
2071
|
+
description_text = description_raw
|
|
2072
|
+
else:
|
|
2073
|
+
description_text = _escape_markdown_text(description_raw)
|
|
2074
|
+
|
|
2051
2075
|
lines.append(f"🖊️ 描述:{description_text}")
|
|
2052
2076
|
lines.append(f"📅 创建时间:{_format_local_time(task.created_at)}")
|
|
2053
2077
|
lines.append(f"🔁 更新时间:{_format_local_time(task.updated_at)}")
|
|
2078
|
+
|
|
2079
|
+
# 修复:父任务ID字段也避免双重转义
|
|
2054
2080
|
if task.parent_id:
|
|
2055
|
-
|
|
2081
|
+
if _IS_MARKDOWN_V2:
|
|
2082
|
+
parent_text = task.parent_id
|
|
2083
|
+
else:
|
|
2084
|
+
parent_text = _escape_markdown_text(task.parent_id)
|
|
2056
2085
|
lines.append(f"👪 父任务:{parent_text}")
|
|
2057
2086
|
|
|
2058
2087
|
return "\n".join(lines)
|
|
@@ -5023,7 +5052,11 @@ async def _build_task_search_view(
|
|
|
5023
5052
|
sanitized_keyword = keyword.replace("\n", " ").strip()
|
|
5024
5053
|
if not sanitized_keyword:
|
|
5025
5054
|
sanitized_keyword = "-"
|
|
5026
|
-
|
|
5055
|
+
# 修复:避免双重转义
|
|
5056
|
+
if _IS_MARKDOWN_V2:
|
|
5057
|
+
escaped_keyword = sanitized_keyword
|
|
5058
|
+
else:
|
|
5059
|
+
escaped_keyword = _escape_markdown_text(sanitized_keyword)
|
|
5027
5060
|
lines = [
|
|
5028
5061
|
"*任务搜索结果*",
|
|
5029
5062
|
f"搜索关键词:{escaped_keyword}",
|
|
@@ -6748,6 +6781,11 @@ async def on_task_detail_callback(callback: CallbackQuery) -> None:
|
|
|
6748
6781
|
sent = await _answer_with_markdown(message, detail_text, reply_markup=markup)
|
|
6749
6782
|
if sent is not None:
|
|
6750
6783
|
_init_task_view_context(sent, detail_state)
|
|
6784
|
+
else:
|
|
6785
|
+
# 修复:消息发送失败时给用户反馈
|
|
6786
|
+
await message.answer(
|
|
6787
|
+
f"⚠️ 任务详情显示失败,可能包含特殊字符。\n任务ID: {task_id}\n请联系管理员检查任务内容。"
|
|
6788
|
+
)
|
|
6751
6789
|
return
|
|
6752
6790
|
if await _try_edit_message(message, detail_text, reply_markup=markup):
|
|
6753
6791
|
_push_detail_view(message, task_id)
|
|
@@ -6755,6 +6793,11 @@ async def on_task_detail_callback(callback: CallbackQuery) -> None:
|
|
|
6755
6793
|
sent = await _answer_with_markdown(message, detail_text, reply_markup=markup)
|
|
6756
6794
|
if sent is not None:
|
|
6757
6795
|
_init_task_view_context(sent, detail_state)
|
|
6796
|
+
else:
|
|
6797
|
+
# 修复:消息发送失败时给用户反馈
|
|
6798
|
+
await message.answer(
|
|
6799
|
+
f"⚠️ 任务详情显示失败,可能包含特殊字符。\n任务ID: {task_id}\n请联系管理员检查任务内容。"
|
|
6800
|
+
)
|
|
6758
6801
|
|
|
6759
6802
|
|
|
6760
6803
|
async def _fallback_task_detail_back(callback: CallbackQuery) -> None:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bot.py,sha256=
|
|
1
|
+
bot.py,sha256=mX0fgXEbm7M5baUvX_Q--NWpwYWzF8Yge6wrp4MoS6U,264070
|
|
2
2
|
logging_setup.py,sha256=gvxHi8mUwK3IhXJrsGNTDo-DR6ngkyav1X-tvlBF_IE,4613
|
|
3
3
|
master.py,sha256=Qz2NTapUexVvpQz8Y_pVhKd-uXkqp3M6oclzfAzIuGs,106497
|
|
4
4
|
project_repository.py,sha256=UcthtSGOJK0cTE5bQCneo3xkomRG-kyc1N1QVqxeHIs,17577
|
|
@@ -425,14 +425,14 @@ tasks/constants.py,sha256=tS1kZxBIUm3JJUMHm25XI-KHNUZl5NhbbuzjzL_rF-c,299
|
|
|
425
425
|
tasks/fsm.py,sha256=rKXXLEieQQU4r2z_CZUvn1_70FXiZXBBugF40gpe_tQ,1476
|
|
426
426
|
tasks/models.py,sha256=N_qqRBo9xMSV0vbn4k6bLBXT8C_dp_oTFUxvdx16ZQM,2459
|
|
427
427
|
tasks/service.py,sha256=w_S_aWiVqRXzXEpimLDsuCCCX2lB5uDkff9aKThBw9c,41916
|
|
428
|
-
vibego_cli/__init__.py,sha256=
|
|
428
|
+
vibego_cli/__init__.py,sha256=M8Oc6o3XOUKq9SL__MXA-SqxrkAPAXJ3RZSCBM_TZlw,311
|
|
429
429
|
vibego_cli/__main__.py,sha256=qqTrYmRRLe4361fMzbI3-CqpZ7AhTofIHmfp4ykrrBY,158
|
|
430
430
|
vibego_cli/config.py,sha256=33WSORCfUIxrDtgASPEbVqVLBVNHh-RSFLpNy7tfc0s,2992
|
|
431
431
|
vibego_cli/deps.py,sha256=1nRXI7Dd-S1hYE8DligzK5fIluQWETRUj4_OKL0DikQ,1419
|
|
432
432
|
vibego_cli/main.py,sha256=e2W5Pb9U9rfmF-jNX9uIA3222lhM0GgcvSdFTDBZd2s,12086
|
|
433
433
|
vibego_cli/data/worker_requirements.txt,sha256=QSt30DSSSHtfucTFPpc7twk9kLS5rVLNTcvDiagxrZg,62
|
|
434
|
-
vibego-0.2.
|
|
435
|
-
vibego-0.2.
|
|
436
|
-
vibego-0.2.
|
|
437
|
-
vibego-0.2.
|
|
438
|
-
vibego-0.2.
|
|
434
|
+
vibego-0.2.18.dist-info/METADATA,sha256=EV6IIf-JRkYtbjZVBMN1e8RCHfX-0vGNmJICXQOcbEY,10475
|
|
435
|
+
vibego-0.2.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
436
|
+
vibego-0.2.18.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
|
|
437
|
+
vibego-0.2.18.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
|
|
438
|
+
vibego-0.2.18.dist-info/RECORD,,
|
vibego_cli/__init__.py
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|