wcgw 5.1.0__tar.gz → 5.1.2__tar.gz

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.

Files changed (59) hide show
  1. {wcgw-5.1.0 → wcgw-5.1.2}/.github/workflows/python-tests.yml +1 -1
  2. {wcgw-5.1.0 → wcgw-5.1.2}/.github/workflows/python-types.yml +1 -1
  3. {wcgw-5.1.0 → wcgw-5.1.2}/PKG-INFO +5 -18
  4. {wcgw-5.1.0 → wcgw-5.1.2}/README.md +4 -17
  5. {wcgw-5.1.0 → wcgw-5.1.2}/pyproject.toml +1 -1
  6. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/display_tree.py +4 -4
  7. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/tools.py +12 -10
  8. {wcgw-5.1.0 → wcgw-5.1.2}/uv.lock +397 -352
  9. {wcgw-5.1.0 → wcgw-5.1.2}/.github/workflows/python-publish.yml +0 -0
  10. {wcgw-5.1.0 → wcgw-5.1.2}/.gitignore +0 -0
  11. {wcgw-5.1.0 → wcgw-5.1.2}/.gitmodules +0 -0
  12. {wcgw-5.1.0 → wcgw-5.1.2}/.python-version +0 -0
  13. {wcgw-5.1.0 → wcgw-5.1.2}/.vscode/settings.json +0 -0
  14. {wcgw-5.1.0 → wcgw-5.1.2}/CLAUDE.md +0 -0
  15. {wcgw-5.1.0 → wcgw-5.1.2}/Dockerfile +0 -0
  16. {wcgw-5.1.0 → wcgw-5.1.2}/LICENSE +0 -0
  17. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/__init__.py +0 -0
  18. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/__init__.py +0 -0
  19. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/bash_state/bash_state.py +0 -0
  20. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/bash_state/parser/__init__.py +0 -0
  21. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/bash_state/parser/bash_statement_parser.py +0 -0
  22. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/common.py +0 -0
  23. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/diff-instructions.txt +0 -0
  24. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/encoder/__init__.py +0 -0
  25. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/file_ops/diff_edit.py +0 -0
  26. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/file_ops/extensions.py +0 -0
  27. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/file_ops/search_replace.py +0 -0
  28. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/mcp_server/Readme.md +0 -0
  29. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/mcp_server/__init__.py +0 -0
  30. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/mcp_server/server.py +0 -0
  31. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/memory.py +0 -0
  32. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/modes.py +0 -0
  33. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/file_stats.py +0 -0
  34. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/path_prob.py +0 -0
  35. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/paths_model.vocab +0 -0
  36. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/paths_tokens.model +0 -0
  37. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/repo_ops/repo_context.py +0 -0
  38. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/client/tool_prompts.py +0 -0
  39. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/py.typed +0 -0
  40. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw/types_.py +0 -0
  41. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/__init__.py +0 -0
  42. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/__main__.py +0 -0
  43. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/anthropic_client.py +0 -0
  44. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/cli.py +0 -0
  45. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/openai_client.py +0 -0
  46. {wcgw-5.1.0 → wcgw-5.1.2}/src/wcgw_cli/openai_utils.py +0 -0
  47. {wcgw-5.1.0 → wcgw-5.1.2}/static/claude-ss.jpg +0 -0
  48. {wcgw-5.1.0 → wcgw-5.1.2}/static/computer-use.jpg +0 -0
  49. {wcgw-5.1.0 → wcgw-5.1.2}/static/example.jpg +0 -0
  50. {wcgw-5.1.0 → wcgw-5.1.2}/static/rocket-icon.png +0 -0
  51. {wcgw-5.1.0 → wcgw-5.1.2}/static/ss1.png +0 -0
  52. {wcgw-5.1.0 → wcgw-5.1.2}/static/workflow-demo.gif +0 -0
  53. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_bash_parser.py +0 -0
  54. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_bash_parser_complex.py +0 -0
  55. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_edit.py +0 -0
  56. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_file_range_tracking.py +0 -0
  57. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_mcp_server.py +0 -0
  58. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_readfiles.py +0 -0
  59. {wcgw-5.1.0 → wcgw-5.1.2}/tests/test_tools.py +0 -0
@@ -27,7 +27,7 @@ jobs:
27
27
  pip install uv
28
28
  - name: Run tests with coverage
29
29
  run: |
30
- uv run --group tests --python "${{ matrix.python-version }}" pytest --cov=wcgw --cov-report=xml --cov-report=term-missing
30
+ uv run --frozen --group tests --python "${{ matrix.python-version }}" pytest --cov=wcgw --cov-report=xml --cov-report=term-missing
31
31
  - name: Upload coverage reports to Codecov
32
32
  uses: codecov/codecov-action@v4
33
33
  if: success()
@@ -27,4 +27,4 @@ jobs:
27
27
  pip install uv
28
28
  - name: Run type checks
29
29
  run: |
30
- uv run --group types --python "${{ matrix.python-version }}" mypy --strict src/wcgw
30
+ uv run --frozen --group types --python "${{ matrix.python-version }}" mypy --strict src/wcgw
@@ -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
  }
@@ -87,13 +87,7 @@ Then create or update `claude_desktop_config.json` (~/Library/Application Suppor
87
87
  "mcpServers": {
88
88
  "wcgw": {
89
89
  "command": "uv",
90
- "args": [
91
- "tool",
92
- "run",
93
- "--python",
94
- "3.12",
95
- "wcgw@latest"
96
- ]
90
+ "args": ["tool", "run", "--python", "3.12", "wcgw@latest"]
97
91
  }
98
92
  }
99
93
  }
@@ -122,14 +116,7 @@ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_confi
122
116
  "mcpServers": {
123
117
  "wcgw": {
124
118
  "command": "wsl.exe",
125
- "args": [
126
- "uv",
127
- "tool",
128
- "run",
129
- "--python",
130
- "3.12",
131
- "wcgw@latest"
132
- ]
119
+ "args": ["uv", "tool", "run", "--python", "3.12", "wcgw@latest"]
133
120
  }
134
121
  }
135
122
  }
@@ -201,7 +188,7 @@ Then you can update `/Users/username/Library/Application Support/Claude/claude_d
201
188
  ```
202
189
  {
203
190
  "mcpServers": {
204
- "filesystem": {
191
+ "wcgw": {
205
192
  "command": "docker",
206
193
  "args": [
207
194
  "run",
@@ -209,7 +196,7 @@ Then you can update `/Users/username/Library/Application Support/Claude/claude_d
209
196
  "--rm",
210
197
  "--mount",
211
198
  "type=bind,src=/Users/username/Desktop,dst=/workspace/Desktop",
212
- "wcgw",
199
+ "wcgw"
213
200
  ]
214
201
  }
215
202
  }
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
3
3
  name = "wcgw"
4
- version = "5.1.0"
4
+ version = "5.1.2"
5
5
  description = "Shell and coding agent for Claude and other mcp clients"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.11"
@@ -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:
@@ -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