wcgw 5.4.3__tar.gz → 5.4.5__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.
- {wcgw-5.4.3 → wcgw-5.4.5}/PKG-INFO +18 -11
- {wcgw-5.4.3 → wcgw-5.4.5}/README.md +16 -10
- {wcgw-5.4.3 → wcgw-5.4.5}/pyproject.toml +2 -1
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/tools.py +12 -10
- {wcgw-5.4.3 → wcgw-5.4.5}/uv.lock +24 -1
- {wcgw-5.4.3 → wcgw-5.4.5}/.github/workflows/python-publish.yml +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.github/workflows/python-tests.yml +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.github/workflows/python-types.yml +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.gitignore +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.gitmodules +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.python-version +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/.vscode/settings.json +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/CLAUDE.md +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/Dockerfile +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/LICENSE +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/bash_state/bash_state.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/bash_state/parser/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/bash_state/parser/bash_statement_parser.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/common.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/diff-instructions.txt +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/encoder/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/file_ops/diff_edit.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/file_ops/extensions.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/file_ops/search_replace.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/mcp_server/Readme.md +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/mcp_server/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/mcp_server/server.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/memory.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/modes.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/display_tree.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/file_stats.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/path_prob.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/paths_model.vocab +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/paths_tokens.model +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/repo_ops/repo_context.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/schema_generator.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/client/tool_prompts.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/py.typed +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw/types_.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/__init__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/__main__.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/anthropic_client.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/cli.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/openai_client.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/src/wcgw_cli/openai_utils.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/claude-ss.jpg +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/computer-use.jpg +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/example.jpg +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/rocket-icon.png +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/ss1.png +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/static/workflow-demo.gif +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_bash_parser.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_bash_parser_complex.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_edit.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_file_range_tracking.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_mcp_server.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_readfiles.py +0 -0
- {wcgw-5.4.3 → wcgw-5.4.5}/tests/test_tools.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: wcgw
|
|
3
|
-
Version: 5.4.
|
|
3
|
+
Version: 5.4.5
|
|
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>
|
|
@@ -26,6 +26,7 @@ Requires-Dist: tree-sitter-bash>=0.23.3
|
|
|
26
26
|
Requires-Dist: tree-sitter>=0.24.0
|
|
27
27
|
Requires-Dist: typer>=0.12.5
|
|
28
28
|
Requires-Dist: uvicorn>=0.31.0
|
|
29
|
+
Requires-Dist: wcmatch>=10.1
|
|
29
30
|
Requires-Dist: websockets>=13.1
|
|
30
31
|
Description-Content-Type: text/markdown
|
|
31
32
|
|
|
@@ -86,7 +87,7 @@ wcgw is an MCP server with tightly integrated shell and code editing tools.
|
|
|
86
87
|
- By default it runs in 'wcgw' mode that has no restrictions and full authorisation.
|
|
87
88
|
- More details in [Modes section](#modes)
|
|
88
89
|
- ⚡ **Runs in multiplex terminal** Run `screen -x` to attach to the terminal that the AI runs commands on. See history or interrupt process or interact with the same terminal that AI uses.
|
|
89
|
-
- ⚡ **Automatically load CLAUDE.md** Loads "CLAUDE.md" file in project root and sends as instructions during initialisation. Instructions in a global "~/.wcgw/CLAUDE.md" file are loaded and added along with project specific CLAUDE.md. The file name is case sensitive.
|
|
90
|
+
- ⚡ **Automatically load CLAUDE.md/AGENTS.md** Loads "CLAUDE.md" or "AGENTS.md" file in project root and sends as instructions during initialisation. Instructions in a global "~/.wcgw/CLAUDE.md" or "~/.wcgw/AGENTS.md" file are loaded and added along with project specific CLAUDE.md. The file name is case sensitive. CLAUDE.md is attached if it's present otherwise AGENTS.md is attached.
|
|
90
91
|
|
|
91
92
|
## Top use cases examples
|
|
92
93
|
|
|
@@ -118,7 +119,7 @@ Then create or update `claude_desktop_config.json` (~/Library/Application Suppor
|
|
|
118
119
|
"mcpServers": {
|
|
119
120
|
"wcgw": {
|
|
120
121
|
"command": "uv",
|
|
121
|
-
"args": ["tool", "run", "--python", "3.12", "wcgw
|
|
122
|
+
"args": ["tool", "run", "--python", "3.12", "wcgw"]
|
|
122
123
|
}
|
|
123
124
|
}
|
|
124
125
|
}
|
|
@@ -129,10 +130,10 @@ Then restart claude app.
|
|
|
129
130
|
_If there's an error in setting up_
|
|
130
131
|
|
|
131
132
|
- If there's an error like "uv ENOENT", make sure `uv` is installed. Then run 'which uv' in the terminal, and use its output in place of "uv" in the configuration.
|
|
132
|
-
- If there's still an issue, check that `uv tool run --python 3.12 wcgw
|
|
133
|
+
- If there's still an issue, check that `uv tool run --python 3.12 wcgw` runs in your terminal. It should have no output and shouldn't exit.
|
|
133
134
|
- Try removing ~/.cache/uv folder
|
|
134
135
|
- Try using `uv` version `0.6.0` for which this tool was tested.
|
|
135
|
-
- Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --python 3.12 wcgw
|
|
136
|
+
- Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --python 3.12 wcgw`
|
|
136
137
|
|
|
137
138
|
### Windows on wsl
|
|
138
139
|
|
|
@@ -147,12 +148,12 @@ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_confi
|
|
|
147
148
|
"mcpServers": {
|
|
148
149
|
"wcgw": {
|
|
149
150
|
"command": "wsl.exe",
|
|
150
|
-
"args": ["uv", "tool", "run", "--python", "3.12", "wcgw
|
|
151
|
+
"args": ["uv", "tool", "run", "--python", "3.12", "wcgw"]
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
```
|
|
155
|
-
When you encounter an error, execute the command wsl uv --python 3.12 wcgw
|
|
156
|
+
When you encounter an error, execute the command wsl uv --python 3.12 wcgw in command prompt. If you get the `error /bin/bash: line 1: uv: command not found`, it means uv was not installed globally and you need to point to the correct path of uv.
|
|
156
157
|
1. Find where uv is installed:
|
|
157
158
|
```bash
|
|
158
159
|
whereis uv
|
|
@@ -162,7 +163,7 @@ Example output:
|
|
|
162
163
|
|
|
163
164
|
2. Test the full path works:
|
|
164
165
|
```
|
|
165
|
-
wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw
|
|
166
|
+
wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw
|
|
166
167
|
```
|
|
167
168
|
|
|
168
169
|
3. Update the config with the full path:
|
|
@@ -171,7 +172,7 @@ wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw@latest
|
|
|
171
172
|
"mcpServers": {
|
|
172
173
|
"wcgw": {
|
|
173
174
|
"command": "wsl.exe",
|
|
174
|
-
"args": ["/home/mywsl/.local/bin/uv", "tool", "run", "--python", "3.12", "wcgw
|
|
175
|
+
"args": ["/home/mywsl/.local/bin/uv", "tool", "run", "--python", "3.12", "wcgw"]
|
|
175
176
|
}
|
|
176
177
|
}
|
|
177
178
|
}
|
|
@@ -223,6 +224,12 @@ You can interact with the terminal but beware that the AI might be running in pa
|
|
|
223
224
|
|
|
224
225
|
You shouldn't exit the session using `exit `or Ctrl-d, instead you should use `ctrl+a+d` to safely detach without destroying the screen session.
|
|
225
226
|
|
|
227
|
+
Include the following in ~/.screenrc for better scrolling experience
|
|
228
|
+
```
|
|
229
|
+
defscrollback 10000
|
|
230
|
+
termcapinfo xterm* ti@:te@
|
|
231
|
+
```
|
|
232
|
+
|
|
226
233
|
### [Optional] Vs code extension
|
|
227
234
|
|
|
228
235
|
https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw
|
|
@@ -267,7 +274,7 @@ Add `OPENAI_API_KEY` and `OPENAI_ORG_ID` env variables.
|
|
|
267
274
|
|
|
268
275
|
Then run
|
|
269
276
|
|
|
270
|
-
`uvx wcgw
|
|
277
|
+
`uvx wcgw wcgw_local --limit 0.1` # Cost limit $0.1
|
|
271
278
|
|
|
272
279
|
You can now directly write messages or press enter key to open vim for multiline message and text pasting.
|
|
273
280
|
|
|
@@ -277,7 +284,7 @@ Add `ANTHROPIC_API_KEY` env variable.
|
|
|
277
284
|
|
|
278
285
|
Then run
|
|
279
286
|
|
|
280
|
-
`uvx wcgw
|
|
287
|
+
`uvx wcgw wcgw_local --claude`
|
|
281
288
|
|
|
282
289
|
You can now directly write messages or press enter key to open vim for multiline message and text pasting.
|
|
283
290
|
|
|
@@ -55,7 +55,7 @@ wcgw is an MCP server with tightly integrated shell and code editing tools.
|
|
|
55
55
|
- By default it runs in 'wcgw' mode that has no restrictions and full authorisation.
|
|
56
56
|
- More details in [Modes section](#modes)
|
|
57
57
|
- ⚡ **Runs in multiplex terminal** Run `screen -x` to attach to the terminal that the AI runs commands on. See history or interrupt process or interact with the same terminal that AI uses.
|
|
58
|
-
- ⚡ **Automatically load CLAUDE.md** Loads "CLAUDE.md" file in project root and sends as instructions during initialisation. Instructions in a global "~/.wcgw/CLAUDE.md" file are loaded and added along with project specific CLAUDE.md. The file name is case sensitive.
|
|
58
|
+
- ⚡ **Automatically load CLAUDE.md/AGENTS.md** Loads "CLAUDE.md" or "AGENTS.md" file in project root and sends as instructions during initialisation. Instructions in a global "~/.wcgw/CLAUDE.md" or "~/.wcgw/AGENTS.md" file are loaded and added along with project specific CLAUDE.md. The file name is case sensitive. CLAUDE.md is attached if it's present otherwise AGENTS.md is attached.
|
|
59
59
|
|
|
60
60
|
## Top use cases examples
|
|
61
61
|
|
|
@@ -87,7 +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": ["tool", "run", "--python", "3.12", "wcgw
|
|
90
|
+
"args": ["tool", "run", "--python", "3.12", "wcgw"]
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
}
|
|
@@ -98,10 +98,10 @@ Then restart claude app.
|
|
|
98
98
|
_If there's an error in setting up_
|
|
99
99
|
|
|
100
100
|
- If there's an error like "uv ENOENT", make sure `uv` is installed. Then run 'which uv' in the terminal, and use its output in place of "uv" in the configuration.
|
|
101
|
-
- If there's still an issue, check that `uv tool run --python 3.12 wcgw
|
|
101
|
+
- If there's still an issue, check that `uv tool run --python 3.12 wcgw` runs in your terminal. It should have no output and shouldn't exit.
|
|
102
102
|
- Try removing ~/.cache/uv folder
|
|
103
103
|
- Try using `uv` version `0.6.0` for which this tool was tested.
|
|
104
|
-
- Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --python 3.12 wcgw
|
|
104
|
+
- Debug the mcp server using `npx @modelcontextprotocol/inspector@0.1.7 uv tool run --python 3.12 wcgw`
|
|
105
105
|
|
|
106
106
|
### Windows on wsl
|
|
107
107
|
|
|
@@ -116,12 +116,12 @@ Then add or update the claude config file `%APPDATA%\Claude\claude_desktop_confi
|
|
|
116
116
|
"mcpServers": {
|
|
117
117
|
"wcgw": {
|
|
118
118
|
"command": "wsl.exe",
|
|
119
|
-
"args": ["uv", "tool", "run", "--python", "3.12", "wcgw
|
|
119
|
+
"args": ["uv", "tool", "run", "--python", "3.12", "wcgw"]
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
```
|
|
124
|
-
When you encounter an error, execute the command wsl uv --python 3.12 wcgw
|
|
124
|
+
When you encounter an error, execute the command wsl uv --python 3.12 wcgw in command prompt. If you get the `error /bin/bash: line 1: uv: command not found`, it means uv was not installed globally and you need to point to the correct path of uv.
|
|
125
125
|
1. Find where uv is installed:
|
|
126
126
|
```bash
|
|
127
127
|
whereis uv
|
|
@@ -131,7 +131,7 @@ Example output:
|
|
|
131
131
|
|
|
132
132
|
2. Test the full path works:
|
|
133
133
|
```
|
|
134
|
-
wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw
|
|
134
|
+
wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
3. Update the config with the full path:
|
|
@@ -140,7 +140,7 @@ wsl /home/mywsl/.local/bin/uv tool run --python 3.12 wcgw@latest
|
|
|
140
140
|
"mcpServers": {
|
|
141
141
|
"wcgw": {
|
|
142
142
|
"command": "wsl.exe",
|
|
143
|
-
"args": ["/home/mywsl/.local/bin/uv", "tool", "run", "--python", "3.12", "wcgw
|
|
143
|
+
"args": ["/home/mywsl/.local/bin/uv", "tool", "run", "--python", "3.12", "wcgw"]
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
}
|
|
@@ -192,6 +192,12 @@ You can interact with the terminal but beware that the AI might be running in pa
|
|
|
192
192
|
|
|
193
193
|
You shouldn't exit the session using `exit `or Ctrl-d, instead you should use `ctrl+a+d` to safely detach without destroying the screen session.
|
|
194
194
|
|
|
195
|
+
Include the following in ~/.screenrc for better scrolling experience
|
|
196
|
+
```
|
|
197
|
+
defscrollback 10000
|
|
198
|
+
termcapinfo xterm* ti@:te@
|
|
199
|
+
```
|
|
200
|
+
|
|
195
201
|
### [Optional] Vs code extension
|
|
196
202
|
|
|
197
203
|
https://marketplace.visualstudio.com/items?itemName=AmanRusia.wcgw
|
|
@@ -236,7 +242,7 @@ Add `OPENAI_API_KEY` and `OPENAI_ORG_ID` env variables.
|
|
|
236
242
|
|
|
237
243
|
Then run
|
|
238
244
|
|
|
239
|
-
`uvx wcgw
|
|
245
|
+
`uvx wcgw wcgw_local --limit 0.1` # Cost limit $0.1
|
|
240
246
|
|
|
241
247
|
You can now directly write messages or press enter key to open vim for multiline message and text pasting.
|
|
242
248
|
|
|
@@ -246,7 +252,7 @@ Add `ANTHROPIC_API_KEY` env variable.
|
|
|
246
252
|
|
|
247
253
|
Then run
|
|
248
254
|
|
|
249
|
-
`uvx wcgw
|
|
255
|
+
`uvx wcgw wcgw_local --claude`
|
|
250
256
|
|
|
251
257
|
You can now directly write messages or press enter key to open vim for multiline message and text pasting.
|
|
252
258
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
|
|
3
3
|
name = "wcgw"
|
|
4
|
-
version = "5.4.
|
|
4
|
+
version = "5.4.5"
|
|
5
5
|
description = "Shell and coding agent for Claude and other mcp clients"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.11"
|
|
@@ -27,6 +27,7 @@ dependencies = [
|
|
|
27
27
|
"tree-sitter>=0.24.0",
|
|
28
28
|
"tree-sitter-bash>=0.23.3",
|
|
29
29
|
"mcp>=1.7.0",
|
|
30
|
+
"wcmatch>=10.1",
|
|
30
31
|
]
|
|
31
32
|
|
|
32
33
|
[project.urls]
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import base64
|
|
2
|
-
import fnmatch
|
|
3
2
|
import glob
|
|
4
3
|
import json
|
|
5
4
|
import mimetypes
|
|
@@ -29,6 +28,7 @@ from openai.types.chat import (
|
|
|
29
28
|
from pydantic import BaseModel, TypeAdapter, ValidationError
|
|
30
29
|
from syntax_checker import Output as SCOutput
|
|
31
30
|
from syntax_checker import check_syntax as raw_check_syntax
|
|
31
|
+
from wcmatch import glob as wcglob
|
|
32
32
|
|
|
33
33
|
from ..client.bash_state.bash_state import (
|
|
34
34
|
BashState,
|
|
@@ -267,7 +267,7 @@ def initialize(
|
|
|
267
267
|
initial_files, initial_paths_with_ranges, _ = read_files(
|
|
268
268
|
read_files_, coding_max_tokens, noncoding_max_tokens, context
|
|
269
269
|
)
|
|
270
|
-
initial_files_context = f"---\n# Requested files\n{initial_files}\n---\n"
|
|
270
|
+
initial_files_context = f"---\n# Requested files\nHere are the contents of the requested files:\n{initial_files}\n---\n"
|
|
271
271
|
|
|
272
272
|
# Check for global CLAUDE.md and workspace CLAUDE.md
|
|
273
273
|
alignment_context = ""
|
|
@@ -570,8 +570,8 @@ def write_file(
|
|
|
570
570
|
|
|
571
571
|
# Validate using write_if_empty_mode after checking whitelist
|
|
572
572
|
allowed_globs = context.bash_state.write_if_empty_mode.allowed_globs
|
|
573
|
-
if allowed_globs != "all" and not
|
|
574
|
-
|
|
573
|
+
if allowed_globs != "all" and not wcglob.globmatch(
|
|
574
|
+
path_, allowed_globs, flags=wcglob.GLOBSTAR
|
|
575
575
|
):
|
|
576
576
|
return (
|
|
577
577
|
f"Error: updating file {path_} not allowed in current mode. Doesn't match allowed globs: {allowed_globs}",
|
|
@@ -600,7 +600,7 @@ def write_file(
|
|
|
600
600
|
return (
|
|
601
601
|
(
|
|
602
602
|
msg
|
|
603
|
-
+ f"Here's the existing file:\n<
|
|
603
|
+
+ f"Here's the existing file:\n<file-contents-numbered>\n{file_content_str}\n{final_message}\n</file-contents-numbered>"
|
|
604
604
|
),
|
|
605
605
|
{path_: file_ranges},
|
|
606
606
|
)
|
|
@@ -622,7 +622,7 @@ def write_file(
|
|
|
622
622
|
return (
|
|
623
623
|
(
|
|
624
624
|
msg
|
|
625
|
-
+ f"Here's the existing file:\n<
|
|
625
|
+
+ f"Here's the existing file:\n<file-contents-numbered>\n{file_content_str}\n</file-contents-numbered>\n{final_message}"
|
|
626
626
|
),
|
|
627
627
|
{path_: file_ranges},
|
|
628
628
|
)
|
|
@@ -762,8 +762,8 @@ def _do_diff_edit(
|
|
|
762
762
|
|
|
763
763
|
# Validate using file_edit_mode
|
|
764
764
|
allowed_globs = context.bash_state.file_edit_mode.allowed_globs
|
|
765
|
-
if allowed_globs != "all" and not
|
|
766
|
-
|
|
765
|
+
if allowed_globs != "all" and not wcglob.globmatch(
|
|
766
|
+
path_, allowed_globs, flags=wcglob.GLOBSTAR
|
|
767
767
|
):
|
|
768
768
|
raise Exception(
|
|
769
769
|
f"Error: updating file {path_} not allowed in current mode. Doesn't match allowed globs: {allowed_globs}"
|
|
@@ -1201,10 +1201,12 @@ def read_files(
|
|
|
1201
1201
|
noncoding_max_tokens = max(0, noncoding_max_tokens - tokens)
|
|
1202
1202
|
|
|
1203
1203
|
range_formatted = range_format(start_line_num, end_line_num)
|
|
1204
|
-
message +=
|
|
1204
|
+
message += (
|
|
1205
|
+
f'\n<file-contents-numbered path="{file}{range_formatted}">\n{content}\n'
|
|
1206
|
+
)
|
|
1205
1207
|
|
|
1206
1208
|
if not truncated:
|
|
1207
|
-
message += "</
|
|
1209
|
+
message += "</file-contents-numbered>"
|
|
1208
1210
|
|
|
1209
1211
|
# Check if we've hit both token limit
|
|
1210
1212
|
if (
|
|
@@ -64,6 +64,15 @@ wheels = [
|
|
|
64
64
|
{ url = "https://files.pythonhosted.org/packages/a2/ee/3fd29bf416eb4f1c5579cf12bf393ae954099258abd7bde03c4f9716ef6b/autoflake-2.3.1-py3-none-any.whl", hash = "sha256:3ae7495db9084b7b32818b4140e6dc4fc280b712fb414f5b8fe57b0a8e85a840", size = 32483, upload-time = "2024-03-13T03:41:26.969Z" },
|
|
65
65
|
]
|
|
66
66
|
|
|
67
|
+
[[package]]
|
|
68
|
+
name = "bracex"
|
|
69
|
+
version = "2.6"
|
|
70
|
+
source = { registry = "https://pypi.org/simple" }
|
|
71
|
+
sdist = { url = "https://files.pythonhosted.org/packages/63/9a/fec38644694abfaaeca2798b58e276a8e61de49e2e37494ace423395febc/bracex-2.6.tar.gz", hash = "sha256:98f1347cd77e22ee8d967a30ad4e310b233f7754dbf31ff3fceb76145ba47dc7", size = 26642, upload-time = "2025-06-22T19:12:31.254Z" }
|
|
72
|
+
wheels = [
|
|
73
|
+
{ url = "https://files.pythonhosted.org/packages/9d/2a/9186535ce58db529927f6cf5990a849aa9e052eea3e2cfefe20b9e1802da/bracex-2.6-py3-none-any.whl", hash = "sha256:0b0049264e7340b3ec782b5cb99beb325f36c3782a32e36e876452fd49a09952", size = 11508, upload-time = "2025-06-22T19:12:29.781Z" },
|
|
74
|
+
]
|
|
75
|
+
|
|
67
76
|
[[package]]
|
|
68
77
|
name = "certifi"
|
|
69
78
|
version = "2025.4.26"
|
|
@@ -1398,7 +1407,7 @@ wheels = [
|
|
|
1398
1407
|
|
|
1399
1408
|
[[package]]
|
|
1400
1409
|
name = "wcgw"
|
|
1401
|
-
version = "5.4.
|
|
1410
|
+
version = "5.4.5"
|
|
1402
1411
|
source = { editable = "." }
|
|
1403
1412
|
dependencies = [
|
|
1404
1413
|
{ name = "anthropic" },
|
|
@@ -1421,6 +1430,7 @@ dependencies = [
|
|
|
1421
1430
|
{ name = "tree-sitter-bash" },
|
|
1422
1431
|
{ name = "typer" },
|
|
1423
1432
|
{ name = "uvicorn" },
|
|
1433
|
+
{ name = "wcmatch" },
|
|
1424
1434
|
{ name = "websockets" },
|
|
1425
1435
|
]
|
|
1426
1436
|
|
|
@@ -1466,6 +1476,7 @@ requires-dist = [
|
|
|
1466
1476
|
{ name = "tree-sitter-bash", specifier = ">=0.23.3" },
|
|
1467
1477
|
{ name = "typer", specifier = ">=0.12.5" },
|
|
1468
1478
|
{ name = "uvicorn", specifier = ">=0.31.0" },
|
|
1479
|
+
{ name = "wcmatch", specifier = ">=10.1" },
|
|
1469
1480
|
{ name = "websockets", specifier = ">=13.1" },
|
|
1470
1481
|
]
|
|
1471
1482
|
|
|
@@ -1489,6 +1500,18 @@ types = [
|
|
|
1489
1500
|
{ name = "types-toml", specifier = ">=0.10.8.20240310" },
|
|
1490
1501
|
]
|
|
1491
1502
|
|
|
1503
|
+
[[package]]
|
|
1504
|
+
name = "wcmatch"
|
|
1505
|
+
version = "10.1"
|
|
1506
|
+
source = { registry = "https://pypi.org/simple" }
|
|
1507
|
+
dependencies = [
|
|
1508
|
+
{ name = "bracex" },
|
|
1509
|
+
]
|
|
1510
|
+
sdist = { url = "https://files.pythonhosted.org/packages/79/3e/c0bdc27cf06f4e47680bd5803a07cb3dfd17de84cde92dd217dcb9e05253/wcmatch-10.1.tar.gz", hash = "sha256:f11f94208c8c8484a16f4f48638a85d771d9513f4ab3f37595978801cb9465af", size = 117421, upload-time = "2025-06-22T19:14:02.49Z" }
|
|
1511
|
+
wheels = [
|
|
1512
|
+
{ url = "https://files.pythonhosted.org/packages/eb/d8/0d1d2e9d3fabcf5d6840362adcf05f8cf3cd06a73358140c3a97189238ae/wcmatch-10.1-py3-none-any.whl", hash = "sha256:5848ace7dbb0476e5e55ab63c6bbd529745089343427caa5537f230cc01beb8a", size = 39854, upload-time = "2025-06-22T19:14:00.978Z" },
|
|
1513
|
+
]
|
|
1514
|
+
|
|
1492
1515
|
[[package]]
|
|
1493
1516
|
name = "wcwidth"
|
|
1494
1517
|
version = "0.2.13"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|