@taj-special/dravix-code 1.2.4 → 1.2.6
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/dist/cli/index.js +109 -142
- package/dist/utils/display.js +9 -29
- package/dist/utils/layout.js +13 -0
- package/package.json +1 -2
package/dist/cli/index.js
CHANGED
|
@@ -3,26 +3,15 @@ import * as path from 'path';
|
|
|
3
3
|
import { randomBytes } from 'crypto';
|
|
4
4
|
import { execSync } from 'child_process';
|
|
5
5
|
import chalk from 'chalk';
|
|
6
|
-
import { banner, printHelp, printError, colors
|
|
6
|
+
import { banner, printHelp, printError, colors } from '../utils/display.js';
|
|
7
7
|
import { startRepl } from './repl.js';
|
|
8
|
-
import { isLoggedIn, logout, saveConfig, AUTH_URL } from '../services/auth.js';
|
|
8
|
+
import { isLoggedIn, logout, getSavedUser, saveConfig, checkPlan, AUTH_URL } from '../services/auth.js';
|
|
9
|
+
import { checkUsage, usageBar, fmtNum, formatResetTime } from '../services/usage.js';
|
|
9
10
|
const POLL_URL = 'https://dravix.app/cli-auth.php';
|
|
10
11
|
const SPINNER = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
11
12
|
function link(url) {
|
|
12
13
|
return `\x1b]8;;${url}\x1b\\${url}\x1b]8;;\x1b\\`;
|
|
13
14
|
}
|
|
14
|
-
function cx(s) {
|
|
15
|
-
const cols = process.stdout.columns ?? 80;
|
|
16
|
-
return ' '.repeat(Math.max(0, Math.floor((cols - s.length) / 2)));
|
|
17
|
-
}
|
|
18
|
-
function drawStars(count) {
|
|
19
|
-
const starChars = ['✦', '✧', '⋆', '·'];
|
|
20
|
-
for (let i = 0; i < count; i++) {
|
|
21
|
-
const cols = process.stdout.columns ?? 80;
|
|
22
|
-
const x = Math.floor(Math.random() * (cols - 10)) + 5;
|
|
23
|
-
console.log(' '.repeat(x) + colors.subtext(starChars[Math.floor(Math.random() * starChars.length)]));
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
15
|
async function pollSession(sessionId) {
|
|
27
16
|
try {
|
|
28
17
|
const res = await fetch(`${POLL_URL}?action=poll&session=${sessionId}`);
|
|
@@ -36,58 +25,47 @@ async function pollSession(sessionId) {
|
|
|
36
25
|
}
|
|
37
26
|
async function showWelcome() {
|
|
38
27
|
const cols = process.stdout.columns ?? 80;
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
28
|
+
const W = Math.min(cols, 64);
|
|
29
|
+
const P = colors.primary;
|
|
30
|
+
const PB = colors.primary.bold;
|
|
31
|
+
const DIM = colors.muted;
|
|
32
|
+
const G = colors.success;
|
|
33
|
+
const White = colors.text;
|
|
34
|
+
const Muted = colors.muted;
|
|
35
|
+
const line = () => DIM(' ' + '─'.repeat(W - 4));
|
|
36
|
+
const pad = (s, w) => s + ' '.repeat(Math.max(w - s.length, 0));
|
|
42
37
|
console.clear();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
'
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
console.log(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
console.log('')
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
console.log(indent + colors.dim('╭' + '─'.repeat(boxW - 2) + '╮'));
|
|
70
|
-
console.log(indent + colors.dim('│') + ' ' + colors.subtext(display) + pPad + ' ' + colors.dim('│'));
|
|
71
|
-
console.log(indent + colors.dim('│') + ' ' + colors.primary('Build') + colors.muted(' · ') + colors.text('Dravix Auto') + colors.muted(' (Titanium + Quantum)') + ' ' + colors.dim('│'));
|
|
72
|
-
console.log(indent + colors.dim('╰' + '─'.repeat(boxW - 2) + '╯'));
|
|
73
|
-
console.log('');
|
|
74
|
-
// Shortcuts
|
|
75
|
-
console.log(indent +
|
|
76
|
-
colors.primary('Tab') + colors.muted(' mode ') +
|
|
77
|
-
colors.primary('Ctrl+P') + colors.muted(' settings ') +
|
|
78
|
-
colors.primary('@') + colors.muted(' file ') +
|
|
79
|
-
colors.primary('$') + colors.muted(' agent ') +
|
|
80
|
-
colors.primary('/') + colors.muted(' commands'));
|
|
81
|
-
console.log('');
|
|
82
|
-
// CTA
|
|
38
|
+
banner();
|
|
39
|
+
console.log(' ' + White.bold('Welcome to Dravix Code') + Muted(' — your AI coding partner'));
|
|
40
|
+
console.log(' ' + Muted('Works like Claude Code, Cursor, Copilot — but in your terminal.') + '\n');
|
|
41
|
+
const boxW = Math.min(W - 4, 58);
|
|
42
|
+
const inner = boxW - 2;
|
|
43
|
+
const BC = DIM;
|
|
44
|
+
const row = (icon, text) => {
|
|
45
|
+
const content = ` ${icon} ${text}`;
|
|
46
|
+
const padded = pad(content, inner);
|
|
47
|
+
return ' ' + BC('│') + White(padded) + BC('│');
|
|
48
|
+
};
|
|
49
|
+
console.log(' ' + BC('╭' + '─'.repeat(boxW - 2) + '╮'));
|
|
50
|
+
console.log(' ' + BC('│') + P(pad(' Capabilities', inner)) + BC('│'));
|
|
51
|
+
console.log(' ' + BC('├' + '─'.repeat(boxW - 2) + '┤'));
|
|
52
|
+
console.log(row(G('✓'), 'Write, edit and create code with AI'));
|
|
53
|
+
console.log(row(G('✓'), 'Search and understand any codebase'));
|
|
54
|
+
console.log(row(G('✓'), 'Run commands and fix errors automatically'));
|
|
55
|
+
console.log(row(G('✓'), 'Read files, folders and project structure'));
|
|
56
|
+
console.log(row(G('✓'), 'Works with TypeScript, Python, Go and more'));
|
|
57
|
+
console.log(' ' + BC('╰' + '─'.repeat(boxW - 2) + '╯') + '\n');
|
|
58
|
+
console.log(' ' + Muted('Powered by ') +
|
|
59
|
+
P.bold('Dravix 3 Titanium') +
|
|
60
|
+
Muted(' + ') +
|
|
61
|
+
P.bold('Dravix 3.5 Quantum'));
|
|
62
|
+
console.log(line() + '\n');
|
|
63
|
+
console.log(' ' + Muted('Sign in with your Google account to get started.') + '\n');
|
|
83
64
|
const enterKey = chalk.bgHex('#312e81').hex('#c7d2fe').bold(' Enter ');
|
|
84
|
-
const escKey =
|
|
85
|
-
console.log(
|
|
86
|
-
console.log(
|
|
87
|
-
|
|
88
|
-
const bottomLeft = '~' + path.basename(process.cwd());
|
|
89
|
-
const bottomRight = 'v' + VERSION;
|
|
90
|
-
process.stdout.write(`\x1b[${rows};1H\x1b[2K` + colors.muted(bottomLeft) + ' '.repeat(Math.max(cols - bottomLeft.length - bottomRight.length, 2)) + colors.muted(bottomRight));
|
|
65
|
+
const escKey = chalk.hex('#374151').bold(' Esc ');
|
|
66
|
+
console.log(' ' + enterKey + Muted(' Sign in with Google'));
|
|
67
|
+
console.log(' ' + escKey + Muted(' Cancel') + '\n');
|
|
68
|
+
console.log(line() + '\n');
|
|
91
69
|
return new Promise((resolve) => {
|
|
92
70
|
process.stdin.setRawMode(true);
|
|
93
71
|
process.stdin.resume();
|
|
@@ -113,43 +91,27 @@ async function showWelcome() {
|
|
|
113
91
|
async function browserAuth() {
|
|
114
92
|
const sessionId = randomBytes(16).toString('hex');
|
|
115
93
|
const authUrl = `${AUTH_URL}?session=${sessionId}`;
|
|
94
|
+
const DIM = colors.muted;
|
|
95
|
+
const W = colors.text;
|
|
96
|
+
const P = colors.primary;
|
|
116
97
|
const cols = process.stdout.columns ?? 80;
|
|
117
|
-
const
|
|
118
|
-
const boxW = Math.min(cols - 6, 70);
|
|
119
|
-
const indent = ' '.repeat(Math.max(0, Math.floor((cols - boxW) / 2)));
|
|
98
|
+
const line = DIM(' ' + '─'.repeat(Math.min(cols - 4, 51)));
|
|
120
99
|
console.clear();
|
|
121
|
-
|
|
122
|
-
console.log(
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
'██████╔╝██║ ██║██║ ██║ ╚████╔╝ ██║██╔╝ ██╗',
|
|
129
|
-
'╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝',
|
|
130
|
-
];
|
|
131
|
-
for (const line of logoLines) {
|
|
132
|
-
console.log(cx(line) + colors.primary.bold(line));
|
|
133
|
-
}
|
|
134
|
-
console.log(cx('C O D E') + colors.accent.bold('C O D E'));
|
|
135
|
-
drawStars(2);
|
|
136
|
-
console.log('');
|
|
137
|
-
// Auth steps box
|
|
138
|
-
console.log(indent + colors.dim('╭' + '─'.repeat(boxW - 2) + '╮'));
|
|
139
|
-
console.log(indent + colors.dim('│') + ' ' + colors.text('Step 1 — ') + colors.muted('Open this link in your browser:') + ' ' + colors.dim('│'));
|
|
140
|
-
console.log(indent + colors.dim('│') + ' ' + colors.primary(link(authUrl)) + ' ' + colors.dim('│'));
|
|
141
|
-
console.log(indent + colors.dim('│') + ' ' + colors.dim('Step 2 — Sign in and authorize') + ' ' + colors.dim('│'));
|
|
142
|
-
console.log(indent + colors.dim('│') + ' ' + colors.dim('Step 3 — Return here (auto-connects)') + ' ' + colors.dim('│'));
|
|
143
|
-
console.log(indent + colors.dim('╰' + '─'.repeat(boxW - 2) + '╯'));
|
|
144
|
-
console.log('');
|
|
145
|
-
// Spinner
|
|
100
|
+
banner();
|
|
101
|
+
console.log(line);
|
|
102
|
+
console.log('\n ' + DIM('Step 1 — ') + W('Open this link in your browser:') + '\n');
|
|
103
|
+
console.log(' ' + colors.primary(link(authUrl)) + '\n');
|
|
104
|
+
console.log(' ' + DIM('Step 2 — ') + W('Sign in to your Dravix account and authorize access'));
|
|
105
|
+
console.log(' ' + DIM('Step 3 — ') + W('Return here — authentication completes automatically') + '\n');
|
|
106
|
+
console.log(line + '\n');
|
|
146
107
|
let frameIdx = 0;
|
|
147
108
|
await new Promise((resolve, reject) => {
|
|
148
109
|
let done = false;
|
|
149
110
|
const spinnerInterval = setInterval(() => {
|
|
150
111
|
if (done)
|
|
151
112
|
return;
|
|
152
|
-
process.stdout.write(`\r ${colors.muted(SPINNER[frameIdx
|
|
113
|
+
process.stdout.write(`\r ${colors.muted(SPINNER[frameIdx % SPINNER.length])} ${colors.muted('Waiting for authentication...')}`);
|
|
114
|
+
frameIdx++;
|
|
153
115
|
}, 80);
|
|
154
116
|
const poll = async () => {
|
|
155
117
|
if (done)
|
|
@@ -160,7 +122,8 @@ async function browserAuth() {
|
|
|
160
122
|
clearInterval(spinnerInterval);
|
|
161
123
|
process.stdout.write('\r\x1b[K');
|
|
162
124
|
saveConfig({ token: result.token, name: result.name, email: result.email });
|
|
163
|
-
console.log(' ' + colors.success('✓') + ' ' +
|
|
125
|
+
console.log(' ' + colors.success('✓') + ' ' + W('Signed in as ') + colors.primary.bold(result.name) + DIM(' · ') + colors.muted(result.email));
|
|
126
|
+
console.log(DIM('\n ' + '─'.repeat(47)) + '\n');
|
|
164
127
|
resolve();
|
|
165
128
|
return;
|
|
166
129
|
}
|
|
@@ -171,7 +134,8 @@ async function browserAuth() {
|
|
|
171
134
|
if (!done) {
|
|
172
135
|
done = true;
|
|
173
136
|
clearInterval(spinnerInterval);
|
|
174
|
-
|
|
137
|
+
process.stdout.write('\r\x1b[K');
|
|
138
|
+
reject(new Error('Authentication timed out after 5 minutes.'));
|
|
175
139
|
}
|
|
176
140
|
}, 300_000);
|
|
177
141
|
});
|
|
@@ -196,7 +160,10 @@ async function main() {
|
|
|
196
160
|
}
|
|
197
161
|
let justAuthenticated = false;
|
|
198
162
|
if (arg === '--login') {
|
|
199
|
-
if (
|
|
163
|
+
if (isLoggedIn()) {
|
|
164
|
+
banner();
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
200
167
|
await browserAuth();
|
|
201
168
|
justAuthenticated = true;
|
|
202
169
|
}
|
|
@@ -205,55 +172,55 @@ async function main() {
|
|
|
205
172
|
await browserAuth();
|
|
206
173
|
justAuthenticated = true;
|
|
207
174
|
}
|
|
175
|
+
const { name, email } = getSavedUser();
|
|
208
176
|
const cwd = (arg && !arg.startsWith('--')) ? path.resolve(arg) : process.cwd();
|
|
209
|
-
|
|
210
|
-
const
|
|
177
|
+
const token = (await import('../services/auth.js')).getToken() ?? '';
|
|
178
|
+
const [plan, usage] = await Promise.all([
|
|
179
|
+
email ? checkPlan(email) : Promise.resolve('Free'),
|
|
180
|
+
token ? checkUsage(token) : Promise.resolve(null),
|
|
181
|
+
]);
|
|
182
|
+
const C = colors.primary;
|
|
183
|
+
const DIM = colors.muted;
|
|
184
|
+
const W = colors.text;
|
|
185
|
+
const planBadge = plan === 'Plus'
|
|
186
|
+
? colors.accent.bold('Plus')
|
|
187
|
+
: colors.muted('Free');
|
|
211
188
|
const rows = process.stdout.rows ?? 24;
|
|
212
|
-
const
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
189
|
+
const cols = process.stdout.columns ?? 80;
|
|
190
|
+
// FULL-SCREEN: clear everything, set scroll region to entire terminal
|
|
191
|
+
process.stdout.write('\x1b[2J'); // Clear entire screen
|
|
192
|
+
process.stdout.write(`\x1b[1;${rows}r`); // Scroll region = entire terminal
|
|
193
|
+
process.stdout.write('\x1b[1;1H'); // Move to top-left
|
|
194
|
+
// Draw the app (ONE logo only)
|
|
195
|
+
banner();
|
|
196
|
+
console.log(DIM(' ' + '─'.repeat(45)));
|
|
197
|
+
console.log(colors.muted(' User ') + W(name ?? 'Unknown') + DIM(' · ') + colors.muted(email ?? ''));
|
|
198
|
+
console.log(colors.muted(' Plan ') + planBadge);
|
|
199
|
+
if (usage) {
|
|
200
|
+
const { bar, pct } = usageBar(usage.tokens_used, usage.limit);
|
|
201
|
+
const barColor = pct >= 80 ? colors.error
|
|
202
|
+
: pct >= 50 ? colors.warn
|
|
203
|
+
: colors.success;
|
|
204
|
+
const resetStr = formatResetTime(usage);
|
|
205
|
+
console.log(colors.muted(' Tokens ') +
|
|
206
|
+
barColor(bar) + ' ' +
|
|
207
|
+
colors.subtext(fmtNum(usage.tokens_used) + ' / ' + fmtNum(usage.limit)) +
|
|
208
|
+
DIM(' · resets in ' + resetStr));
|
|
227
209
|
}
|
|
228
|
-
console.log(
|
|
229
|
-
|
|
230
|
-
console.log('');
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
console.log(indent +
|
|
243
|
-
colors.primary('Tab') + colors.muted(' mode ') +
|
|
244
|
-
colors.primary('Ctrl+P') + colors.muted(' settings ') +
|
|
245
|
-
colors.primary('@') + colors.muted(' file ') +
|
|
246
|
-
colors.primary('$') + colors.muted(' agent ') +
|
|
247
|
-
colors.primary('/') + colors.muted(' commands'));
|
|
248
|
-
console.log('');
|
|
249
|
-
// Tip
|
|
250
|
-
console.log(indent +
|
|
251
|
-
colors.primary('●') + colors.muted(' Tip ') +
|
|
252
|
-
colors.text('Use syntax ') + colors.primary('{env:VAR_NAME}') + colors.text(' to reference variables'));
|
|
253
|
-
// Bottom bar
|
|
254
|
-
const bottomLeft = '~' + path.basename(cwd);
|
|
255
|
-
const bottomRight = 'v' + VERSION;
|
|
256
|
-
process.stdout.write(`\x1b[${rows};1H\x1b[2K` + colors.muted(bottomLeft) + ' '.repeat(Math.max(cols - bottomLeft.length - bottomRight.length, 2)) + colors.muted(bottomRight));
|
|
210
|
+
console.log(colors.muted(' Project ') + W(path.basename(cwd)));
|
|
211
|
+
console.log(colors.muted(' Path ') + DIM(cwd));
|
|
212
|
+
console.log(DIM(' ' + '─'.repeat(45)));
|
|
213
|
+
console.log(colors.muted(' ') + C('Tab') + colors.muted(' path complete ') + C('@') + colors.muted(' file picker ') + C('Ctrl+C') + colors.muted(' cancel ') + C('/help') + colors.muted(' commands'));
|
|
214
|
+
process.stdout.write('\n');
|
|
215
|
+
// Start REPL and handle cleanup on exit
|
|
216
|
+
const cleanup = () => {
|
|
217
|
+
process.stdout.write('\x1b[r'); // Reset scroll region
|
|
218
|
+
process.stdout.write('\x1b[2J'); // Clear screen
|
|
219
|
+
process.stdout.write('\x1b[1;1H'); // Move to top
|
|
220
|
+
};
|
|
221
|
+
process.on('exit', cleanup);
|
|
222
|
+
process.on('SIGINT', () => { cleanup(); process.exit(0); });
|
|
223
|
+
process.on('SIGTERM', () => { cleanup(); process.exit(0); });
|
|
257
224
|
await startRepl(cwd);
|
|
258
225
|
}
|
|
259
226
|
main().catch((err) => {
|
package/dist/utils/display.js
CHANGED
|
@@ -20,35 +20,16 @@ export const colors = {
|
|
|
20
20
|
text: chalk.hex('#e2e8f0'),
|
|
21
21
|
subtext: chalk.hex('#94a3b8'),
|
|
22
22
|
};
|
|
23
|
-
function cx(s) {
|
|
24
|
-
const cols = process.stdout.columns ?? 80;
|
|
25
|
-
return ' '.repeat(Math.max(0, Math.floor((cols - s.length) / 2)));
|
|
26
|
-
}
|
|
27
|
-
function drawStars(count) {
|
|
28
|
-
const starChars = ['✦', '✧', '⋆', '·'];
|
|
29
|
-
for (let i = 0; i < count; i++) {
|
|
30
|
-
const cols = process.stdout.columns ?? 80;
|
|
31
|
-
const x = Math.floor(Math.random() * (cols - 10)) + 5;
|
|
32
|
-
console.log(' '.repeat(x) + colors.subtext(starChars[Math.floor(Math.random() * starChars.length)]));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
23
|
export function banner() {
|
|
36
|
-
console.log(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝',
|
|
46
|
-
];
|
|
47
|
-
for (const line of logoLines) {
|
|
48
|
-
console.log(cx(line) + colors.primary.bold(line));
|
|
49
|
-
}
|
|
50
|
-
console.log(cx('C O D E') + colors.accent.bold('C O D E'));
|
|
51
|
-
drawStars(3);
|
|
24
|
+
console.log(colors.primary.bold(`
|
|
25
|
+
██████╗ ██████╗ █████╗ ██╗ ██╗██╗██╗ ██╗
|
|
26
|
+
██╔══██╗██╔══██╗██╔══██╗██║ ██║██║╚██╗██╔╝
|
|
27
|
+
██║ ██║██████╔╝███████║██║ ██║██║ ╚███╔╝
|
|
28
|
+
██║ ██║██╔══██╗██╔══██║╚██╗ ██╔╝██║ ██╔██╗
|
|
29
|
+
██████╔╝██║ ██║██║ ██║ ╚████╔╝ ██║██╔╝ ██╗
|
|
30
|
+
╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═══╝ ╚═╝╚═╝ ╚═╝`));
|
|
31
|
+
console.log(colors.primary.bold(' Code') + colors.muted(` v${VERSION} · `) + colors.accent('AI-powered coding assistant'));
|
|
32
|
+
console.log(colors.dim(' ─────────────────────────────────────────────\n'));
|
|
52
33
|
}
|
|
53
34
|
export function printAI(chunk) {
|
|
54
35
|
process.stdout.write(colors.ai(chunk));
|
|
@@ -82,7 +63,6 @@ export function printOpResult(result) {
|
|
|
82
63
|
const labelStr = colors.subtext(' Updated ');
|
|
83
64
|
const statPad = statStr ? ' ' + statStr : '';
|
|
84
65
|
console.log(iconStr + labelStr + pathStr + statPad);
|
|
85
|
-
// Compact mode: only show diff if changes are large (>30 lines)
|
|
86
66
|
const totalChanges = displayAdds + displayRemoves;
|
|
87
67
|
if (totalChanges > 30) {
|
|
88
68
|
if (result.linesBefore !== undefined && result.linesAfter !== undefined) {
|
package/dist/utils/layout.js
CHANGED
|
@@ -14,10 +14,23 @@ export class ChatLayout {
|
|
|
14
14
|
makeSep() {
|
|
15
15
|
return chalk.hex('#374151')(' ' + '─'.repeat(Math.max(this.cols - 4, 40)));
|
|
16
16
|
}
|
|
17
|
+
/** Full-screen mode: hide everything outside the app */
|
|
18
|
+
enterFullScreen() {
|
|
19
|
+
this.rows = process.stdout.rows ?? 24;
|
|
20
|
+
this.cols = process.stdout.columns ?? 80;
|
|
21
|
+
// Clear entire screen first
|
|
22
|
+
process.stdout.write('\x1b[2J');
|
|
23
|
+
// Set scroll region to ENTIRE terminal (rows 1 to rows)
|
|
24
|
+
// This hides everything outside the app
|
|
25
|
+
process.stdout.write(`\x1b[1;${this.rows}r`);
|
|
26
|
+
// Move to top-left
|
|
27
|
+
process.stdout.write('\x1b[1;1H');
|
|
28
|
+
}
|
|
17
29
|
/** Call once at the start of startRepl — sets scroll region + draws divider. */
|
|
18
30
|
init() {
|
|
19
31
|
this.rows = process.stdout.rows ?? 24;
|
|
20
32
|
this.cols = process.stdout.columns ?? 80;
|
|
33
|
+
// Set scroll region for chat (excluding bottom 3 rows for divider/input/hints)
|
|
21
34
|
process.stdout.write(`\x1b[1;${this.scrollEnd}r`);
|
|
22
35
|
this.redrawDivider();
|
|
23
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taj-special/dravix-code",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.6",
|
|
4
4
|
"description": "AI-powered coding assistant CLI — Dravix Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"prepublishOnly": "tsc"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@taj-special/dravix-code": "^1.2.0",
|
|
20
19
|
"chalk": "^5.3.0"
|
|
21
20
|
},
|
|
22
21
|
"devDependencies": {
|