code-puppy 0.0.68__py3-none-any.whl → 0.0.70__py3-none-any.whl

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.
@@ -12,8 +12,8 @@ from code_puppy.command_line.utils import make_directory_table
12
12
  META_COMMANDS_HELP = """
13
13
  [bold magenta]Meta Commands Help[/bold magenta]
14
14
  ~help, ~h Show this help message
15
- ~cd [dir] Change directory or show directories
16
- ~codemap [dir] Show code structure for [dir]
15
+ ~cd <dir> Change directory or show directories
16
+ ~codemap <dir> Show code structure for <dir>
17
17
  ~m <model> Set active model
18
18
  ~motd Show the latest message of the day (MOTD)
19
19
  ~show Show puppy config key-values
@@ -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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code-puppy
3
- Version: 0.0.68
3
+ Version: 0.0.70
4
4
  Summary: Code generation agent
5
5
  Author: Michael Pfaffenberger
6
6
  License: MIT
@@ -9,8 +9,9 @@ code_puppy/session_memory.py,sha256=4sgAAjbXdLSi8hETpd56tgtrG6hqMUuZWDlJOu6BQjA,
9
9
  code_puppy/version_checker.py,sha256=aRGulzuY4C4CdFvU1rITduyL-1xTFsn4GiD1uSfOl_Y,396
10
10
  code_puppy/command_line/__init__.py,sha256=y7WeRemfYppk8KVbCGeAIiTuiOszIURCDjOMZv_YRmU,45
11
11
  code_puppy/command_line/file_path_completion.py,sha256=gw8NpIxa6GOpczUJRyh7VNZwoXKKn-yvCqit7h2y6Gg,2931
12
- code_puppy/command_line/meta_command_handler.py,sha256=LCRwta1uUC56h3reybm4ea-m6XFCOw45siVxo09mC2k,6121
12
+ code_puppy/command_line/meta_command_handler.py,sha256=kP57BU7gH23ten0CHX1XmrCbe89WFxoHzz6ddeRGrCE,6121
13
13
  code_puppy/command_line/model_picker_completion.py,sha256=NkyZZG7IhcVWSJ3ADytwCA5f8DpNeVs759Qtqs4fQtY,3733
14
+ code_puppy/command_line/motd.py,sha256=ZsI5fVW4aALs-YDtZ3mR7HSkD9VY4bjVQEqzHult2zk,1593
14
15
  code_puppy/command_line/prompt_toolkit_completion.py,sha256=_gP0FIOgHDNHTTWLNL0XNzr6sO0ISe7Mec1uQNo9kcM,8337
15
16
  code_puppy/command_line/utils.py,sha256=7eyxDHjPjPB9wGDJQQcXV_zOsGdYsFgI0SGCetVmTqE,1251
16
17
  code_puppy/tools/__init__.py,sha256=J_HCbkivdr1rP5vfucxttXhGmTBx0S2LNoDMrbaE-Fc,558
@@ -20,9 +21,9 @@ code_puppy/tools/file_modifications.py,sha256=d0fC2CCnkmv0kEJ8kvKTuUMTww3S_mgF06
20
21
  code_puppy/tools/file_operations.py,sha256=xqj7MiK6sGTaC8NMrMRTybWlXG32S-DjybqJtnufRcI,11715
21
22
  code_puppy/tools/ts_code_map.py,sha256=-CXLzFxFMefoYYdWxfPwFugZhkfVxdiftGb3LZnEttk,17567
22
23
  code_puppy/tools/web_search.py,sha256=sA2ierjuuYA517-uhb5s53SgeVsyOe1nExoZsrU1Fps,1284
23
- code_puppy-0.0.68.data/data/code_puppy/models.json,sha256=AY1dcFd3bMFaJBjU_u-PjsrnmcKbjjtGhjL3uYfqpW8,1692
24
- code_puppy-0.0.68.dist-info/METADATA,sha256=EzQk3DSvZYzQX8s1-HVZHZFDLEuh5KWfJoPeGKVmuDU,4955
25
- code_puppy-0.0.68.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
26
- code_puppy-0.0.68.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
27
- code_puppy-0.0.68.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
28
- code_puppy-0.0.68.dist-info/RECORD,,
24
+ code_puppy-0.0.70.data/data/code_puppy/models.json,sha256=AY1dcFd3bMFaJBjU_u-PjsrnmcKbjjtGhjL3uYfqpW8,1692
25
+ code_puppy-0.0.70.dist-info/METADATA,sha256=UhgU7uOQrUqwByIlrFpizfETVSK_0Ry3CRAl5NdTbqw,4955
26
+ code_puppy-0.0.70.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
27
+ code_puppy-0.0.70.dist-info/entry_points.txt,sha256=d8YkBvIUxF-dHNJAj-x4fPEqizbY5d_TwvYpc01U5kw,58
28
+ code_puppy-0.0.70.dist-info/licenses/LICENSE,sha256=31u8x0SPgdOq3izJX41kgFazWsM43zPEF9eskzqbJMY,1075
29
+ code_puppy-0.0.70.dist-info/RECORD,,