wcgw 5.1.1__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.

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.1
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>
@@ -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
@@ -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.1.dist-info/METADATA,sha256=L2k3QXK92C7sDStHug9QJo2BwFUkXU4jsOVFWVcv_Fw,14755
34
- wcgw-5.1.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
35
- wcgw-5.1.1.dist-info/entry_points.txt,sha256=UnjK-MAH4Qssh0tGJDMeij1oi-oRKokItkknP_BwShE,94
36
- wcgw-5.1.1.dist-info/licenses/LICENSE,sha256=BvY8xqjOfc3X2qZpGpX3MZEmF-4Dp0LqgKBbT6L_8oI,11142
37
- wcgw-5.1.1.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