vibego 0.2.56__py3-none-any.whl → 0.2.57__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
@@ -1344,6 +1344,36 @@ ATTACHMENT_USAGE_HINT = (
1344
1344
  _FS_SAFE_PATTERN = re.compile(r"[^A-Za-z0-9._-]")
1345
1345
 
1346
1346
 
1347
+ def _attachment_directory_prefix_for_display(relative_path: str) -> Optional[str]:
1348
+ """根据附件相对路径推导目录前缀,便于提示模型定位。"""
1349
+
1350
+ path_str = (relative_path or "").strip()
1351
+ if not path_str:
1352
+ return None
1353
+
1354
+ try:
1355
+ parent = Path(path_str).parent
1356
+ except Exception:
1357
+ return None
1358
+
1359
+ parent_str = parent.as_posix()
1360
+ if parent_str in {"", "."}:
1361
+ if path_str.startswith("./"):
1362
+ parent_str = "./"
1363
+ elif path_str.startswith("/"):
1364
+ parent_str = "/"
1365
+ else:
1366
+ return None
1367
+ else:
1368
+ if path_str.startswith("./") and not parent_str.startswith(("./", "/")):
1369
+ parent_str = f"./{parent_str}"
1370
+
1371
+ if not parent_str.endswith("/"):
1372
+ parent_str = f"{parent_str}/"
1373
+
1374
+ return parent_str
1375
+
1376
+
1347
1377
  def _sanitize_fs_component(value: str, fallback: str) -> str:
1348
1378
  """清理路径片段中的特殊字符,避免越权访问。"""
1349
1379
 
@@ -1628,7 +1658,15 @@ def _build_prompt_with_attachments(
1628
1658
  if base_text:
1629
1659
  sections.append(base_text)
1630
1660
  if attachments:
1631
- lines = ["附件列表(文件位于项目工作目录,可直接读取):"]
1661
+ directory_hint: Optional[str] = None
1662
+ for item in attachments:
1663
+ directory_hint = _attachment_directory_prefix_for_display(item.relative_path)
1664
+ if directory_hint:
1665
+ break
1666
+ if directory_hint:
1667
+ lines = [f"附件列表(文件位于项目工作目录({directory_hint}),可直接读取):"]
1668
+ else:
1669
+ lines = ["附件列表(文件位于项目工作目录,可直接读取):"]
1632
1670
  for idx, item in enumerate(attachments, 1):
1633
1671
  lines.append(
1634
1672
  f"{idx}. {item.display_name}({item.mime_type})→ {item.relative_path}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: vibego
3
- Version: 0.2.56
3
+ Version: 0.2.57
4
4
  Summary: vibego CLI:用于初始化与管理 Telegram Master Bot 的工具
5
5
  Author: Hypha
6
6
  License-Expression: LicenseRef-Proprietary
@@ -1,4 +1,4 @@
1
- bot.py,sha256=61C8rX5QSAEW2k-uo07-1fsAkxzPHQU_pIK8sNv3Yno,290330
1
+ bot.py,sha256=-on8QBKAHcMtSWShP3cvqTJof2gWXLMUtPieaj7EpmM,291534
2
2
  logging_setup.py,sha256=gvxHi8mUwK3IhXJrsGNTDo-DR6ngkyav1X-tvlBF_IE,4613
3
3
  master.py,sha256=Jwxf6I94jOADzb9Xio1wb-tWy5wgQ9PlmdpKW4mhQMg,117114
4
4
  project_repository.py,sha256=UcthtSGOJK0cTE5bQCneo3xkomRG-kyc1N1QVqxeHIs,17577
@@ -426,14 +426,14 @@ tasks/constants.py,sha256=tS1kZxBIUm3JJUMHm25XI-KHNUZl5NhbbuzjzL_rF-c,299
426
426
  tasks/fsm.py,sha256=rKXXLEieQQU4r2z_CZUvn1_70FXiZXBBugF40gpe_tQ,1476
427
427
  tasks/models.py,sha256=N_qqRBo9xMSV0vbn4k6bLBXT8C_dp_oTFUxvdx16ZQM,2459
428
428
  tasks/service.py,sha256=w_S_aWiVqRXzXEpimLDsuCCCX2lB5uDkff9aKThBw9c,41916
429
- vibego_cli/__init__.py,sha256=QFEe29DY2UJ5zPJ4ZaUjupZTUDyDW8bEYxjvErxtMr0,311
429
+ vibego_cli/__init__.py,sha256=4SS400ravryVKHd1SCM6mZ6KOnzAD0aN3Bzkhcg9rb0,311
430
430
  vibego_cli/__main__.py,sha256=qqTrYmRRLe4361fMzbI3-CqpZ7AhTofIHmfp4ykrrBY,158
431
431
  vibego_cli/config.py,sha256=VxkPJMq01tA3h3cOkH-z_tiP7pMgfSGGicRvUnCWkhI,3054
432
432
  vibego_cli/deps.py,sha256=1nRXI7Dd-S1hYE8DligzK5fIluQWETRUj4_OKL0DikQ,1419
433
433
  vibego_cli/main.py,sha256=X__NXwZnIDIFbdKSTbNyZgZHKcPlN0DQz9sqTI1aQ9E,12158
434
434
  vibego_cli/data/worker_requirements.txt,sha256=QSt30DSSSHtfucTFPpc7twk9kLS5rVLNTcvDiagxrZg,62
435
- vibego-0.2.56.dist-info/METADATA,sha256=2jRuQcO_K3wbOi441F0MHDxuJKJ0GB3t4UM9BzpzDck,10519
436
- vibego-0.2.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
437
- vibego-0.2.56.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
438
- vibego-0.2.56.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
439
- vibego-0.2.56.dist-info/RECORD,,
435
+ vibego-0.2.57.dist-info/METADATA,sha256=uYSuc5xbtB4s-QP6Fmq7PU2IuECkWBoJomUrSa-NuZg,10519
436
+ vibego-0.2.57.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
437
+ vibego-0.2.57.dist-info/entry_points.txt,sha256=Lsy_zm-dlyxt8-9DL9blBReIwU2k22c8-kifr46ND1M,48
438
+ vibego-0.2.57.dist-info/top_level.txt,sha256=R56CT3nW5H5v3ce0l3QDN4-C4qxTrNWzRTwrxnkDX4U,69
439
+ vibego-0.2.57.dist-info/RECORD,,
vibego_cli/__init__.py CHANGED
@@ -7,6 +7,6 @@ from __future__ import annotations
7
7
 
8
8
  __all__ = ["main", "__version__"]
9
9
 
10
- __version__ = "0.2.56"
10
+ __version__ = "0.2.57"
11
11
 
12
12
  from .main import main # noqa: E402