code-puppy 0.0.69__tar.gz → 0.0.70__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.
- {code_puppy-0.0.69 → code_puppy-0.0.70}/PKG-INFO +1 -1
- code_puppy-0.0.70/code_puppy/command_line/motd.py +45 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/pyproject.toml +1 -1
- {code_puppy-0.0.69 → code_puppy-0.0.70}/.gitignore +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/LICENSE +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/README.md +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/__init__.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/agent.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/agent_prompts.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/__init__.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/file_path_completion.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/meta_command_handler.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/model_picker_completion.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/prompt_toolkit_completion.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/utils.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/config.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/main.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/model_factory.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/models.json +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/session_memory.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/__init__.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/command_runner.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/common.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/file_modifications.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/file_operations.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/ts_code_map.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/tools/web_search.py +0 -0
- {code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/version_checker.py +0 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MOTD (Message of the Day) feature for code-puppy.
|
|
3
|
+
Stores seen versions in ~/.puppy_cfg/motd.txt.
|
|
4
|
+
"""
|
|
5
|
+
import os
|
|
6
|
+
from typing import Optional
|
|
7
|
+
|
|
8
|
+
MOTD_VERSION = "20240601"
|
|
9
|
+
MOTD_MESSAGE = """
|
|
10
|
+
June 14th, 2025 - Wow... code_puppy has been downloaded 10s of thousands of times.
|
|
11
|
+
|
|
12
|
+
This new update has a bug fix where message truncation would sometimes cause tool-calls and tool-replies
|
|
13
|
+
to become isolated, and an exception would be raied creating a situation only recoverable by restarting
|
|
14
|
+
code-puppy or using the `clear` command to get rid of all message history.
|
|
15
|
+
|
|
16
|
+
Thankfully that is fixed. Message truncation max-length is configurable with the following command:
|
|
17
|
+
`~set message_history_length 25` if you want to truncate to 25 messages. The default is 40.
|
|
18
|
+
|
|
19
|
+
This message-of-the-day will not appear again unless you run ~motd.
|
|
20
|
+
|
|
21
|
+
Please open issues on GitHub if you find any bugs! Cheers!
|
|
22
|
+
"""
|
|
23
|
+
MOTD_TRACK_FILE = os.path.expanduser("~/.puppy_cfg/motd.txt")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def has_seen_motd(version: str) -> bool:
|
|
27
|
+
if not os.path.exists(MOTD_TRACK_FILE):
|
|
28
|
+
return False
|
|
29
|
+
with open(MOTD_TRACK_FILE, "r") as f:
|
|
30
|
+
seen_versions = {line.strip() for line in f if line.strip()}
|
|
31
|
+
return version in seen_versions
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def mark_motd_seen(version: str):
|
|
35
|
+
os.makedirs(os.path.dirname(MOTD_TRACK_FILE), exist_ok=True)
|
|
36
|
+
with open(MOTD_TRACK_FILE, "a") as f:
|
|
37
|
+
f.write(f"{version}\n")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def print_motd(console, force: bool = False) -> bool:
|
|
41
|
+
if force or not has_seen_motd(MOTD_VERSION):
|
|
42
|
+
console.print(MOTD_MESSAGE)
|
|
43
|
+
mark_motd_seen(MOTD_VERSION)
|
|
44
|
+
return True
|
|
45
|
+
return False
|
|
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
|
{code_puppy-0.0.69 → code_puppy-0.0.70}/code_puppy/command_line/prompt_toolkit_completion.py
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|