wcgw 2.8.9__py3-none-any.whl → 2.8.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 wcgw might be problematic. Click here for more details.
- mcp_wcgw/types.py +1 -1
- wcgw/client/tools.py +28 -3
- {wcgw-2.8.9.dist-info → wcgw-2.8.10.dist-info}/METADATA +1 -1
- {wcgw-2.8.9.dist-info → wcgw-2.8.10.dist-info}/RECORD +7 -7
- {wcgw-2.8.9.dist-info → wcgw-2.8.10.dist-info}/WHEEL +0 -0
- {wcgw-2.8.9.dist-info → wcgw-2.8.10.dist-info}/entry_points.txt +0 -0
- {wcgw-2.8.9.dist-info → wcgw-2.8.10.dist-info}/licenses/LICENSE +0 -0
mcp_wcgw/types.py
CHANGED
wcgw/client/tools.py
CHANGED
|
@@ -6,8 +6,10 @@ import importlib.metadata
|
|
|
6
6
|
import json
|
|
7
7
|
import mimetypes
|
|
8
8
|
import os
|
|
9
|
+
import platform
|
|
9
10
|
import re
|
|
10
11
|
import shlex
|
|
12
|
+
import subprocess
|
|
11
13
|
import time
|
|
12
14
|
import traceback
|
|
13
15
|
import uuid
|
|
@@ -133,15 +135,38 @@ def ask_confirmation(prompt: Confirmation) -> str:
|
|
|
133
135
|
PROMPT_CONST = "#" + "@wcgw@#"
|
|
134
136
|
|
|
135
137
|
|
|
136
|
-
def
|
|
138
|
+
def is_mac() -> bool:
|
|
139
|
+
return platform.system() == "Darwin"
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def get_tmpdir() -> str:
|
|
143
|
+
current_tmpdir = os.environ.get("TMPDIR", "")
|
|
144
|
+
if current_tmpdir or not is_mac():
|
|
145
|
+
return current_tmpdir
|
|
146
|
+
try:
|
|
147
|
+
# Fix issue while running ocrmypdf -> tesseract -> leptonica, set TMPDIR
|
|
148
|
+
# https://github.com/tesseract-ocr/tesseract/issues/4333
|
|
149
|
+
result = subprocess.check_output(
|
|
150
|
+
["getconf", "DARWIN_USER_TEMP_DIR"],
|
|
151
|
+
text=True,
|
|
152
|
+
).strip()
|
|
153
|
+
return result
|
|
154
|
+
except subprocess.CalledProcessError:
|
|
155
|
+
return "//tmp"
|
|
156
|
+
except Exception:
|
|
157
|
+
return ""
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
def start_shell(is_restricted_mode: bool, initial_dir: str) -> pexpect.spawn: # type: ignore[type-arg]
|
|
137
161
|
cmd = "/bin/bash"
|
|
138
162
|
if is_restricted_mode:
|
|
139
163
|
cmd += " -r"
|
|
140
164
|
|
|
165
|
+
overrideenv = {**os.environ, "PS1": PROMPT_CONST, "TMPDIR": get_tmpdir()}
|
|
141
166
|
try:
|
|
142
167
|
shell = pexpect.spawn(
|
|
143
168
|
cmd,
|
|
144
|
-
env=
|
|
169
|
+
env=overrideenv, # type: ignore[arg-type]
|
|
145
170
|
echo=False,
|
|
146
171
|
encoding="utf-8",
|
|
147
172
|
timeout=TIMEOUT,
|
|
@@ -158,7 +183,7 @@ def start_shell(is_restricted_mode: bool, initial_dir: str) -> pexpect.spawn: #
|
|
|
158
183
|
|
|
159
184
|
shell = pexpect.spawn(
|
|
160
185
|
"/bin/bash --noprofile --norc",
|
|
161
|
-
env=
|
|
186
|
+
env=overrideenv, # type: ignore[arg-type]
|
|
162
187
|
echo=False,
|
|
163
188
|
encoding="utf-8",
|
|
164
189
|
timeout=TIMEOUT,
|
|
@@ -7,7 +7,7 @@ wcgw/client/diff-instructions.txt,sha256=tmJ9Fu9XdO_72lYXQQNY9RZyx91bjxrXJf9d_KB
|
|
|
7
7
|
wcgw/client/memory.py,sha256=8LdYsOhvCOoC1kfvDr85kNy07WnhPMvE6B2FRM2w85Y,2902
|
|
8
8
|
wcgw/client/modes.py,sha256=FkDJIgjKrlJEufLq3abWfqV25BdF2pH-HnoHafy9LrA,10484
|
|
9
9
|
wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
|
|
10
|
-
wcgw/client/tools.py,sha256=
|
|
10
|
+
wcgw/client/tools.py,sha256=c-LipooLb6XBF9l-qwJlzBLzznlqQQuCXRB9HSZJFT0,53450
|
|
11
11
|
wcgw/client/file_ops/diff_edit.py,sha256=OlJCpPSE_3T41q9H0yDORm6trjm3w6zh1EkuPTxik2A,16832
|
|
12
12
|
wcgw/client/file_ops/search_replace.py,sha256=Napa7IWaYPGMNdttunKyRDkb90elZE7r23B_o_htRxo,5585
|
|
13
13
|
wcgw/client/mcp_server/Readme.md,sha256=I8N4dHkTUVGNQ63BQkBMBhCCBTgqGOSF_pUR6iOEiUk,2495
|
|
@@ -28,7 +28,7 @@ wcgw_cli/openai_client.py,sha256=wp4XDf3t3W6XG5LHgr6bFckePyty24BGtsOEjOrIrk0,179
|
|
|
28
28
|
wcgw_cli/openai_utils.py,sha256=xGOb3W5ALrIozV7oszfGYztpj0FnXdD7jAxm5lEIVKY,2439
|
|
29
29
|
mcp_wcgw/__init__.py,sha256=fKCgOdN7cn7gR3YGFaGyV5Goe8A2sEyllLcsRkN0i-g,2601
|
|
30
30
|
mcp_wcgw/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
31
|
-
mcp_wcgw/types.py,sha256=
|
|
31
|
+
mcp_wcgw/types.py,sha256=f4nENSEc2Zu9YJkrXcSPgwUbc9pPhqhzy-_CBGGttoQ,30570
|
|
32
32
|
mcp_wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
mcp_wcgw/client/__main__.py,sha256=9ne6Gk1udW_GSwq7O7aZSYwwqSBTgyMVjNVc6s6GJoQ,2280
|
|
34
34
|
mcp_wcgw/client/session.py,sha256=RqdIN6ov9vklKY2B0-hvjIM5JtUetbyhhrF7a0HKAJ8,8044
|
|
@@ -48,8 +48,8 @@ mcp_wcgw/shared/memory.py,sha256=dBsOghxHz8-tycdSVo9kSujbsC8xb_tYsGmuJobuZnw,281
|
|
|
48
48
|
mcp_wcgw/shared/progress.py,sha256=ymxOsb8XO5Mhlop7fRfdbmvPodANj7oq6O4dD0iUcnw,1048
|
|
49
49
|
mcp_wcgw/shared/session.py,sha256=e44a0LQOW8gwdLs9_DE9oDsxqW2U8mXG3d5KT95bn5o,10393
|
|
50
50
|
mcp_wcgw/shared/version.py,sha256=d2LZii-mgsPIxpshjkXnOTUmk98i0DT4ff8VpA_kAvE,111
|
|
51
|
-
wcgw-2.8.
|
|
52
|
-
wcgw-2.8.
|
|
53
|
-
wcgw-2.8.
|
|
54
|
-
wcgw-2.8.
|
|
55
|
-
wcgw-2.8.
|
|
51
|
+
wcgw-2.8.10.dist-info/METADATA,sha256=-bjtkmro5UQVMBYYzxbakEIADO-VOpONetLtwxb1vX4,13054
|
|
52
|
+
wcgw-2.8.10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
53
|
+
wcgw-2.8.10.dist-info/entry_points.txt,sha256=vd3tj1_Kzfp55LscJ8-6WFMM5hm9cWTfNGFCrWBnH3Q,124
|
|
54
|
+
wcgw-2.8.10.dist-info/licenses/LICENSE,sha256=BvY8xqjOfc3X2qZpGpX3MZEmF-4Dp0LqgKBbT6L_8oI,11142
|
|
55
|
+
wcgw-2.8.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|