codegpt-ai 2.7.0 → 2.8.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.
Files changed (2) hide show
  1. package/chat.py +77 -38
  2. package/package.json +1 -1
package/chat.py CHANGED
@@ -1242,61 +1242,100 @@ def print_header(model):
1242
1242
  B = "bold bright_blue"
1243
1243
  D = "dim"
1244
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}]║[/]"
1245
+ # Fit to terminal width — no clipping
1246
+ w = min(console.width - 2, 56)
1247
+
1248
+ # Detailed spider models for each direction
1249
+ spiders = {
1250
+ "top": [
1251
+ f"[{D}] ╱╲[/]",
1252
+ f"[{D}] ╱╲(o.o)╱╲[/]",
1253
+ f"[{D}] ╱╱ ╲╱╱ ╲╲[/]",
1254
+ f"[{D}] ||[/]",
1255
+ ],
1256
+ "right": [
1257
+ f"[{D}] ╱╲[/]",
1258
+ f"[{D}] (o.o)╲~~~[/]",
1259
+ f"[{D}] ╲╱[/]",
1260
+ ],
1261
+ "bottom": [
1262
+ f"[{D}] ||[/]",
1263
+ f"[{D}] ╲╲ ╱╲╲ ╱╱[/]",
1264
+ f"[{D}] ╲╱(o.o)╲╱[/]",
1265
+ f"[{D}] ╲╱[/]",
1266
+ ],
1267
+ "left": [
1268
+ f"[{D}] ╱╲[/]",
1269
+ f"[{D}]~~~╱(o.o)[/]",
1270
+ f"[{D}] ╲╱[/]",
1271
+ ],
1272
+ }
1273
+
1274
+ def build_banner(pos_name):
1275
+ """Build banner with detailed spider at given position."""
1276
+ # Adaptive width border
1277
+ inner = w - 4 # inside the ║ ║
1278
+ pad = inner - 36 # 36 = content width
1279
+ lpad = pad // 2
1280
+ rpad = pad - lpad
1281
+
1282
+ top_b = f"[{R}] ╔{'═' * inner}╗[/]"
1283
+ bot_b = f"[{R}] ╚{'═' * inner}╝[/]"
1284
+ empty = f"[{R}] ║[/]{' ' * inner}[{R}]║[/]"
1285
+ title = f"[{R}] ║[/]{' ' * lpad}[{R}]C[/][{B}]o[/][{R}]d[/][{B}]e[/] [{R}]G[/][{B}]P[/][{R}]T[/] [{D}]v2.0[/]{' ' * (rpad + 16)}[{R}]║[/]"
1286
+ sub = f"[{R}] ║[/]{' ' * lpad}[{D}]local ai · powered by ollama[/]{' ' * (rpad + 7)}[{R}]║[/]"
1287
+ stats = f"[{R}] ║[/]{' ' * lpad}[{B}]123[/] [{D}]cmds ·[/] [{B}]26[/] [{D}]tools ·[/] [{B}]8[/] [{D}]agents[/]{' ' * (rpad + 8)}[{R}]║[/]"
1257
1288
 
1258
1289
  lines = []
1259
- p = pos % 8
1260
1290
 
1261
- if p in (0, 1): # top
1262
- lines.append(f"[{D}] {spider}[/]")
1263
- lines.append(f"[{D}] ||[/]")
1291
+ if pos_name == "top":
1292
+ for sl in spiders["top"]:
1293
+ lines.append(sl)
1264
1294
  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
1295
+ elif pos_name == "right":
1296
+ lines.extend([top_b, empty, title])
1297
+ # Spider on right side
1298
+ for i, sl in enumerate(spiders["right"]):
1299
+ if i == 0:
1300
+ lines.append(f"{sub} {sl}")
1301
+ elif i == 1:
1302
+ lines.append(f"{stats} {sl}")
1303
+ else:
1304
+ lines.append(f"{empty} {sl}")
1305
+ lines.append(bot_b)
1306
+ elif pos_name == "bottom":
1272
1307
  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)
1308
+ for sl in spiders["bottom"]:
1309
+ lines.append(sl)
1310
+ else: # left
1276
1311
  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}]║[/]")
1312
+ for i, sl in enumerate(spiders["left"]):
1313
+ if i == 1:
1314
+ lines.append(f"{sl} [{R}]║[/]{' ' * lpad}[{R}]C[/][{B}]o[/][{R}]d[/][{B}]e[/] [{R}]G[/][{B}]P[/][{R}]T[/] [{D}]v2.0[/]{' ' * (rpad + 16)}[{R}]║[/]")
1315
+ else:
1316
+ lines.append(f"{' ' * 5} {empty}")
1279
1317
  lines.extend([sub, stats, empty, bot_b])
1280
1318
 
1281
1319
  return "\n".join(lines)
1282
1320
 
1283
- # Animate spider crawling around the banner
1321
+ # Animate spider crawling 1 full lap, ~2 seconds
1322
+ positions = ["top", "right", "bottom", "left"]
1284
1323
  try:
1285
1324
  with Live(
1286
- Text.from_markup(build_banner(0)),
1287
- console=console, refresh_per_second=6, transient=True,
1325
+ Text.from_markup(build_banner("top")),
1326
+ console=console, refresh_per_second=4, transient=True,
1288
1327
  ) 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)
1328
+ for lap in range(2):
1329
+ for pos in positions:
1330
+ live.update(Text.from_markup(build_banner(pos)))
1331
+ time.sleep(0.4)
1292
1332
 
1293
- # Final position — static
1333
+ # Final position
1294
1334
  import random
1295
- final = random.randint(0, 7)
1335
+ final = random.choice(positions)
1296
1336
  console.print(Text.from_markup(build_banner(final)))
1297
1337
  except Exception:
1298
- # Fallback if Live doesn't work
1299
- console.print(Text.from_markup(build_banner(0)))
1338
+ console.print(Text.from_markup(build_banner("top")))
1300
1339
  console.print()
1301
1340
  console.print(Text.from_markup(
1302
1341
  f" [dim]model[/] [bright_blue]{model}[/]\n"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codegpt-ai",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Local AI Assistant Hub — 80+ commands, 29 tools, 8 agents, training, security",
5
5
  "author": "ArukuX",
6
6
  "license": "MIT",