wcgw 2.4.1__py3-none-any.whl → 2.4.3__py3-none-any.whl

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/client/tools.py CHANGED
@@ -397,6 +397,12 @@ def _incremental_text(text: str, last_pending_output: str) -> str:
397
397
  return rstrip(rendered)
398
398
 
399
399
 
400
+ def is_status_check(arg: BashInteraction | BashCommand) -> bool:
401
+ return isinstance(arg, BashInteraction) and (
402
+ arg.send_specials == ["Enter"] or arg.send_ascii == [10]
403
+ )
404
+
405
+
400
406
  def execute_bash(
401
407
  enc: tiktoken.Encoding,
402
408
  bash_arg: BashCommand | BashInteraction,
@@ -428,7 +434,9 @@ def execute_bash(
428
434
  "Command should not contain newline character in middle. Run only one command at a time."
429
435
  )
430
436
 
431
- BASH_STATE.shell.sendline(command)
437
+ for i in range(0, len(command), 128):
438
+ BASH_STATE.shell.send(command[i : i + 128])
439
+ BASH_STATE.shell.send(BASH_STATE.shell.linesep)
432
440
 
433
441
  else:
434
442
  if (
@@ -491,7 +499,9 @@ def execute_bash(
491
499
  0,
492
500
  )
493
501
  console.print(f"Interact text: {bash_arg.send_text}")
494
- BASH_STATE.shell.sendline(bash_arg.send_text)
502
+ for i in range(0, len(bash_arg.send_text), 128):
503
+ BASH_STATE.shell.send(bash_arg.send_text[i : i + 128])
504
+ BASH_STATE.shell.send(BASH_STATE.shell.linesep)
495
505
 
496
506
  except KeyboardInterrupt:
497
507
  BASH_STATE.shell.sendintr()
@@ -505,13 +515,14 @@ def execute_bash(
505
515
  incremental_text = _incremental_text(text, BASH_STATE.pending_output)
506
516
 
507
517
  second_wait_success = False
508
- if incremental_text and isinstance(bash_arg, BashInteraction):
518
+ if is_status_check(bash_arg):
509
519
  # There's some text in BashInteraction mode wait for TIMEOUT_WHILE_OUTPUT
510
520
  remaining = TIMEOUT_WHILE_OUTPUT - wait
511
521
  patience = OUTPUT_WAIT_PATIENCE
522
+ if not incremental_text:
523
+ patience -= 1
512
524
  itext = incremental_text
513
525
  while remaining > 0 and patience > 0:
514
- print(remaining, TIMEOUT_WHILE_OUTPUT)
515
526
  index = BASH_STATE.shell.expect([PROMPT, pexpect.TIMEOUT], timeout=wait)
516
527
  if index == 0:
517
528
  second_wait_success = True
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: wcgw
3
- Version: 2.4.1
3
+ Version: 2.4.3
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>
@@ -8,7 +8,6 @@ Requires-Python: <3.13,>=3.11
8
8
  Requires-Dist: anthropic>=0.39.0
9
9
  Requires-Dist: fastapi>=0.115.0
10
10
  Requires-Dist: humanize>=4.11.0
11
- Requires-Dist: mcp-wcgw
12
11
  Requires-Dist: openai>=1.46.0
13
12
  Requires-Dist: petname>=2.6
14
13
  Requires-Dist: pexpect>=4.9.0
@@ -0,0 +1,44 @@
1
+ wcgw/__init__.py,sha256=9K2QW7QuSLhMTVbKbBYd9UUp-ZyrfBrxcjuD_xk458k,118
2
+ wcgw/types_.py,sha256=9h0-UKS4emx12eI24VSfgvz8WW0p5hwxFwzq8Wvbk6w,1858
3
+ wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ wcgw/client/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
5
+ wcgw/client/anthropic_client.py,sha256=ymMi2Kmkcso_6PT8iuwsqLz4Ne6oTvId3OWBB4La3gc,21147
6
+ wcgw/client/cli.py,sha256=-z0kpDAW3mzfQrQeZfaVJhBCAQY3HXnt9GdgQ8s-u0Y,1003
7
+ wcgw/client/common.py,sha256=grH-yV_4tnTQZ29xExn4YicGLxEq98z-HkEZwH0ReSg,1410
8
+ wcgw/client/computer_use.py,sha256=35NKAlMrxwD0TBlMMRnbCwz4g8TBRGOlcy-cmS-yJ_A,15247
9
+ wcgw/client/diff-instructions.txt,sha256=s5AJKG23JsjwRYhFZFQVvwDpF67vElawrmdXwvukR1A,1683
10
+ wcgw/client/openai_client.py,sha256=uJ2l9NXsZuipUcJYR_bFcNNmNlfnCvPm6-M-LiVSVts,17942
11
+ wcgw/client/openai_utils.py,sha256=YNwCsA-Wqq7jWrxP0rfQmBTb1dI0s7dWXzQqyTzOZT4,2629
12
+ wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
13
+ wcgw/client/tools.py,sha256=cOrlfFRkDXBxlB8pAQ8vOds9EYmnRncftoNkGsabRD0,44563
14
+ wcgw/client/mcp_server/Readme.md,sha256=I8N4dHkTUVGNQ63BQkBMBhCCBTgqGOSF_pUR6iOEiUk,2495
15
+ wcgw/client/mcp_server/__init__.py,sha256=hyPPwO9cabAJsOMWhKyat9yl7OlSmIobaoAZKHu3DMc,381
16
+ wcgw/client/mcp_server/server.py,sha256=CNUOAd83lCq0Ed_ZRwd66gIjMFN9VBSO4moTLUPTWwM,11956
17
+ wcgw/relay/serve.py,sha256=KLYjTvM9CfqdxgFOfHM8LUkFGZ9kKyyJunpNdEIFQUk,8766
18
+ wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
19
+ mcp_wcgw/__init__.py,sha256=fKCgOdN7cn7gR3YGFaGyV5Goe8A2sEyllLcsRkN0i-g,2601
20
+ mcp_wcgw/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
21
+ mcp_wcgw/types.py,sha256=Enq5vqOPaQdObK9OQuafdLuMxb5RsLQ3k_k613fK41k,30556
22
+ mcp_wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
+ mcp_wcgw/client/__main__.py,sha256=9ne6Gk1udW_GSwq7O7aZSYwwqSBTgyMVjNVc6s6GJoQ,2280
24
+ mcp_wcgw/client/session.py,sha256=RqdIN6ov9vklKY2B0-hvjIM5JtUetbyhhrF7a0HKAJ8,8044
25
+ mcp_wcgw/client/sse.py,sha256=qDaxXvcjfh9c4bcaLlRT0Bk_VXHLV9Iao6OPPaQ69Oo,6540
26
+ mcp_wcgw/client/stdio.py,sha256=KfIIcqPYxQch_rMABvp7LH8k9BkO1WEIr-MTe_HZQxM,3943
27
+ mcp_wcgw/server/__init__.py,sha256=xEX-pPL96vkS9p-xkA4Zgbl-R3riyOlSYBWyj-ktURc,19160
28
+ mcp_wcgw/server/__main__.py,sha256=re57YcuuIxypjzq0tIUgdq1VPmzzDBl7BzyZuDrfZOQ,1348
29
+ mcp_wcgw/server/models.py,sha256=ghdetxlFc4QhoEN9JdBbpGGyUZKZX2n3heMsjrwTaC8,310
30
+ mcp_wcgw/server/session.py,sha256=ZD0KHGOF3tih4aTFYTklvT7YKC5w9kf9-0wPja8rltE,10386
31
+ mcp_wcgw/server/sse.py,sha256=5IE0HPR9cN9yfWw3Qq81ENxJzK06DxJLb6rUDBwE7bQ,6863
32
+ mcp_wcgw/server/stdio.py,sha256=iy6xkRgNoK7bbyF-azmEWS2kHqfWPDBHNttmuscwNh4,2894
33
+ mcp_wcgw/server/websocket.py,sha256=2shuqa8JgQ9D7N52z32vZZe6E6Wqy07OilMjSMEh68Y,2234
34
+ mcp_wcgw/shared/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
+ mcp_wcgw/shared/context.py,sha256=insWMqwR5vVXuA2yqXbqAf9I8XzvNe71_3JOdCAYr3o,360
36
+ mcp_wcgw/shared/exceptions.py,sha256=RfKb8VrUooBnq_UAQhT4C0f-KJpDvkozRiD58nOqgq8,176
37
+ mcp_wcgw/shared/memory.py,sha256=dBsOghxHz8-tycdSVo9kSujbsC8xb_tYsGmuJobuZnw,2819
38
+ mcp_wcgw/shared/progress.py,sha256=ymxOsb8XO5Mhlop7fRfdbmvPodANj7oq6O4dD0iUcnw,1048
39
+ mcp_wcgw/shared/session.py,sha256=e44a0LQOW8gwdLs9_DE9oDsxqW2U8mXG3d5KT95bn5o,10393
40
+ mcp_wcgw/shared/version.py,sha256=d2LZii-mgsPIxpshjkXnOTUmk98i0DT4ff8VpA_kAvE,111
41
+ wcgw-2.4.3.dist-info/METADATA,sha256=dwZvKTDJRrxkrx5vmL_QxLQCVhHD75dD8kZhr1PL02M,7931
42
+ wcgw-2.4.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
+ wcgw-2.4.3.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
44
+ wcgw-2.4.3.dist-info/RECORD,,
@@ -1,22 +0,0 @@
1
- wcgw/__init__.py,sha256=9K2QW7QuSLhMTVbKbBYd9UUp-ZyrfBrxcjuD_xk458k,118
2
- wcgw/types_.py,sha256=9h0-UKS4emx12eI24VSfgvz8WW0p5hwxFwzq8Wvbk6w,1858
3
- wcgw/client/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- wcgw/client/__main__.py,sha256=wcCrL4PjG51r5wVKqJhcoJPTLfHW0wNbD31DrUN0MWI,28
5
- wcgw/client/anthropic_client.py,sha256=ymMi2Kmkcso_6PT8iuwsqLz4Ne6oTvId3OWBB4La3gc,21147
6
- wcgw/client/cli.py,sha256=-z0kpDAW3mzfQrQeZfaVJhBCAQY3HXnt9GdgQ8s-u0Y,1003
7
- wcgw/client/common.py,sha256=grH-yV_4tnTQZ29xExn4YicGLxEq98z-HkEZwH0ReSg,1410
8
- wcgw/client/computer_use.py,sha256=35NKAlMrxwD0TBlMMRnbCwz4g8TBRGOlcy-cmS-yJ_A,15247
9
- wcgw/client/diff-instructions.txt,sha256=s5AJKG23JsjwRYhFZFQVvwDpF67vElawrmdXwvukR1A,1683
10
- wcgw/client/openai_client.py,sha256=uJ2l9NXsZuipUcJYR_bFcNNmNlfnCvPm6-M-LiVSVts,17942
11
- wcgw/client/openai_utils.py,sha256=YNwCsA-Wqq7jWrxP0rfQmBTb1dI0s7dWXzQqyTzOZT4,2629
12
- wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
13
- wcgw/client/tools.py,sha256=ZLUlVDS-G-_UId5nJoeXINlvjvP2DUGLuTAFmHTDUvw,44131
14
- wcgw/client/mcp_server/Readme.md,sha256=I8N4dHkTUVGNQ63BQkBMBhCCBTgqGOSF_pUR6iOEiUk,2495
15
- wcgw/client/mcp_server/__init__.py,sha256=hyPPwO9cabAJsOMWhKyat9yl7OlSmIobaoAZKHu3DMc,381
16
- wcgw/client/mcp_server/server.py,sha256=CNUOAd83lCq0Ed_ZRwd66gIjMFN9VBSO4moTLUPTWwM,11956
17
- wcgw/relay/serve.py,sha256=KLYjTvM9CfqdxgFOfHM8LUkFGZ9kKyyJunpNdEIFQUk,8766
18
- wcgw/relay/static/privacy.txt,sha256=s9qBdbx2SexCpC_z33sg16TptmAwDEehMCLz4L50JLc,529
19
- wcgw-2.4.1.dist-info/METADATA,sha256=mjWjB7heir277o_H6FfQoabauQIgGTWFlKT548ToFNU,7955
20
- wcgw-2.4.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
21
- wcgw-2.4.1.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
22
- wcgw-2.4.1.dist-info/RECORD,,
File without changes