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.
- {kopipasta-0.23.0/kopipasta.egg-info → kopipasta-0.24.0}/PKG-INFO +1 -1
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta/main.py +26 -9
- {kopipasta-0.23.0 → kopipasta-0.24.0/kopipasta.egg-info}/PKG-INFO +1 -1
- {kopipasta-0.23.0 → kopipasta-0.24.0}/setup.py +1 -1
- {kopipasta-0.23.0 → kopipasta-0.24.0}/LICENSE +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/MANIFEST.in +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/README.md +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta/__init__.py +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta.egg-info/SOURCES.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta.egg-info/dependency_links.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta.egg-info/entry_points.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta.egg-info/requires.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/kopipasta.egg-info/top_level.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/requirements.txt +0 -0
- {kopipasta-0.23.0 → kopipasta-0.24.0}/setup.cfg +0 -0
|
@@ -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
|
-
#
|
|
867
|
-
|
|
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.
|
|
879
|
-
|
|
880
|
-
#
|
|
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
|
-
|
|
883
|
-
"to fulfill
|
|
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
|
-
"
|
|
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:
|
|
@@ -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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|