wcgw 3.0.3__py3-none-any.whl → 3.0.5__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.
- wcgw/client/bash_state/bash_state.py +7 -17
- wcgw/client/tools.py +5 -3
- wcgw/relay/serve.py +1 -1
- wcgw/types_.py +2 -2
- {wcgw-3.0.3.dist-info → wcgw-3.0.5.dist-info}/METADATA +1 -1
- {wcgw-3.0.3.dist-info → wcgw-3.0.5.dist-info}/RECORD +9 -9
- {wcgw-3.0.3.dist-info → wcgw-3.0.5.dist-info}/WHEEL +0 -0
- {wcgw-3.0.3.dist-info → wcgw-3.0.5.dist-info}/entry_points.txt +0 -0
- {wcgw-3.0.3.dist-info → wcgw-3.0.5.dist-info}/licenses/LICENSE +0 -0
|
@@ -468,16 +468,6 @@ class BashState:
|
|
|
468
468
|
cwd: str,
|
|
469
469
|
) -> None:
|
|
470
470
|
"""Create a new BashState instance from a serialized state dictionary"""
|
|
471
|
-
if (
|
|
472
|
-
self._bash_command_mode == bash_command_mode
|
|
473
|
-
and ((self._cwd == cwd) or not cwd)
|
|
474
|
-
and (self._file_edit_mode == file_edit_mode)
|
|
475
|
-
and (self._write_if_empty_mode == write_if_empty_mode)
|
|
476
|
-
and (self._mode == mode)
|
|
477
|
-
and (self._whitelist_for_overwrite == set(whitelist_for_overwrite))
|
|
478
|
-
):
|
|
479
|
-
# No need to reset shell if the state is the same
|
|
480
|
-
return
|
|
481
471
|
self._bash_command_mode = bash_command_mode
|
|
482
472
|
self._cwd = cwd or self._cwd
|
|
483
473
|
self._file_edit_mode = file_edit_mode
|
|
@@ -585,12 +575,12 @@ def get_status(bash_state: BashState) -> str:
|
|
|
585
575
|
|
|
586
576
|
def is_status_check(arg: BashCommand) -> bool:
|
|
587
577
|
return (
|
|
588
|
-
isinstance(arg.
|
|
578
|
+
isinstance(arg.action_json, StatusCheck)
|
|
589
579
|
or (
|
|
590
|
-
isinstance(arg.
|
|
591
|
-
and arg.
|
|
580
|
+
isinstance(arg.action_json, SendSpecials)
|
|
581
|
+
and arg.action_json.send_specials == ["Enter"]
|
|
592
582
|
)
|
|
593
|
-
or (isinstance(arg.
|
|
583
|
+
or (isinstance(arg.action_json, SendAscii) and arg.action_json.send_ascii == [10])
|
|
594
584
|
)
|
|
595
585
|
|
|
596
586
|
|
|
@@ -605,8 +595,8 @@ def execute_bash(
|
|
|
605
595
|
output, cost = _execute_bash(bash_state, enc, bash_arg, max_tokens, timeout_s)
|
|
606
596
|
|
|
607
597
|
# Remove echo if it's a command
|
|
608
|
-
if isinstance(bash_arg.
|
|
609
|
-
command = bash_arg.
|
|
598
|
+
if isinstance(bash_arg.action_json, Command):
|
|
599
|
+
command = bash_arg.action_json.command.strip()
|
|
610
600
|
if output.startswith(command):
|
|
611
601
|
output = output[len(command) :]
|
|
612
602
|
|
|
@@ -624,7 +614,7 @@ def _execute_bash(
|
|
|
624
614
|
) -> tuple[str, float]:
|
|
625
615
|
try:
|
|
626
616
|
is_interrupt = False
|
|
627
|
-
command_data = bash_arg.
|
|
617
|
+
command_data = bash_arg.action_json
|
|
628
618
|
|
|
629
619
|
if isinstance(command_data, Command):
|
|
630
620
|
if bash_state.bash_command_mode.allowed_commands == "none":
|
wcgw/client/tools.py
CHANGED
|
@@ -324,7 +324,7 @@ def try_open_file(file_path: str) -> None:
|
|
|
324
324
|
break
|
|
325
325
|
except:
|
|
326
326
|
continue
|
|
327
|
-
|
|
327
|
+
|
|
328
328
|
# Try to open the file if a command is available
|
|
329
329
|
if open_cmd:
|
|
330
330
|
try:
|
|
@@ -698,7 +698,7 @@ def get_tool_output(
|
|
|
698
698
|
context.console.print("Calling task memory tool")
|
|
699
699
|
relevant_files = []
|
|
700
700
|
warnings = ""
|
|
701
|
-
arg.project_root_path = os.path.expanduser(arg.project_root_path)
|
|
701
|
+
arg.project_root_path = os.path.expanduser(arg.project_root_path)
|
|
702
702
|
for fglob in arg.relevant_file_globs:
|
|
703
703
|
fglob = expand_user(fglob)
|
|
704
704
|
if not os.path.isabs(fglob) and arg.project_root_path:
|
|
@@ -708,7 +708,9 @@ def get_tool_output(
|
|
|
708
708
|
if not globs:
|
|
709
709
|
warnings += f"Warning: No files found for the glob: {fglob}\n"
|
|
710
710
|
relevant_files_data = read_files(relevant_files[:10_000], None, context)
|
|
711
|
-
save_path = save_memory(
|
|
711
|
+
save_path = save_memory(
|
|
712
|
+
arg, relevant_files_data, context.bash_state.serialize()
|
|
713
|
+
)
|
|
712
714
|
if not relevant_files and arg.relevant_file_globs:
|
|
713
715
|
output_ = f'Error: No files found for the given globs. Context file successfully saved at "{save_path}", but please fix the error.'
|
|
714
716
|
elif warnings:
|
wcgw/relay/serve.py
CHANGED
|
@@ -179,7 +179,7 @@ async def bash_command(command: CommandWithUUID) -> str:
|
|
|
179
179
|
await clients[user_id](
|
|
180
180
|
Mdata(
|
|
181
181
|
data=BashCommand(
|
|
182
|
-
|
|
182
|
+
action_json=command.action_json, wait_for_seconds=command.wait_for_seconds
|
|
183
183
|
),
|
|
184
184
|
user_id=user_id,
|
|
185
185
|
)
|
wcgw/types_.py
CHANGED
|
@@ -19,7 +19,7 @@ class CodeWriterMode(BaseModel):
|
|
|
19
19
|
allowed_globs: Literal["all"] | list[str]
|
|
20
20
|
allowed_commands: Literal["all"] | list[str]
|
|
21
21
|
|
|
22
|
-
def
|
|
22
|
+
def model_post_init(self, _: Any) -> None:
|
|
23
23
|
# Patch frequently wrong output trading off accuracy
|
|
24
24
|
# in rare case there's a file named 'all' or a command named 'all'
|
|
25
25
|
if len(self.allowed_commands) == 1:
|
|
@@ -99,7 +99,7 @@ class SendAscii(BaseModel):
|
|
|
99
99
|
|
|
100
100
|
|
|
101
101
|
class BashCommand(BaseModel):
|
|
102
|
-
|
|
102
|
+
action_json: Command | StatusCheck | SendText | SendSpecials | SendAscii
|
|
103
103
|
wait_for_seconds: Optional[float] = None
|
|
104
104
|
|
|
105
105
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
wcgw/__init__.py,sha256=qUofQOAXCGcWr2u_B8U-MIMhhYaBUpUwNDcscvRmYfo,90
|
|
2
2
|
wcgw/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
wcgw/types_.py,sha256=
|
|
3
|
+
wcgw/types_.py,sha256=xd3TP9_57iFVoKxkBsl3G7mwIW5uIog68xJ_Khh9E9s,3639
|
|
4
4
|
wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
wcgw/client/common.py,sha256=OCH7Tx64jojz3M3iONUrGMadE07W21DiZs5sOxWX1Qc,1456
|
|
6
6
|
wcgw/client/diff-instructions.txt,sha256=tmJ9Fu9XdO_72lYXQQNY9RZyx91bjxrXJf9d_KBz57k,1611
|
|
7
7
|
wcgw/client/memory.py,sha256=8LdYsOhvCOoC1kfvDr85kNy07WnhPMvE6B2FRM2w85Y,2902
|
|
8
8
|
wcgw/client/modes.py,sha256=FjIQOjT5oI7dk9VG0oRemN1A6EHBvHnuSQGKuRbguJI,10352
|
|
9
9
|
wcgw/client/tool_prompts.py,sha256=H36Sr3yH2YuHZTc08Y6rTUWlYWjKMFtIGP6vbAVNwZo,3988
|
|
10
|
-
wcgw/client/tools.py,sha256=
|
|
11
|
-
wcgw/client/bash_state/bash_state.py,sha256=
|
|
10
|
+
wcgw/client/tools.py,sha256=Sz6tCm9KXVKZHbUqGViYUZnhJ78oV4_k1USX205HLI0,25415
|
|
11
|
+
wcgw/client/bash_state/bash_state.py,sha256=_qQC7dASIm4c1wAb6SKTdAdNYD5l3Km-WyA7U_lDt_k,26157
|
|
12
12
|
wcgw/client/encoder/__init__.py,sha256=Y-8f43I6gMssUCWpX5rLYiAFv3D-JPRs4uNEejPlke8,1514
|
|
13
13
|
wcgw/client/file_ops/diff_edit.py,sha256=sIwXSSkWYff_Dp3oHfefqtSuFqLrxbhKvzkCoLuLqDE,18679
|
|
14
14
|
wcgw/client/file_ops/search_replace.py,sha256=Napa7IWaYPGMNdttunKyRDkb90elZE7r23B_o_htRxo,5585
|
|
@@ -21,7 +21,7 @@ wcgw/client/repo_ops/paths_model.vocab,sha256=M1pXycYDQehMXtpp-qAgU7rtzeBbCOiJo4
|
|
|
21
21
|
wcgw/client/repo_ops/paths_tokens.model,sha256=jiwwE4ae8ADKuTZISutXuM5Wfyc_FBmN5rxTjoNnCos,1569052
|
|
22
22
|
wcgw/client/repo_ops/repo_context.py,sha256=5NqRxBY0K-SBFXJ0Ybt7llzYOBD8pRkTpruMMJHWxv4,4336
|
|
23
23
|
wcgw/relay/client.py,sha256=BUeEKUsWts8RpYxXwXcyFyjBJhOCS-CxThAlL_-VCOI,3618
|
|
24
|
-
wcgw/relay/serve.py,sha256=
|
|
24
|
+
wcgw/relay/serve.py,sha256=xFAFiRENPae723_kwaaCgBmqL5sffYHKPu3esrMu57M,7896
|
|
25
25
|
wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
|
|
26
26
|
wcgw_cli/__init__.py,sha256=TNxXsTPgb52OhakIda9wTRh91cqoBqgQRx5TxjzQQFU,21
|
|
27
27
|
wcgw_cli/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
|
|
@@ -51,8 +51,8 @@ mcp_wcgw/shared/memory.py,sha256=dBsOghxHz8-tycdSVo9kSujbsC8xb_tYsGmuJobuZnw,281
|
|
|
51
51
|
mcp_wcgw/shared/progress.py,sha256=ymxOsb8XO5Mhlop7fRfdbmvPodANj7oq6O4dD0iUcnw,1048
|
|
52
52
|
mcp_wcgw/shared/session.py,sha256=e44a0LQOW8gwdLs9_DE9oDsxqW2U8mXG3d5KT95bn5o,10393
|
|
53
53
|
mcp_wcgw/shared/version.py,sha256=d2LZii-mgsPIxpshjkXnOTUmk98i0DT4ff8VpA_kAvE,111
|
|
54
|
-
wcgw-3.0.
|
|
55
|
-
wcgw-3.0.
|
|
56
|
-
wcgw-3.0.
|
|
57
|
-
wcgw-3.0.
|
|
58
|
-
wcgw-3.0.
|
|
54
|
+
wcgw-3.0.5.dist-info/METADATA,sha256=H1pRv12T5HGlwRjRd-RuMkRmpJEMkbCrVre1aeb93PE,14049
|
|
55
|
+
wcgw-3.0.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
56
|
+
wcgw-3.0.5.dist-info/entry_points.txt,sha256=vd3tj1_Kzfp55LscJ8-6WFMM5hm9cWTfNGFCrWBnH3Q,124
|
|
57
|
+
wcgw-3.0.5.dist-info/licenses/LICENSE,sha256=BvY8xqjOfc3X2qZpGpX3MZEmF-4Dp0LqgKBbT6L_8oI,11142
|
|
58
|
+
wcgw-3.0.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|