kopipasta 0.23.0__tar.gz → 0.24.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.

Potentially problematic release.


This version of kopipasta might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kopipasta
3
- Version: 0.23.0
3
+ Version: 0.24.0
4
4
  Summary: A CLI tool to generate prompts with project structure and file contents
5
5
  Home-page: https://github.com/mkorpela/kopipasta
6
6
  Author: Mikko Korpela
@@ -862,9 +862,12 @@ def start_chat_session(initial_prompt: str):
862
862
  print("\n" + "-"*20)
863
863
 
864
864
  while True:
865
+ is_patch_request = False
865
866
  try:
866
- # Replace standard input with prompt_toolkit for multiline support
867
- user_input = prompt("👤 You (Submit with Esc+Enter or Alt+Enter): ", multiline=True)
867
+ # Print the header on a separate line
868
+ print("👤 You (Submit with Esc+Enter):")
869
+ # Get input using prompt_toolkit with a minimal indicator
870
+ user_input = prompt(">> ", multiline=True)
868
871
  # prompt_toolkit raises EOFError on Ctrl+D, so this handler remains correct.
869
872
  except EOFError:
870
873
  print("\nExiting...")
@@ -875,19 +878,33 @@ def start_chat_session(initial_prompt: str):
875
878
 
876
879
  if user_input.lower() == '/q':
877
880
  break
878
- elif user_input.strip() == '/patch':
879
- print("\n🤖 Gemini: Thinking... (requesting code changes)")
880
- # Prompt instructing the model to use the new JSON format
881
+ elif user_input.endswith('/patch'):
882
+ is_patch_request = True
883
+ # Extract message before /patch
884
+ user_message = user_input[:-len('/patch')].strip()
885
+ print(f"\n🛠️ Requesting patches... (Context: '{user_message}' if provided)")
886
+ elif not user_input:
887
+ continue # Ignore empty input
888
+ else:
889
+ user_message = user_input # Regular message
890
+
891
+
892
+ # --- Handle Patch Request ---
893
+ if is_patch_request:
894
+ print("🤖 Gemini: Thinking... (generating code changes)")
895
+ # Include user message part if it exists
896
+ patch_context = f"Based on our conversation and specifically: \"{user_message}\"\n\n" if user_message else "Based on our conversation,\n\n"
897
+
881
898
  patch_request_prompt = (
882
- "Based on our conversation, generate the necessary code changes "
883
- "to fulfill my request. Provide the changes as a JSON list, where each item "
899
+ patch_context +
900
+ "Generate the necessary code changes to fulfill the request. Provide the changes as a JSON list, where each item "
884
901
  "is an object with the following keys:\n"
885
902
  "- 'reasoning': Explain why this specific change is needed.\n"
886
903
  "- 'file_path': The relative path to the file to modify.\n"
887
904
  "- 'original_text': The exact, unique block of text to replace.\n"
888
- "- 'new_text': The text to replace original_text with.\n"
905
+ "- 'new_text': The text to replace original_text with. Do not include any temporary comments like '// CHANGE BEGINS' or '/* PATCH START */'.\n"
889
906
  "Ensure 'original_text' is unique within the specified 'file_path'. "
890
- "Format the response strictly as: { \"patches\": [ { patch_item_1 }, { patch_item_2 }, ... ] }"
907
+ "Respond ONLY with the JSON object conforming to this structure: { \"patches\": [ { patch_item_1 }, { patch_item_2 }, ... ] }"
891
908
  )
892
909
 
893
910
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: kopipasta
3
- Version: 0.23.0
3
+ Version: 0.24.0
4
4
  Summary: A CLI tool to generate prompts with project structure and file contents
5
5
  Home-page: https://github.com/mkorpela/kopipasta
6
6
  Author: Mikko Korpela
@@ -10,7 +10,7 @@ with open("requirements.txt", "r", encoding="utf-8") as f:
10
10
 
11
11
  setup(
12
12
  name="kopipasta",
13
- version="0.23.0",
13
+ version="0.24.0",
14
14
  author="Mikko Korpela",
15
15
  author_email="mikko.korpela@gmail.com",
16
16
  description="A CLI tool to generate prompts with project structure and file contents",
File without changes
File without changes
File without changes
File without changes
File without changes