patchpal 0.21.4__tar.gz → 0.21.6__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 (66) hide show
  1. {patchpal-0.21.4/patchpal.egg-info → patchpal-0.21.6}/PKG-INFO +7 -6
  2. {patchpal-0.21.4 → patchpal-0.21.6}/README.md +6 -5
  3. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/__init__.py +1 -1
  4. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/autopilot.py +12 -9
  5. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/sandbox.py +60 -10
  6. {patchpal-0.21.4 → patchpal-0.21.6/patchpal.egg-info}/PKG-INFO +7 -6
  7. {patchpal-0.21.4 → patchpal-0.21.6}/LICENSE +0 -0
  8. {patchpal-0.21.4 → patchpal-0.21.6}/MANIFEST.in +0 -0
  9. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/agent/__init__.py +0 -0
  10. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/agent/function_calling.py +0 -0
  11. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/agent/react.py +0 -0
  12. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/__init__.py +0 -0
  13. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/interactive.py +0 -0
  14. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/mcp.py +0 -0
  15. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/cli/streaming.py +0 -0
  16. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/config.py +0 -0
  17. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/context.py +0 -0
  18. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/permissions.py +0 -0
  19. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/prompts/react_prompt.md +0 -0
  20. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/prompts/system_prompt.md +0 -0
  21. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/skills.py +0 -0
  22. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/__init__.py +0 -0
  23. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/code_analysis.py +0 -0
  24. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/common.py +0 -0
  25. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/definitions.py +0 -0
  26. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/file_reading.py +0 -0
  27. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/file_writing.py +0 -0
  28. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/find_tool.py +0 -0
  29. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/grep_tool.py +0 -0
  30. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/image_handler.py +0 -0
  31. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/mcp.py +0 -0
  32. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/repo_map.py +0 -0
  33. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/shell_tools.py +0 -0
  34. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/todo_tools.py +0 -0
  35. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/tool_schema.py +0 -0
  36. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/user_interaction.py +0 -0
  37. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal/tools/web_tools.py +0 -0
  38. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal.egg-info/SOURCES.txt +0 -0
  39. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal.egg-info/dependency_links.txt +0 -0
  40. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal.egg-info/entry_points.txt +0 -0
  41. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal.egg-info/requires.txt +0 -0
  42. {patchpal-0.21.4 → patchpal-0.21.6}/patchpal.egg-info/top_level.txt +0 -0
  43. {patchpal-0.21.4 → patchpal-0.21.6}/pyproject.toml +0 -0
  44. {patchpal-0.21.4 → patchpal-0.21.6}/setup.cfg +0 -0
  45. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_agent.py +0 -0
  46. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_cli.py +0 -0
  47. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_config_dynamic.py +0 -0
  48. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_context.py +0 -0
  49. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_custom_tools.py +0 -0
  50. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_enabled_tools.py +0 -0
  51. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_find_tool.py +0 -0
  52. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_guardrails.py +0 -0
  53. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_image_blocking.py +0 -0
  54. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_maximum_security.py +0 -0
  55. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_mcp_config.py +0 -0
  56. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_memory.py +0 -0
  57. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_operational_safety.py +0 -0
  58. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_optional_tools.py +0 -0
  59. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_permissions.py +0 -0
  60. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_react.py +0 -0
  61. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_reasoning_content.py +0 -0
  62. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_repo_map.py +0 -0
  63. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_simplified_prompt.py +0 -0
  64. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_skills.py +0 -0
  65. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_streaming.py +0 -0
  66. {patchpal-0.21.4 → patchpal-0.21.6}/tests/test_tools.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchpal
3
- Version: 0.21.4
3
+ Version: 0.21.6
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
@@ -73,10 +73,11 @@ Full documentation is [here](https://amaiya.github.io/patchpal).
73
73
  ## Quick Start
74
74
 
75
75
  ```bash
76
- $ pip install patchpal # install
77
- $ patchpal # start
76
+ $ pip install patchpal # install
77
+ $ patchpal --model <model_id> # start
78
78
  ```
79
79
 
80
+ > Model support: Any [LiteLLM-supported model](https://models.litellm.ai/) is can be used.
80
81
  > Platform support: Linux, macOS, and Windows are all supported
81
82
 
82
83
  **Alternative: Run with Docker/Podman (no installation required)**
@@ -87,16 +88,16 @@ docker run -it --rm \
87
88
  -v $(pwd):/workspace \
88
89
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
89
90
  ghcr.io/amaiya/patchpal-sandbox:latest \
90
- patchpal
91
+ patchpal --model anthropic/claude-sonnet-4-5
91
92
 
92
93
  # Or with Podman
93
94
  podman run -it --rm \
94
95
  -v $(pwd):/workspace \
95
96
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
96
97
  ghcr.io/amaiya/patchpal-sandbox:latest \
97
- patchpal
98
+ patchpal --model anthropic/claude-sonnet-4-5
98
99
 
99
- # Specify a different model with --model
100
+ # Specify a different model
100
101
  docker run -it --rm \
101
102
  -v $(pwd):/workspace \
102
103
  -e OPENAI_API_KEY=$OPENAI_API_KEY \
@@ -24,10 +24,11 @@ Full documentation is [here](https://amaiya.github.io/patchpal).
24
24
  ## Quick Start
25
25
 
26
26
  ```bash
27
- $ pip install patchpal # install
28
- $ patchpal # start
27
+ $ pip install patchpal # install
28
+ $ patchpal --model <model_id> # start
29
29
  ```
30
30
 
31
+ > Model support: Any [LiteLLM-supported model](https://models.litellm.ai/) is can be used.
31
32
  > Platform support: Linux, macOS, and Windows are all supported
32
33
 
33
34
  **Alternative: Run with Docker/Podman (no installation required)**
@@ -38,16 +39,16 @@ docker run -it --rm \
38
39
  -v $(pwd):/workspace \
39
40
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
40
41
  ghcr.io/amaiya/patchpal-sandbox:latest \
41
- patchpal
42
+ patchpal --model anthropic/claude-sonnet-4-5
42
43
 
43
44
  # Or with Podman
44
45
  podman run -it --rm \
45
46
  -v $(pwd):/workspace \
46
47
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
47
48
  ghcr.io/amaiya/patchpal-sandbox:latest \
48
- patchpal
49
+ patchpal --model anthropic/claude-sonnet-4-5
49
50
 
50
- # Specify a different model with --model
51
+ # Specify a different model
51
52
  docker run -it --rm \
52
53
  -v $(pwd):/workspace \
53
54
  -e OPENAI_API_KEY=$OPENAI_API_KEY \
@@ -1,6 +1,6 @@
1
1
  """PatchPal - An open-source Claude Code clone implemented purely in Python."""
2
2
 
3
- __version__ = "0.21.4"
3
+ __version__ = "0.21.6"
4
4
 
5
5
  from patchpal.agent import create_agent, create_react_agent
6
6
  from patchpal.cli.autopilot import autopilot_loop
@@ -18,8 +18,8 @@ ONLY use in isolated environments (Docker containers, VMs, throwaway projects).
18
18
  See examples/ralph/README.md for detailed safety guidelines.
19
19
 
20
20
  Usage:
21
- patchpal-autopilot --prompt "Build a REST API with tests" --completion-promise "COMPLETE"
22
- patchpal-autopilot --prompt-file task.md --completion-promise "DONE" --max-iterations 50
21
+ patchpal-autopilot --prompt "Build a REST API with tests"
22
+ patchpal-autopilot --prompt-file task.md --max-iterations 50
23
23
  """
24
24
 
25
25
  import argparse
@@ -184,19 +184,22 @@ def main():
184
184
  epilog="""
185
185
  Examples:
186
186
  # Build a calculator with tests
187
- patchpal-autopilot --prompt "Create calculator.py with add, subtract, multiply, divide functions. Create test_calculator.py with pytest tests. Run tests to verify." --completion-promise "COMPLETE" --max-iterations 20
187
+ patchpal-autopilot --prompt "Create calculator.py with add, subtract, multiply, divide functions. Create test_calculator.py with pytest tests. Run tests to verify." --max-iterations 20
188
188
 
189
189
  # Refactor code with specific completion criteria
190
- patchpal-autopilot --prompt "Refactor auth.py to use async/await. Update all tests. Run tests to verify." --completion-promise "COMPLETE"
190
+ patchpal-autopilot --model openai/gpt-5-mini --prompt "Refactor auth.py to use async/await. Update all tests. Run tests to verify."
191
191
 
192
192
  # Use prompt from file
193
- patchpal-autopilot --prompt-file task.md --completion-promise "DONE" --max-iterations 50
193
+ patchpal-autopilot --prompt-file task.md --max-iterations 50
194
194
 
195
195
  # With local Ollama model (zero API cost)
196
- patchpal-autopilot --model ollama_chat/qwen2.5-coder:7b --prompt "..." --completion-promise "COMPLETE"
196
+ patchpal-autopilot --model ollama_chat/qwen2.5-coder:7b --prompt "..."
197
+
198
+ # Custom completion promise (optional, defaults to "COMPLETE")
199
+ patchpal-autopilot --prompt-file task.md --completion-promise "DONE"
197
200
 
198
201
  # Skip confirmation prompt (for automation/scripts)
199
- PATCHPAL_AUTOPILOT_CONFIRMED=true patchpal-autopilot --prompt-file task.md --completion-promise "DONE"
202
+ PATCHPAL_AUTOPILOT_CONFIRMED=true patchpal-autopilot --prompt-file task.md
200
203
 
201
204
  Prompt Best Practices:
202
205
  - Include the completion promise in your prompt (agent sees this as the goal)
@@ -222,8 +225,8 @@ Related Resources (Ralph Wiggum Technique):
222
225
  parser.add_argument(
223
226
  "--completion-promise",
224
227
  type=str,
225
- required=True,
226
- help='String that signals completion (e.g., "COMPLETE", "DONE")',
228
+ default="COMPLETE",
229
+ help='String that signals completion (default: "COMPLETE")',
227
230
  )
228
231
  parser.add_argument(
229
232
  "--max-iterations",
@@ -6,7 +6,7 @@ Provides sandboxed execution for both interactive and autopilot modes.
6
6
 
7
7
  Usage:
8
8
  patchpal-sandbox --model openai/gpt-5.2-codex
9
- patchpal-sandbox --env-file .env -- autopilot --prompt "Fix the bug" --completion-promise "DONE"
9
+ patchpal-sandbox --env-file .env -- autopilot --prompt "Fix the bug"
10
10
  patchpal-sandbox --host-network -- --model ollama_chat/llama3.1
11
11
  """
12
12
 
@@ -213,11 +213,33 @@ def build_container_args(sandbox_args, patchpal_args):
213
213
  container_args.extend(["-v", f"{patchpal_dir}:/root/.patchpal"])
214
214
  mounted_paths.add(patchpal_dir)
215
215
 
216
+ # Development mode: mount local patchpal source code
217
+ dev_mode = False
218
+ if sandbox_args.dev:
219
+ # Check if we're in the patchpal repo (look for pyproject.toml or setup.py)
220
+ repo_root = os.getcwd()
221
+ if os.path.isfile(os.path.join(repo_root, "pyproject.toml")) or os.path.isfile(
222
+ os.path.join(repo_root, "setup.py")
223
+ ):
224
+ # Mount the patchpal source directory
225
+ container_args.extend(["-v", f"{repo_root}:/patchpal-dev"])
226
+ dev_mode = True
227
+ print("ℹ️ Development mode: Mounting local patchpal code from", repo_root)
228
+ else:
229
+ print(
230
+ "⚠️ Warning: --dev flag used but not in patchpal repo root (no pyproject.toml or setup.py found)"
231
+ )
232
+
216
233
  # Mount SSL certificates if they exist (Linux/WSL)
217
234
  ssl_cert_file = "/etc/ssl/certs/ca-certificates.crt"
218
235
  if os.path.isfile(ssl_cert_file):
219
236
  container_args.extend(["-v", f"{ssl_cert_file}:{ssl_cert_file}:ro"])
220
237
  mounted_paths.add(ssl_cert_file)
238
+ # Set environment variables so Python's requests library uses the mounted cert
239
+ if "SSL_CERT_FILE" not in os.environ:
240
+ container_args.extend(["-e", f"SSL_CERT_FILE={ssl_cert_file}"])
241
+ if "REQUESTS_CA_BUNDLE" not in os.environ:
242
+ container_args.extend(["-e", f"REQUESTS_CA_BUNDLE={ssl_cert_file}"])
221
243
 
222
244
  ssl_cert_dir = "/usr/local/share/ca-certificates"
223
245
  if os.path.isdir(ssl_cert_dir) and os.listdir(ssl_cert_dir):
@@ -225,12 +247,20 @@ def build_container_args(sandbox_args, patchpal_args):
225
247
  mounted_paths.add(ssl_cert_dir)
226
248
 
227
249
  # Mount SSL_CERT_FILE and REQUESTS_CA_BUNDLE if set
250
+ # Map host cert files to /tmp inside container since parent dirs may not exist
251
+ cert_mapping = {} # Track host path -> container path mappings
228
252
  for env_var in ["SSL_CERT_FILE", "REQUESTS_CA_BUNDLE"]:
229
253
  cert_path = os.environ.get(env_var)
230
- if cert_path and os.path.isfile(cert_path) and cert_path not in mounted_paths:
231
- container_args.extend(["-v", f"{cert_path}:{cert_path}:ro"])
232
- container_args.extend(["-e", f"{env_var}={cert_path}"])
233
- mounted_paths.add(cert_path)
254
+ if cert_path and os.path.isfile(cert_path):
255
+ if cert_path not in cert_mapping:
256
+ # First time seeing this cert file - mount it
257
+ container_cert_path = f"/tmp/{os.path.basename(cert_path)}"
258
+ container_args.extend(["-v", f"{cert_path}:{container_cert_path}:ro"])
259
+ cert_mapping[cert_path] = container_cert_path
260
+ mounted_paths.add(cert_path)
261
+
262
+ # Always set the environment variable to point to the container path
263
+ container_args.extend(["-e", f"{env_var}={cert_mapping[cert_path]}"])
234
264
 
235
265
  # Add image
236
266
  container_args.append(sandbox_args.image)
@@ -248,11 +278,16 @@ def build_container_args(sandbox_args, patchpal_args):
248
278
 
249
279
  quoted_args = " ".join(shlex.quote(arg) for arg in patchpal_cmd_args)
250
280
 
251
- # If using pre-built patchpal-sandbox image, skip pip install
252
- # Otherwise, install patchpal first (fallback for custom images)
253
- if "patchpal-sandbox" in sandbox_args.image:
281
+ # Build the shell command
282
+ if dev_mode:
283
+ # Development mode: reinstall patchpal from mounted source
284
+ # Show pip output in case of errors, but suppress normal installation messages
285
+ shell_cmd = f"pip install -e /patchpal-dev 2>&1 | grep -i error || true && {patchpal_cmd} {quoted_args}"
286
+ elif "patchpal-sandbox" in sandbox_args.image:
287
+ # Using pre-built image, skip pip install
254
288
  shell_cmd = f"{patchpal_cmd} {quoted_args}"
255
289
  else:
290
+ # Custom image, install patchpal from PyPI
256
291
  shell_cmd = f"pip install -q patchpal && {patchpal_cmd} {quoted_args}"
257
292
 
258
293
  container_args.extend(["bash", "-c", shell_cmd])
@@ -379,10 +414,10 @@ EXAMPLES:
379
414
  patchpal-sandbox --env-file ~/.config/patchpal/.env -- --model anthropic/claude-sonnet-4-5
380
415
 
381
416
  # AutoPilot mode - permissions automatically DISABLED
382
- patchpal-sandbox -- autopilot --model openai/gpt-5-mini --prompt "Add error handling to auth.py" --completion-promise "COMPLETE"
417
+ patchpal-sandbox -- autopilot --model openai/gpt-5-mini --prompt "Add error handling to auth.py"
383
418
 
384
419
  # AutoPilot mode - read file containing prompt and and .env file
385
- patchpal-sandbox --env-file .env -- autopilot --model openai/gpt-5.2-codex --prompt-file task.md --completion-promise "DONE"
420
+ patchpal-sandbox --env-file .env -- autopilot --model openai/gpt-5.2-codex --prompt-file task.md
386
421
 
387
422
  # Ollama: Linux/WSL requires host network to reach Ollama on localhost
388
423
  patchpal-sandbox --host-network -- --model ollama_chat/qwen3:8b # interactive
@@ -433,6 +468,11 @@ def main():
433
468
  parser.add_argument("--memory", default=None)
434
469
  parser.add_argument("--cpus", type=float, default=None)
435
470
  parser.add_argument("--env-file", default=None)
471
+ parser.add_argument(
472
+ "--dev",
473
+ action="store_true",
474
+ help="Mount local patchpal code for development (requires being run from patchpal repo root)",
475
+ )
436
476
 
437
477
  try:
438
478
  sandbox_args = parser.parse_args(sandbox_argv)
@@ -459,6 +499,16 @@ def main():
459
499
  print(f"Image: {sandbox_args.image}")
460
500
  print(f"Network: {sandbox_args.network}")
461
501
  print(f"Workspace: {os.getcwd()}")
502
+
503
+ # Debug: Show SSL cert files being mounted (if any)
504
+ ssl_env_vars = {
505
+ k: v for k, v in os.environ.items() if "SSL" in k or "CERT" in k or "CA_BUNDLE" in k
506
+ }
507
+ if ssl_env_vars and sandbox_args.dev:
508
+ print("\n🔒 SSL environment variables (dev mode debug):")
509
+ for k, v in ssl_env_vars.items():
510
+ print(f" {k}={v}")
511
+
462
512
  print()
463
513
 
464
514
  # Run container
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: patchpal
3
- Version: 0.21.4
3
+ Version: 0.21.6
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
@@ -73,10 +73,11 @@ Full documentation is [here](https://amaiya.github.io/patchpal).
73
73
  ## Quick Start
74
74
 
75
75
  ```bash
76
- $ pip install patchpal # install
77
- $ patchpal # start
76
+ $ pip install patchpal # install
77
+ $ patchpal --model <model_id> # start
78
78
  ```
79
79
 
80
+ > Model support: Any [LiteLLM-supported model](https://models.litellm.ai/) is can be used.
80
81
  > Platform support: Linux, macOS, and Windows are all supported
81
82
 
82
83
  **Alternative: Run with Docker/Podman (no installation required)**
@@ -87,16 +88,16 @@ docker run -it --rm \
87
88
  -v $(pwd):/workspace \
88
89
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
89
90
  ghcr.io/amaiya/patchpal-sandbox:latest \
90
- patchpal
91
+ patchpal --model anthropic/claude-sonnet-4-5
91
92
 
92
93
  # Or with Podman
93
94
  podman run -it --rm \
94
95
  -v $(pwd):/workspace \
95
96
  -e ANTHROPIC_API_KEY=$ANTHROPIC_API_KEY \
96
97
  ghcr.io/amaiya/patchpal-sandbox:latest \
97
- patchpal
98
+ patchpal --model anthropic/claude-sonnet-4-5
98
99
 
99
- # Specify a different model with --model
100
+ # Specify a different model
100
101
  docker run -it --rm \
101
102
  -v $(pwd):/workspace \
102
103
  -e OPENAI_API_KEY=$OPENAI_API_KEY \
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes