@bluehawks/cli 1.0.44 → 1.0.45
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/components/ChatArea.d.ts.map +1 -1
- package/dist/cli/components/ChatArea.js +37 -3
- package/dist/cli/components/ChatArea.js.map +1 -1
- package/dist/config/constants.d.ts +1 -1
- package/dist/config/constants.js +1 -1
- package/package.json +1 -1
- package/src/cli/components/ChatArea.tsx +49 -7
- package/src/config/constants.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatArea.d.ts","sourceRoot":"","sources":["../../../src/cli/components/ChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzD,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAa;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,eAAe,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"ChatArea.d.ts","sourceRoot":"","sources":["../../../src/cli/components/ChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,UAAU,cAAc;IACpB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IACzD,OAAO,EAAE,MAAM,CAAC;CACnB;AAED,UAAU,aAAa;IACnB,QAAQ,EAAE,cAAc,EAAE,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9B,eAAe,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,GAAG,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAkJ5C,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useInput } from 'ink';
|
|
2
4
|
import { Box, Text } from 'ink';
|
|
3
5
|
import Spinner from 'ink-spinner';
|
|
4
6
|
import TextInput from 'ink-text-input';
|
|
@@ -13,7 +15,39 @@ export const ChatArea = ({ messages, streamingContent, currentTool, isProcessing
|
|
|
13
15
|
default: return 'gray';
|
|
14
16
|
}
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
const [scrollOffset, setScrollOffset] = React.useState(0);
|
|
19
|
+
const visibleCount = 15; // Number of messages to show at once
|
|
20
|
+
useInput((input, key) => {
|
|
21
|
+
if (key.pageUp) {
|
|
22
|
+
setScrollOffset(prev => Math.min(prev + 5, Math.max(0, messages.length - visibleCount)));
|
|
23
|
+
}
|
|
24
|
+
else if (key.pageDown) {
|
|
25
|
+
setScrollOffset(prev => Math.max(0, prev - 5));
|
|
26
|
+
}
|
|
27
|
+
else if (key.upArrow && !input) { // Only scroll if no text input (or maybe Alt+Up?)
|
|
28
|
+
// Actually, standard terminals use PageUp/Down for history. Let's stick to PageKeys to avoid conflict with history navigation in Input.
|
|
29
|
+
setScrollOffset(prev => Math.min(prev + 1, Math.max(0, messages.length - visibleCount)));
|
|
30
|
+
}
|
|
31
|
+
else if (key.downArrow && !input) {
|
|
32
|
+
setScrollOffset(prev => Math.max(0, prev - 1));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
// Calculate window
|
|
36
|
+
// offset 0 = show last N (end of list)
|
|
37
|
+
// offset > 0 = shift window up by N
|
|
38
|
+
// Slice logic:
|
|
39
|
+
// Start: length - visibleCount - offset
|
|
40
|
+
// End: length - offset
|
|
41
|
+
const total = messages.length;
|
|
42
|
+
const effectiveOffset = Math.min(scrollOffset, Math.max(0, total - visibleCount));
|
|
43
|
+
// If we are at default (offset 0), we want the *last* visibleCount messages.
|
|
44
|
+
// slice(-(visibleCount), undefined)
|
|
45
|
+
// If offset is 5, we want slice(-(visibleCount + 5), -5)
|
|
46
|
+
const start = -(visibleCount + effectiveOffset);
|
|
47
|
+
const end = effectiveOffset === 0 ? undefined : -effectiveOffset;
|
|
48
|
+
const visibleMessages = messages.slice(start, end);
|
|
49
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: "cyan", flexGrow: 1, paddingX: 1, overflowY: "hidden", children: [_jsxs(Box, { flexDirection: "column", flexGrow: 1, justifyContent: "flex-end", children: [effectiveOffset > 0 && (_jsx(Box, { justifyContent: "center", borderStyle: "single", borderColor: "yellow", marginBottom: 1, children: _jsxs(Text, { color: "yellow", children: ["\u2B06 SCROLLING HISTORY (", effectiveOffset, ") - Press PageDown to return \u2B07"] }) })), visibleMessages.map((msg, i) => {
|
|
50
|
+
// i is relative to slice.
|
|
17
51
|
if (msg.role === 'tool') {
|
|
18
52
|
try {
|
|
19
53
|
const content = JSON.parse(msg.content);
|
|
@@ -31,6 +65,6 @@ export const ChatArea = ({ messages, streamingContent, currentTool, isProcessing
|
|
|
31
65
|
}
|
|
32
66
|
}
|
|
33
67
|
return (_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: getRoleColor(msg.role), children: msg.role === 'user' ? '👤 YOU ' : msg.role === 'assistant' ? '🦅 BLUEHAWKS AI ' : 'ℹ️ SYSTEM ' }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "white", children: [(msg.role === 'user' || msg.role === 'assistant') ? '🔹 ' : '', msg.content] }) })] }, i));
|
|
34
|
-
}), streamingContent && (_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "magenta", children: "\uD83E\uDD85 BLUEHAWKS AI " }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "white", children: ["\uD83D\uDD39 ", streamingContent] }) })] })), currentTool && !messages.some(m => m.role === 'tool' && m.content.includes(currentTool) && m.content.includes('tool_start')) && (_jsxs(Box, { marginBottom: 1, children: [_jsx(Spinner, { type: "dots" }), _jsxs(Text, { color: "magenta", children: [" Executing ", currentTool, "..."] })] })), pendingApproval && (_jsxs(Box, { borderStyle: "double", borderColor: "yellow", padding: 1, marginY: 1, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["\u26A0\uFE0F APPROVAL REQUIRED: ", pendingApproval.toolName] }), _jsx(Text, { children: "Press Y to approve, N to deny" })] }))] }), !pendingApproval && (_jsxs(Box, { borderStyle: "single", borderTop: true, borderColor: "cyan", paddingTop: 0, marginTop: 1, children: [_jsx(Text, { color: "cyan", children: "\u276F " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: onSubmit, placeholder: isProcessing ? "Processing..." : "Command..." })] }))] }));
|
|
68
|
+
}), effectiveOffset === 0 && streamingContent && (_jsxs(Box, { marginBottom: 1, flexDirection: "column", children: [_jsx(Text, { bold: true, color: "magenta", children: "\uD83E\uDD85 BLUEHAWKS AI " }), _jsx(Box, { marginLeft: 2, children: _jsxs(Text, { color: "white", children: ["\uD83D\uDD39 ", streamingContent] }) })] })), effectiveOffset === 0 && currentTool && !messages.some(m => m.role === 'tool' && m.content.includes(currentTool) && m.content.includes('tool_start')) && (_jsxs(Box, { marginBottom: 1, children: [_jsx(Spinner, { type: "dots" }), _jsxs(Text, { color: "magenta", children: [" Executing ", currentTool, "..."] })] })), effectiveOffset === 0 && pendingApproval && (_jsxs(Box, { borderStyle: "double", borderColor: "yellow", padding: 1, marginY: 1, children: [_jsxs(Text, { color: "yellow", bold: true, children: ["\u26A0\uFE0F APPROVAL REQUIRED: ", pendingApproval.toolName] }), _jsx(Text, { children: "Press Y to approve, N to deny" })] }))] }), !pendingApproval && (_jsxs(Box, { borderStyle: "single", borderTop: true, borderColor: "cyan", paddingTop: 0, marginTop: 1, children: [_jsx(Text, { color: "cyan", children: "\u276F " }), _jsx(TextInput, { value: input, onChange: setInput, onSubmit: onSubmit, placeholder: isProcessing ? "Processing..." : "Command..." })] }))] }));
|
|
35
69
|
};
|
|
36
70
|
//# sourceMappingURL=ChatArea.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatArea.js","sourceRoot":"","sources":["../../../src/cli/components/ChatArea.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ChatArea.js","sourceRoot":"","sources":["../../../src/cli/components/ChatArea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAmBvC,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAC9C,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,YAAY,EACZ,KA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";
|
|
8
8
|
export declare const CLI_NAME = "bluehawks";
|
|
9
|
-
export declare const CLI_VERSION = "1.0.
|
|
9
|
+
export declare const CLI_VERSION = "1.0.45";
|
|
10
10
|
export declare const CLI_DESCRIPTION = "A production-ready multi-agent AI CLI assistant";
|
|
11
11
|
export declare const CONFIG_DIR_NAME = ".bluehawks";
|
|
12
12
|
export declare const SETTINGS_FILE = "settings.json";
|
package/dist/config/constants.js
CHANGED
|
@@ -8,7 +8,7 @@ export const DEFAULT_EMBEDDING_MODEL = 'Qwen/Qwen3-Embedding-0.6B';
|
|
|
8
8
|
export const DEFAULT_RERANK_MODEL = 'Qwen/Qwen3-Reranker-0.6B';
|
|
9
9
|
// CLI Metadata
|
|
10
10
|
export const CLI_NAME = 'bluehawks';
|
|
11
|
-
export const CLI_VERSION = '1.0.
|
|
11
|
+
export const CLI_VERSION = '1.0.45';
|
|
12
12
|
export const CLI_DESCRIPTION = 'A production-ready multi-agent AI CLI assistant';
|
|
13
13
|
// Configuration Paths
|
|
14
14
|
export const CONFIG_DIR_NAME = '.bluehawks';
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React from 'react'; import { useInput } from 'ink';
|
|
2
2
|
import { Box, Text } from 'ink';
|
|
3
3
|
import Spinner from 'ink-spinner';
|
|
4
4
|
import TextInput from 'ink-text-input';
|
|
@@ -41,11 +41,53 @@ export const ChatArea: React.FC<ChatAreaProps> = ({
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
const [scrollOffset, setScrollOffset] = React.useState(0);
|
|
45
|
+
const visibleCount = 15; // Number of messages to show at once
|
|
46
|
+
|
|
47
|
+
useInput((input, key) => {
|
|
48
|
+
if (key.pageUp) {
|
|
49
|
+
setScrollOffset(prev => Math.min(prev + 5, Math.max(0, messages.length - visibleCount)));
|
|
50
|
+
} else if (key.pageDown) {
|
|
51
|
+
setScrollOffset(prev => Math.max(0, prev - 5));
|
|
52
|
+
} else if (key.upArrow && !input) { // Only scroll if no text input (or maybe Alt+Up?)
|
|
53
|
+
// Actually, standard terminals use PageUp/Down for history. Let's stick to PageKeys to avoid conflict with history navigation in Input.
|
|
54
|
+
setScrollOffset(prev => Math.min(prev + 1, Math.max(0, messages.length - visibleCount)));
|
|
55
|
+
} else if (key.downArrow && !input) {
|
|
56
|
+
setScrollOffset(prev => Math.max(0, prev - 1));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Calculate window
|
|
61
|
+
// offset 0 = show last N (end of list)
|
|
62
|
+
// offset > 0 = shift window up by N
|
|
63
|
+
// Slice logic:
|
|
64
|
+
// Start: length - visibleCount - offset
|
|
65
|
+
// End: length - offset
|
|
66
|
+
const total = messages.length;
|
|
67
|
+
const effectiveOffset = Math.min(scrollOffset, Math.max(0, total - visibleCount));
|
|
68
|
+
|
|
69
|
+
// If we are at default (offset 0), we want the *last* visibleCount messages.
|
|
70
|
+
// slice(-(visibleCount), undefined)
|
|
71
|
+
|
|
72
|
+
// If offset is 5, we want slice(-(visibleCount + 5), -5)
|
|
73
|
+
|
|
74
|
+
const start = -(visibleCount + effectiveOffset);
|
|
75
|
+
const end = effectiveOffset === 0 ? undefined : -effectiveOffset;
|
|
76
|
+
|
|
77
|
+
const visibleMessages = messages.slice(start, end);
|
|
78
|
+
|
|
44
79
|
return (
|
|
45
80
|
<Box flexDirection="column" borderStyle="single" borderColor="cyan" flexGrow={1} paddingX={1} overflowY="hidden">
|
|
46
81
|
{/* Messages Area */}
|
|
47
82
|
<Box flexDirection="column" flexGrow={1} justifyContent="flex-end">
|
|
48
|
-
{
|
|
83
|
+
{effectiveOffset > 0 && (
|
|
84
|
+
<Box justifyContent="center" borderStyle="single" borderColor="yellow" marginBottom={1}>
|
|
85
|
+
<Text color="yellow">⬆ SCROLLING HISTORY ({effectiveOffset}) - Press PageDown to return ⬇</Text>
|
|
86
|
+
</Box>
|
|
87
|
+
)}
|
|
88
|
+
|
|
89
|
+
{visibleMessages.map((msg, i) => {
|
|
90
|
+
// i is relative to slice.
|
|
49
91
|
if (msg.role === 'tool') {
|
|
50
92
|
try {
|
|
51
93
|
const content = JSON.parse(msg.content);
|
|
@@ -83,8 +125,8 @@ export const ChatArea: React.FC<ChatAreaProps> = ({
|
|
|
83
125
|
);
|
|
84
126
|
})}
|
|
85
127
|
|
|
86
|
-
{/* Streaming */}
|
|
87
|
-
{streamingContent && (
|
|
128
|
+
{/* Streaming (only show if at bottom) */}
|
|
129
|
+
{effectiveOffset === 0 && streamingContent && (
|
|
88
130
|
<Box marginBottom={1} flexDirection="column">
|
|
89
131
|
<Text bold color="magenta">🦅 BLUEHAWKS AI </Text>
|
|
90
132
|
<Box marginLeft={2}>
|
|
@@ -93,8 +135,8 @@ export const ChatArea: React.FC<ChatAreaProps> = ({
|
|
|
93
135
|
</Box>
|
|
94
136
|
)}
|
|
95
137
|
|
|
96
|
-
{/* Current Tool Spinner */}
|
|
97
|
-
{currentTool && !messages.some(m => m.role === 'tool' && m.content.includes(currentTool) && m.content.includes('tool_start')) && (
|
|
138
|
+
{/* Current Tool Spinner (only show if at bottom) */}
|
|
139
|
+
{effectiveOffset === 0 && currentTool && !messages.some(m => m.role === 'tool' && m.content.includes(currentTool) && m.content.includes('tool_start')) && (
|
|
98
140
|
<Box marginBottom={1}>
|
|
99
141
|
<Spinner type="dots" />
|
|
100
142
|
<Text color="magenta"> Executing {currentTool}...</Text>
|
|
@@ -102,7 +144,7 @@ export const ChatArea: React.FC<ChatAreaProps> = ({
|
|
|
102
144
|
)}
|
|
103
145
|
|
|
104
146
|
{/* Approval Prompt */}
|
|
105
|
-
{pendingApproval && (
|
|
147
|
+
{effectiveOffset === 0 && pendingApproval && (
|
|
106
148
|
<Box borderStyle="double" borderColor="yellow" padding={1} marginY={1}>
|
|
107
149
|
<Text color="yellow" bold>⚠️ APPROVAL REQUIRED: {pendingApproval.toolName}</Text>
|
|
108
150
|
<Text>Press Y to approve, N to deny</Text>
|
package/src/config/constants.ts
CHANGED
|
@@ -10,7 +10,7 @@ export const DEFAULT_RERANK_MODEL = 'Qwen/Qwen3-Reranker-0.6B';
|
|
|
10
10
|
|
|
11
11
|
// CLI Metadata
|
|
12
12
|
export const CLI_NAME = 'bluehawks';
|
|
13
|
-
export const CLI_VERSION = '1.0.
|
|
13
|
+
export const CLI_VERSION = '1.0.45';
|
|
14
14
|
export const CLI_DESCRIPTION = 'A production-ready multi-agent AI CLI assistant';
|
|
15
15
|
|
|
16
16
|
// Configuration Paths
|