wcgw 3.0.4__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.
- {wcgw-3.0.4 → wcgw-3.0.5}/PKG-INFO +1 -1
- {wcgw-3.0.4 → wcgw-3.0.5}/gpt_action_json_schema.json +3 -3
- {wcgw-3.0.4 → wcgw-3.0.5}/pyproject.toml +1 -1
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/bash_state/bash_state.py +7 -7
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/relay/serve.py +1 -1
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/types_.py +2 -2
- {wcgw-3.0.4 → wcgw-3.0.5}/tests/test_mcp_server.py +4 -4
- {wcgw-3.0.4 → wcgw-3.0.5}/tests/test_tools.py +23 -23
- {wcgw-3.0.4 → wcgw-3.0.5}/uv.lock +1 -1
- {wcgw-3.0.4 → wcgw-3.0.5}/.github/workflows/python-publish.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.github/workflows/python-tests.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.github/workflows/python-types.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.gitignore +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.gitmodules +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.python-version +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/.vscode/settings.json +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/Dockerfile +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/LICENSE +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/gpt_instructions.txt +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/openai.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.git +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/main-checks.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/publish-pypi.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/pull-request-checks.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.github/workflows/shared.yml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.gitignore +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/.python-version +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/CODE_OF_CONDUCT.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/CONTRIBUTING.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/LICENSE +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/RELEASE.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/SECURITY.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/.python-version +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/mcp_simple_prompt/server.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-prompt/pyproject.toml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/.python-version +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/mcp_simple_resource/server.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/pyproject.toml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/.python-version +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/README.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/server.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/pyproject.toml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/pyproject.toml +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/session.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/sse.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/client/stdio.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/py.typed +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/models.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/session.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/sse.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/stdio.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/server/websocket.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/context.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/exceptions.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/memory.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/progress.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/session.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/shared/version.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/src/mcp_wcgw/types.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/test_session.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/client/test_stdio.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/conftest.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/test_session.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/server/test_stdio.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/shared/test_memory.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/tests/test_types.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/uv.lock +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/common.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/diff-instructions.txt +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/encoder/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/file_ops/diff_edit.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/file_ops/search_replace.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/mcp_server/Readme.md +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/mcp_server/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/mcp_server/server.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/memory.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/modes.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/repo_ops/display_tree.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/repo_ops/path_prob.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/repo_ops/paths_model.vocab +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/repo_ops/paths_tokens.model +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/repo_ops/repo_context.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/tool_prompts.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/client/tools.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/py.typed +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/relay/client.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw/relay/static/privacy.txt +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/__init__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/__main__.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/anthropic_client.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/cli.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/openai_client.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/src/wcgw_cli/openai_utils.py +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/static/claude-ss.jpg +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/static/computer-use.jpg +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/static/example.jpg +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/static/rocket-icon.png +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/static/ss1.png +0 -0
- {wcgw-3.0.4 → wcgw-3.0.5}/tests/test_edit.py +0 -0
|
@@ -310,7 +310,7 @@
|
|
|
310
310
|
},
|
|
311
311
|
"CommandWithUUID": {
|
|
312
312
|
"properties": {
|
|
313
|
-
"
|
|
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": "
|
|
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
|
-
"
|
|
353
|
+
"action_json",
|
|
354
354
|
"user_id"
|
|
355
355
|
],
|
|
356
356
|
"title": "CommandWithUUID"
|
|
@@ -575,12 +575,12 @@ def get_status(bash_state: BashState) -> str:
|
|
|
575
575
|
|
|
576
576
|
def is_status_check(arg: BashCommand) -> bool:
|
|
577
577
|
return (
|
|
578
|
-
isinstance(arg.
|
|
578
|
+
isinstance(arg.action_json, StatusCheck)
|
|
579
579
|
or (
|
|
580
|
-
isinstance(arg.
|
|
581
|
-
and arg.
|
|
580
|
+
isinstance(arg.action_json, SendSpecials)
|
|
581
|
+
and arg.action_json.send_specials == ["Enter"]
|
|
582
582
|
)
|
|
583
|
-
or (isinstance(arg.
|
|
583
|
+
or (isinstance(arg.action_json, SendAscii) and arg.action_json.send_ascii == [10])
|
|
584
584
|
)
|
|
585
585
|
|
|
586
586
|
|
|
@@ -595,8 +595,8 @@ def execute_bash(
|
|
|
595
595
|
output, cost = _execute_bash(bash_state, enc, bash_arg, max_tokens, timeout_s)
|
|
596
596
|
|
|
597
597
|
# Remove echo if it's a command
|
|
598
|
-
if isinstance(bash_arg.
|
|
599
|
-
command = bash_arg.
|
|
598
|
+
if isinstance(bash_arg.action_json, Command):
|
|
599
|
+
command = bash_arg.action_json.command.strip()
|
|
600
600
|
if output.startswith(command):
|
|
601
601
|
output = output[len(command) :]
|
|
602
602
|
|
|
@@ -614,7 +614,7 @@ def _execute_bash(
|
|
|
614
614
|
) -> tuple[str, float]:
|
|
615
615
|
try:
|
|
616
616
|
is_interrupt = False
|
|
617
|
-
command_data = bash_arg.
|
|
617
|
+
command_data = bash_arg.action_json
|
|
618
618
|
|
|
619
619
|
if isinstance(command_data, Command):
|
|
620
620
|
if bash_state.bash_command_mode.allowed_commands == "none":
|
|
@@ -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
|
-
|
|
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
|
|
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
|
-
|
|
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 "
|
|
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["
|
|
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 = {"
|
|
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", {"
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
)
|
|
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
|
{wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-resource/.python-version
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__init__.py
RENAMED
|
File without changes
|
{wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/__main__.py
RENAMED
|
File without changes
|
{wcgw-3.0.4 → wcgw-3.0.5}/src/mcp_wcgw_fork/examples/servers/simple-tool/mcp_simple_tool/server.py
RENAMED
|
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
|
|
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
|