codegpt-ai 2.2.0 → 2.7.0
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.
- package/chat.py +70 -6
- package/package.json +1 -1
package/chat.py
CHANGED
|
@@ -1222,9 +1222,13 @@ def print_header(model):
|
|
|
1222
1222
|
compact = is_compact()
|
|
1223
1223
|
|
|
1224
1224
|
if compact:
|
|
1225
|
-
console.print(
|
|
1225
|
+
console.print()
|
|
1226
|
+
console.print(Text.from_markup(
|
|
1227
|
+
f" [bold red]Code[/][bold bright_blue]GPT[/] [dim]v2.0 · {model}[/]"
|
|
1228
|
+
))
|
|
1229
|
+
console.print(Rule(style="dim", characters="─"))
|
|
1230
|
+
console.print()
|
|
1226
1231
|
else:
|
|
1227
|
-
# Clean startup like Claude Code — no ASCII art on repeat, just info
|
|
1228
1232
|
is_local = "localhost" in OLLAMA_URL or "127.0.0.1" in OLLAMA_URL
|
|
1229
1233
|
server = "local" if is_local else OLLAMA_URL.split("//")[1].split("/")[0] if "//" in OLLAMA_URL else "?"
|
|
1230
1234
|
profile = load_profile()
|
|
@@ -1232,15 +1236,75 @@ def print_header(model):
|
|
|
1232
1236
|
mem_count = len(load_memories())
|
|
1233
1237
|
|
|
1234
1238
|
console.print()
|
|
1235
|
-
|
|
1239
|
+
|
|
1240
|
+
# Banner parts
|
|
1241
|
+
R = "bold red"
|
|
1242
|
+
B = "bold bright_blue"
|
|
1243
|
+
D = "dim"
|
|
1244
|
+
|
|
1245
|
+
def build_banner(pos):
|
|
1246
|
+
"""Build banner with spider at given position (0-7 around the border)."""
|
|
1247
|
+
sp_faces = [" /╲(o.o)╱\\", " /╲(o.o)╱\\", "~~~(o.o)>", "~~~(o.o)>",
|
|
1248
|
+
" \\╱(o.o)╲/", " \\╱(o.o)╲/", "<(o.o)~~~", "<(o.o)~~~"]
|
|
1249
|
+
spider = sp_faces[pos % 8]
|
|
1250
|
+
|
|
1251
|
+
top_b = f"[{R}] ╔════════════════════════════════════════════════════╗[/]"
|
|
1252
|
+
bot_b = f"[{R}] ╚════════════════════════════════════════════════════╝[/]"
|
|
1253
|
+
empty = f"[{R}] ║[/] [{R}]║[/]"
|
|
1254
|
+
title = f"[{R}] ║[/] [{R}]C[/][{B}]o[/][{R}]d[/][{B}]e[/] [{R}]G[/][{B}]P[/][{R}]T[/] [{D}]v2.0[/] [{R}]║[/]"
|
|
1255
|
+
sub = f"[{R}] ║[/] [{D}]local ai · powered by ollama[/] [{R}]║[/]"
|
|
1256
|
+
stats = f"[{R}] ║[/] [{B}]123[/] [{D}]commands ·[/] [{B}]26[/] [{D}]tools ·[/] [{B}]8[/] [{D}]agents[/] [{R}]║[/]"
|
|
1257
|
+
|
|
1258
|
+
lines = []
|
|
1259
|
+
p = pos % 8
|
|
1260
|
+
|
|
1261
|
+
if p in (0, 1): # top
|
|
1262
|
+
lines.append(f"[{D}] {spider}[/]")
|
|
1263
|
+
lines.append(f"[{D}] ||[/]")
|
|
1264
|
+
lines.extend([top_b, empty, title, sub, stats, empty, bot_b])
|
|
1265
|
+
elif p in (2, 3): # right
|
|
1266
|
+
lines.append(top_b)
|
|
1267
|
+
lines.append(empty)
|
|
1268
|
+
lines.append(title)
|
|
1269
|
+
lines.append(f"[{R}] ║[/] [{D}]local ai · powered by ollama[/] [{R}]║[/][{D}]~~{spider}[/]")
|
|
1270
|
+
lines.extend([stats, empty, bot_b])
|
|
1271
|
+
elif p in (4, 5): # bottom
|
|
1272
|
+
lines.extend([top_b, empty, title, sub, stats, empty, bot_b])
|
|
1273
|
+
lines.append(f"[{D}] ||[/]")
|
|
1274
|
+
lines.append(f"[{D}] {spider}[/]")
|
|
1275
|
+
else: # left (6, 7)
|
|
1276
|
+
lines.append(top_b)
|
|
1277
|
+
lines.append(empty)
|
|
1278
|
+
lines.append(f"[{D}]{spider}~~[/][{R}]║[/] [{R}]C[/][{B}]o[/][{R}]d[/][{B}]e[/] [{R}]G[/][{B}]P[/][{R}]T[/] [{D}]v2.0[/] [{R}]║[/]")
|
|
1279
|
+
lines.extend([sub, stats, empty, bot_b])
|
|
1280
|
+
|
|
1281
|
+
return "\n".join(lines)
|
|
1282
|
+
|
|
1283
|
+
# Animate spider crawling around the banner
|
|
1284
|
+
try:
|
|
1285
|
+
with Live(
|
|
1286
|
+
Text.from_markup(build_banner(0)),
|
|
1287
|
+
console=console, refresh_per_second=6, transient=True,
|
|
1288
|
+
) as live:
|
|
1289
|
+
for frame in range(16): # 2 full laps
|
|
1290
|
+
live.update(Text.from_markup(build_banner(frame)))
|
|
1291
|
+
time.sleep(0.2)
|
|
1292
|
+
|
|
1293
|
+
# Final position — static
|
|
1294
|
+
import random
|
|
1295
|
+
final = random.randint(0, 7)
|
|
1296
|
+
console.print(Text.from_markup(build_banner(final)))
|
|
1297
|
+
except Exception:
|
|
1298
|
+
# Fallback if Live doesn't work
|
|
1299
|
+
console.print(Text.from_markup(build_banner(0)))
|
|
1236
1300
|
console.print()
|
|
1237
1301
|
console.print(Text.from_markup(
|
|
1238
|
-
f" [dim]model[/] [
|
|
1302
|
+
f" [dim]model[/] [bright_blue]{model}[/]\n"
|
|
1239
1303
|
f" [dim]server[/] [green]{server}[/]\n"
|
|
1240
1304
|
f" [dim]user[/] {name}\n"
|
|
1241
|
-
f" [dim]memory[/] {mem_count} items
|
|
1242
|
-
f" [dim]commands[/] {len(COMMANDS)}"
|
|
1305
|
+
f" [dim]memory[/] {mem_count} items"
|
|
1243
1306
|
))
|
|
1307
|
+
console.print(Rule(style="dim", characters="─"))
|
|
1244
1308
|
console.print()
|
|
1245
1309
|
|
|
1246
1310
|
|