wcgw 2.4.3__tar.gz → 2.5.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.

Files changed (109) hide show
  1. wcgw-2.5.0/LICENSE +243 -0
  2. {wcgw-2.4.3 → wcgw-2.5.0}/PKG-INFO +3 -3
  3. {wcgw-2.4.3 → wcgw-2.5.0}/gpt_action_json_schema.json +44 -42
  4. {wcgw-2.4.3 → wcgw-2.5.0}/gpt_instructions.txt +3 -4
  5. {wcgw-2.4.3 → wcgw-2.5.0}/pyproject.toml +2 -3
  6. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/anthropic_client.py +7 -17
  7. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/common.py +3 -1
  8. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/mcp_server/server.py +7 -7
  9. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/openai_client.py +6 -9
  10. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/openai_utils.py +5 -5
  11. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/tools.py +159 -83
  12. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/relay/serve.py +3 -3
  13. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/types_.py +3 -3
  14. {wcgw-2.4.3 → wcgw-2.5.0}/uv.lock +75 -63
  15. {wcgw-2.4.3 → wcgw-2.5.0}/.github/workflows/python-publish.yml +0 -0
  16. {wcgw-2.4.3 → wcgw-2.5.0}/.github/workflows/python-tests.yml +0 -0
  17. {wcgw-2.4.3 → wcgw-2.5.0}/.github/workflows/python-types.yml +0 -0
  18. {wcgw-2.4.3 → wcgw-2.5.0}/.gitignore +0 -0
  19. {wcgw-2.4.3 → wcgw-2.5.0}/.gitmodules +0 -0
  20. {wcgw-2.4.3 → wcgw-2.5.0}/.python-version +0 -0
  21. {wcgw-2.4.3 → wcgw-2.5.0}/.vscode/settings.json +0 -0
  22. {wcgw-2.4.3 → wcgw-2.5.0}/README.md +0 -0
  23. {wcgw-2.4.3 → wcgw-2.5.0}/openai.md +0 -0
  24. {wcgw-2.4.3 → wcgw-2.5.0}/src/__init__.py +0 -0
  25. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.git +0 -0
  26. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  27. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  28. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/workflows/main-checks.yml +0 -0
  29. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/workflows/publish-pypi.yml +0 -0
  30. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/workflows/pull-request-checks.yml +0 -0
  31. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.github/workflows/shared.yml +0 -0
  32. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.gitignore +0 -0
  33. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/.python-version +0 -0
  34. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/CODE_OF_CONDUCT.md +0 -0
  35. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/CONTRIBUTING.md +0 -0
  36. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/LICENSE +0 -0
  37. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/README.md +0 -0
  38. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/RELEASE.md +0 -0
  39. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/SECURITY.md +0 -0
  40. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/README.md +0 -0
  41. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/.python-version +0 -0
  42. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/README.md +0 -0
  43. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/mcp_simple_prompt/__init__.py +0 -0
  44. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/mcp_simple_prompt/__main__.py +0 -0
  45. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/mcp_simple_prompt/server.py +0 -0
  46. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-prompt/pyproject.toml +0 -0
  47. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/.python-version +0 -0
  48. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/README.md +0 -0
  49. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/mcp_simple_resource/__init__.py +0 -0
  50. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/mcp_simple_resource/__main__.py +0 -0
  51. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/mcp_simple_resource/server.py +0 -0
  52. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-resource/pyproject.toml +0 -0
  53. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/.python-version +0 -0
  54. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/README.md +0 -0
  55. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/mcp_simple_tool/__init__.py +0 -0
  56. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/mcp_simple_tool/__main__.py +0 -0
  57. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/mcp_simple_tool/server.py +0 -0
  58. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/examples/servers/simple-tool/pyproject.toml +0 -0
  59. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/pyproject.toml +0 -0
  60. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/__init__.py +0 -0
  61. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/client/__init__.py +0 -0
  62. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/client/__main__.py +0 -0
  63. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/client/session.py +0 -0
  64. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/client/sse.py +0 -0
  65. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/client/stdio.py +0 -0
  66. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/py.typed +0 -0
  67. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/__init__.py +0 -0
  68. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/__main__.py +0 -0
  69. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/models.py +0 -0
  70. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/session.py +0 -0
  71. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/sse.py +0 -0
  72. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/stdio.py +0 -0
  73. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/server/websocket.py +0 -0
  74. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/__init__.py +0 -0
  75. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/context.py +0 -0
  76. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/exceptions.py +0 -0
  77. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/memory.py +0 -0
  78. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/progress.py +0 -0
  79. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/session.py +0 -0
  80. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/shared/version.py +0 -0
  81. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/src/mcp_wcgw/types.py +0 -0
  82. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/__init__.py +0 -0
  83. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/client/__init__.py +0 -0
  84. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/client/test_session.py +0 -0
  85. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/client/test_stdio.py +0 -0
  86. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/conftest.py +0 -0
  87. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/server/__init__.py +0 -0
  88. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/server/test_session.py +0 -0
  89. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/server/test_stdio.py +0 -0
  90. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/shared/test_memory.py +0 -0
  91. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/tests/test_types.py +0 -0
  92. {wcgw-2.4.3 → wcgw-2.5.0}/src/mcp_wcgw/uv.lock +0 -0
  93. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/__init__.py +0 -0
  94. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/__init__.py +0 -0
  95. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/__main__.py +0 -0
  96. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/cli.py +0 -0
  97. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/computer_use.py +0 -0
  98. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/diff-instructions.txt +0 -0
  99. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/mcp_server/Readme.md +0 -0
  100. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/mcp_server/__init__.py +0 -0
  101. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/client/sys_utils.py +0 -0
  102. {wcgw-2.4.3 → wcgw-2.5.0}/src/wcgw/relay/static/privacy.txt +0 -0
  103. {wcgw-2.4.3 → wcgw-2.5.0}/static/claude-ss.jpg +0 -0
  104. {wcgw-2.4.3 → wcgw-2.5.0}/static/computer-use.jpg +0 -0
  105. {wcgw-2.4.3 → wcgw-2.5.0}/static/example.jpg +0 -0
  106. {wcgw-2.4.3 → wcgw-2.5.0}/static/rocket-icon.png +0 -0
  107. {wcgw-2.4.3 → wcgw-2.5.0}/static/ss1.png +0 -0
  108. {wcgw-2.4.3 → wcgw-2.5.0}/tests/test_basic.py +0 -0
  109. {wcgw-2.4.3 → wcgw-2.5.0}/tests/test_tools.py +0 -0
wcgw-2.5.0/LICENSE ADDED
@@ -0,0 +1,243 @@
1
+ The majority of this software is licensed under the MIT License.
2
+ Portions of this software include code licensed under the Apache License, Version 2.0.
3
+
4
+ --------------------------------------------------------------------------------
5
+ MIT License (Primary License)
6
+ --------------------------------------------------------------------------------
7
+
8
+ Copyright (c) 2024 arusia
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ --------------------------------------------------------------------------------
29
+ Third Party Components
30
+ --------------------------------------------------------------------------------
31
+
32
+ This project includes components from the following third-party projects:
33
+
34
+ 1. The file at src/wcgw/client/diff-instructions.txt is substantially modified from Aider
35
+ Source: https://github.com/Aider-AI/aider
36
+ Original Copyright (c) 2023 Aider-AI
37
+ Licensed under the Apache License, Version 2.0
38
+ Modified version Copyright (c) 2024 arusia
39
+
40
+ The full text of the Apache License 2.0 follows:
41
+
42
+ --------------------------------------------------------------------------------
43
+ Apache License
44
+ Version 2.0, January 2004
45
+ http://www.apache.org/licenses/
46
+
47
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
48
+
49
+ 1. Definitions.
50
+
51
+ "License" shall mean the terms and conditions for use, reproduction,
52
+ and distribution as defined by Sections 1 through 9 of this document.
53
+
54
+ "Licensor" shall mean the copyright owner or entity authorized by
55
+ the copyright owner that is granting the License.
56
+
57
+ "Legal Entity" shall mean the union of the acting entity and all
58
+ other entities that control, are controlled by, or are under common
59
+ control with that entity. For the purposes of this definition,
60
+ "control" means (i) the power, direct or indirect, to cause the
61
+ direction or management of such entity, whether by contract or
62
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
63
+ outstanding shares, or (iii) beneficial ownership of such entity.
64
+
65
+ "You" (or "Your") shall mean an individual or Legal Entity
66
+ exercising permissions granted by this License.
67
+
68
+ "Source" form shall mean the preferred form for making modifications,
69
+ including but not limited to software source code, documentation
70
+ source, and configuration files.
71
+
72
+ "Object" form shall mean any form resulting from mechanical
73
+ transformation or translation of a Source form, including but
74
+ not limited to compiled object code, generated documentation,
75
+ and conversions to other media types.
76
+
77
+ "Work" shall mean the work of authorship, whether in Source or
78
+ Object form, made available under the License, as indicated by a
79
+ copyright notice that is included in or attached to the work
80
+ (an example is provided in the Appendix below).
81
+
82
+ "Derivative Works" shall mean any work, whether in Source or Object
83
+ form, that is based on (or derived from) the Work and for which the
84
+ editorial revisions, annotations, elaborations, or other modifications
85
+ represent, as a whole, an original work of authorship. For the purposes
86
+ of this License, Derivative Works shall not include works that remain
87
+ separable from, or merely link (or bind by name) to the interfaces of,
88
+ the Work and Derivative Works thereof.
89
+
90
+ "Contribution" shall mean any work of authorship, including
91
+ the original version of the Work and any modifications or additions
92
+ to that Work or Derivative Works thereof, that is intentionally
93
+ submitted to Licensor for inclusion in the Work by the copyright owner
94
+ or by an individual or Legal Entity authorized to submit on behalf of
95
+ the copyright owner. For the purposes of this definition, "submitted"
96
+ means any form of electronic, verbal, or written communication sent
97
+ to the Licensor or its representatives, including but not limited to
98
+ communication on electronic mailing lists, source code control systems,
99
+ and issue tracking systems that are managed by, or on behalf of, the
100
+ Licensor for the purpose of discussing and improving the Work, but
101
+ excluding communication that is conspicuously marked or otherwise
102
+ designated in writing by the copyright owner as "Not a Contribution."
103
+
104
+ "Contributor" shall mean Licensor and any individual or Legal Entity
105
+ on behalf of whom a Contribution has been received by Licensor and
106
+ subsequently incorporated within the Work.
107
+
108
+ 2. Grant of Copyright License. Subject to the terms and conditions of
109
+ this License, each Contributor hereby grants to You a perpetual,
110
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
111
+ copyright license to reproduce, prepare Derivative Works of,
112
+ publicly display, publicly perform, sublicense, and distribute the
113
+ Work and such Derivative Works in Source or Object form.
114
+
115
+ 3. Grant of Patent License. Subject to the terms and conditions of
116
+ this License, each Contributor hereby grants to You a perpetual,
117
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
118
+ (except as stated in this section) patent license to make, have made,
119
+ use, offer to sell, sell, import, and otherwise transfer the Work,
120
+ where such license applies only to those patent claims licensable
121
+ by such Contributor that are necessarily infringed by their
122
+ Contribution(s) alone or by combination of their Contribution(s)
123
+ with the Work to which such Contribution(s) was submitted. If You
124
+ institute patent litigation against any entity (including a
125
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
126
+ or a Contribution incorporated within the Work constitutes direct
127
+ or contributory patent infringement, then any patent licenses
128
+ granted to You under this License for that Work shall terminate
129
+ as of the date such litigation is filed.
130
+
131
+ 4. Redistribution. You may reproduce and distribute copies of the
132
+ Work or Derivative Works thereof in any medium, with or without
133
+ modifications, and in Source or Object form, provided that You
134
+ meet the following conditions:
135
+
136
+ (a) You must give any other recipients of the Work or
137
+ Derivative Works a copy of this License; and
138
+
139
+ (b) You must cause any modified files to carry prominent notices
140
+ stating that You changed the files; and
141
+
142
+ (c) You must retain, in the Source form of any Derivative Works
143
+ that You distribute, all copyright, patent, trademark, and
144
+ attribution notices from the Source form of the Work,
145
+ excluding those notices that do not pertain to any part of
146
+ the Derivative Works; and
147
+
148
+ (d) If the Work includes a "NOTICE" text file as part of its
149
+ distribution, then any Derivative Works that You distribute must
150
+ include a readable copy of the attribution notices contained
151
+ within such NOTICE file, excluding those notices that do not
152
+ pertain to any part of the Derivative Works, in at least one
153
+ of the following places: within a NOTICE text file distributed
154
+ as part of the Derivative Works; within the Source form or
155
+ documentation, if provided along with the Derivative Works; or,
156
+ within a display generated by the Derivative Works, if and
157
+ wherever such third-party notices normally appear. The contents
158
+ of the NOTICE file are for informational purposes only and
159
+ do not modify the License. You may add Your own attribution
160
+ notices within Derivative Works that You distribute, alongside
161
+ or as an addendum to the NOTICE text from the Work, provided
162
+ that such additional attribution notices cannot be construed
163
+ as modifying the License.
164
+
165
+ You may add Your own copyright statement to Your modifications and
166
+ may provide additional or different license terms and conditions
167
+ for use, reproduction, or distribution of Your modifications, or
168
+ for any such Derivative Works as a whole, provided Your use,
169
+ reproduction, and distribution of the Work otherwise complies with
170
+ the conditions stated in this License.
171
+
172
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
173
+ any Contribution intentionally submitted for inclusion in the Work
174
+ by You to the Licensor shall be under the terms and conditions of
175
+ this License, without any additional terms or conditions.
176
+ Notwithstanding the above, nothing herein shall supersede or modify
177
+ the terms of any separate license agreement you may have executed
178
+ with Licensor regarding such Contributions.
179
+
180
+ 6. Trademarks. This License does not grant permission to use the trade
181
+ names, trademarks, service marks, or product names of the Licensor,
182
+ except as required for reasonable and customary use in describing the
183
+ origin of the Work and reproducing the content of the NOTICE file.
184
+
185
+ 7. Disclaimer of Warranty. Unless required by applicable law or
186
+ agreed to in writing, Licensor provides the Work (and each
187
+ Contributor provides its Contributions) on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
189
+ implied, including, without limitation, any warranties or conditions
190
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
191
+ PARTICULAR PURPOSE. You are solely responsible for determining the
192
+ appropriateness of using or redistributing the Work and assume any
193
+ risks associated with Your exercise of permissions under this License.
194
+
195
+ 8. Limitation of Liability. In no event and under no legal theory,
196
+ whether in tort (including negligence), contract, or otherwise,
197
+ unless required by applicable law (such as deliberate and grossly
198
+ negligent acts) or agreed to in writing, shall any Contributor be
199
+ liable to You for damages, including any direct, indirect, special,
200
+ incidental, or consequential damages of any character arising as a
201
+ result of this License or out of the use or inability to use the
202
+ Work (including but not limited to damages for loss of goodwill,
203
+ work stoppage, computer failure or malfunction, or any and all
204
+ other commercial damages or losses), even if such Contributor
205
+ has been advised of the possibility of such damages.
206
+
207
+ 9. Accepting Warranty or Additional Liability. While redistributing
208
+ the Work or Derivative Works thereof, You may choose to offer,
209
+ and charge a fee for, acceptance of support, warranty, indemnity,
210
+ or other liability obligations and/or rights consistent with this
211
+ License. However, in accepting such obligations, You may act only
212
+ on Your own behalf and on Your sole responsibility, not on behalf
213
+ of any other Contributor, and only if You agree to indemnify,
214
+ defend, and hold each Contributor harmless for any liability
215
+ incurred by, or claims asserted against, such Contributor by reason
216
+ of your accepting any such warranty or additional liability.
217
+
218
+ END OF TERMS AND CONDITIONS
219
+
220
+ APPENDIX: How to apply the Apache License to your work.
221
+
222
+ To apply the Apache License to your work, attach the following
223
+ boilerplate notice, with the fields enclosed by brackets "[]"
224
+ replaced with your own identifying information. (Don't include
225
+ the brackets!) The text should be enclosed in the appropriate
226
+ comment syntax for the file format. We also recommend that a
227
+ file or class name and description of purpose be included on the
228
+ same "printed page" as the copyright notice for easier
229
+ identification within third-party archives.
230
+
231
+ Copyright [yyyy] [name of copyright owner]
232
+
233
+ Licensed under the Apache License, Version 2.0 (the "License");
234
+ you may not use this file except in compliance with the License.
235
+ You may obtain a copy of the License at
236
+
237
+ http://www.apache.org/licenses/LICENSE-2.0
238
+
239
+ Unless required by applicable law or agreed to in writing, software
240
+ distributed under the License is distributed on an "AS IS" BASIS,
241
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242
+ See the License for the specific language governing permissions and
243
+ limitations under the License.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 2.4.3
3
+ Version: 2.5.0
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>
7
+ License-File: LICENSE
7
8
  Requires-Python: <3.13,>=3.11
8
9
  Requires-Dist: anthropic>=0.39.0
9
10
  Requires-Dist: fastapi>=0.115.0
10
- Requires-Dist: humanize>=4.11.0
11
11
  Requires-Dist: openai>=1.46.0
12
12
  Requires-Dist: petname>=2.6
13
13
  Requires-Dist: pexpect>=4.9.0
@@ -18,7 +18,7 @@ Requires-Dist: rich>=13.8.1
18
18
  Requires-Dist: semantic-version>=2.10.0
19
19
  Requires-Dist: shell>=1.0.1
20
20
  Requires-Dist: syntax-checker==0.2.10
21
- Requires-Dist: tiktoken==0.7.0
21
+ Requires-Dist: tokenizers>=0.21.0
22
22
  Requires-Dist: toml>=0.10.2
23
23
  Requires-Dist: typer>=0.12.5
24
24
  Requires-Dist: types-pexpect>=4.9.0.20240806
@@ -6,7 +6,7 @@
6
6
  },
7
7
  "servers": [
8
8
  {
9
- "url": "https://a0e8-125-99-67-222.ngrok-free.app"
9
+ "url": "https://04df-103-212-152-58.ngrok-free.app"
10
10
  }
11
11
  ],
12
12
  "paths": {
@@ -297,9 +297,6 @@
297
297
  "properties": {
298
298
  "type": {
299
299
  "type": "string",
300
- "enum": [
301
- "BashInteraction"
302
- ],
303
300
  "const": "BashInteraction",
304
301
  "title": "Type"
305
302
  },
@@ -352,6 +349,17 @@
352
349
  ],
353
350
  "title": "Send Ascii"
354
351
  },
352
+ "wait_for_seconds": {
353
+ "anyOf": [
354
+ {
355
+ "type": "integer"
356
+ },
357
+ {
358
+ "type": "null"
359
+ }
360
+ ],
361
+ "title": "Wait For Seconds"
362
+ },
355
363
  "user_id": {
356
364
  "type": "string",
357
365
  "format": "uuid",
@@ -384,30 +392,6 @@
384
392
  ],
385
393
  "title": "CommandWithUUID"
386
394
  },
387
- "WriteIfEmptyWithUUID": {
388
- "properties": {
389
- "file_path": {
390
- "type": "string",
391
- "title": "File Path"
392
- },
393
- "file_content": {
394
- "type": "string",
395
- "title": "File Content"
396
- },
397
- "user_id": {
398
- "type": "string",
399
- "format": "uuid",
400
- "title": "User Id"
401
- }
402
- },
403
- "type": "object",
404
- "required": [
405
- "file_path",
406
- "file_content",
407
- "user_id"
408
- ],
409
- "title": "WriteIfEmptyWithUUID"
410
- },
411
395
  "FileEditWithUUID": {
412
396
  "properties": {
413
397
  "file_path": {
@@ -449,9 +433,6 @@
449
433
  "properties": {
450
434
  "type": {
451
435
  "type": "string",
452
- "enum": [
453
- "Initialize"
454
- ],
455
436
  "const": "Initialize",
456
437
  "title": "Type"
457
438
  },
@@ -470,16 +451,16 @@
470
451
  },
471
452
  "ReadFileWithUUID": {
472
453
  "properties": {
473
- "file_path": {
474
- "type": "string",
475
- "title": "File Path"
454
+ "file_paths": {
455
+ "items": {
456
+ "type": "string"
457
+ },
458
+ "type": "array",
459
+ "title": "File Paths"
476
460
  },
477
461
  "type": {
478
462
  "type": "string",
479
- "enum": [
480
- "ReadFile"
481
- ],
482
- "const": "ReadFile",
463
+ "const": "ReadFiles",
483
464
  "title": "Type"
484
465
  },
485
466
  "user_id": {
@@ -490,7 +471,7 @@
490
471
  },
491
472
  "type": "object",
492
473
  "required": [
493
- "file_path",
474
+ "file_paths",
494
475
  "type",
495
476
  "user_id"
496
477
  ],
@@ -500,9 +481,6 @@
500
481
  "properties": {
501
482
  "should_reset": {
502
483
  "type": "boolean",
503
- "enum": [
504
- true
505
- ],
506
484
  "const": true,
507
485
  "title": "Should Reset"
508
486
  },
@@ -551,6 +529,30 @@
551
529
  "type"
552
530
  ],
553
531
  "title": "ValidationError"
532
+ },
533
+ "WriteIfEmptyWithUUID": {
534
+ "properties": {
535
+ "file_path": {
536
+ "type": "string",
537
+ "title": "File Path"
538
+ },
539
+ "file_content": {
540
+ "type": "string",
541
+ "title": "File Content"
542
+ },
543
+ "user_id": {
544
+ "type": "string",
545
+ "format": "uuid",
546
+ "title": "User Id"
547
+ }
548
+ },
549
+ "type": "object",
550
+ "required": [
551
+ "file_path",
552
+ "file_content",
553
+ "user_id"
554
+ ],
555
+ "title": "WriteIfEmptyWithUUID"
554
556
  }
555
557
  }
556
558
  }
@@ -20,10 +20,9 @@ Instructions for `BashCommand`:
20
20
  - The control will return to you in 5 seconds regardless of the status. For heavy commands, keep checking status using BashInteraction till they are finished.
21
21
  - Run long running commands in background using screen instead of "&".
22
22
 
23
- Instructions for `Read File`
24
- - Read full content of a file.
25
- - Provide absolute file path only.
26
- - Use this instead of 'cat' from BashCommand
23
+ Instructions for `Read Files`
24
+ - Read full file content of one or more files.
25
+ - Provide absolute file paths only
27
26
 
28
27
  Instructions for `Write if Empty`
29
28
  - Write content to an empty or non-existent file. Provide file path and content. Use this instead of BashCommand for writing new files.
@@ -1,7 +1,7 @@
1
1
  [project]
2
2
  authors = [{ name = "Aman Rusia", email = "gapypi@arcfu.com" }]
3
3
  name = "wcgw"
4
- version = "2.4.3"
4
+ version = "2.5.0"
5
5
  description = "Shell and coding agent on claude and chatgpt"
6
6
  readme = "README.md"
7
7
  requires-python = ">=3.11, <3.13"
@@ -10,7 +10,6 @@ dependencies = [
10
10
  "typer>=0.12.5",
11
11
  "rich>=13.8.1",
12
12
  "python-dotenv>=1.0.1",
13
- "tiktoken==0.7.0",
14
13
  "pexpect>=4.9.0",
15
14
  "shell>=1.0.1",
16
15
  "types-pexpect>=4.9.0.20240806",
@@ -23,8 +22,8 @@ dependencies = [
23
22
  "pydantic>=2.9.2",
24
23
  "semantic-version>=2.10.0",
25
24
  "anthropic>=0.39.0",
26
- "humanize>=4.11.0",
27
25
  "syntax-checker==0.2.10",
26
+ "tokenizers>=0.21.0",
28
27
  ]
29
28
 
30
29
  [project.urls]
@@ -29,7 +29,7 @@ from ..types_ import (
29
29
  FileEdit,
30
30
  Keyboard,
31
31
  Mouse,
32
- ReadFile,
32
+ ReadFiles,
33
33
  ReadImage,
34
34
  ResetShell,
35
35
  ScreenShot,
@@ -41,12 +41,7 @@ from .common import CostData
41
41
  from .tools import ImageData
42
42
  from .computer_use import Computer
43
43
 
44
- from .tools import (
45
- DoneFlag,
46
- get_tool_output,
47
- which_tool_name,
48
- )
49
- import tiktoken
44
+ from .tools import DoneFlag, get_tool_output, which_tool_name, default_enc
50
45
 
51
46
  from urllib import parse
52
47
  import subprocess
@@ -156,10 +151,6 @@ def loop(
156
151
 
157
152
  limit = 1
158
153
 
159
- enc = tiktoken.encoding_for_model(
160
- "gpt-4o-2024-08-06",
161
- )
162
-
163
154
  tools = [
164
155
  ToolParam(
165
156
  input_schema=BashCommand.model_json_schema(),
@@ -192,12 +183,11 @@ def loop(
192
183
  """,
193
184
  ),
194
185
  ToolParam(
195
- input_schema=ReadFile.model_json_schema(),
196
- name="ReadFile",
186
+ input_schema=ReadFiles.model_json_schema(),
187
+ name="ReadFiles",
197
188
  description="""
198
- - Read full file content
199
- - Provide absolute file path only
200
- - Use this instead of 'cat' from BashCommand
189
+ - Read full file content of one or more files.
190
+ - Provide absolute file paths only
201
191
  """,
202
192
  ),
203
193
  ToolParam(
@@ -451,7 +441,7 @@ System information:
451
441
  try:
452
442
  output_or_dones, _ = get_tool_output(
453
443
  tool_parsed,
454
- enc,
444
+ default_enc,
455
445
  limit - cost,
456
446
  loop,
457
447
  max_tokens=8000,
@@ -38,7 +38,9 @@ def discard_input() -> None:
38
38
  while True:
39
39
  # Check if there is input to be read
40
40
  if sys.stdin in select.select([sys.stdin], [], [], 0)[0]:
41
- sys.stdin.read(1) # Read one character at a time to flush the input buffer
41
+ sys.stdin.read(
42
+ 1
43
+ ) # Read one character at a time to flush the input buffer
42
44
  else:
43
45
  break
44
46
  finally:
@@ -21,7 +21,7 @@ from ...types_ import (
21
21
  FileEdit,
22
22
  Keyboard,
23
23
  Mouse,
24
- ReadFile,
24
+ ReadFiles,
25
25
  ReadImage,
26
26
  ResetShell,
27
27
  Initialize,
@@ -76,7 +76,7 @@ async def handle_list_tools() -> list[types.Tool]:
76
76
  inputSchema=Initialize.model_json_schema(),
77
77
  name="Initialize",
78
78
  description="""
79
- - Always call this at the start of the conversation before anything else.
79
+ - Always call this at the start of the conversation before using any of the shell tools from wcgw.
80
80
  """,
81
81
  ),
82
82
  ToolParam(
@@ -92,6 +92,7 @@ async def handle_list_tools() -> list[types.Tool]:
92
92
  - 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.
93
93
  - Run long running commands in background using screen instead of "&".
94
94
  - Use longer wait_for_seconds if the command is expected to run for a long time.
95
+ - Do not use 'cat' to read files, use ReadFiles tool instead.
95
96
  """,
96
97
  ),
97
98
  ToolParam(
@@ -110,12 +111,11 @@ async def handle_list_tools() -> list[types.Tool]:
110
111
  """,
111
112
  ),
112
113
  ToolParam(
113
- inputSchema=ReadFile.model_json_schema(),
114
- name="ReadFile",
114
+ inputSchema=ReadFiles.model_json_schema(),
115
+ name="ReadFiles",
115
116
  description="""
116
- - Read full file content
117
- - Provide absolute file path only
118
- - Use this instead of 'cat' from BashCommand
117
+ - Read full file content of one or more files.
118
+ - Provide absolute file paths only
119
119
  """,
120
120
  ),
121
121
  ToolParam(
@@ -17,6 +17,7 @@ from openai.types.chat import (
17
17
  )
18
18
  import rich
19
19
  import petname # type: ignore[import-untyped]
20
+ import tokenizers # type: ignore[import-untyped]
20
21
  from typer import Typer
21
22
  import uuid
22
23
 
@@ -26,7 +27,7 @@ from ..types_ import (
26
27
  WriteIfEmpty,
27
28
  FileEdit,
28
29
  ReadImage,
29
- ReadFile,
30
+ ReadFiles,
30
31
  ResetShell,
31
32
  )
32
33
 
@@ -40,7 +41,6 @@ from .tools import (
40
41
  get_tool_output,
41
42
  which_tool,
42
43
  )
43
- import tiktoken
44
44
 
45
45
  from urllib import parse
46
46
  import subprocess
@@ -160,9 +160,7 @@ def loop(
160
160
  config.cost_limit = limit
161
161
  limit = config.cost_limit
162
162
 
163
- enc = tiktoken.encoding_for_model(
164
- config.model if not config.model.startswith("o1") else "gpt-4o"
165
- )
163
+ enc = tokenizers.Tokenizer.from_pretrained("Xenova/gpt-4o")
166
164
 
167
165
  tools = [
168
166
  openai.pydantic_function_tool(
@@ -188,11 +186,10 @@ def loop(
188
186
  - Only one of send_text, send_specials, send_ascii should be provided.""",
189
187
  ),
190
188
  openai.pydantic_function_tool(
191
- ReadFile,
189
+ ReadFiles,
192
190
  description="""
193
- - Read full file content
194
- - Provide absolute file path only
195
- - Use this instead of 'cat' from BashCommand
191
+ - Read full file content of one or more files.
192
+ - Provide absolute file paths only
196
193
  """,
197
194
  ),
198
195
  openai.pydantic_function_tool(
@@ -15,7 +15,7 @@ from openai.types.chat import (
15
15
  ParsedChatCompletionMessage,
16
16
  )
17
17
  import rich
18
- import tiktoken
18
+ from tokenizers import Tokenizer # type: ignore[import-untyped]
19
19
  from typer import Typer
20
20
  import uuid
21
21
 
@@ -23,7 +23,7 @@ from .common import CostData, History
23
23
 
24
24
 
25
25
  def get_input_cost(
26
- cost_map: CostData, enc: tiktoken.Encoding, history: History
26
+ cost_map: CostData, enc: Tokenizer, history: History
27
27
  ) -> tuple[float, int]:
28
28
  input_tokens = 0
29
29
  for msg in history:
@@ -31,8 +31,8 @@ def get_input_cost(
31
31
  refusal = msg.get("refusal")
32
32
  if isinstance(content, list):
33
33
  for part in content:
34
- if 'text' in part:
35
- input_tokens += len(enc.encode(part['text']))
34
+ if "text" in part:
35
+ input_tokens += len(enc.encode(part["text"]))
36
36
  elif content is None:
37
37
  if refusal is None:
38
38
  raise ValueError("Expected content or refusal to be present")
@@ -47,7 +47,7 @@ def get_input_cost(
47
47
 
48
48
  def get_output_cost(
49
49
  cost_map: CostData,
50
- enc: tiktoken.Encoding,
50
+ enc: Tokenizer,
51
51
  item: ChatCompletionMessage | ChatCompletionMessageParam,
52
52
  ) -> tuple[float, int]:
53
53
  if isinstance(item, ChatCompletionMessage):