wcgw 1.0.0__tar.gz → 1.1.0__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-1.0.0 → wcgw-1.1.0}/PKG-INFO +3 -2
- {wcgw-1.0.0 → wcgw-1.1.0}/README.md +1 -1
- {wcgw-1.0.0 → wcgw-1.1.0}/gpt_action_json_schema.json +94 -48
- wcgw-1.1.0/gpt_instructions.txt +86 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/pyproject.toml +2 -1
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/__init__.py +1 -1
- wcgw-1.1.0/src/wcgw/client/__init__.py +0 -0
- wcgw-1.1.0/src/wcgw/client/anthropic_client.py +415 -0
- wcgw-1.1.0/src/wcgw/client/cli.py +40 -0
- wcgw-1.1.0/src/wcgw/client/diff-instructions.txt +44 -0
- wcgw-1.0.0/src/wcgw/client/basic.py → wcgw-1.1.0/src/wcgw/client/openai_client.py +41 -13
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/client/tools.py +223 -105
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/relay/serve.py +22 -71
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/types_.py +26 -0
- wcgw-1.1.0/tests/test_basic.py +71 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/tests/test_tools.py +2 -2
- {wcgw-1.0.0 → wcgw-1.1.0}/uv.lock +21 -1
- wcgw-1.0.0/gpt_instructions.txt +0 -38
- wcgw-1.0.0/src/wcgw/client/claude.py +0 -384
- wcgw-1.0.0/tests/test_basic.py +0 -59
- {wcgw-1.0.0 → wcgw-1.1.0}/.github/workflows/python-publish.yml +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/.github/workflows/python-tests.yml +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/.gitignore +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/.python-version +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/.vscode/settings.json +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/config.toml +0 -0
- /wcgw-1.0.0/src/wcgw/client/openai_adapters.py → /wcgw-1.1.0/src/__init__.py +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/client/__main__.py +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/client/common.py +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/client/openai_utils.py +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/src/wcgw/relay/static/privacy.txt +0 -0
- {wcgw-1.0.0 → wcgw-1.1.0}/static/ss1.png +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: wcgw
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: What could go wrong giving full shell access to chatgpt?
|
|
5
5
|
Project-URL: Homepage, https://github.com/rusiaaman/wcgw
|
|
6
6
|
Author-email: Aman Rusia <gapypi@arcfu.com>
|
|
7
7
|
Requires-Python: <3.13,>=3.10
|
|
8
|
+
Requires-Dist: anthropic>=0.39.0
|
|
8
9
|
Requires-Dist: fastapi>=0.115.0
|
|
9
10
|
Requires-Dist: mypy>=1.11.2
|
|
10
11
|
Requires-Dist: nltk>=3.9.1
|
|
@@ -101,7 +102,7 @@ https://github.com/rusiaaman/wcgw/blob/main/gpt_instructions.txt
|
|
|
101
102
|
https://github.com/rusiaaman/wcgw/blob/main/gpt_action_json_schema.json
|
|
102
103
|
|
|
103
104
|
Run the server
|
|
104
|
-
`gunicorn --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:443 src.relay.serve:app --certfile fullchain.pem --keyfile privkey.pem`
|
|
105
|
+
`gunicorn --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:443 src.wcgw.relay.serve:app --certfile fullchain.pem --keyfile privkey.pem`
|
|
105
106
|
|
|
106
107
|
If you don't have public ip and domain name, you can use `ngrok` or similar services to get a https address to the api.
|
|
107
108
|
|
|
@@ -74,7 +74,7 @@ https://github.com/rusiaaman/wcgw/blob/main/gpt_instructions.txt
|
|
|
74
74
|
https://github.com/rusiaaman/wcgw/blob/main/gpt_action_json_schema.json
|
|
75
75
|
|
|
76
76
|
Run the server
|
|
77
|
-
`gunicorn --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:443 src.relay.serve:app --certfile fullchain.pem --keyfile privkey.pem`
|
|
77
|
+
`gunicorn --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:443 src.wcgw.relay.serve:app --certfile fullchain.pem --keyfile privkey.pem`
|
|
78
78
|
|
|
79
79
|
If you don't have public ip and domain name, you can use `ngrok` or similar services to get a https address to the api.
|
|
80
80
|
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
},
|
|
7
7
|
"servers": [
|
|
8
8
|
{
|
|
9
|
-
"url": "https://
|
|
9
|
+
"url": "https://7d75-103-212-152-58.ngrok-free.app"
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"paths": {
|
|
13
|
-
"/v1/
|
|
13
|
+
"/v1/create_file": {
|
|
14
14
|
"post": {
|
|
15
15
|
"x-openai-isConsequential": false,
|
|
16
|
-
"summary": "
|
|
17
|
-
"operationId": "
|
|
16
|
+
"summary": "Create File",
|
|
17
|
+
"operationId": "create_file_v1_create_file_post",
|
|
18
18
|
"requestBody": {
|
|
19
19
|
"content": {
|
|
20
20
|
"application/json": {
|
|
21
21
|
"schema": {
|
|
22
|
-
"$ref": "#/components/schemas/
|
|
22
|
+
"$ref": "#/components/schemas/CreateFileNewWithUUID"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
},
|
|
@@ -32,7 +32,47 @@
|
|
|
32
32
|
"application/json": {
|
|
33
33
|
"schema": {
|
|
34
34
|
"type": "string",
|
|
35
|
-
"title": "Response
|
|
35
|
+
"title": "Response Create File V1 Create File Post"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"422": {
|
|
41
|
+
"description": "Validation Error",
|
|
42
|
+
"content": {
|
|
43
|
+
"application/json": {
|
|
44
|
+
"schema": {
|
|
45
|
+
"$ref": "#/components/schemas/HTTPValidationError"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"/v1/full_file_edit": {
|
|
54
|
+
"post": {
|
|
55
|
+
"x-openai-isConsequential": false,
|
|
56
|
+
"summary": "File Edit Find Replace",
|
|
57
|
+
"operationId": "file_edit_find_replace_v1_full_file_edit_post",
|
|
58
|
+
"requestBody": {
|
|
59
|
+
"content": {
|
|
60
|
+
"application/json": {
|
|
61
|
+
"schema": {
|
|
62
|
+
"$ref": "#/components/schemas/FullFileEditWithUUID"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": true
|
|
67
|
+
},
|
|
68
|
+
"responses": {
|
|
69
|
+
"200": {
|
|
70
|
+
"description": "Successful Response",
|
|
71
|
+
"content": {
|
|
72
|
+
"application/json": {
|
|
73
|
+
"schema": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"title": "Response File Edit Find Replace V1 Full File Edit Post"
|
|
36
76
|
}
|
|
37
77
|
}
|
|
38
78
|
}
|
|
@@ -255,6 +295,54 @@
|
|
|
255
295
|
],
|
|
256
296
|
"title": "CommandWithUUID"
|
|
257
297
|
},
|
|
298
|
+
"CreateFileNewWithUUID": {
|
|
299
|
+
"properties": {
|
|
300
|
+
"file_path": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"title": "File Path"
|
|
303
|
+
},
|
|
304
|
+
"file_content": {
|
|
305
|
+
"type": "string",
|
|
306
|
+
"title": "File Content"
|
|
307
|
+
},
|
|
308
|
+
"user_id": {
|
|
309
|
+
"type": "string",
|
|
310
|
+
"format": "uuid",
|
|
311
|
+
"title": "User Id"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
"type": "object",
|
|
315
|
+
"required": [
|
|
316
|
+
"file_path",
|
|
317
|
+
"file_content",
|
|
318
|
+
"user_id"
|
|
319
|
+
],
|
|
320
|
+
"title": "CreateFileNewWithUUID"
|
|
321
|
+
},
|
|
322
|
+
"FullFileEditWithUUID": {
|
|
323
|
+
"properties": {
|
|
324
|
+
"file_path": {
|
|
325
|
+
"type": "string",
|
|
326
|
+
"title": "File Path"
|
|
327
|
+
},
|
|
328
|
+
"file_edit_using_searh_replace_blocks": {
|
|
329
|
+
"type": "string",
|
|
330
|
+
"title": "File Edit Using Searh Replace Blocks"
|
|
331
|
+
},
|
|
332
|
+
"user_id": {
|
|
333
|
+
"type": "string",
|
|
334
|
+
"format": "uuid",
|
|
335
|
+
"title": "User Id"
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
"type": "object",
|
|
339
|
+
"required": [
|
|
340
|
+
"file_path",
|
|
341
|
+
"file_edit_using_searh_replace_blocks",
|
|
342
|
+
"user_id"
|
|
343
|
+
],
|
|
344
|
+
"title": "FullFileEditWithUUID"
|
|
345
|
+
},
|
|
258
346
|
"HTTPValidationError": {
|
|
259
347
|
"properties": {
|
|
260
348
|
"detail": {
|
|
@@ -323,48 +411,6 @@
|
|
|
323
411
|
"type"
|
|
324
412
|
],
|
|
325
413
|
"title": "ValidationError"
|
|
326
|
-
},
|
|
327
|
-
"Writefile": {
|
|
328
|
-
"properties": {
|
|
329
|
-
"file_path": {
|
|
330
|
-
"type": "string",
|
|
331
|
-
"title": "File Path"
|
|
332
|
-
},
|
|
333
|
-
"file_content": {
|
|
334
|
-
"type": "string",
|
|
335
|
-
"title": "File Content"
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
"type": "object",
|
|
339
|
-
"required": [
|
|
340
|
-
"file_path",
|
|
341
|
-
"file_content"
|
|
342
|
-
],
|
|
343
|
-
"title": "Writefile"
|
|
344
|
-
},
|
|
345
|
-
"WritefileWithUUID": {
|
|
346
|
-
"properties": {
|
|
347
|
-
"file_path": {
|
|
348
|
-
"type": "string",
|
|
349
|
-
"title": "File Path"
|
|
350
|
-
},
|
|
351
|
-
"file_content": {
|
|
352
|
-
"type": "string",
|
|
353
|
-
"title": "File Content"
|
|
354
|
-
},
|
|
355
|
-
"user_id": {
|
|
356
|
-
"type": "string",
|
|
357
|
-
"format": "uuid",
|
|
358
|
-
"title": "User Id"
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
"type": "object",
|
|
362
|
-
"required": [
|
|
363
|
-
"file_path",
|
|
364
|
-
"file_content",
|
|
365
|
-
"user_id"
|
|
366
|
-
],
|
|
367
|
-
"title": "WritefileWithUUID"
|
|
368
414
|
}
|
|
369
415
|
}
|
|
370
416
|
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
You're a cli assistant.
|
|
2
|
+
|
|
3
|
+
Instructions:
|
|
4
|
+
|
|
5
|
+
- You should use the provided bash execution tool to run script to complete objective.
|
|
6
|
+
- Do not use sudo. Do not use interactive commands.
|
|
7
|
+
- Ask user for confirmation before running anything major
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
To execute bash commands OR write files use the provided api.
|
|
11
|
+
|
|
12
|
+
Instructions for `BashCommand`:
|
|
13
|
+
- Execute a bash command. This is stateful (beware with subsequent calls).
|
|
14
|
+
- Do not use interactive commands like nano. Prefer writing simpler commands.
|
|
15
|
+
- Status of the command and the current working directory will always be returned at the end.
|
|
16
|
+
- Optionally `exit shell has restarted` is the output, in which case environment resets, you can run fresh commands.
|
|
17
|
+
- The first line might be `(...truncated)` if the output is too long.
|
|
18
|
+
|
|
19
|
+
Instructions for `Create File New`
|
|
20
|
+
- Write content to a new file. Provide file path and content. Use this instead of BashCommand for writing new files.
|
|
21
|
+
- This doesn't create any directories, please create directories using `mkdir -p` BashCommand.
|
|
22
|
+
- Provide absolute file path only.
|
|
23
|
+
- For editing existing files, use FullFileEdit.
|
|
24
|
+
|
|
25
|
+
Instructions for `BashInteraction`
|
|
26
|
+
- Interact with running program using this tool
|
|
27
|
+
- Special keys like arrows, interrupts, enter, etc.
|
|
28
|
+
- Send text input to the running program.
|
|
29
|
+
- Only one of send_text, send_specials, send_ascii should be provided.
|
|
30
|
+
|
|
31
|
+
Instructions for `ResetShell`
|
|
32
|
+
- Resets the shell. Use only if all interrupts and prompt reset attempts have failed repeatedly.
|
|
33
|
+
|
|
34
|
+
Instructions for `FullFileEdit`:
|
|
35
|
+
- Use absolute file path only.
|
|
36
|
+
- Use SEARCH/REPLACE blocks to edit the file.
|
|
37
|
+
Only edit the files using the following SEARCH/REPLACE blocks.
|
|
38
|
+
```
|
|
39
|
+
<<<<<<< SEARCH
|
|
40
|
+
=======
|
|
41
|
+
def hello():
|
|
42
|
+
"print a greeting"
|
|
43
|
+
|
|
44
|
+
print("hello")
|
|
45
|
+
>>>>>>> REPLACE
|
|
46
|
+
|
|
47
|
+
<<<<<<< SEARCH
|
|
48
|
+
def hello():
|
|
49
|
+
"print a greeting"
|
|
50
|
+
|
|
51
|
+
print("hello")
|
|
52
|
+
=======
|
|
53
|
+
from hello import hello
|
|
54
|
+
>>>>>>> REPLACE
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
# *SEARCH/REPLACE block* Rules:
|
|
58
|
+
|
|
59
|
+
Every *SEARCH/REPLACE block* must use this format:
|
|
60
|
+
1. The start of search block: <<<<<<< SEARCH
|
|
61
|
+
2. A contiguous chunk of lines to search for in the existing source code
|
|
62
|
+
3. The dividing line: =======
|
|
63
|
+
4. The lines to replace into the source code
|
|
64
|
+
5. The end of the replace block: >>>>>>> REPLACE
|
|
65
|
+
|
|
66
|
+
Use the *FULL* file path, as shown to you by the user.
|
|
67
|
+
|
|
68
|
+
Every *SEARCH* section must *EXACTLY MATCH* the existing file content, character for character, including all comments, docstrings, etc.
|
|
69
|
+
If the file contains code or other data wrapped/escaped in json/xml/quotes or other containers, you need to propose edits to the literal contents of the file, including the container markup.
|
|
70
|
+
|
|
71
|
+
*SEARCH/REPLACE* blocks will *only* replace the first match occurrence.
|
|
72
|
+
Including multiple unique *SEARCH/REPLACE* blocks if needed.
|
|
73
|
+
Include enough lines in each SEARCH section to uniquely match each set of lines that need to change.
|
|
74
|
+
|
|
75
|
+
Keep *SEARCH/REPLACE* blocks concise.
|
|
76
|
+
Break large *SEARCH/REPLACE* blocks into a series of smaller blocks that each change a small portion of the file.
|
|
77
|
+
Include just the changing lines, and a few surrounding lines if needed for uniqueness.
|
|
78
|
+
Do not include long runs of unchanging lines in *SEARCH/REPLACE* blocks.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
Always run `pwd` if you get any file or directory not found error to make sure you're not lost, or to get absolute cwd.
|
|
82
|
+
|
|
83
|
+
Always critically think and debate with yourself to solve the problem. Understand the context and the code by reading as much resources as possible before writing a single piece of code.
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
Ask the user for the user_id `UUID` if they haven't provided in the first message.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
|
|
3
3
|
name = "wcgw"
|
|
4
|
-
version = "1.
|
|
4
|
+
version = "1.1.0"
|
|
5
5
|
description = "What could go wrong giving full shell access to chatgpt?"
|
|
6
6
|
readme = "README.md"
|
|
7
7
|
requires-python = ">=3.10, <3.13"
|
|
@@ -24,6 +24,7 @@ dependencies = [
|
|
|
24
24
|
"pydantic>=2.9.2",
|
|
25
25
|
"semantic-version>=2.10.0",
|
|
26
26
|
"nltk>=3.9.1",
|
|
27
|
+
"anthropic>=0.39.0",
|
|
27
28
|
]
|
|
28
29
|
|
|
29
30
|
[project.urls]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
from .client.
|
|
1
|
+
from .client.cli import app
|
|
2
2
|
from .client.tools import run as listen
|
|
File without changes
|