aether-ai-agent-cli 1.1.4__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.
@@ -0,0 +1,169 @@
1
+ // ═══════════════════════════════════════════════════════════
2
+ // AETHER AI CLI — Dynamic Theme-Aware Formatting Utilities
3
+ // ═══════════════════════════════════════════════════════════
4
+
5
+ import chalk from "chalk";
6
+
7
+ // ── Theme Definitions ─────────────────────────────────────
8
+ export const THEMES = {
9
+ cyberpunk: {
10
+ accent: "#00f0ff", // Neon cyan
11
+ accent2: "#bd93f9", // Neon purple/magenta
12
+ accent3: "#50fa7b", // Neon green
13
+ danger: "#ff5555", // Neon red
14
+ warning: "#ffb86c", // Neon orange
15
+ muted: "#6272a4", // Comment gray
16
+ text: "#f8f8f2", // Crisp white-yellow
17
+ dim: "#44475a", // Border gray
18
+ brand: "#00f0ff", // Neon cyan
19
+ success: "#50fa7b", // Neon green
20
+ error: "#ff5555",
21
+ magenta: "#ff79c6",
22
+ orange: "#ffb86c",
23
+ },
24
+ matrix: {
25
+ accent: "#50fa7b", // Lime green
26
+ accent2: "#00ff00", // Matrix green
27
+ accent3: "#8efb50", // Light lime
28
+ danger: "#ff5555",
29
+ warning: "#ffb86c",
30
+ muted: "#1f5f1f", // Dark forest green
31
+ text: "#aaffaa", // Soft green text
32
+ dim: "#103f10", // Dark green border
33
+ brand: "#50fa7b",
34
+ success: "#50fa7b",
35
+ error: "#ff5555",
36
+ magenta: "#50fa7b",
37
+ orange: "#8efb50",
38
+ },
39
+ synthwave: {
40
+ accent: "#ff79c6", // Neon pink
41
+ accent2: "#ffb86c", // Neon orange
42
+ accent3: "#bd93f9", // Neon purple
43
+ danger: "#ff5555",
44
+ warning: "#ffb86c",
45
+ muted: "#6f2a8a", // Dark purple
46
+ text: "#ffe8f5", // Soft pinkish white
47
+ dim: "#3e104f", // Deep purple border
48
+ brand: "#ff79c6",
49
+ success: "#bd93f9",
50
+ error: "#ff5555",
51
+ magenta: "#ff79c6",
52
+ orange: "#ffb86c",
53
+ },
54
+ crimson: {
55
+ accent: "#ff5555", // Neon red
56
+ accent2: "#ffb86c", // Gold/orange
57
+ accent3: "#f1fa8c", // Neon yellow
58
+ danger: "#ff5555",
59
+ warning: "#ffb86c",
60
+ muted: "#662222", // Muted red-gray
61
+ text: "#ffffff", // White text
62
+ dim: "#331111", // Dark red border
63
+ brand: "#ff5555",
64
+ success: "#f1fa8c",
65
+ error: "#ff5555",
66
+ magenta: "#ff5555",
67
+ orange: "#ffb86c",
68
+ }
69
+ };
70
+
71
+ let activeThemeName = "cyberpunk";
72
+
73
+ // ── Dynamic Colors Resolver ───────────────────────────────
74
+ export const colors = new Proxy({}, {
75
+ get(target, prop) {
76
+ const theme = THEMES[activeThemeName] || THEMES.cyberpunk;
77
+ const colorHex = theme[prop] || "#ffffff";
78
+ const isBold = prop === "brand" || prop === "success" || prop === "error";
79
+
80
+ let fn = chalk.hex(colorHex);
81
+ if (isBold) {
82
+ fn = fn.bold;
83
+ }
84
+ return fn;
85
+ }
86
+ });
87
+
88
+ // ── Labels ────────────────────────────────────────────────
89
+ export const label = {
90
+ get system() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent).bold(" SYSTEM "); },
91
+ get user() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent3).bold(" YOU "); },
92
+ get aether() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent).bold(" AETHER "); },
93
+ get error() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#2a0a14" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].danger).bold(" ERROR "); },
94
+ get info() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent2).bold(" INFO "); },
95
+ get config() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].warning).bold(" CONFIG "); },
96
+ get math() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent3).bold(" MATH "); },
97
+ get krylo() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent).bold(" KRYLO "); },
98
+ get mode() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent2).bold(" MODE "); },
99
+ get mesh() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].accent).bold(" MESH "); },
100
+ get file() { return chalk.bgHex(activeThemeName === "cyberpunk" ? "#0c1825" : THEMES[activeThemeName].dim).hex(THEMES[activeThemeName].warning).bold(" FILE "); },
101
+ };
102
+
103
+ // ── Formatting Helpers ───────────────────────────────────
104
+ export function separator(char = "─", length) {
105
+ const width = process.stdout.columns || 80;
106
+ const targetLength = length !== undefined ? length : Math.max(10, width - 4);
107
+ return colors.dim(char.repeat(targetLength));
108
+ }
109
+
110
+ export function heading(text) {
111
+ return colors.brand(`\n ${text}\n`) + separator();
112
+ }
113
+
114
+ export function keyValue(key, value) {
115
+ return ` ${colors.muted(key + ":")} ${colors.text(value)}`;
116
+ }
117
+
118
+ export function bullet(text) {
119
+ return ` ${colors.accent("›")} ${colors.text(text)}`;
120
+ }
121
+
122
+ export function modeBadge(mode) {
123
+ const theme = THEMES[activeThemeName] || THEMES.cyberpunk;
124
+ const badges = {
125
+ synthesis: chalk.bgHex(activeThemeName === "cyberpunk" ? "#1a3a2a" : theme.dim).hex(theme.accent3).bold(" SYNTHESIS "),
126
+ research: chalk.bgHex(activeThemeName === "cyberpunk" ? "#1a2a3a" : theme.dim).hex(theme.accent2).bold(" RESEARCH "),
127
+ architect: chalk.bgHex(activeThemeName === "cyberpunk" ? "#2a1a3a" : theme.dim).hex(theme.magenta).bold(" ARCHITECT "),
128
+ titan: chalk.bgHex(activeThemeName === "cyberpunk" ? "#1a2a3a" : theme.dim).hex(theme.accent).bold(" TITAN FUSION "),
129
+ };
130
+ return badges[mode?.toLowerCase()] || badges.titan;
131
+ }
132
+
133
+ /**
134
+ * Backs up the cursor and clears terminal lines printed during real-time streaming
135
+ * so they can be replaced by the final formatted response.
136
+ * @param {string} text - The raw streamed text that was printed
137
+ */
138
+ export function clearStreamedText(text) {
139
+ if (!process.stdout.isTTY) return;
140
+ const width = process.stdout.columns || 80;
141
+ const lines = text.split("\n");
142
+ let lineCount = 0;
143
+ for (const line of lines) {
144
+ lineCount += Math.max(1, Math.ceil(line.length / width));
145
+ }
146
+ if (lineCount > 0) {
147
+ process.stdout.write(`\x1b[${lineCount}A\x1b[J`);
148
+ }
149
+ }
150
+
151
+ // ── Theme State Management ────────────────────────────────
152
+
153
+ export function getActiveTheme() {
154
+ return activeThemeName;
155
+ }
156
+
157
+ export function setTheme(themeName) {
158
+ if (!themeName) return false;
159
+ const name = themeName.toLowerCase().trim();
160
+ if (THEMES[name]) {
161
+ activeThemeName = name;
162
+ return true;
163
+ }
164
+ return false;
165
+ }
166
+
167
+ export function getThemesList() {
168
+ return Object.keys(THEMES);
169
+ }