wcgw 5.1.0__py3-none-any.whl → 5.1.2__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.

@@ -15,7 +15,7 @@ class DirectoryTree:
15
15
  self.root = root
16
16
  self.max_files = max_files
17
17
  self.expanded_files: Set[Path] = set()
18
- self.expanded_dirs = set[Path]()
18
+ self.expanded_dirs: Set[Path] = set()
19
19
 
20
20
  if not self.root.exists():
21
21
  raise ValueError(f"Root path {root} does not exist")
@@ -77,11 +77,11 @@ class DirectoryTree:
77
77
  def _display_recursive(
78
78
  current_path: Path, indent: int = 0, depth: int = 0
79
79
  ) -> None:
80
- # Print current directory name
80
+ # Print current directory name with a trailing slash for directories
81
81
  if current_path == self.root:
82
- writer.write(f"{current_path}\n")
82
+ writer.write(f"{current_path}/\n")
83
83
  else:
84
- writer.write(f"{' ' * indent}{current_path.name}\n")
84
+ writer.write(f"{' ' * indent}{current_path.name}/\n")
85
85
 
86
86
  # Don't recurse beyond depth 1 unless path contains expanded files
87
87
  if depth > 0 and current_path not in self.expanded_dirs:
wcgw/client/tools.py CHANGED
@@ -475,7 +475,7 @@ def get_context_for_errors(
475
475
  ntokens = len(default_enc.encoder(context))
476
476
  if ntokens > max_tokens:
477
477
  return "Please re-read the file to understand the context"
478
- return f"Here's relevant snippet from the file where the syntax errors occured:\n```\n{context}\n```"
478
+ return f"Here's relevant snippet from the file where the syntax errors occured:\n<snippet>\n{context}\n</snippet>"
479
479
 
480
480
 
481
481
  def write_file(
@@ -556,7 +556,7 @@ def write_file(
556
556
  return (
557
557
  (
558
558
  msg
559
- + f"Here's the existing file:\n```\n{file_content_str}\n{final_message}\n```"
559
+ + f"Here's the existing file:\n<wcgw:file>\n{file_content_str}\n{final_message}\n</wcgw:file>"
560
560
  ),
561
561
  {path_: file_ranges},
562
562
  )
@@ -578,7 +578,7 @@ def write_file(
578
578
  return (
579
579
  (
580
580
  msg
581
- + f"Here's the existing file:\n```\n{file_content_str}\n```\n{final_message}"
581
+ + f"Here's the existing file:\n<wcgw:file>\n{file_content_str}\n</wcgw:file>\n{final_message}"
582
582
  ),
583
583
  {path_: file_ranges},
584
584
  )
@@ -1164,25 +1164,27 @@ def read_files(
1164
1164
  continue
1165
1165
 
1166
1166
  if coding_max_tokens:
1167
- coding_max_tokens = coding_max_tokens - tokens
1167
+ coding_max_tokens = max(0, coding_max_tokens - tokens)
1168
1168
  if noncoding_max_tokens:
1169
- noncoding_max_tokens = noncoding_max_tokens - tokens
1169
+ noncoding_max_tokens = max(0, noncoding_max_tokens - tokens)
1170
1170
 
1171
1171
  range_formatted = range_format(start_line_num, end_line_num)
1172
- message += f"\n{file}{range_formatted}\n```\n{content}\n"
1172
+ message += f'\n<wcgw:file path="{file}{range_formatted}">\n{content}\n'
1173
1173
 
1174
- # Check if we've hit either token limit
1174
+ if not truncated:
1175
+ message += "</wcgw:file>"
1176
+
1177
+ # Check if we've hit both token limit
1175
1178
  if (
1176
1179
  truncated
1177
1180
  or (coding_max_tokens is not None and coding_max_tokens <= 0)
1178
- or (noncoding_max_tokens is not None and noncoding_max_tokens <= 0)
1181
+ and (noncoding_max_tokens is not None and noncoding_max_tokens <= 0)
1179
1182
  ):
1180
1183
  not_reading = file_paths[i + 1 :]
1181
1184
  if not_reading:
1182
1185
  message += f"\nNot reading the rest of the files: {', '.join(not_reading)} due to token limit, please call again"
1183
1186
  break
1184
- else:
1185
- message += "```"
1187
+
1186
1188
  return message, file_ranges_dict, truncated
1187
1189
 
1188
1190
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 5.1.0
3
+ Version: 5.1.2
4
4
  Summary: Shell and coding agent for Claude and other mcp clients
5
5
  Project-URL: Homepage, https://github.com/rusiaaman/wcgw
6
6
  Author-email: Aman Rusia <gapypi@arcfu.com>
@@ -118,13 +118,7 @@ Then create or update `claude_desktop_config.json` (~/Library/Application Suppor
118
118
  "mcpServers": {
119
119
  "wcgw": {
120
120
  "command": "uv",
121
- "args": [
122
- "tool",
123
- "run",
124
- "--python",
125
- "3.12",
126
- "wcgw@latest"
127
- ]
121
+ "args": ["tool", "run", "--python", "3.12", "wcgw@latest"]
128
122
  }
129
123
  }
130
124
  }
@@ -153,14 +147,7 @@ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_confi
153
147
  "mcpServers": {
154
148
  "wcgw": {
155
149
  "command": "wsl.exe",
156
- "args": [
157
- "uv",
158
- "tool",
159
- "run",
160
- "--python",
161
- "3.12",
162
- "wcgw@latest"
163
- ]
150
+ "args": ["uv", "tool", "run", "--python", "3.12", "wcgw@latest"]
164
151
  }
165
152
  }
166
153
  }
@@ -232,7 +219,7 @@ Then you can update `/Users/username/Library/Application Support/Claude/claude_d
232
219
  ```
233
220
  {
234
221
  "mcpServers": {
235
- "filesystem": {
222
+ "wcgw": {
236
223
  "command": "docker",
237
224
  "args": [
238
225
  "run",
@@ -240,7 +227,7 @@ Then you can update `/Users/username/Library/Application Support/Claude/claude_d
240
227
  "--rm",
241
228
  "--mount",
242
229
  "type=bind,src=/Users/username/Desktop,dst=/workspace/Desktop",
243
- "wcgw",
230
+ "wcgw"
244
231
  ]
245
232
  }
246
233
  }
@@ -7,7 +7,7 @@ wcgw/client/diff-instructions.txt,sha256=eKRFA86yXWIGwNxIDaegTgTzIrFIBDWWiN1yP8H
7
7
  wcgw/client/memory.py,sha256=U2Nw2si3Zg7n_RhNAuaYcmrrDtZ_Mooi-kfAOKflT-I,3079
8
8
  wcgw/client/modes.py,sha256=roH6SPBokJMr5IzAlccdI-vJyvyS5vqSMMyth7TE86A,10315
9
9
  wcgw/client/tool_prompts.py,sha256=Qgj8aqEFeKilF9otDu6ZQkV0Ig4l6JaeM99uWu4ecDQ,4802
10
- wcgw/client/tools.py,sha256=lKGvkHBEBTrm80o6sFTNUv9VtMHEs-y4cT_mdkYjJNM,48276
10
+ wcgw/client/tools.py,sha256=y1Li2Wtnh5KkDoxCsQne-eCksjMlclBcgftzPVc3Vfw,48375
11
11
  wcgw/client/bash_state/bash_state.py,sha256=GXBh9zcCqSgUCKn9ZtVLosfqOkJRwrzO-qzyETNHTeE,41744
12
12
  wcgw/client/bash_state/parser/__init__.py,sha256=AnlNSmoQTSoqqlLOLX4P1uXfzc5VGeCGJsGgtisq2zE,207
13
13
  wcgw/client/bash_state/parser/bash_statement_parser.py,sha256=9a8vPO1r3_tXmaAcubTQ5UY-NseWlalgm8LZA17LXuY,6058
@@ -18,7 +18,7 @@ wcgw/client/file_ops/search_replace.py,sha256=bB1S-xkDdOX4h7UHHxfCHaQiS9KyYkIdU6
18
18
  wcgw/client/mcp_server/Readme.md,sha256=2Z88jj1mf9daYGW1CWaldcJ0moy8owDumhR2glBY3A8,109
19
19
  wcgw/client/mcp_server/__init__.py,sha256=mm7xhBIPwJpRT3u-Qsj4cKVMpVyucJoKRlbMP_gRRB0,343
20
20
  wcgw/client/mcp_server/server.py,sha256=jjwrmZZ8X0tXD0rsPZ9fKjEpdXpXCfdhEsN3Ho_tC8I,4989
21
- wcgw/client/repo_ops/display_tree.py,sha256=uOGX2IbXTKXwtXT2wdDszuH4ODmSYsHm0toU55e1vYI,4021
21
+ wcgw/client/repo_ops/display_tree.py,sha256=g282qCKLCwo8O9NHUBnkG_NkIusroVzz3NZi8VIcmAI,4066
22
22
  wcgw/client/repo_ops/file_stats.py,sha256=AUA0Br7zFRpylWFYZPGMeGPJy3nWp9e2haKi34JptHE,4887
23
23
  wcgw/client/repo_ops/path_prob.py,sha256=SWf0CDn37rtlsYRQ51ufSxay-heaQoVIhr1alB9tZ4M,2144
24
24
  wcgw/client/repo_ops/paths_model.vocab,sha256=M1pXycYDQehMXtpp-qAgU7rtzeBbCOiJo4qcYFY0kqk,315087
@@ -30,8 +30,8 @@ wcgw_cli/anthropic_client.py,sha256=8bjDY59-aioyTJgpB-NBHZNhZaq6rqcTJcOf81kzCyA,
30
30
  wcgw_cli/cli.py,sha256=-7FBe_lahKyUOhf65iurTA1M1gXXXAiT0OVKQVcZKKo,948
31
31
  wcgw_cli/openai_client.py,sha256=GOqoSFazTV-cFjpdZGPM0DIwec8Up2TEcKUbsN40AGY,15990
32
32
  wcgw_cli/openai_utils.py,sha256=xGOb3W5ALrIozV7oszfGYztpj0FnXdD7jAxm5lEIVKY,2439
33
- wcgw-5.1.0.dist-info/METADATA,sha256=VUNkqbng5Y1O7WtFaJkjuCkTtUSSZBpCjv6aHGZcdq0,14866
34
- wcgw-5.1.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- wcgw-5.1.0.dist-info/entry_points.txt,sha256=UnjK-MAH4Qssh0tGJDMeij1oi-oRKokItkknP_BwShE,94
36
- wcgw-5.1.0.dist-info/licenses/LICENSE,sha256=BvY8xqjOfc3X2qZpGpX3MZEmF-4Dp0LqgKBbT6L_8oI,11142
37
- wcgw-5.1.0.dist-info/RECORD,,
33
+ wcgw-5.1.2.dist-info/METADATA,sha256=5SrTq2BhXtZcufNDlO9N8eqjqMkxRxQafzgj1QWGMpM,14755
34
+ wcgw-5.1.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
+ wcgw-5.1.2.dist-info/entry_points.txt,sha256=UnjK-MAH4Qssh0tGJDMeij1oi-oRKokItkknP_BwShE,94
36
+ wcgw-5.1.2.dist-info/licenses/LICENSE,sha256=BvY8xqjOfc3X2qZpGpX3MZEmF-4Dp0LqgKBbT6L_8oI,11142
37
+ wcgw-5.1.2.dist-info/RECORD,,
File without changes