agen-vektor 0.3.2 → 0.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.
- package/dist/tui/app.js +24 -15
- package/dist/tui/statusbar.js +17 -13
- package/package.json +1 -1
package/dist/tui/app.js
CHANGED
|
@@ -706,7 +706,7 @@ class App {
|
|
|
706
706
|
return (0, terminal_1.getTerminalSize)().cols;
|
|
707
707
|
}
|
|
708
708
|
chatHeight() {
|
|
709
|
-
return Math.max(1, (0, terminal_1.getTerminalSize)().rows -
|
|
709
|
+
return Math.max(1, (0, terminal_1.getTerminalSize)().rows - 7);
|
|
710
710
|
}
|
|
711
711
|
render() {
|
|
712
712
|
const { rows, cols } = (0, terminal_1.getTerminalSize)();
|
|
@@ -721,32 +721,41 @@ class App {
|
|
|
721
721
|
spinner: this.spinner.frame(),
|
|
722
722
|
running: this.running,
|
|
723
723
|
};
|
|
724
|
+
const frame = theme_1.THEME.borderBright;
|
|
725
|
+
const innerW = Math.max(4, cols - 2);
|
|
724
726
|
const parts = [];
|
|
725
|
-
|
|
726
|
-
parts.push((0, statusbar_1.
|
|
727
|
-
|
|
727
|
+
// Row 1-2: framed header + project bar
|
|
728
|
+
parts.push((0, terminal_1.cursorTo)(1, 1) + terminal_1.ANSI.clearLineEnd + (0, statusbar_1.renderHeader)(cols, info));
|
|
729
|
+
parts.push((0, terminal_1.cursorTo)(2, 1) + terminal_1.ANSI.clearLineEnd + (0, statusbar_1.renderProjectBar)(cols, info));
|
|
730
|
+
// Row 3: separator
|
|
731
|
+
parts.push((0, terminal_1.cursorTo)(3, 1) + terminal_1.ANSI.clearLineEnd + frame + terminal_1.BOX.teeRight + terminal_1.BOX.h.repeat(innerW) + terminal_1.BOX.teeLeft + theme_1.THEME.reset);
|
|
732
|
+
// Chat area (rows 4..) — each line wrapped in the frame
|
|
728
733
|
const chatH = this.chatHeight();
|
|
729
|
-
const chatW =
|
|
734
|
+
const chatW = innerW;
|
|
730
735
|
const all = (0, chat_1.renderMessages)(this.messages, chatW);
|
|
731
736
|
const maxScroll = Math.max(0, all.length - chatH);
|
|
732
737
|
this.scroll = Math.min(this.scroll, maxScroll);
|
|
733
738
|
const visible = all.slice(this.scroll, this.scroll + chatH);
|
|
734
|
-
const chatTop =
|
|
739
|
+
const chatTop = 4;
|
|
740
|
+
const empty = ' '.repeat(innerW);
|
|
735
741
|
for (let i = 0; i < chatH; i++) {
|
|
736
|
-
const content = visible[i] !== undefined ? visible[i] :
|
|
737
|
-
parts.push((0, terminal_1.cursorTo)(chatTop + i, 1) + terminal_1.ANSI.clearLineEnd + content);
|
|
742
|
+
const content = visible[i] !== undefined ? visible[i] : empty;
|
|
743
|
+
parts.push((0, terminal_1.cursorTo)(chatTop + i, 1) + terminal_1.ANSI.clearLineEnd + frame + terminal_1.BOX.v + theme_1.THEME.reset + ' ' + content + ' ' + frame + terminal_1.BOX.v + theme_1.THEME.reset);
|
|
738
744
|
}
|
|
739
|
-
// Separator
|
|
745
|
+
// Separator between chat and input
|
|
740
746
|
const sepRow = chatTop + chatH;
|
|
741
|
-
parts.push((0, terminal_1.cursorTo)(sepRow, 1) + terminal_1.ANSI.clearLineEnd +
|
|
742
|
-
// Input
|
|
747
|
+
parts.push((0, terminal_1.cursorTo)(sepRow, 1) + terminal_1.ANSI.clearLineEnd + frame + terminal_1.BOX.teeRight + terminal_1.BOX.h.repeat(innerW) + terminal_1.BOX.teeLeft + theme_1.THEME.reset);
|
|
748
|
+
// Input row
|
|
743
749
|
const inputRow = sepRow + 1;
|
|
744
|
-
const rendered = this.input.render(
|
|
745
|
-
parts.push((0, terminal_1.cursorTo)(inputRow, 1) + terminal_1.ANSI.clearLineEnd + rendered.line);
|
|
746
|
-
const cursorCol = rendered.cursorCol +
|
|
747
|
-
// Status bar
|
|
750
|
+
const rendered = this.input.render(innerW);
|
|
751
|
+
parts.push((0, terminal_1.cursorTo)(inputRow, 1) + terminal_1.ANSI.clearLineEnd + frame + terminal_1.BOX.v + theme_1.THEME.reset + ' ' + rendered.line + ' ' + frame + terminal_1.BOX.v + theme_1.THEME.reset);
|
|
752
|
+
const cursorCol = rendered.cursorCol + 3;
|
|
753
|
+
// Status bar row
|
|
748
754
|
const statusRow = inputRow + 1;
|
|
749
755
|
parts.push((0, terminal_1.cursorTo)(statusRow, 1) + terminal_1.ANSI.clearLineEnd + (0, statusbar_1.renderStatusBar)(cols, info));
|
|
756
|
+
// Bottom border
|
|
757
|
+
const bottomRow = statusRow + 1;
|
|
758
|
+
parts.push((0, terminal_1.cursorTo)(bottomRow, 1) + terminal_1.ANSI.clearLineEnd + frame + terminal_1.BOX.bl + terminal_1.BOX.h.repeat(innerW) + terminal_1.BOX.br + theme_1.THEME.reset);
|
|
750
759
|
// Modal overlay
|
|
751
760
|
if (this.modal.type !== 'none') {
|
|
752
761
|
const overlay = this.renderModal(rows, cols);
|
package/dist/tui/statusbar.js
CHANGED
|
@@ -5,11 +5,15 @@ exports.renderProjectBar = renderProjectBar;
|
|
|
5
5
|
exports.renderStatusBar = renderStatusBar;
|
|
6
6
|
/**
|
|
7
7
|
* Status bar — top header + project bar + bottom hint bar.
|
|
8
|
-
*
|
|
8
|
+
* Renders inside the VectorHead frame (Freebuff-style borders):
|
|
9
|
+
* ╭─ VectorHead ● status ─── provider · model ─╮
|
|
10
|
+
* │ Project: ~/x Mode: ask │
|
|
11
|
+
* │ ENTER Send · TAB Commands · ? Help ● ask │
|
|
9
12
|
*/
|
|
10
13
|
const terminal_1 = require("../utils/terminal");
|
|
11
14
|
const theme_1 = require("./theme");
|
|
12
|
-
|
|
15
|
+
const frame = theme_1.THEME.borderBright;
|
|
16
|
+
/** Render the top framed header line: ╭─ VectorHead ● status ... provider · model ─╮ */
|
|
13
17
|
function renderHeader(width, info) {
|
|
14
18
|
const brand = `${theme_1.THEME.bold}${theme_1.THEME.accent}VectorHead${theme_1.THEME.reset}`;
|
|
15
19
|
const dot = info.connected ? `${theme_1.THEME.success}●${theme_1.THEME.reset}` : `${theme_1.THEME.error}○${theme_1.THEME.reset}`;
|
|
@@ -18,20 +22,20 @@ function renderHeader(width, info) {
|
|
|
18
22
|
const provider = `${theme_1.THEME.dim}${info.provider}${theme_1.THEME.reset}`;
|
|
19
23
|
const model = `${theme_1.THEME.accentDim}${info.model}${theme_1.THEME.reset}`;
|
|
20
24
|
const right = `${provider} · ${model}`;
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
return theme_1.THEME.bgBar + (0, terminal_1.pad)(line, width) + theme_1.THEME.reset;
|
|
25
|
+
const inner = Math.max(2, width - 2);
|
|
26
|
+
const mid = Math.max(1, inner - (0, terminal_1.stripAnsi)(left).length - (0, terminal_1.stripAnsi)(right).length - 3);
|
|
27
|
+
return `${frame}${terminal_1.BOX.tl}${theme_1.THEME.reset} ${left}${' '.repeat(mid)}${right} ${frame}${terminal_1.BOX.tr}${theme_1.THEME.reset}`;
|
|
25
28
|
}
|
|
26
|
-
/** Render the project line: Project: <path>
|
|
29
|
+
/** Render the framed project line: │ Project: <path> ... Mode: ask │ */
|
|
27
30
|
function renderProjectBar(width, info) {
|
|
28
31
|
const label = `${theme_1.THEME.dim}Project:${theme_1.THEME.reset} ${theme_1.THEME.text}${info.project}${theme_1.THEME.reset}`;
|
|
29
32
|
const modeColor = info.mode === 'yolo' ? theme_1.THEME.warn : theme_1.THEME.muted;
|
|
30
33
|
const mode = `${theme_1.THEME.dim}Mode:${theme_1.THEME.reset} ${modeColor}${info.mode}${theme_1.THEME.reset}`;
|
|
31
|
-
const
|
|
32
|
-
|
|
34
|
+
const inner = Math.max(2, width - 2);
|
|
35
|
+
const mid = Math.max(1, inner - (0, terminal_1.stripAnsi)(label).length - (0, terminal_1.stripAnsi)(mode).length - 3);
|
|
36
|
+
return `${frame}${terminal_1.BOX.v}${theme_1.THEME.reset} ${label}${' '.repeat(mid)}${mode} ${frame}${terminal_1.BOX.v}${theme_1.THEME.reset}`;
|
|
33
37
|
}
|
|
34
|
-
/** Render the bottom hint/status bar with live spinner. */
|
|
38
|
+
/** Render the framed bottom hint/status bar with live spinner. */
|
|
35
39
|
function renderStatusBar(width, info) {
|
|
36
40
|
const left = `ENTER ${theme_1.THEME.accent}Send${theme_1.THEME.reset} TAB ${theme_1.THEME.accent}Commands${theme_1.THEME.reset} CTRL+C ${theme_1.THEME.accent}Stop${theme_1.THEME.reset} ? ${theme_1.THEME.accent}Help${theme_1.THEME.reset}`;
|
|
37
41
|
let right = '';
|
|
@@ -41,7 +45,7 @@ function renderStatusBar(width, info) {
|
|
|
41
45
|
const conn = info.connected ? `${theme_1.THEME.success}●${theme_1.THEME.reset}` : `${theme_1.THEME.error}○${theme_1.THEME.reset}`;
|
|
42
46
|
const mode = info.mode === 'yolo' ? `${theme_1.THEME.warn}YOLO${theme_1.THEME.reset}` : `${theme_1.THEME.muted}ask${theme_1.THEME.reset}`;
|
|
43
47
|
right += `${conn} ${mode}`;
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
return theme_1.THEME.
|
|
48
|
+
const inner = Math.max(2, width - 2);
|
|
49
|
+
const mid = Math.max(1, inner - (0, terminal_1.stripAnsi)(left).length - (0, terminal_1.stripAnsi)(right).length - 3);
|
|
50
|
+
return `${frame}${terminal_1.BOX.v}${theme_1.THEME.reset} ${left}${' '.repeat(mid)}${right} ${frame}${terminal_1.BOX.v}${theme_1.THEME.reset}`;
|
|
47
51
|
}
|
package/package.json
CHANGED