langchain-agentx-python 2.2.2__py3-none-any.whl → 2.2.3__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.
@@ -11,7 +11,7 @@ from langchain_agentx import create_loop_agent
11
11
  ```
12
12
  """
13
13
 
14
- __version__ = "2.2.2"
14
+ __version__ = "2.2.3"
15
15
 
16
16
  from .loop import ( # noqa: F401
17
17
  create_loop_agent,
@@ -28,6 +28,19 @@ from langchain_agentx.utils.subprocess_text import (
28
28
  from .models import GrepOutputMode
29
29
 
30
30
 
31
+ def resolve_ripgrep_subprocess_cwd(search_path: str) -> str:
32
+ """subprocess cwd 必须是目录;schema 允许 path 为文件时退到父目录。
33
+
34
+ Windows 上相对 glob 需要 cwd≈搜索根目录;但不能把文件路径直接当 cwd
35
+ (会 NotADirectoryError / Errno 20)。rg 命令行目标仍用原 search_path。
36
+ """
37
+ real = os.path.realpath(search_path)
38
+ if os.path.isfile(real):
39
+ parent = os.path.dirname(real)
40
+ return parent if parent else os.sep
41
+ return real
42
+
43
+
31
44
  class GrepTimeoutError(ToolRuntimeError):
32
45
  def __init__(self, message: str) -> None:
33
46
  super().__init__(message, code="GREP_TIMEOUT")
@@ -60,14 +73,16 @@ def run_ripgrep_lines(
60
73
  对齐 CC ripgrep.ts:returncode 1 -> [];EAGAIN 时以 -j 1 重试一次。
61
74
  供 RipgrepBackend 与 Glob 的 rg --files 列文件共用。
62
75
 
63
- SDK 补充:``subprocess cwd=search_path``。CC 隐式依赖进程 cwd≈searchDir;
64
- 编排布局 ``state_root≠repo`` 时须显式设 cwd,否则 Windows 上目录前缀 glob(如 ``alpha/*``)误空。
76
+ SDK 补充:``subprocess cwd`` 对齐搜索根目录(目录本身,或文件的父目录)。
77
+ CC 隐式依赖进程 cwd≈searchDir;编排布局 ``state_root≠repo`` 时须显式设 cwd
78
+ 否则 Windows 上目录前缀 glob(如 ``alpha/*``)误空。
65
79
 
66
80
  若 ``cancel_event`` 非空,使用可中断子进程路径(``RgSubprocessController``),
67
81
  不再走 ``text_runner.run``(便于测试 mock 时仅覆盖无取消路径)。
68
82
  """
69
- search_cwd = os.path.realpath(search_path)
70
- cmd = [rg_path, *args, search_cwd]
83
+ search_target = os.path.realpath(search_path)
84
+ search_cwd = resolve_ripgrep_subprocess_cwd(search_path)
85
+ cmd = [rg_path, *args, search_target]
71
86
  if cancel_event is not None:
72
87
  if cancel_event.is_set():
73
88
  raise GrepCancelledError("ripgrep cancelled before start")
@@ -321,7 +336,7 @@ class RipgrepBackend:
321
336
  plugin_glob_exclusions=plugin_glob_exclusions,
322
337
  )
323
338
  cmd = [self._rg_path, *args, os.path.realpath(search_path)]
324
- search_cwd = os.path.realpath(search_path)
339
+ search_cwd = resolve_ripgrep_subprocess_cwd(search_path)
325
340
  if cancel_event is not None and cancel_event.is_set():
326
341
  raise GrepCancelledError("ripgrep cancelled before start")
327
342
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langchain-agentx-python
3
- Version: 2.2.2
3
+ Version: 2.2.3
4
4
  Summary: LangChain/LangGraph-based agent utilities for CodeBaseX.
5
5
  Author-email: GoodMood2008 <GoodMood2008@users.noreply.github.com>
6
6
  License: Apache License
@@ -1,4 +1,4 @@
1
- langchain_agentx/__init__.py,sha256=CeiwdY0JNT9SJDHhM5_WnrLFW0CaC3PjbVuO98Owi1o,1614
1
+ langchain_agentx/__init__.py,sha256=bMHXxvdlfRUJK-ZT43f2Hgef2tNuOs5bc3mv-F4BQRc,1614
2
2
  langchain_agentx/command/__init__.py,sha256=Ej260S5uFQcmEtGZQG_NH7BYjHoStrpBLtGUsBTxyZk,631
3
3
  langchain_agentx/command/allowed_tools.py,sha256=TVA0VM8rm98H-QbLK_GRiX5RhEAZFxKawliMi4kk96A,3359
4
4
  langchain_agentx/command/context.py,sha256=DIGOGPBw5UGDBm0WNNJlKx1h_9rCRmcdROv4DT61Qug,731
@@ -581,7 +581,7 @@ langchain_agentx/tools/glob/rg_list_backend.py,sha256=gTyFQE0eYHl-7LkSdah76S8bQn
581
581
  langchain_agentx/tools/glob/rg_pattern.py,sha256=YOV-1gdxC52vzdAwgz27l7mzPJvVuHqpqeWhiEnWQJs,1377
582
582
  langchain_agentx/tools/glob/tool.py,sha256=m746Vl_aI9eFmrXYECkg16zMln9YPVxqjtijPlc5ALA,14868
583
583
  langchain_agentx/tools/grep/__init__.py,sha256=AA9qa42Ap9tw6lPQkNgKzYmr4hu44eP93qVdyP-eFNU,162
584
- langchain_agentx/tools/grep/backend.py,sha256=DSKetuS6Wcta5wrDBVFYSVDLsou0VDXXZyvdFvN1nls,13885
584
+ langchain_agentx/tools/grep/backend.py,sha256=bzwRUJ_aZjs84oIG3l6IAVygGiLDyNsHPePiMaFMo-4,14539
585
585
  langchain_agentx/tools/grep/models.py,sha256=6fTSux0COK06weQ7PWYqCGBQx60OaNtqC5q7xKtf5i0,3860
586
586
  langchain_agentx/tools/grep/prompt.py,sha256=Euo1NErphk5WHxaKXwJH-1v7joblfwEFWHIYNthKkzo,1336
587
587
  langchain_agentx/tools/grep/rg_subprocess_controller.py,sha256=ijMJnKPo7iEDFBz-_YipTiPusrL6OO2XbWxHUuwpMfA,4056
@@ -760,8 +760,8 @@ langchain_agentx/workspace/root_grant_manager.py,sha256=W3gy8HTevbERbXqIgRcjzOXO
760
760
  langchain_agentx/workspace/tool_boundary.py,sha256=UDwX6swpSLsx9HNkYuuRRiV5o7ZZG_Bru2Yn0c5kNX8,5724
761
761
  langchain_agentx/workspace/validators.py,sha256=tQt-6TOcL8Fw7Ig5ebA9S7vGWh1rby920eFW6x8Tk9E,1439
762
762
  langchain_agentx/workspace/view.py,sha256=PGasqTaqhlD03SXXazHuw4RHfV681AIdlsYqL70pEjc,4774
763
- langchain_agentx_python-2.2.2.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
764
- langchain_agentx_python-2.2.2.dist-info/METADATA,sha256=YHgIChmc4fVyfDcUNs9faXXrRAdOrZ8CF3db6Wnw-JY,24250
765
- langchain_agentx_python-2.2.2.dist-info/WHEEL,sha256=51RkbunBAw4BWsgaQWTpPhg4Diwp3c9P5iaLk67Hdtg,92
766
- langchain_agentx_python-2.2.2.dist-info/top_level.txt,sha256=Ge284pniNt8xea0OLk2o9o32GqVpDhOYk20fwE-0xxA,17
767
- langchain_agentx_python-2.2.2.dist-info/RECORD,,
763
+ langchain_agentx_python-2.2.3.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
764
+ langchain_agentx_python-2.2.3.dist-info/METADATA,sha256=VcuvJI240NmP2VxSl2xxXD2BTvpnCLxnkXjg5aHzmQE,24250
765
+ langchain_agentx_python-2.2.3.dist-info/WHEEL,sha256=51RkbunBAw4BWsgaQWTpPhg4Diwp3c9P5iaLk67Hdtg,92
766
+ langchain_agentx_python-2.2.3.dist-info/top_level.txt,sha256=Ge284pniNt8xea0OLk2o9o32GqVpDhOYk20fwE-0xxA,17
767
+ langchain_agentx_python-2.2.3.dist-info/RECORD,,