code-puppy 0.0.159__py3-none-any.whl → 0.0.160__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.
- code_puppy/tools/file_modifications.py +22 -14
- {code_puppy-0.0.159.dist-info → code_puppy-0.0.160.dist-info}/METADATA +1 -1
- {code_puppy-0.0.159.dist-info → code_puppy-0.0.160.dist-info}/RECORD +7 -7
- {code_puppy-0.0.159.data → code_puppy-0.0.160.data}/data/code_puppy/models.json +0 -0
- {code_puppy-0.0.159.dist-info → code_puppy-0.0.160.dist-info}/WHEEL +0 -0
- {code_puppy-0.0.159.dist-info → code_puppy-0.0.160.dist-info}/entry_points.txt +0 -0
- {code_puppy-0.0.159.dist-info → code_puppy-0.0.160.dist-info}/licenses/LICENSE +0 -0
|
@@ -525,23 +525,31 @@ def register_file_modifications_tools(agent):
|
|
|
525
525
|
"""
|
|
526
526
|
# Generate group_id for edit_file tool execution
|
|
527
527
|
if isinstance(payload, str):
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
file_path
|
|
528
|
+
try:
|
|
529
|
+
# Fallback for weird models that just can't help but send json strings...
|
|
530
|
+
payload = json.loads(json_repair.repair_json(payload))
|
|
531
|
+
if "replacements" in payload:
|
|
532
|
+
payload = ReplacementsPayload(**payload)
|
|
533
|
+
elif "delete_snippet" in payload:
|
|
534
|
+
payload = DeleteSnippetPayload(**payload)
|
|
535
|
+
elif "content" in payload:
|
|
536
|
+
payload = ContentPayload(**payload)
|
|
537
|
+
else:
|
|
538
|
+
file_path = "Unknown"
|
|
539
|
+
if "file_path" in payload:
|
|
540
|
+
file_path = payload["file_path"]
|
|
541
|
+
return {
|
|
542
|
+
"success": False,
|
|
543
|
+
"path": file_path,
|
|
544
|
+
"message": "One of 'content', 'replacements', or 'delete_snippet' must be provided in payload.",
|
|
545
|
+
"changed": False,
|
|
546
|
+
}
|
|
547
|
+
except Exception as e:
|
|
540
548
|
return {
|
|
541
549
|
"success": False,
|
|
542
550
|
"path": file_path,
|
|
543
|
-
"message": "
|
|
544
|
-
"changed": False
|
|
551
|
+
"message": f"edit_file call failed: {str(e)}",
|
|
552
|
+
"changed": False
|
|
545
553
|
}
|
|
546
554
|
group_id = generate_group_id("edit_file", payload.file_path)
|
|
547
555
|
result = _edit_file(context, payload, group_id)
|
|
@@ -80,7 +80,7 @@ code_puppy/tools/__init__.py,sha256=YiiXRqxU1BEJ5t0Oe163lSqOneI9sKtwDW0swCPgBt4,
|
|
|
80
80
|
code_puppy/tools/agent_tools.py,sha256=bHMrFIbYRhuubR41G_XdLsk3cUKWfIPl2O4bVzo2pE0,5591
|
|
81
81
|
code_puppy/tools/command_runner.py,sha256=GVNsgwjTFD9tkNlycgMNmMoVPdmMkZkbAcHH5y6iMww,26070
|
|
82
82
|
code_puppy/tools/common.py,sha256=pL-9xcRs3rxU7Fl9X9EUgbDp2-csh2LLJ5DHH_KAHKY,10596
|
|
83
|
-
code_puppy/tools/file_modifications.py,sha256=
|
|
83
|
+
code_puppy/tools/file_modifications.py,sha256=8lsICe4EY3rMKfUXLm7yn3SzD4XwIN8CktdEDBxdpAM,30746
|
|
84
84
|
code_puppy/tools/file_operations.py,sha256=dfG1MDmpvbxsdapSAyo-FJoctC1XM6_AO8HM1PlxUIE,30894
|
|
85
85
|
code_puppy/tools/tools_content.py,sha256=bsBqW-ppd1XNAS_g50B3UHDQBWEALC1UneH6-afz1zo,2365
|
|
86
86
|
code_puppy/tui/__init__.py,sha256=XesAxIn32zLPOmvpR2wIDxDAnnJr81a5pBJB4cZp1Xs,321
|
|
@@ -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.
|
|
108
|
-
code_puppy-0.0.
|
|
109
|
-
code_puppy-0.0.
|
|
110
|
-
code_puppy-0.0.
|
|
111
|
-
code_puppy-0.0.
|
|
112
|
-
code_puppy-0.0.
|
|
107
|
+
code_puppy-0.0.160.data/data/code_puppy/models.json,sha256=iXmLZGflnQcu2DRh4WUlgAhoXdvoxUc7KBhB8YxawXM,3088
|
|
108
|
+
code_puppy-0.0.160.dist-info/METADATA,sha256=01Gp901aHmA7usLBx-TDWoGY0ZWx1DNoDo0FQ6-h1us,19567
|
|
109
|
+
code_puppy-0.0.160.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
110
|
+
code_puppy-0.0.160.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
|
|
111
|
+
code_puppy-0.0.160.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
|
|
112
|
+
code_puppy-0.0.160.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|