meshapi-code 0.2.0__tar.gz → 0.2.1__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.
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/PKG-INFO +1 -1
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/pyproject.toml +1 -1
- meshapi_code-0.2.1/src/meshapi/__init__.py +1 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/cli.py +38 -11
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/render.py +6 -3
- meshapi_code-0.2.0/src/meshapi/__init__.py +0 -1
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/.github/workflows/publish.yml +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/.gitignore +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/CLAUDE.md +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/LICENSE +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/README.md +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/__main__.py +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/client.py +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/commands.py +0 -0
- {meshapi_code-0.2.0 → meshapi_code-0.2.1}/src/meshapi/config.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.1"
|
|
@@ -7,13 +7,25 @@ import httpx
|
|
|
7
7
|
from prompt_toolkit import PromptSession
|
|
8
8
|
from prompt_toolkit.history import FileHistory
|
|
9
9
|
from prompt_toolkit.styles import Style
|
|
10
|
-
from rich.
|
|
10
|
+
from rich.text import Text
|
|
11
11
|
|
|
12
12
|
from . import __version__
|
|
13
13
|
from .client import stream_chat
|
|
14
14
|
from .commands import handle_command
|
|
15
15
|
from .config import CONFIG_FILE, HISTORY_FILE, load_config
|
|
16
|
-
from .render import BRAND, BRAND_BG, BRAND_DIM, console, fmt_usd, pretty_cwd, render_stream
|
|
16
|
+
from .render import BRAND, BRAND_BG, BRAND_BG_FG, BRAND_DIM, console, fmt_usd, pretty_cwd, render_stream
|
|
17
|
+
|
|
18
|
+
# ANSI Shadow figlet font
|
|
19
|
+
MESH_LOGO_LINES = [
|
|
20
|
+
"███╗ ███╗███████╗███████╗██╗ ██╗",
|
|
21
|
+
"████╗ ████║██╔════╝██╔════╝██║ ██║",
|
|
22
|
+
"██╔████╔██║█████╗ ███████╗███████║",
|
|
23
|
+
"██║╚██╔╝██║██╔══╝ ╚════██║██╔══██║",
|
|
24
|
+
"██║ ╚═╝ ██║███████╗███████║██║ ██║",
|
|
25
|
+
"╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═╝",
|
|
26
|
+
]
|
|
27
|
+
LOGO_WIDTH = 35 # chars per line
|
|
28
|
+
LOGO_GUTTER = 3 # spaces between logo and info column
|
|
17
29
|
|
|
18
30
|
|
|
19
31
|
def parse_args(argv=None) -> argparse.Namespace:
|
|
@@ -46,14 +58,29 @@ def main() -> None:
|
|
|
46
58
|
}
|
|
47
59
|
|
|
48
60
|
session = PromptSession(history=FileHistory(str(HISTORY_FILE)))
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
f"
|
|
54
|
-
"
|
|
55
|
-
|
|
56
|
-
|
|
61
|
+
|
|
62
|
+
info_per_line: list = [
|
|
63
|
+
None,
|
|
64
|
+
None,
|
|
65
|
+
Text.from_markup(f"[bold {BRAND}]✦ meshapi {__version__}[/bold {BRAND}]"),
|
|
66
|
+
Text.from_markup(f"cwd: [{BRAND}]{pretty_cwd()}[/{BRAND}]"),
|
|
67
|
+
Text.from_markup(f"model: [bold {BRAND}]{cfg['model']}[/bold {BRAND}]"),
|
|
68
|
+
Text.from_markup(f"route: [{BRAND}]{cfg.get('route') or 'default'}[/{BRAND}]"),
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
console.print() # top gap so banner doesn't crowd the shell prompt
|
|
72
|
+
for i, logo_line in enumerate(MESH_LOGO_LINES):
|
|
73
|
+
line = Text()
|
|
74
|
+
line.append(logo_line, style=BRAND)
|
|
75
|
+
info = info_per_line[i] if i < len(info_per_line) else None
|
|
76
|
+
if info is not None:
|
|
77
|
+
pad = max(0, LOGO_WIDTH - len(logo_line))
|
|
78
|
+
line.append(" " * (pad + LOGO_GUTTER))
|
|
79
|
+
line.append(info)
|
|
80
|
+
console.print(line)
|
|
81
|
+
console.print()
|
|
82
|
+
console.print("type /help for commands, /exit to quit", style=BRAND_DIM)
|
|
83
|
+
console.print() # bottom gap before the first prompt rule
|
|
57
84
|
|
|
58
85
|
while True:
|
|
59
86
|
try:
|
|
@@ -67,7 +94,7 @@ def main() -> None:
|
|
|
67
94
|
"› ",
|
|
68
95
|
style=Style.from_dict({
|
|
69
96
|
"prompt": f"bold fg:{BRAND} bg:{BRAND_BG}",
|
|
70
|
-
"": f"bg:{BRAND_BG}",
|
|
97
|
+
"": f"fg:{BRAND_BG_FG} bg:{BRAND_BG}",
|
|
71
98
|
}),
|
|
72
99
|
)
|
|
73
100
|
console.rule(style=BRAND_DIM, characters="─")
|
|
@@ -29,13 +29,16 @@ def _detect_theme() -> str:
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
# Brand palette — Mesh API purple, theme-adaptive
|
|
32
|
-
BRAND = "#6f5af5" # foreground brand, same on both themes
|
|
33
32
|
if _detect_theme() == "dark":
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
BRAND = "#8b78f7" # bumped lighter on dark — official #6f5af5 reads dim on dark wine/black
|
|
34
|
+
BRAND_DIM = "#aea3f0" # lighter dim — clearly visible on dark backgrounds
|
|
35
|
+
BRAND_BG = "#372d73" # mid-dark purple — clearly visible without being loud
|
|
36
|
+
BRAND_BG_FG = "#f5f0ff" # near-white with slight purple tint for input text
|
|
36
37
|
else:
|
|
38
|
+
BRAND = "#6f5af5" # official brand color — strong contrast on white
|
|
37
39
|
BRAND_DIM = "#5a4ec4" # darker dim — visible on light bg
|
|
38
40
|
BRAND_BG = "#ebe4fc" # pale lavender highlight against white
|
|
41
|
+
BRAND_BG_FG = "#2c2540" # near-black with purple tint for input text on light theme
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
def fmt_usd(value) -> str:
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.0"
|
|
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
|