Skip to content

Commit

Permalink
Merge pull request #15 from rusiaaman/2.4
Browse files Browse the repository at this point in the history
2.4
  • Loading branch information
rusiaaman authored Dec 21, 2024
2 parents 2254c02 + 0e13edc commit 30212a7
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 68 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
authors = [{ name = "Aman Rusia", email = "[email protected]" }]
name = "wcgw"
version = "2.3.3"
version = "2.4.0"
description = "Shell and coding agent on claude and chatgpt"
readme = "README.md"
requires-python = ">=3.11, <3.13"
Expand Down
11 changes: 6 additions & 5 deletions src/wcgw/client/mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,28 +82,28 @@ async def handle_list_tools() -> list[types.Tool]:
ToolParam(
inputSchema=BashCommand.model_json_schema(),
name="BashCommand",
description="""
description=f"""
- Execute a bash command. This is stateful (beware with subsequent calls).
- Do not use interactive commands like nano. Prefer writing simpler commands.
- Status of the command and the current working directory will always be returned at the end.
- Optionally `exit shell has restarted` is the output, in which case environment resets, you can run fresh commands.
- The first or the last line might be `(...truncated)` if the output is too long.
- Always run `pwd` if you get any file or directory not found error to make sure you're not lost.
- The control will return to you in 3 seconds regardless of the status. For heavy commands, keep checking status using BashInteraction till they are finished.
- The control will return to you in {SLEEP_TIME_MAX_S} seconds regardless of the status. For heavy commands, keep checking status using BashInteraction till they are finished.
- Run long running commands in background using screen instead of "&".
- Use longer wait_for_seconds if the command is expected to run for a long time.
""",
),
ToolParam(
inputSchema=BashInteraction.model_json_schema(),
name="BashInteraction",
description="""
description=f"""
- Interact with running program using this tool
- Special keys like arrows, interrupts, enter, etc.
- Send text input to the running program.
- Send send_specials=["Enter"] to recheck status of a running program.
- Only one of send_text, send_specials, send_ascii should be provided.
- This returns within 3 seconds, for heavy programs keep checking status for upto 10 turns before asking user to continue checking again.
- This returns within {SLEEP_TIME_MAX_S} seconds, for heavy programs keep checking status for upto 10 turns before asking user to continue checking again.
- Programs don't hang easily, so most likely explanation for no output is usually that the program is still running, and you need to check status again using ["Enter"].
- Do not send Ctrl-c before checking for status till 10 minutes or whatever is appropriate for the program to finish.
- Set longer wait_for_seconds when program is expected to run for a long time.
Expand Down Expand Up @@ -273,7 +273,8 @@ async def main(computer_use: bool) -> None:
global COMPUTER_USE_ON_DOCKER_ENABLED

tools.TIMEOUT = SLEEP_TIME_MAX_S

tools.TIMEOUT_WHILE_OUTPUT = 55
tools.OUTPUT_WAIT_PATIENCE = 5
tools.console = tools.DisableConsole()

if computer_use:
Expand Down
Loading

0 comments on commit 30212a7

Please sign in to comment.