patchpal 0.21.7__tar.gz → 0.22.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.
Files changed (67) hide show
  1. {patchpal-0.21.7/patchpal.egg-info → patchpal-0.22.0}/PKG-INFO +2 -2
  2. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/__init__.py +1 -1
  3. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/agent/function_calling.py +28 -10
  4. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/agent/react.py +2 -2
  5. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/cli/mcp.py +1 -1
  6. patchpal-0.22.0/patchpal/cli/sandbox.py +1070 -0
  7. {patchpal-0.21.7 → patchpal-0.22.0/patchpal.egg-info}/PKG-INFO +2 -2
  8. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal.egg-info/requires.txt +1 -1
  9. {patchpal-0.21.7 → patchpal-0.22.0}/pyproject.toml +1 -1
  10. patchpal-0.21.7/patchpal/cli/sandbox.py +0 -527
  11. {patchpal-0.21.7 → patchpal-0.22.0}/LICENSE +0 -0
  12. {patchpal-0.21.7 → patchpal-0.22.0}/MANIFEST.in +0 -0
  13. {patchpal-0.21.7 → patchpal-0.22.0}/README.md +0 -0
  14. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/agent/__init__.py +0 -0
  15. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/cli/__init__.py +0 -0
  16. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/cli/autopilot.py +0 -0
  17. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/cli/interactive.py +0 -0
  18. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/cli/streaming.py +0 -0
  19. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/config.py +0 -0
  20. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/context.py +0 -0
  21. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/permissions.py +0 -0
  22. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/prompts/react_prompt.md +0 -0
  23. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/prompts/system_prompt.md +0 -0
  24. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/skills.py +0 -0
  25. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/__init__.py +0 -0
  26. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/code_analysis.py +0 -0
  27. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/common.py +0 -0
  28. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/definitions.py +0 -0
  29. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/file_reading.py +0 -0
  30. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/file_writing.py +0 -0
  31. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/find_tool.py +0 -0
  32. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/grep_tool.py +0 -0
  33. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/image_handler.py +0 -0
  34. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/mcp.py +0 -0
  35. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/repo_map.py +0 -0
  36. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/shell_tools.py +0 -0
  37. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/todo_tools.py +0 -0
  38. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/tool_schema.py +0 -0
  39. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/user_interaction.py +0 -0
  40. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal/tools/web_tools.py +0 -0
  41. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal.egg-info/SOURCES.txt +0 -0
  42. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal.egg-info/dependency_links.txt +0 -0
  43. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal.egg-info/entry_points.txt +0 -0
  44. {patchpal-0.21.7 → patchpal-0.22.0}/patchpal.egg-info/top_level.txt +0 -0
  45. {patchpal-0.21.7 → patchpal-0.22.0}/setup.cfg +0 -0
  46. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_agent.py +0 -0
  47. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_cli.py +0 -0
  48. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_config_dynamic.py +0 -0
  49. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_context.py +0 -0
  50. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_custom_tools.py +0 -0
  51. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_enabled_tools.py +0 -0
  52. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_find_tool.py +0 -0
  53. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_guardrails.py +0 -0
  54. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_image_blocking.py +0 -0
  55. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_maximum_security.py +0 -0
  56. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_mcp_config.py +0 -0
  57. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_memory.py +0 -0
  58. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_operational_safety.py +0 -0
  59. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_optional_tools.py +0 -0
  60. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_permissions.py +0 -0
  61. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_react.py +0 -0
  62. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_reasoning_content.py +0 -0
  63. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_repo_map.py +0 -0
  64. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_simplified_prompt.py +0 -0
  65. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_skills.py +0 -0
  66. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_streaming.py +0 -0
  67. {patchpal-0.21.7 → patchpal-0.22.0}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchpal
3
- Version: 0.21.7
3
+ Version: 0.22.0
4
4
  Summary: An agentic coding and automation assistant, supporting both local and cloud LLMs
5
5
  Author: PatchPal Contributors
6
6
  License-Expression: Apache-2.0
@@ -19,7 +19,7 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
19
  Requires-Python: >=3.10
20
20
  Description-Content-Type: text/markdown
21
21
  License-File: LICENSE
22
- Requires-Dist: litellm>=1.0.0
22
+ Requires-Dist: litellm<=1.82.6
23
23
  Requires-Dist: requests>=2.31.0
24
24
  Requires-Dist: beautifulsoup4>=4.12.0
25
25
  Requires-Dist: ddgs>=1.0.0
@@ -1,6 +1,6 @@
1
1
  """PatchPal - An open-source Claude Code clone implemented purely in Python."""
2
2
 
3
- __version__ = "0.21.7"
3
+ __version__ = "0.22.0"
4
4
 
5
5
  from patchpal.agent import create_agent, create_react_agent
6
6
  from patchpal.cli.autopilot import autopilot_loop
@@ -67,13 +67,21 @@ def _setup_bedrock_env():
67
67
  """Set up Bedrock-specific environment variables for LiteLLM.
68
68
 
69
69
  Configures custom region and endpoint URL for AWS Bedrock (including GovCloud and VPC endpoints).
70
- Maps PatchPal's environment variables to LiteLLM's expected format.
70
+ Maps AWS SDK standard variables and PatchPal-specific variables to LiteLLM's expected format.
71
+
72
+ Region precedence:
73
+ 1. AWS_BEDROCK_REGION (PatchPal-specific)
74
+ 2. AWS_REGION (AWS SDK standard)
75
+ 3. AWS_DEFAULT_REGION (AWS SDK standard)
76
+ 4. AWS_REGION_NAME (LiteLLM-specific)
77
+
78
+ Endpoint precedence:
79
+ 1. AWS_BEDROCK_ENDPOINT (PatchPal-specific)
80
+ 2. AWS_ENDPOINT_URL_BEDROCK_RUNTIME (AWS SDK standard, boto3 1.28.0+)
81
+ 3. AWS_ENDPOINT_URL (AWS SDK global, boto3 1.28.0+)
82
+ 4. AWS_BEDROCK_RUNTIME_ENDPOINT (LiteLLM-specific)
71
83
  """
72
84
  # Set custom region (e.g., us-gov-east-1 for GovCloud)
73
- # LiteLLM checks these environment variables in order:
74
- # 1. AWS_REGION_NAME (LiteLLM-specific)
75
- # 2. AWS_REGION (standard AWS)
76
- # 3. AWS_DEFAULT_REGION (standard AWS)
77
85
  bedrock_region = (
78
86
  os.getenv("AWS_BEDROCK_REGION")
79
87
  or os.getenv("AWS_REGION")
@@ -90,7 +98,17 @@ def _setup_bedrock_env():
90
98
  os.environ["AWS_REGION"] = bedrock_region
91
99
 
92
100
  # Set custom endpoint URL (e.g., VPC endpoint or GovCloud endpoint)
93
- bedrock_endpoint = os.getenv("AWS_BEDROCK_ENDPOINT")
101
+ # Check for custom endpoint in order of precedence:
102
+ # 1. AWS_BEDROCK_ENDPOINT (PatchPal-specific)
103
+ # 2. AWS_ENDPOINT_URL_BEDROCK_RUNTIME (AWS SDK standard, boto3 1.28.0+)
104
+ # 3. AWS_ENDPOINT_URL (AWS SDK global endpoint, boto3 1.28.0+)
105
+ # 4. AWS_BEDROCK_RUNTIME_ENDPOINT (LiteLLM-specific)
106
+ bedrock_endpoint = (
107
+ os.getenv("AWS_BEDROCK_ENDPOINT")
108
+ or os.getenv("AWS_ENDPOINT_URL_BEDROCK_RUNTIME")
109
+ or os.getenv("AWS_ENDPOINT_URL")
110
+ or os.getenv("AWS_BEDROCK_RUNTIME_ENDPOINT")
111
+ )
94
112
  if bedrock_endpoint and not os.getenv("AWS_BEDROCK_RUNTIME_ENDPOINT"):
95
113
  os.environ["AWS_BEDROCK_RUNTIME_ENDPOINT"] = bedrock_endpoint
96
114
 
@@ -801,7 +819,7 @@ It's currently empty (just the template). The file is automatically loaded at se
801
819
 
802
820
  except Exception as e:
803
821
  # Compaction failed - warn but continue
804
- print(f"\033[1;31m✗ Compaction failed: {e}\033[0m")
822
+ print(f"\033[1;31m✗ Compaction failed: {e}\033[0m\n", flush=True)
805
823
  print(
806
824
  "\033[1;33m Continuing without compaction. Consider starting a new session.\033[0m\n"
807
825
  )
@@ -1185,7 +1203,7 @@ It's currently empty (just the template). The file is automatically loaded at se
1185
1203
  tool_args = json.loads(tool_args_str)
1186
1204
  except json.JSONDecodeError:
1187
1205
  tool_result = f"Error: Invalid JSON arguments for {tool_name}"
1188
- print(f"\033[1;31m✗ {tool_name}: Invalid arguments\033[0m")
1206
+ print(f"\033[1;31m✗ {tool_name}: Invalid arguments\033[0m\n", flush=True)
1189
1207
  else:
1190
1208
  # Get the tool function (check custom tools first, then built-in)
1191
1209
  tool_func = self.custom_tool_funcs.get(tool_name) or TOOL_FUNCTIONS.get(
@@ -1193,7 +1211,7 @@ It's currently empty (just the template). The file is automatically loaded at se
1193
1211
  )
1194
1212
  if tool_func is None:
1195
1213
  tool_result = f"Error: Unknown tool {tool_name}"
1196
- print(f"\033[1;31m✗ Unknown tool: {tool_name}\033[0m")
1214
+ print(f"\033[1;31m✗ Unknown tool: {tool_name}\033[0m\n", flush=True)
1197
1215
  else:
1198
1216
  # Show tool call message
1199
1217
  if tool_name in self.custom_tool_funcs:
@@ -1393,7 +1411,7 @@ It's currently empty (just the template). The file is automatically loaded at se
1393
1411
  tool_result = tool_func(**filtered_args)
1394
1412
  except Exception as e:
1395
1413
  tool_result = f"Error executing {tool_name}: {e}"
1396
- print(f"\033[1;31m✗ {tool_name}: {e}\033[0m")
1414
+ print(f"\033[1;31m✗ {tool_name}: {e}\033[0m\n", flush=True)
1397
1415
 
1398
1416
  # Add tool result to messages
1399
1417
  result_str = str(tool_result)
@@ -533,7 +533,7 @@ class ReActAgent:
533
533
  tool_func = self.tool_functions.get(tool_name)
534
534
  if tool_func is None:
535
535
  error_msg = f"Error: Unknown tool '{tool_name}'"
536
- print(f"\033[1;31m✗ {error_msg}\033[0m")
536
+ print(f"\033[1;31m✗ {error_msg}\033[0m\n", flush=True)
537
537
  self.messages.append({"role": "user", "content": f"Observation: {error_msg}"})
538
538
  continue
539
539
 
@@ -571,7 +571,7 @@ class ReActAgent:
571
571
 
572
572
  except Exception as e:
573
573
  tool_result = f"Error executing {tool_name}: {e}"
574
- print(f"\033[1;31m✗ {tool_name}: {e}\033[0m")
574
+ print(f"\033[1;31m✗ {tool_name}: {e}\033[0m\n", flush=True)
575
575
 
576
576
  # Check if operation was cancelled
577
577
  if str(tool_result).strip() == "Operation cancelled by user.":
@@ -250,7 +250,7 @@ def cmd_test(args):
250
250
  print("\n✓ Test successful!")
251
251
 
252
252
  except Exception as e:
253
- print(f"\n✗ Test failed: {e}")
253
+ print(f"\n✗ Test failed: {e}", flush=True)
254
254
  sys.exit(1)
255
255
 
256
256