stella-coder 5.3.1 → 5.3.3

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 (52) hide show
  1. package/COMMANDS.md +47 -0
  2. package/install-av.bat +17 -0
  3. package/install-stella-pkg.bat +21 -0
  4. package/oneline-av.ps1 +7 -0
  5. package/oneline-stella.ps1 +2 -0
  6. package/package.json +1 -1
  7. package/releases/stella-antivirus/database.mjs +871 -0
  8. package/releases/stella-antivirus/index.mjs +8 -0
  9. package/releases/stella-antivirus/install-av.bat +12 -0
  10. package/releases/stella-antivirus/scanner.mjs +591 -0
  11. package/releases/stella-antivirus/ui.mjs +570 -0
  12. package/releases/stella-antivirus.zip +0 -0
  13. package/releases/stella-coder/README.md +67 -0
  14. package/releases/stella-coder/adb.mjs +200 -0
  15. package/releases/stella-coder/autonomous-agent.mjs +550 -0
  16. package/releases/stella-coder/banner.mjs +46 -0
  17. package/releases/stella-coder/browser-control.mjs +274 -0
  18. package/releases/stella-coder/build.mjs +151 -0
  19. package/releases/stella-coder/charts.mjs +411 -0
  20. package/releases/stella-coder/coding-brain.mjs +753 -0
  21. package/releases/stella-coder/game-engine.mjs +708 -0
  22. package/releases/stella-coder/gdrive-backup.mjs +338 -0
  23. package/releases/stella-coder/git-api.mjs +407 -0
  24. package/releases/stella-coder/gmail.mjs +415 -0
  25. package/releases/stella-coder/home-assistant.mjs +168 -0
  26. package/releases/stella-coder/index.mjs +5810 -0
  27. package/releases/stella-coder/install-stella.bat +12 -0
  28. package/releases/stella-coder/markdown.mjs +100 -0
  29. package/releases/stella-coder/mcp.mjs +296 -0
  30. package/releases/stella-coder/package.json +67 -0
  31. package/releases/stella-coder/presentations.mjs +1106 -0
  32. package/releases/stella-coder/protect.mjs +182 -0
  33. package/releases/stella-coder/screen-monitor.mjs +334 -0
  34. package/releases/stella-coder/sea-config.json +5 -0
  35. package/releases/stella-coder/security.mjs +237 -0
  36. package/releases/stella-coder/subagents.mjs +142 -0
  37. package/releases/stella-coder/telegram-bot.mjs +824 -0
  38. package/releases/stella-coder/tg-server.mjs +116 -0
  39. package/releases/stella-coder/theme.mjs +91 -0
  40. package/releases/stella-coder/tools.mjs +3143 -0
  41. package/releases/stella-coder/web-parser.mjs +229 -0
  42. package/releases/stella-coder/yandex-maps.mjs +426 -0
  43. package/releases/stella-coder.zip +0 -0
  44. package/run-antivirus.bat +4 -0
  45. package/setup-antivirus.bat +64 -0
  46. package/setup-full.bat +65 -0
  47. package/setup-full.ps1 +84 -0
  48. package/setup-stella.bat +46 -0
  49. package/stella-cli/index.mjs +12 -2
  50. package/stella-cli/protect.mjs +182 -0
  51. package/stella.bat +3 -0
  52. package/tests/test-modules.mjs +101 -0
@@ -0,0 +1,116 @@
1
+ import fs from "node:fs"
2
+ import path from "node:path"
3
+ import os from "node:os"
4
+ import { execSync, spawn } from "node:child_process"
5
+ import { startBot, stopBot } from "./telegram-bot.mjs"
6
+
7
+ // ═══════════════════════════════════════════════════════════════════
8
+ // STELLA TELEGRAM SERVER — постоянная работа бота
9
+ // ═══════════════════════════════════════════════════════════════════
10
+
11
+ const CONFIG_DIR = path.join(os.homedir(), ".stella")
12
+ const PID_FILE = path.join(CONFIG_DIR, "tg-bot.pid")
13
+ const LOG_FILE = path.join(CONFIG_DIR, "tg-bot.log")
14
+
15
+ function log(msg) {
16
+ const timestamp = new Date().toLocaleString("ru-RU")
17
+ const line = `[${timestamp}] ${msg}`
18
+ console.log(line)
19
+ try {
20
+ fs.mkdirSync(CONFIG_DIR, { recursive: true })
21
+ fs.appendFileSync(LOG_FILE, line + "\n")
22
+ } catch {}
23
+ }
24
+
25
+ function savePID() {
26
+ fs.mkdirSync(CONFIG_DIR, { recursive: true })
27
+ fs.writeFileSync(PID_FILE, String(process.pid))
28
+ }
29
+
30
+ function removePID() {
31
+ try { fs.unlinkSync(PID_FILE) } catch {}
32
+ }
33
+
34
+ function isRunning() {
35
+ try {
36
+ if (!fs.existsSync(PID_FILE)) return false
37
+ const pid = parseInt(fs.readFileSync(PID_FILE, "utf8"))
38
+ process.kill(pid, 0)
39
+ return true
40
+ } catch {
41
+ return false
42
+ }
43
+ }
44
+
45
+ // Handle cleanup
46
+ process.on("SIGINT", () => {
47
+ log("Bot shutting down (SIGINT)")
48
+ removePID()
49
+ process.exit(0)
50
+ })
51
+
52
+ process.on("SIGTERM", () => {
53
+ log("Bot shutting down (SIGTERM)")
54
+ removePID()
55
+ process.exit(0)
56
+ })
57
+
58
+ process.on("exit", () => {
59
+ removePID()
60
+ })
61
+
62
+ // Main
63
+ async function main() {
64
+ const args = process.argv.slice(2)
65
+
66
+ if (args.includes("--stop")) {
67
+ if (!isRunning()) {
68
+ console.log("Bot is not running")
69
+ return
70
+ }
71
+ const pid = parseInt(fs.readFileSync(PID_FILE, "utf8"))
72
+ try {
73
+ process.kill(pid, "SIGTERM")
74
+ console.log(`Bot stopped (PID: ${pid})`)
75
+ removePID()
76
+ } catch (e) {
77
+ console.log(`Failed to stop: ${e.message}`)
78
+ }
79
+ return
80
+ }
81
+
82
+ if (args.includes("--status")) {
83
+ if (isRunning()) {
84
+ const pid = fs.readFileSync(PID_FILE, "utf8")
85
+ console.log(`Bot is running (PID: ${pid})`)
86
+ } else {
87
+ console.log("Bot is not running")
88
+ }
89
+ return
90
+ }
91
+
92
+ if (isRunning()) {
93
+ const pid = fs.readFileSync(PID_FILE, "utf8")
94
+ console.log(`Bot already running (PID: ${pid})`)
95
+ return
96
+ }
97
+
98
+ // Start bot
99
+ savePID()
100
+ log(`Bot starting (PID: ${process.pid})`)
101
+ log(`Platform: ${os.platform()} ${os.release()}`)
102
+ log(`Node: ${process.version}`)
103
+
104
+ const result = await startBot()
105
+ if (result) {
106
+ log("Bot started successfully")
107
+ console.log("Stella Telegram Bot is running!")
108
+ console.log("Press Ctrl+C to stop")
109
+ } else {
110
+ log("Bot failed to start")
111
+ removePID()
112
+ process.exit(1)
113
+ }
114
+ }
115
+
116
+ main()
@@ -0,0 +1,91 @@
1
+ // Stella Coder 3.9 — purple/blue ANSI theme
2
+ const ESC = "\x1b["
3
+
4
+ export const reset = `${ESC}0m`
5
+ export const bold = (s) => `${ESC}1m${s}${reset}`
6
+ export const dim = (s) => `${ESC}2m${s}${reset}`
7
+ export const italic = (s) => `${ESC}3m${s}${reset}`
8
+ export const underline = (s) => `${ESC}4m${s}${reset}`
9
+ export const inverse = (s) => `${ESC}7m${s}${reset}`
10
+ export const strikethrough = (s) => `${ESC}9m${s}${reset}`
11
+
12
+ export const rgb = (r, g, b) => (s) => `${ESC}38;2;${r};${g};${b}m${s}${reset}`
13
+ export const bgRgb = (r, g, b) => (s) => `${ESC}48;2;${r};${g};${b}m${s}${reset}`
14
+
15
+ // Palette: violet -> blue
16
+ export const violet = rgb(167, 139, 250) // #a78bfa
17
+ export const purple = rgb(139, 92, 246) // #8b5cf6
18
+ export const indigo = rgb(129, 140, 248) // #818cf8
19
+ export const blue = rgb(96, 165, 250) // #60a5fa
20
+ export const cyan = rgb(103, 232, 249) // #67e8f9
21
+ export const green = rgb(74, 222, 128)
22
+ export const red = rgb(248, 113, 113)
23
+ export const yellow = rgb(250, 204, 21)
24
+ export const gray = rgb(148, 163, 184)
25
+ export const darkGray = rgb(100, 116, 139)
26
+ export const white = rgb(237, 233, 254)
27
+
28
+ // Gradient stops from violet to blue
29
+ const STOPS = [
30
+ [167, 139, 250],
31
+ [139, 92, 246],
32
+ [129, 140, 248],
33
+ [99, 102, 241],
34
+ [96, 165, 250],
35
+ ]
36
+
37
+ function lerp(a, b, t) {
38
+ return Math.round(a + (b - a) * t)
39
+ }
40
+
41
+ export function gradientLine(text) {
42
+ const chars = [...text]
43
+ const n = Math.max(chars.length - 1, 1)
44
+ let out = ""
45
+ for (let i = 0; i < chars.length; i++) {
46
+ const t = (i / n) * (STOPS.length - 1)
47
+ const idx = Math.min(Math.floor(t), STOPS.length - 2)
48
+ const f = t - idx
49
+ const [r1, g1, b1] = STOPS[idx]
50
+ const [r2, g2, b2] = STOPS[idx + 1]
51
+ out += `${ESC}38;2;${lerp(r1, r2, f)};${lerp(g1, g2, f)};${lerp(b1, b2, f)}m${chars[i]}`
52
+ }
53
+ return out + reset
54
+ }
55
+
56
+ export function gradient(text) {
57
+ return text
58
+ .split("\n")
59
+ .map((l) => gradientLine(l))
60
+ .join("\n")
61
+ }
62
+
63
+ // Rounded box drawing
64
+ export function box(lines, { color = purple, padding = 1, title = "" } = {}) {
65
+ const strip = (s) => s.replace(/\x1b\[[0-9;]*m/g, "")
66
+ const width = Math.max(...lines.map((l) => strip(l).length), strip(title).length + 2)
67
+ const pad = " ".repeat(padding)
68
+ const inner = width + padding * 2
69
+ // Handle color as array [r,g,b] or function
70
+ const colorFn = Array.isArray(color) ? rgb(color[0], color[1], color[2]) : color
71
+ const top = title
72
+ ? colorFn("╭─ ") + bold(violet(title)) + colorFn(" " + "─".repeat(Math.max(inner - strip(title).length - 3, 0)) + "╮")
73
+ : colorFn("╭" + "─".repeat(inner) + "╮")
74
+ const body = lines.map((l) => colorFn("│") + pad + l + " ".repeat(width - strip(l).length) + pad + colorFn("│"))
75
+ const bottom = colorFn("╰" + "─".repeat(inner) + "╯")
76
+ return [top, ...body, bottom].join("\n")
77
+ }
78
+
79
+ export const SPINNER_FRAMES = ["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"]
80
+ export const SPINNER_WORDS = [
81
+ "Thinking",
82
+ "Pondering",
83
+ "Vibing",
84
+ "Computing",
85
+ "Reasoning",
86
+ "Conjuring",
87
+ "Synthesizing",
88
+ "Brewing",
89
+ "Crafting",
90
+ "Weaving",
91
+ ]