wcgw 2.4.2__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.2
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>
@@ -10,7 +10,7 @@ wcgw/client/diff-instructions.txt,sha256=s5AJKG23JsjwRYhFZFQVvwDpF67vElawrmdXwvu
10
10
  wcgw/client/openai_client.py,sha256=uJ2l9NXsZuipUcJYR_bFcNNmNlfnCvPm6-M-LiVSVts,17942
11
11
  wcgw/client/openai_utils.py,sha256=YNwCsA-Wqq7jWrxP0rfQmBTb1dI0s7dWXzQqyTzOZT4,2629
12
12
  wcgw/client/sys_utils.py,sha256=GajPntKhaTUMn6EOmopENWZNR2G_BJyuVbuot0x6veI,1376
13
- wcgw/client/tools.py,sha256=ZLUlVDS-G-_UId5nJoeXINlvjvP2DUGLuTAFmHTDUvw,44131
13
+ wcgw/client/tools.py,sha256=cOrlfFRkDXBxlB8pAQ8vOds9EYmnRncftoNkGsabRD0,44563
14
14
  wcgw/client/mcp_server/Readme.md,sha256=I8N4dHkTUVGNQ63BQkBMBhCCBTgqGOSF_pUR6iOEiUk,2495
15
15
  wcgw/client/mcp_server/__init__.py,sha256=hyPPwO9cabAJsOMWhKyat9yl7OlSmIobaoAZKHu3DMc,381
16
16
  wcgw/client/mcp_server/server.py,sha256=CNUOAd83lCq0Ed_ZRwd66gIjMFN9VBSO4moTLUPTWwM,11956
@@ -38,7 +38,7 @@ mcp_wcgw/shared/memory.py,sha256=dBsOghxHz8-tycdSVo9kSujbsC8xb_tYsGmuJobuZnw,281
38
38
  mcp_wcgw/shared/progress.py,sha256=ymxOsb8XO5Mhlop7fRfdbmvPodANj7oq6O4dD0iUcnw,1048
39
39
  mcp_wcgw/shared/session.py,sha256=e44a0LQOW8gwdLs9_DE9oDsxqW2U8mXG3d5KT95bn5o,10393
40
40
  mcp_wcgw/shared/version.py,sha256=d2LZii-mgsPIxpshjkXnOTUmk98i0DT4ff8VpA_kAvE,111
41
- wcgw-2.4.2.dist-info/METADATA,sha256=hyO0tbDU7FBSsRNcuX8tnbyg_j2pTtdWm7JG9GY-UZQ,7931
42
- wcgw-2.4.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
43
- wcgw-2.4.2.dist-info/entry_points.txt,sha256=eKo1omwbAggWlQ0l7GKoR7uV1-j16nk9tK0BhC2Oz_E,120
44
- wcgw-2.4.2.dist-info/RECORD,,
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,,
File without changes