code-puppy 0.0.162__py3-none-any.whl → 0.0.163__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.
@@ -497,7 +497,7 @@ def share_your_reasoning(
497
497
  def register_agent_run_shell_command(agent):
498
498
  """Register only the agent_run_shell_command tool."""
499
499
 
500
- @agent.tool(strict=False)
500
+ @agent.tool
501
501
  def agent_run_shell_command(
502
502
  context: RunContext, command: str = "", cwd: str = None, timeout: int = 60
503
503
  ) -> ShellCommandOutput:
@@ -553,7 +553,7 @@ def register_agent_run_shell_command(agent):
553
553
  def register_agent_share_your_reasoning(agent):
554
554
  """Register only the agent_share_your_reasoning tool."""
555
555
 
556
- @agent.tool(strict=False)
556
+ @agent.tool
557
557
  def agent_share_your_reasoning(
558
558
  context: RunContext, reasoning: str = "", next_steps: str | None = None
559
559
  ) -> ReasoningOutput:
@@ -451,7 +451,7 @@ def _delete_file(
451
451
  def register_edit_file(agent):
452
452
  """Register only the edit_file tool."""
453
453
 
454
- @agent.tool(strict=False)
454
+ @agent.tool
455
455
  def edit_file(
456
456
  context: RunContext,
457
457
  payload: EditFilePayload | str = "",
@@ -468,17 +468,20 @@ def register_edit_file(agent):
468
468
  payload: One of three payload types:
469
469
 
470
470
  ContentPayload:
471
+ - file_path (str): Path to file
471
472
  - content (str): Full file content to write
472
473
  - overwrite (bool, optional): Whether to overwrite existing files.
473
474
  Defaults to False (safe mode).
474
475
 
475
476
  ReplacementsPayload:
477
+ - file_path (str): Path to file
476
478
  - replacements (List[Replacement]): List of text replacements where
477
479
  each Replacement contains:
478
480
  - old_str (str): Exact text to find and replace
479
481
  - new_str (str): Replacement text
480
482
 
481
483
  DeleteSnippetPayload:
484
+ - file_path (str): Path to file
482
485
  - delete_snippet (str): Exact text snippet to remove from file
483
486
 
484
487
  Returns:
@@ -492,7 +495,7 @@ def register_edit_file(agent):
492
495
 
493
496
  Examples:
494
497
  >>> # Create new file with content
495
- >>> payload = {"file_path": "hello.py", "content": "print('Hello!')"}
498
+ >>> payload = {"file_path": "hello.py", "content": "print('Hello!')", "overwrite": true}
496
499
  >>> result = edit_file(ctx, payload)
497
500
 
498
501
  >>> # Replace text in existing file
@@ -519,6 +522,28 @@ def register_edit_file(agent):
519
522
  - Use delete_snippet for removing specific code blocks
520
523
  """
521
524
  # Handle string payload parsing (for models that send JSON strings)
525
+
526
+ parse_error_message = """Examples:
527
+ >>> # Create new file with content
528
+ >>> payload = {"file_path": "hello.py", "content": "print('Hello!')", "overwrite": true}
529
+ >>> result = edit_file(ctx, payload)
530
+
531
+ >>> # Replace text in existing file
532
+ >>> payload = {
533
+ ... "file_path": "config.py",
534
+ ... "replacements": [
535
+ ... {"old_str": "debug = False", "new_str": "debug = True"}
536
+ ... ]
537
+ ... }
538
+ >>> result = edit_file(ctx, payload)
539
+
540
+ >>> # Delete snippet from file
541
+ >>> payload = {
542
+ ... "file_path": "main.py",
543
+ ... "delete_snippet": "# TODO: remove this comment"
544
+ ... }
545
+ >>> result = edit_file(ctx, payload)"""
546
+
522
547
  if isinstance(payload, str):
523
548
  try:
524
549
  # Fallback for weird models that just can't help but send json strings...
@@ -536,14 +561,14 @@ def register_edit_file(agent):
536
561
  return {
537
562
  "success": False,
538
563
  "path": file_path,
539
- "message": "One of 'content', 'replacements', or 'delete_snippet' must be provided in payload.",
564
+ "message": f"One of 'content', 'replacements', or 'delete_snippet' must be provided in payload. Refer to the following examples: {parse_error_message}",
540
565
  "changed": False,
541
566
  }
542
567
  except Exception as e:
543
568
  return {
544
569
  "success": False,
545
570
  "path": 'Not retrievable in Payload',
546
- "message": f"edit_file call failed: {str(e)}",
571
+ "message": f"edit_file call failed: {str(e)} - this means the tool failed to parse your inputs. Refer to the following examples: {parse_error_message}",
547
572
  "changed": False
548
573
  }
549
574
 
@@ -557,7 +582,7 @@ def register_edit_file(agent):
557
582
  def register_delete_file(agent):
558
583
  """Register only the delete_file tool."""
559
584
 
560
- @agent.tool(strict=False)
585
+ @agent.tool
561
586
  def delete_file(context: RunContext, file_path: str = "") -> Dict[str, Any]:
562
587
  """Safely delete files with comprehensive logging and diff generation.
563
588
 
@@ -603,7 +603,7 @@ def register_list_files(agent):
603
603
  """Register only the list_files tool."""
604
604
  from code_puppy.config import get_allow_recursion
605
605
 
606
- @agent.tool(strict=False)
606
+ @agent.tool
607
607
  def list_files(
608
608
  context: RunContext, directory: str = ".", recursive: bool = True
609
609
  ) -> ListFileOutput:
@@ -672,7 +672,7 @@ def register_list_files(agent):
672
672
  def register_read_file(agent):
673
673
  """Register only the read_file tool."""
674
674
 
675
- @agent.tool(strict=False)
675
+ @agent.tool
676
676
  def read_file(
677
677
  context: RunContext,
678
678
  file_path: str = "",
@@ -730,7 +730,7 @@ def register_read_file(agent):
730
730
  def register_grep(agent):
731
731
  """Register only the grep tool."""
732
732
 
733
- @agent.tool(strict=False)
733
+ @agent.tool
734
734
  def grep(
735
735
  context: RunContext, search_string: str = "", directory: str = "."
736
736
  ) -> GrepOutput:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.162
3
+ Version: 0.0.163
4
4
  Summary: Code generation agent
5
5
  Project-URL: repository, https://github.com/mpfaffenberger/code_puppy
6
6
  Project-URL: HomePage, https://github.com/mpfaffenberger/code_puppy
@@ -78,10 +78,10 @@ code_puppy/messaging/spinner/textual_spinner.py,sha256=Omx9A-FSPkxYDMYgBXgYMBQnK
78
78
  code_puppy/plugins/__init__.py,sha256=fksDqMUiXPJ5WNuMsYsVR8ulueQRCXPlvECEyicHPtQ,1312
79
79
  code_puppy/tools/__init__.py,sha256=YiiXRqxU1BEJ5t0Oe163lSqOneI9sKtwDW0swCPgBt4,2119
80
80
  code_puppy/tools/agent_tools.py,sha256=bHMrFIbYRhuubR41G_XdLsk3cUKWfIPl2O4bVzo2pE0,5591
81
- code_puppy/tools/command_runner.py,sha256=yH5v8An3N6wYmUVxcMITvPcpcBxXdvtZEcI5CalmWys,20939
81
+ code_puppy/tools/command_runner.py,sha256=kK_lKLTMRvJmNLfunTBTeHFT8Z9EiRC3c_mhyzDhvxM,20911
82
82
  code_puppy/tools/common.py,sha256=pL-9xcRs3rxU7Fl9X9EUgbDp2-csh2LLJ5DHH_KAHKY,10596
83
- code_puppy/tools/file_modifications.py,sha256=nMg9yIejbx48f0walp1JmcbssakYRIgATEuFC3X7udc,22144
84
- code_puppy/tools/file_operations.py,sha256=dfG1MDmpvbxsdapSAyo-FJoctC1XM6_AO8HM1PlxUIE,30894
83
+ code_puppy/tools/file_modifications.py,sha256=_8IkNa3zmboN1usTHhQEBar5ctSOtvH7j74mFmV4WWA,23279
84
+ code_puppy/tools/file_operations.py,sha256=Cxa5bqbVNwgViSdBjwGOrqWmtxBPhQRjDBepgt2Xuxk,30852
85
85
  code_puppy/tools/tools_content.py,sha256=bsBqW-ppd1XNAS_g50B3UHDQBWEALC1UneH6-afz1zo,2365
86
86
  code_puppy/tui/__init__.py,sha256=XesAxIn32zLPOmvpR2wIDxDAnnJr81a5pBJB4cZp1Xs,321
87
87
  code_puppy/tui/app.py,sha256=nPOzwlusjdWzBfu__EbC3Q0etkPrqRq-2g-mk4IcfG4,39378
@@ -104,9 +104,9 @@ code_puppy/tui/screens/help.py,sha256=eJuPaOOCp7ZSUlecearqsuX6caxWv7NQszUh0tZJjB
104
104
  code_puppy/tui/screens/mcp_install_wizard.py,sha256=xqwN5omltMkfxWZwXj3D2PbXbtrxUi1dT0XT77oxOKk,27685
105
105
  code_puppy/tui/screens/settings.py,sha256=GMpv-qa08rorAE9mj3AjmqjZFPhmeJ_GWd-DBHG6iAA,10671
106
106
  code_puppy/tui/screens/tools.py,sha256=3pr2Xkpa9Js6Yhf1A3_wQVRzFOui-KDB82LwrsdBtyk,1715
107
- code_puppy-0.0.162.data/data/code_puppy/models.json,sha256=iXmLZGflnQcu2DRh4WUlgAhoXdvoxUc7KBhB8YxawXM,3088
108
- code_puppy-0.0.162.dist-info/METADATA,sha256=nBdzIMU9yCi6GSd1Szmm8J0gm3K1kXXCP0_bH8AGUMI,19567
109
- code_puppy-0.0.162.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
110
- code_puppy-0.0.162.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
111
- code_puppy-0.0.162.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
112
- code_puppy-0.0.162.dist-info/RECORD,,
107
+ code_puppy-0.0.163.data/data/code_puppy/models.json,sha256=iXmLZGflnQcu2DRh4WUlgAhoXdvoxUc7KBhB8YxawXM,3088
108
+ code_puppy-0.0.163.dist-info/METADATA,sha256=VEvu8qBW4fj-rcg7OVfn75GBzxcUECvRl7fz1PWCjto,19567
109
+ code_puppy-0.0.163.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
110
+ code_puppy-0.0.163.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
111
+ code_puppy-0.0.163.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
112
+ code_puppy-0.0.163.dist-info/RECORD,,