wcgw 3.0.3__tar.gz → 3.0.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.

Files changed (123) hide show
  1. {wcgw-3.0.3 → wcgw-3.0.5}/PKG-INFO +1 -1
  2. {wcgw-3.0.3 → wcgw-3.0.5}/gpt_action_json_schema.json +3 -3
  3. {wcgw-3.0.3 → wcgw-3.0.5}/pyproject.toml +1 -1
  4. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/bash_state/bash_state.py +7 -17
  5. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/tools.py +5 -3
  6. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/relay/serve.py +1 -1
  7. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/types_.py +2 -2
  8. {wcgw-3.0.3 → wcgw-3.0.5}/tests/test_mcp_server.py +4 -4
  9. {wcgw-3.0.3 → wcgw-3.0.5}/tests/test_tools.py +23 -23
  10. {wcgw-3.0.3 → wcgw-3.0.5}/uv.lock +2 -1
  11. {wcgw-3.0.3 → wcgw-3.0.5}/.github/workflows/python-publish.yml +0 -0
  12. {wcgw-3.0.3 → wcgw-3.0.5}/.github/workflows/python-tests.yml +0 -0
  13. {wcgw-3.0.3 → wcgw-3.0.5}/.github/workflows/python-types.yml +0 -0
  14. {wcgw-3.0.3 → wcgw-3.0.5}/.gitignore +0 -0
  15. {wcgw-3.0.3 → wcgw-3.0.5}/.gitmodules +0 -0
  16. {wcgw-3.0.3 → wcgw-3.0.5}/.python-version +0 -0
  17. {wcgw-3.0.3 → wcgw-3.0.5}/.vscode/settings.json +0 -0
  18. {wcgw-3.0.3 → wcgw-3.0.5}/Dockerfile +0 -0
  19. {wcgw-3.0.3 → wcgw-3.0.5}/LICENSE +0 -0
  20. {wcgw-3.0.3 → wcgw-3.0.5}/README.md +0 -0
  21. {wcgw-3.0.3 → wcgw-3.0.5}/gpt_instructions.txt +0 -0
  22. {wcgw-3.0.3 → wcgw-3.0.5}/openai.md +0 -0
  23. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.git +0 -0
  24. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  25. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  26. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/main-checks.yml +0 -0
  27. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/publish-pypi.yml +0 -0
  28. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/pull-request-checks.yml +0 -0
  29. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/shared.yml +0 -0
  30. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.gitignore +0 -0
  31. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/.python-version +0 -0
  32. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/CODE_OF_CONDUCT.md +0 -0
  33. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/CONTRIBUTING.md +0 -0
  34. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/LICENSE +0 -0
  35. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/README.md +0 -0
  36. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/RELEASE.md +0 -0
  37. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/SECURITY.md +0 -0
  38. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/README.md +0 -0
  39. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/.python-version +0 -0
  40. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/README.md +0 -0
  41. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__init__.py +0 -0
  42. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__main__.py +0 -0
  43. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/server.py +0 -0
  44. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/pyproject.toml +0 -0
  45. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/.python-version +0 -0
  46. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/README.md +0 -0
  47. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__init__.py +0 -0
  48. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__main__.py +0 -0
  49. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/server.py +0 -0
  50. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/pyproject.toml +0 -0
  51. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/.python-version +0 -0
  52. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/README.md +0 -0
  53. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__init__.py +0 -0
  54. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__main__.py +0 -0
  55. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/server.py +0 -0
  56. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/pyproject.toml +0 -0
  57. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/pyproject.toml +0 -0
  58. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/__init__.py +0 -0
  59. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__init__.py +0 -0
  60. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__main__.py +0 -0
  61. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/session.py +0 -0
  62. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/sse.py +0 -0
  63. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/stdio.py +0 -0
  64. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/py.typed +0 -0
  65. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__init__.py +0 -0
  66. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__main__.py +0 -0
  67. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/models.py +0 -0
  68. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/session.py +0 -0
  69. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/sse.py +0 -0
  70. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/stdio.py +0 -0
  71. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/websocket.py +0 -0
  72. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/__init__.py +0 -0
  73. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/context.py +0 -0
  74. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/exceptions.py +0 -0
  75. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/memory.py +0 -0
  76. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/progress.py +0 -0
  77. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/session.py +0 -0
  78. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/version.py +0 -0
  79. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/types.py +0 -0
  80. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/__init__.py +0 -0
  81. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/__init__.py +0 -0
  82. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/test_session.py +0 -0
  83. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/test_stdio.py +0 -0
  84. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/conftest.py +0 -0
  85. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/__init__.py +0 -0
  86. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/test_session.py +0 -0
  87. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/test_stdio.py +0 -0
  88. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/shared/test_memory.py +0 -0
  89. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/test_types.py +0 -0
  90. {wcgw-3.0.3 → wcgw-3.0.5}/src/mcp_wcgw_fork/uv.lock +0 -0
  91. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/__init__.py +0 -0
  92. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/__init__.py +0 -0
  93. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/common.py +0 -0
  94. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/diff-instructions.txt +0 -0
  95. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/encoder/__init__.py +0 -0
  96. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/file_ops/diff_edit.py +0 -0
  97. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/file_ops/search_replace.py +0 -0
  98. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/mcp_server/Readme.md +0 -0
  99. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/mcp_server/__init__.py +0 -0
  100. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/mcp_server/server.py +0 -0
  101. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/memory.py +0 -0
  102. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/modes.py +0 -0
  103. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/repo_ops/display_tree.py +0 -0
  104. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/repo_ops/path_prob.py +0 -0
  105. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/repo_ops/paths_model.vocab +0 -0
  106. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/repo_ops/paths_tokens.model +0 -0
  107. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/repo_ops/repo_context.py +0 -0
  108. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/client/tool_prompts.py +0 -0
  109. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/py.typed +0 -0
  110. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/relay/client.py +0 -0
  111. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw/relay/static/privacy.txt +0 -0
  112. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/__init__.py +0 -0
  113. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/__main__.py +0 -0
  114. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/anthropic_client.py +0 -0
  115. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/cli.py +0 -0
  116. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/openai_client.py +0 -0
  117. {wcgw-3.0.3 → wcgw-3.0.5}/src/wcgw_cli/openai_utils.py +0 -0
  118. {wcgw-3.0.3 → wcgw-3.0.5}/static/claude-ss.jpg +0 -0
  119. {wcgw-3.0.3 → wcgw-3.0.5}/static/computer-use.jpg +0 -0
  120. {wcgw-3.0.3 → wcgw-3.0.5}/static/example.jpg +0 -0
  121. {wcgw-3.0.3 → wcgw-3.0.5}/static/rocket-icon.png +0 -0
  122. {wcgw-3.0.3 → wcgw-3.0.5}/static/ss1.png +0 -0
  123. {wcgw-3.0.3 → wcgw-3.0.5}/tests/test_edit.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 3.0.3
3
+ Version: 3.0.5
4
4
  Summary: Shell and coding agent on claude and chatgpt
5
5
  Project-URL: Homepage, https://github.com/rusiaaman/wcgw
6
6
  Author-email: Aman Rusia <gapypi@arcfu.com>
@@ -310,7 +310,7 @@
310
310
  },
311
311
  "CommandWithUUID": {
312
312
  "properties": {
313
- "action": {
313
+ "action_json": {
314
314
  "anyOf": [
315
315
  {
316
316
  "$ref": "#/components/schemas/Command"
@@ -328,7 +328,7 @@
328
328
  "$ref": "#/components/schemas/SendAscii"
329
329
  }
330
330
  ],
331
- "title": "Action"
331
+ "title": "ActionJson"
332
332
  },
333
333
  "wait_for_seconds": {
334
334
  "anyOf": [
@@ -350,7 +350,7 @@
350
350
  "additionalProperties": false,
351
351
  "type": "object",
352
352
  "required": [
353
- "action",
353
+ "action_json",
354
354
  "user_id"
355
355
  ],
356
356
  "title": "CommandWithUUID"
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
3
3
  name = "wcgw"
4
- version = "3.0.3"
4
+ version = "3.0.5"
5
5
  description = "Shell and coding agent on claude and chatgpt"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.11"
@@ -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.action, StatusCheck)
578
+ isinstance(arg.action_json, StatusCheck)
589
579
  or (
590
- isinstance(arg.action, SendSpecials)
591
- and arg.action.send_specials == ["Enter"]
580
+ isinstance(arg.action_json, SendSpecials)
581
+ and arg.action_json.send_specials == ["Enter"]
592
582
  )
593
- or (isinstance(arg.action, SendAscii) and arg.action.send_ascii == [10])
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.action, Command):
609
- command = bash_arg.action.command.strip()
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.action
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":
@@ -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(arg, relevant_files_data, context.bash_state.serialize())
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:
@@ -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
- action=command.action, wait_for_seconds=command.wait_for_seconds
182
+ action_json=command.action_json, wait_for_seconds=command.wait_for_seconds
183
183
  ),
184
184
  user_id=user_id,
185
185
  )
@@ -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 __post_init__(self) -> None:
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
- action: Command | StatusCheck | SendText | SendSpecials | SendAscii
102
+ action_json: Command | StatusCheck | SendText | SendSpecials | SendAscii
103
103
  wait_for_seconds: Optional[float] = None
104
104
 
105
105
 
@@ -140,10 +140,10 @@ async def test_handle_list_tools():
140
140
  assert properties["initial_files_to_read"]["type"] == "array"
141
141
  elif tool.name == "BashCommand":
142
142
  properties = tool.inputSchema["properties"]
143
- assert "action" in properties
143
+ assert "action_json" in properties
144
144
  assert "wait_for_seconds" in properties
145
145
  # Check type field has all the command types
146
- type_properties = properties["action"]["anyOf"]
146
+ type_properties = properties["action_json"]["anyOf"]
147
147
  type_refs = set(p["$ref"].split("/")[-1] for p in type_properties)
148
148
  required_types = {
149
149
  "Command",
@@ -180,7 +180,7 @@ async def test_handle_call_tool(setup_bash_state):
180
180
  assert "Initialize" in result[0].text
181
181
 
182
182
  # Test JSON string argument handling
183
- json_args = {"action": {"command": "ls"}, "wait_for_seconds": None}
183
+ json_args = {"action_json": {"command": "ls"}, "wait_for_seconds": None}
184
184
  result = await handle_call_tool("BashCommand", json_args)
185
185
  assert isinstance(result, list)
186
186
 
@@ -200,7 +200,7 @@ async def test_handle_call_tool(setup_bash_state):
200
200
  side_effect=Exception("Test error"),
201
201
  ):
202
202
  result = await handle_call_tool(
203
- "BashCommand", {"action": {"command": "ls"}, "wait_for_seconds": None}
203
+ "BashCommand", {"action_json": {"command": "ls"}, "wait_for_seconds": None}
204
204
  )
205
205
  assert "GOT EXCEPTION" in result[0].text
206
206
 
@@ -275,7 +275,7 @@ def test_bash_command(context: Context, temp_dir: str) -> None:
275
275
  get_tool_output(context, init_args, default_enc, 1.0, lambda x, y: ("", 0.0), None)
276
276
 
277
277
  # Test when nothing is running
278
- cmd = BashCommand(action=StatusCheck(status_check=True))
278
+ cmd = BashCommand(action_json=StatusCheck(status_check=True))
279
279
  outputs, _ = get_tool_output(
280
280
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
281
281
  )
@@ -283,14 +283,14 @@ def test_bash_command(context: Context, temp_dir: str) -> None:
283
283
  assert "No running command to check status of" in outputs[0]
284
284
 
285
285
  # Start a command and check status
286
- cmd = BashCommand(action=Command(command="sleep 1"), wait_for_seconds=0.1)
286
+ cmd = BashCommand(action_json=Command(command="sleep 1"), wait_for_seconds=0.1)
287
287
  outputs, _ = get_tool_output(
288
288
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
289
289
  )
290
290
  assert "status = still running" in outputs[0]
291
291
 
292
292
  # Check status while command is running
293
- status_check = BashCommand(action=StatusCheck(status_check=True))
293
+ status_check = BashCommand(action_json=StatusCheck(status_check=True))
294
294
  outputs, _ = get_tool_output(
295
295
  context, status_check, default_enc, 1.0, lambda x, y: ("", 0.0), None
296
296
  )
@@ -298,7 +298,7 @@ def test_bash_command(context: Context, temp_dir: str) -> None:
298
298
  assert "status = process exited" in outputs[0]
299
299
 
300
300
  # Test simple command
301
- cmd = BashCommand(action=Command(command="echo 'hello world'"))
301
+ cmd = BashCommand(action_json=Command(command="echo 'hello world'"))
302
302
  outputs, _ = get_tool_output(
303
303
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
304
304
  )
@@ -321,7 +321,7 @@ def test_interaction_commands(context: Context, temp_dir: str) -> None:
321
321
  get_tool_output(context, init_args, default_enc, 1.0, lambda x, y: ("", 0.0), None)
322
322
 
323
323
  # Test text interaction
324
- cmd = BashCommand(action=SendText(send_text="hello"))
324
+ cmd = BashCommand(action_json=SendText(send_text="hello"))
325
325
  outputs, _ = get_tool_output(
326
326
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
327
327
  )
@@ -329,7 +329,7 @@ def test_interaction_commands(context: Context, temp_dir: str) -> None:
329
329
  assert isinstance(outputs[0], str)
330
330
 
331
331
  # Test special keys
332
- cmd = BashCommand(action=SendSpecials(send_specials=["Enter"]))
332
+ cmd = BashCommand(action_json=SendSpecials(send_specials=["Enter"]))
333
333
  outputs, _ = get_tool_output(
334
334
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
335
335
  )
@@ -338,7 +338,7 @@ def test_interaction_commands(context: Context, temp_dir: str) -> None:
338
338
  assert "status = process exited" in outputs[0]
339
339
 
340
340
  # Send ctrl-c
341
- cmd = BashCommand(action=SendAscii(send_ascii=[3])) # Ctrl-C
341
+ cmd = BashCommand(action_json=SendAscii(send_ascii=[3])) # Ctrl-C
342
342
  outputs, _ = get_tool_output(
343
343
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
344
344
  )
@@ -347,28 +347,28 @@ def test_interaction_commands(context: Context, temp_dir: str) -> None:
347
347
  assert "status = process exited" in outputs[0]
348
348
 
349
349
  # Test interactions with long running command
350
- cmd = BashCommand(action=Command(command="sleep 1"), wait_for_seconds=0.1)
350
+ cmd = BashCommand(action_json=Command(command="sleep 1"), wait_for_seconds=0.1)
351
351
  outputs, _ = get_tool_output(
352
352
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
353
353
  )
354
354
  assert "status = still running" in outputs[0]
355
355
 
356
356
  # Check status with special keys
357
- cmd = BashCommand(action=SendSpecials(send_specials=["Enter"]))
357
+ cmd = BashCommand(action_json=SendSpecials(send_specials=["Enter"]))
358
358
  outputs, _ = get_tool_output(
359
359
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
360
360
  )
361
361
  assert "status = process exited" in outputs[0]
362
362
 
363
363
  # Test interrupting command
364
- cmd = BashCommand(action=Command(command="sleep 1"), wait_for_seconds=0.1)
364
+ cmd = BashCommand(action_json=Command(command="sleep 1"), wait_for_seconds=0.1)
365
365
  outputs, _ = get_tool_output(
366
366
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
367
367
  )
368
368
  assert "status = still running" in outputs[0]
369
369
 
370
370
  # Send Ctrl-C
371
- cmd = BashCommand(action=SendSpecials(send_specials=["Ctrl-c"]))
371
+ cmd = BashCommand(action_json=SendSpecials(send_specials=["Ctrl-c"]))
372
372
  outputs, _ = get_tool_output(
373
373
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
374
374
  )
@@ -553,7 +553,7 @@ def test_reinitialize(context: Context, temp_dir: str) -> None:
553
553
  assert context.bash_state.file_edit_mode.allowed_globs == [temp_dir + "/" + "*.py"]
554
554
 
555
555
  # Verify mode was actually changed by trying a command not in allowed list
556
- cmd = BashCommand(action=Command(command="touch test.txt"))
556
+ cmd = BashCommand(action_json=Command(command="touch test.txt"))
557
557
  outputs, _ = get_tool_output(
558
558
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
559
559
  )
@@ -618,7 +618,7 @@ def test_file_io(context: Context, temp_dir: str) -> None:
618
618
  with open(test_file, "w") as f:
619
619
  f.write("hello world")
620
620
 
621
- cmd = BashCommand(action=Command(command=f"cat {test_file}"))
621
+ cmd = BashCommand(action_json=Command(command=f"cat {test_file}"))
622
622
  outputs, _ = get_tool_output(
623
623
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
624
624
  )
@@ -631,13 +631,13 @@ def test_command_interrupt(context: Context, temp_dir: str) -> None:
631
631
  """Test Ctrl-C interruption."""
632
632
  _test_init(context, temp_dir)
633
633
 
634
- cmd = BashCommand(action=Command(command="sleep 5"), wait_for_seconds=0.1)
634
+ cmd = BashCommand(action_json=Command(command="sleep 5"), wait_for_seconds=0.1)
635
635
  outputs, _ = get_tool_output(
636
636
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
637
637
  )
638
638
  assert "status = still running" in outputs[0]
639
639
 
640
- cmd = BashCommand(action=SendSpecials(send_specials=["Ctrl-c"]))
640
+ cmd = BashCommand(action_json=SendSpecials(send_specials=["Ctrl-c"]))
641
641
  outputs, _ = get_tool_output(
642
642
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
643
643
  )
@@ -648,7 +648,7 @@ def test_command_suspend(context: Context, temp_dir: str) -> None:
648
648
  """Test Ctrl-Z suspension."""
649
649
  _test_init(context, temp_dir)
650
650
 
651
- cmd = BashCommand(action=Command(command="sleep 5"), wait_for_seconds=0.1)
651
+ cmd = BashCommand(action_json=Command(command="sleep 5"), wait_for_seconds=0.1)
652
652
  outputs, _ = get_tool_output(
653
653
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
654
654
  )
@@ -659,16 +659,16 @@ def test_text_input(context: Context, temp_dir: str) -> None:
659
659
  """Test sending text to a program."""
660
660
  _test_init(context, temp_dir)
661
661
 
662
- cmd = BashCommand(action=Command(command="cat"))
662
+ cmd = BashCommand(action_json=Command(command="cat"))
663
663
  get_tool_output(context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None)
664
664
 
665
- cmd = BashCommand(action=SendText(send_text="hello"))
665
+ cmd = BashCommand(action_json=SendText(send_text="hello"))
666
666
  outputs, _ = get_tool_output(
667
667
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
668
668
  )
669
669
  assert "hello" in str(outputs[0])
670
670
 
671
- cmd = BashCommand(action=SendSpecials(send_specials=["Ctrl-d"]))
671
+ cmd = BashCommand(action_json=SendSpecials(send_specials=["Ctrl-d"]))
672
672
  outputs, _ = get_tool_output(
673
673
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
674
674
  )
@@ -679,16 +679,16 @@ def test_ascii_input(context: Context, temp_dir: str) -> None:
679
679
  """Test sending ASCII codes."""
680
680
  _test_init(context, temp_dir)
681
681
 
682
- cmd = BashCommand(action=Command(command="cat"))
682
+ cmd = BashCommand(action_json=Command(command="cat"))
683
683
  get_tool_output(context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None)
684
684
 
685
- cmd = BashCommand(action=SendAscii(send_ascii=[65, 66, 67])) # ABC
685
+ cmd = BashCommand(action_json=SendAscii(send_ascii=[65, 66, 67])) # ABC
686
686
  outputs, _ = get_tool_output(
687
687
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
688
688
  )
689
689
  assert "ABC" in str(outputs[0])
690
690
 
691
- cmd = BashCommand(action=SendAscii(send_ascii=[3])) # Ctrl-C
691
+ cmd = BashCommand(action_json=SendAscii(send_ascii=[3])) # Ctrl-C
692
692
  outputs, _ = get_tool_output(
693
693
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
694
694
  )
@@ -779,7 +779,7 @@ def test_error_cases(context: Context, temp_dir: str) -> None:
779
779
  assert "Success" in outputs[0] # Should succeed as it creates directories
780
780
 
781
781
  # Test invalid bash command
782
- cmd = BashCommand(action=Command(command="nonexistentcommand"))
782
+ cmd = BashCommand(action_json=Command(command="nonexistentcommand"))
783
783
  outputs, _ = get_tool_output(
784
784
  context, cmd, default_enc, 1.0, lambda x, y: ("", 0.0), None
785
785
  )
@@ -1,4 +1,5 @@
1
1
  version = 1
2
+ revision = 1
2
3
  requires-python = ">=3.11"
3
4
 
4
5
  [[package]]
@@ -1178,7 +1179,7 @@ wheels = [
1178
1179
 
1179
1180
  [[package]]
1180
1181
  name = "wcgw"
1181
- version = "3.0.3"
1182
+ version = "3.0.5"
1182
1183
  source = { editable = "." }
1183
1184
  dependencies = [
1184
1185
  { name = "anthropic" },
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