@townco/ui 0.1.0
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/README.md +175 -0
- package/dist/core/hooks/index.d.ts +6 -0
- package/dist/core/hooks/index.d.ts.map +1 -0
- package/dist/core/hooks/index.js +6 -0
- package/dist/core/hooks/index.js.map +1 -0
- package/dist/core/hooks/use-chat-input.d.ts +23 -0
- package/dist/core/hooks/use-chat-input.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-input.js +63 -0
- package/dist/core/hooks/use-chat-input.js.map +1 -0
- package/dist/core/hooks/use-chat-messages.d.ts +17 -0
- package/dist/core/hooks/use-chat-messages.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-messages.js +121 -0
- package/dist/core/hooks/use-chat-messages.js.map +1 -0
- package/dist/core/hooks/use-chat-session.d.ts +11 -0
- package/dist/core/hooks/use-chat-session.d.ts.map +1 -0
- package/dist/core/hooks/use-chat-session.js +87 -0
- package/dist/core/hooks/use-chat-session.js.map +1 -0
- package/dist/core/hooks/use-media-query.d.ts +39 -0
- package/dist/core/hooks/use-media-query.js +80 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +9 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/schemas/chat.d.ts +78 -0
- package/dist/core/schemas/chat.d.ts.map +1 -0
- package/dist/core/schemas/chat.js +49 -0
- package/dist/core/schemas/chat.js.map +1 -0
- package/dist/core/schemas/index.d.ts +4 -0
- package/dist/core/schemas/index.d.ts.map +1 -0
- package/dist/core/schemas/index.js +4 -0
- package/dist/core/schemas/index.js.map +1 -0
- package/dist/core/store/chat-store.d.ts +30 -0
- package/dist/core/store/chat-store.d.ts.map +1 -0
- package/dist/core/store/chat-store.js +56 -0
- package/dist/core/store/chat-store.js.map +1 -0
- package/dist/gui/components/Button.d.ts +11 -0
- package/dist/gui/components/Button.d.ts.map +1 -0
- package/dist/gui/components/Button.js +33 -0
- package/dist/gui/components/Button.js.map +1 -0
- package/dist/gui/components/Card.d.ts +8 -0
- package/dist/gui/components/Card.d.ts.map +1 -0
- package/dist/gui/components/Card.js +16 -0
- package/dist/gui/components/Card.js.map +1 -0
- package/dist/gui/components/ChatHeader.d.ts +38 -0
- package/dist/gui/components/ChatHeader.js +84 -0
- package/dist/gui/components/ChatInput.d.ts +42 -0
- package/dist/gui/components/ChatInput.d.ts.map +1 -0
- package/dist/gui/components/ChatInput.js +137 -0
- package/dist/gui/components/ChatInput.js.map +1 -0
- package/dist/gui/components/ChatInterface.d.ts +9 -0
- package/dist/gui/components/ChatInterface.d.ts.map +1 -0
- package/dist/gui/components/ChatInterface.js +132 -0
- package/dist/gui/components/ChatInterface.js.map +1 -0
- package/dist/gui/components/ChatLayout.d.ts +52 -0
- package/dist/gui/components/ChatLayout.js +105 -0
- package/dist/gui/components/ChatPanelTabContent.d.ts +18 -0
- package/dist/gui/components/ChatPanelTabContent.js +15 -0
- package/dist/gui/components/ChatPreview.d.ts +9 -0
- package/dist/gui/components/ChatPreview.d.ts.map +1 -0
- package/dist/gui/components/ChatPreview.js +164 -0
- package/dist/gui/components/ChatPreview.js.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.d.ts +20 -0
- package/dist/gui/components/ChatSecondaryPanel.d.ts.map +1 -0
- package/dist/gui/components/ChatSecondaryPanel.js +44 -0
- package/dist/gui/components/ChatSecondaryPanel.js.map +1 -0
- package/dist/gui/components/ChatSidebar.d.ts +14 -0
- package/dist/gui/components/ChatSidebar.js +23 -0
- package/dist/gui/components/ChatStatus.d.ts +6 -0
- package/dist/gui/components/ChatStatus.d.ts.map +1 -0
- package/dist/gui/components/ChatStatus.js +38 -0
- package/dist/gui/components/ChatStatus.js.map +1 -0
- package/dist/gui/components/ChatView.d.ts +6 -0
- package/dist/gui/components/ChatView.d.ts.map +1 -0
- package/dist/gui/components/ChatView.js +13 -0
- package/dist/gui/components/ChatView.js.map +1 -0
- package/dist/gui/components/ConfigPanel.d.ts +16 -0
- package/dist/gui/components/ConfigPanel.d.ts.map +1 -0
- package/dist/gui/components/ConfigPanel.js +48 -0
- package/dist/gui/components/ConfigPanel.js.map +1 -0
- package/dist/gui/components/Conversation.d.ts +20 -0
- package/dist/gui/components/Conversation.d.ts.map +1 -0
- package/dist/gui/components/Conversation.js +87 -0
- package/dist/gui/components/Conversation.js.map +1 -0
- package/dist/gui/components/Dialog.d.ts +19 -0
- package/dist/gui/components/Dialog.d.ts.map +1 -0
- package/dist/gui/components/Dialog.js +22 -0
- package/dist/gui/components/Dialog.js.map +1 -0
- package/dist/gui/components/DropdownMenu.d.ts +27 -0
- package/dist/gui/components/DropdownMenu.js +68 -0
- package/dist/gui/components/HeightTransition.d.ts +10 -0
- package/dist/gui/components/HeightTransition.d.ts.map +1 -0
- package/dist/gui/components/HeightTransition.js +80 -0
- package/dist/gui/components/HeightTransition.js.map +1 -0
- package/dist/gui/components/Input.d.ts +9 -0
- package/dist/gui/components/Input.d.ts.map +1 -0
- package/dist/gui/components/Input.js +21 -0
- package/dist/gui/components/Input.js.map +1 -0
- package/dist/gui/components/InputBox.d.ts +14 -0
- package/dist/gui/components/InputBox.d.ts.map +1 -0
- package/dist/gui/components/InputBox.js +18 -0
- package/dist/gui/components/InputBox.js.map +1 -0
- package/dist/gui/components/Label.d.ts +4 -0
- package/dist/gui/components/Label.d.ts.map +1 -0
- package/dist/gui/components/Label.js +7 -0
- package/dist/gui/components/Label.js.map +1 -0
- package/dist/gui/components/MarkdownRenderer.d.ts +6 -0
- package/dist/gui/components/MarkdownRenderer.d.ts.map +1 -0
- package/dist/gui/components/MarkdownRenderer.js +86 -0
- package/dist/gui/components/MarkdownRenderer.js.map +1 -0
- package/dist/gui/components/Message.d.ts +26 -0
- package/dist/gui/components/Message.d.ts.map +1 -0
- package/dist/gui/components/Message.js +33 -0
- package/dist/gui/components/Message.js.map +1 -0
- package/dist/gui/components/MessageContent.d.ts +26 -0
- package/dist/gui/components/MessageContent.d.ts.map +1 -0
- package/dist/gui/components/MessageContent.js +104 -0
- package/dist/gui/components/MessageContent.js.map +1 -0
- package/dist/gui/components/MessageList.d.ts +6 -0
- package/dist/gui/components/MessageList.d.ts.map +1 -0
- package/dist/gui/components/MessageList.js +1 -0
- package/dist/gui/components/MessageList.js.map +1 -0
- package/dist/gui/components/PlaygroundLayout.d.ts +10 -0
- package/dist/gui/components/PlaygroundLayout.d.ts.map +1 -0
- package/dist/gui/components/PlaygroundLayout.js +18 -0
- package/dist/gui/components/PlaygroundLayout.js.map +1 -0
- package/dist/gui/components/Reasoning.d.ts +31 -0
- package/dist/gui/components/Reasoning.d.ts.map +1 -0
- package/dist/gui/components/Reasoning.js +70 -0
- package/dist/gui/components/Reasoning.js.map +1 -0
- package/dist/gui/components/Response.d.ts +16 -0
- package/dist/gui/components/Response.d.ts.map +1 -0
- package/dist/gui/components/Response.js +95 -0
- package/dist/gui/components/Response.js.map +1 -0
- package/dist/gui/components/Select.d.ts +13 -0
- package/dist/gui/components/Select.d.ts.map +1 -0
- package/dist/gui/components/Select.js +26 -0
- package/dist/gui/components/Select.js.map +1 -0
- package/dist/gui/components/Sonner.d.ts +5 -0
- package/dist/gui/components/Sonner.js +23 -0
- package/dist/gui/components/StatusBar.d.ts +8 -0
- package/dist/gui/components/StatusBar.d.ts.map +1 -0
- package/dist/gui/components/StatusBar.js +11 -0
- package/dist/gui/components/StatusBar.js.map +1 -0
- package/dist/gui/components/Tabs.d.ts +7 -0
- package/dist/gui/components/Tabs.d.ts.map +1 -0
- package/dist/gui/components/Tabs.js +12 -0
- package/dist/gui/components/Tabs.js.map +1 -0
- package/dist/gui/components/Task.d.ts +35 -0
- package/dist/gui/components/Task.d.ts.map +1 -0
- package/dist/gui/components/Task.js +37 -0
- package/dist/gui/components/Task.js.map +1 -0
- package/dist/gui/components/Textarea.d.ts +11 -0
- package/dist/gui/components/Textarea.d.ts.map +1 -0
- package/dist/gui/components/Textarea.js +51 -0
- package/dist/gui/components/Textarea.js.map +1 -0
- package/dist/gui/components/ThinkingBlock.d.ts +12 -0
- package/dist/gui/components/ThinkingBlock.d.ts.map +1 -0
- package/dist/gui/components/ThinkingBlock.js +40 -0
- package/dist/gui/components/ThinkingBlock.js.map +1 -0
- package/dist/gui/components/TodoList.d.ts +20 -0
- package/dist/gui/components/TodoList.d.ts.map +1 -0
- package/dist/gui/components/TodoList.js +11 -0
- package/dist/gui/components/TodoList.js.map +1 -0
- package/dist/gui/components/TodoListItem.d.ts +10 -0
- package/dist/gui/components/TodoListItem.d.ts.map +1 -0
- package/dist/gui/components/TodoListItem.js +7 -0
- package/dist/gui/components/TodoListItem.js.map +1 -0
- package/dist/gui/components/index.d.ts +23 -0
- package/dist/gui/components/index.d.ts.map +1 -0
- package/dist/gui/components/index.js +28 -0
- package/dist/gui/components/index.js.map +1 -0
- package/dist/gui/index.d.ts +2 -0
- package/dist/gui/index.d.ts.map +1 -0
- package/dist/gui/index.js +4 -0
- package/dist/gui/index.js.map +1 -0
- package/dist/gui/lib/utils.d.ts +2 -0
- package/dist/gui/lib/utils.d.ts.map +1 -0
- package/dist/gui/lib/utils.js +5 -0
- package/dist/gui/lib/utils.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/index.test.d.ts +0 -0
- package/dist/index.test.js +1 -0
- package/dist/sdk/client/acp-client.d.ts +84 -0
- package/dist/sdk/client/acp-client.d.ts.map +1 -0
- package/dist/sdk/client/acp-client.js +225 -0
- package/dist/sdk/client/acp-client.js.map +1 -0
- package/dist/sdk/client/index.d.ts +4 -0
- package/dist/sdk/client/index.d.ts.map +1 -0
- package/dist/sdk/client/index.js +4 -0
- package/dist/sdk/client/index.js.map +1 -0
- package/dist/sdk/index.d.ts +9 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +9 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/schemas/agent.d.ts +87 -0
- package/dist/sdk/schemas/agent.d.ts.map +1 -0
- package/dist/sdk/schemas/agent.js +50 -0
- package/dist/sdk/schemas/agent.js.map +1 -0
- package/dist/sdk/schemas/index.d.ts +6 -0
- package/dist/sdk/schemas/index.d.ts.map +1 -0
- package/dist/sdk/schemas/index.js +6 -0
- package/dist/sdk/schemas/index.js.map +1 -0
- package/dist/sdk/schemas/message.d.ts +195 -0
- package/dist/sdk/schemas/message.d.ts.map +1 -0
- package/dist/sdk/schemas/message.js +95 -0
- package/dist/sdk/schemas/message.js.map +1 -0
- package/dist/sdk/schemas/session.d.ts +158 -0
- package/dist/sdk/schemas/session.d.ts.map +1 -0
- package/dist/sdk/schemas/session.js +54 -0
- package/dist/sdk/schemas/session.js.map +1 -0
- package/dist/sdk/transports/http.d.ts +63 -0
- package/dist/sdk/transports/http.d.ts.map +1 -0
- package/dist/sdk/transports/http.js +476 -0
- package/dist/sdk/transports/http.js.map +1 -0
- package/dist/sdk/transports/index.d.ts +7 -0
- package/dist/sdk/transports/index.d.ts.map +1 -0
- package/dist/sdk/transports/index.js +7 -0
- package/dist/sdk/transports/index.js.map +1 -0
- package/dist/sdk/transports/stdio.d.ts +28 -0
- package/dist/sdk/transports/stdio.d.ts.map +1 -0
- package/dist/sdk/transports/stdio.js +294 -0
- package/dist/sdk/transports/stdio.js.map +1 -0
- package/dist/sdk/transports/types.d.ts +63 -0
- package/dist/sdk/transports/types.d.ts.map +1 -0
- package/dist/sdk/transports/types.js +1 -0
- package/dist/sdk/transports/types.js.map +1 -0
- package/dist/sdk/transports/websocket.d.ts +20 -0
- package/dist/sdk/transports/websocket.d.ts.map +1 -0
- package/dist/sdk/transports/websocket.js +52 -0
- package/dist/sdk/transports/websocket.js.map +1 -0
- package/dist/tui/components/ChatView.d.ts +5 -0
- package/dist/tui/components/ChatView.d.ts.map +1 -0
- package/dist/tui/components/ChatView.js +24 -0
- package/dist/tui/components/ChatView.js.map +1 -0
- package/dist/tui/components/GameOfLife.d.ts +1 -0
- package/dist/tui/components/GameOfLife.d.ts.map +1 -0
- package/dist/tui/components/GameOfLife.js +50 -0
- package/dist/tui/components/GameOfLife.js.map +1 -0
- package/dist/tui/components/InputBox.d.ts +13 -0
- package/dist/tui/components/InputBox.d.ts.map +1 -0
- package/dist/tui/components/InputBox.js +15 -0
- package/dist/tui/components/InputBox.js.map +1 -0
- package/dist/tui/components/MessageList.d.ts +5 -0
- package/dist/tui/components/MessageList.d.ts.map +1 -0
- package/dist/tui/components/MessageList.js +16 -0
- package/dist/tui/components/MessageList.js.map +1 -0
- package/dist/tui/components/MultiSelect.d.ts +13 -0
- package/dist/tui/components/MultiSelect.js +72 -0
- package/dist/tui/components/ReadlineInput.d.ts +8 -0
- package/dist/tui/components/ReadlineInput.d.ts.map +1 -0
- package/dist/tui/components/ReadlineInput.js +240 -0
- package/dist/tui/components/ReadlineInput.js.map +1 -0
- package/dist/tui/components/SingleSelect.d.ts +13 -0
- package/dist/tui/components/SingleSelect.js +46 -0
- package/dist/tui/components/StatusBar.d.ts +9 -0
- package/dist/tui/components/StatusBar.d.ts.map +1 -0
- package/dist/tui/components/StatusBar.js +82 -0
- package/dist/tui/components/StatusBar.js.map +1 -0
- package/dist/tui/components/index.d.ts +11 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js +11 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/index.d.ts +7 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +7 -0
- package/dist/tui/index.js.map +1 -0
- package/package.json +86 -0
- package/src/styles/global.css +152 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessageList.js","sourceRoot":"","sources":["../../../src/tui/components/MessageList.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAM7C,MAAM,UAAU,WAAW,CAAC,EAAE,QAA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G,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MultiSelectOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MultiSelectProps {
|
|
7
|
+
options: MultiSelectOption[];
|
|
8
|
+
selected: string[];
|
|
9
|
+
onChange: (selected: string[]) => void;
|
|
10
|
+
onSubmit: () => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function MultiSelect({ options, selected, onChange, onSubmit, onCancel, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
export function MultiSelect({ options, selected, onChange, onSubmit, onCancel, }) {
|
|
5
|
+
const [focusedIndex, setFocusedIndex] = useState(0);
|
|
6
|
+
const totalItems = options.length + 1; // +1 for Continue button
|
|
7
|
+
useInput((input, key) => {
|
|
8
|
+
// Handle Escape: Cancel
|
|
9
|
+
if (key.escape) {
|
|
10
|
+
onCancel?.();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
// Handle Enter: Toggle selection or submit
|
|
14
|
+
if (key.return) {
|
|
15
|
+
if (focusedIndex === options.length) {
|
|
16
|
+
// On Continue button - submit
|
|
17
|
+
onSubmit();
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
// On an option - toggle selection
|
|
21
|
+
const currentOption = options[focusedIndex];
|
|
22
|
+
if (currentOption) {
|
|
23
|
+
const currentValue = currentOption.value;
|
|
24
|
+
const newSelected = selected.includes(currentValue)
|
|
25
|
+
? selected.filter((v) => v !== currentValue)
|
|
26
|
+
: [...selected, currentValue];
|
|
27
|
+
onChange(newSelected);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Handle Arrow Up: Move focus up
|
|
33
|
+
if (key.upArrow) {
|
|
34
|
+
setFocusedIndex((prev) => (prev > 0 ? prev - 1 : totalItems - 1));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
// Handle Arrow Down: Move focus down
|
|
38
|
+
if (key.downArrow) {
|
|
39
|
+
setFocusedIndex((prev) => (prev < totalItems - 1 ? prev + 1 : 0));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// Handle Spacebar: Toggle selection (only for options, not Continue button)
|
|
43
|
+
if (input === " ") {
|
|
44
|
+
if (focusedIndex >= options.length)
|
|
45
|
+
return; // Don't toggle Continue button
|
|
46
|
+
const currentOption = options[focusedIndex];
|
|
47
|
+
if (!currentOption)
|
|
48
|
+
return;
|
|
49
|
+
const currentValue = currentOption.value;
|
|
50
|
+
const newSelected = selected.includes(currentValue)
|
|
51
|
+
? selected.filter((v) => v !== currentValue)
|
|
52
|
+
: [...selected, currentValue];
|
|
53
|
+
onChange(newSelected);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// Handle Ctrl+A: Select all
|
|
57
|
+
if (key.ctrl && input === "a") {
|
|
58
|
+
onChange(options.map((opt) => opt.value));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
// Handle Ctrl+N: Clear all
|
|
62
|
+
if (key.ctrl && input === "n") {
|
|
63
|
+
onChange([]);
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return (_jsxs(Box, { flexDirection: "column", children: [options.map((option, index) => {
|
|
68
|
+
const isSelected = selected.includes(option.value);
|
|
69
|
+
const isFocused = index === focusedIndex;
|
|
70
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { inverse: isFocused, children: [isSelected ? "[x]" : "[ ]", " ", option.label] }) }), option.description && (_jsx(Box, { paddingLeft: 4, children: _jsx(Text, { dimColor: true, children: option.description }) }))] }, option.value));
|
|
71
|
+
}), _jsx(Box, { marginTop: 1, children: _jsx(Text, { inverse: focusedIndex === options.length, color: "green", bold: true, children: "\u2192 Continue" }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193: Navigate \u2022 Space/Enter: Toggle \u2022 Enter on Continue: Proceed" }) })] }));
|
|
72
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ReadlineInputProps {
|
|
2
|
+
value: string;
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
onSubmit: () => void;
|
|
5
|
+
onEscape?: () => void;
|
|
6
|
+
placeholder?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function ReadlineInput({ value, onChange, onSubmit, onEscape, placeholder, }: ReadlineInputProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadlineInput.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ReadlineInput.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAgB,GACjB,EAAE,kBAAkB,2CA2QpB"}
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text, useInput } from "ink";
|
|
3
|
+
import React, { useState } from "react";
|
|
4
|
+
export function ReadlineInput({ value, onChange, onSubmit, onEscape, placeholder = "", }) {
|
|
5
|
+
const [cursorOffset, setCursorOffset] = useState(0);
|
|
6
|
+
useInput((input, key) => {
|
|
7
|
+
// Handle Esc: Call escape handler
|
|
8
|
+
if (key.escape) {
|
|
9
|
+
if (onEscape) {
|
|
10
|
+
onEscape();
|
|
11
|
+
}
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
// Handle special keys
|
|
15
|
+
if (key.return) {
|
|
16
|
+
const cursorPos = value.length + cursorOffset;
|
|
17
|
+
// Shift+Enter: Insert backslash and newline
|
|
18
|
+
if (key.shift) {
|
|
19
|
+
const newValue = `${value.slice(0, cursorPos)}\\\n${value.slice(cursorPos)}`;
|
|
20
|
+
onChange(newValue);
|
|
21
|
+
if (cursorOffset < 0) {
|
|
22
|
+
setCursorOffset(cursorOffset - 2);
|
|
23
|
+
}
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// Check if cursor is at end and last character is backslash (line continuation)
|
|
27
|
+
if (cursorPos === value.length && value.endsWith("\\")) {
|
|
28
|
+
// Remove backslash and add newline (line continuation)
|
|
29
|
+
const newValue = `${value.slice(0, -1)}\n`;
|
|
30
|
+
onChange(newValue);
|
|
31
|
+
setCursorOffset(0); // Move cursor to end
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
// Alt+Enter adds a newline, Enter submits
|
|
35
|
+
if (key.meta) {
|
|
36
|
+
const newValue = `${value.slice(0, cursorPos)}\n${value.slice(cursorPos)}`;
|
|
37
|
+
onChange(newValue);
|
|
38
|
+
if (cursorOffset < 0) {
|
|
39
|
+
setCursorOffset(cursorOffset - 1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
onSubmit();
|
|
44
|
+
}
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (key.ctrl) {
|
|
48
|
+
// Ctrl+A: Move to beginning of line
|
|
49
|
+
if (input === "a") {
|
|
50
|
+
setCursorOffset(-value.length);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// Ctrl+E: Move to end of line
|
|
54
|
+
if (input === "e") {
|
|
55
|
+
setCursorOffset(0);
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
// Ctrl+W: Delete word backward
|
|
59
|
+
if (input === "w") {
|
|
60
|
+
const cursorPos = value.length + cursorOffset;
|
|
61
|
+
const before = value.slice(0, cursorPos);
|
|
62
|
+
const after = value.slice(cursorPos);
|
|
63
|
+
// Find the start of the word to delete
|
|
64
|
+
const match = before.match(/\s*\S*$/);
|
|
65
|
+
if (match) {
|
|
66
|
+
const newBefore = before.slice(0, -match[0].length);
|
|
67
|
+
onChange(newBefore + after);
|
|
68
|
+
setCursorOffset(-after.length);
|
|
69
|
+
}
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
// Ctrl+U: Delete from cursor to beginning of line
|
|
73
|
+
if (input === "u") {
|
|
74
|
+
const cursorPos = value.length + cursorOffset;
|
|
75
|
+
onChange(value.slice(cursorPos));
|
|
76
|
+
setCursorOffset(-value.slice(cursorPos).length);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
// Ctrl+K: Delete from cursor to end of line
|
|
80
|
+
if (input === "k") {
|
|
81
|
+
const cursorPos = value.length + cursorOffset;
|
|
82
|
+
onChange(value.slice(0, cursorPos));
|
|
83
|
+
setCursorOffset(0);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
// Ctrl+D: Delete character forward
|
|
87
|
+
if (input === "d") {
|
|
88
|
+
const cursorPos = value.length + cursorOffset;
|
|
89
|
+
if (cursorPos < value.length) {
|
|
90
|
+
onChange(value.slice(0, cursorPos) + value.slice(cursorPos + 1));
|
|
91
|
+
}
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
// Ctrl+B: Move backward one character
|
|
95
|
+
if (input === "b") {
|
|
96
|
+
const cursorPos = value.length + cursorOffset;
|
|
97
|
+
if (cursorPos > 0) {
|
|
98
|
+
setCursorOffset(cursorOffset - 1);
|
|
99
|
+
}
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Ctrl+F: Move forward one character
|
|
103
|
+
if (input === "f") {
|
|
104
|
+
const cursorPos = value.length + cursorOffset;
|
|
105
|
+
if (cursorPos < value.length) {
|
|
106
|
+
setCursorOffset(cursorOffset + 1);
|
|
107
|
+
}
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Handle backspace
|
|
112
|
+
if (key.backspace || key.delete) {
|
|
113
|
+
const cursorPos = value.length + cursorOffset;
|
|
114
|
+
if (cursorPos > 0) {
|
|
115
|
+
onChange(value.slice(0, cursorPos - 1) + value.slice(cursorPos));
|
|
116
|
+
if (cursorOffset < 0) {
|
|
117
|
+
setCursorOffset(cursorOffset + 1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// Handle left/right arrow keys
|
|
123
|
+
if (key.leftArrow) {
|
|
124
|
+
const cursorPos = value.length + cursorOffset;
|
|
125
|
+
if (cursorPos > 0) {
|
|
126
|
+
setCursorOffset(cursorOffset - 1);
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (key.rightArrow) {
|
|
131
|
+
const cursorPos = value.length + cursorOffset;
|
|
132
|
+
if (cursorPos < value.length) {
|
|
133
|
+
setCursorOffset(cursorOffset + 1);
|
|
134
|
+
}
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
// Handle up/down arrow keys for multi-line navigation
|
|
138
|
+
if (key.upArrow) {
|
|
139
|
+
const cursorPos = value.length + cursorOffset;
|
|
140
|
+
const lines = value.split("\n");
|
|
141
|
+
// Find which line we're on and our position within it
|
|
142
|
+
let currentLineIndex = 0;
|
|
143
|
+
let charCount = 0;
|
|
144
|
+
let posInLine = cursorPos;
|
|
145
|
+
for (let i = 0; i < lines.length; i++) {
|
|
146
|
+
const line = lines[i];
|
|
147
|
+
if (!line)
|
|
148
|
+
continue;
|
|
149
|
+
const lineLength = line.length + (i < lines.length - 1 ? 1 : 0); // +1 for \n
|
|
150
|
+
if (charCount + lineLength > cursorPos || i === lines.length - 1) {
|
|
151
|
+
currentLineIndex = i;
|
|
152
|
+
posInLine = cursorPos - charCount;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
charCount += lineLength;
|
|
156
|
+
}
|
|
157
|
+
// Move to previous line if possible
|
|
158
|
+
if (currentLineIndex > 0) {
|
|
159
|
+
const prevLine = lines[currentLineIndex - 1];
|
|
160
|
+
const currentLine = lines[currentLineIndex];
|
|
161
|
+
if (prevLine && currentLine) {
|
|
162
|
+
const prevLineStart = charCount - currentLine.length - 1;
|
|
163
|
+
const targetPos = Math.min(posInLine, prevLine.length);
|
|
164
|
+
const newCursorPos = prevLineStart + targetPos;
|
|
165
|
+
setCursorOffset(newCursorPos - value.length);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (key.downArrow) {
|
|
171
|
+
const cursorPos = value.length + cursorOffset;
|
|
172
|
+
const lines = value.split("\n");
|
|
173
|
+
// Find which line we're on and our position within it
|
|
174
|
+
let currentLineIndex = 0;
|
|
175
|
+
let charCount = 0;
|
|
176
|
+
let posInLine = cursorPos;
|
|
177
|
+
for (let i = 0; i < lines.length; i++) {
|
|
178
|
+
const line = lines[i];
|
|
179
|
+
if (!line)
|
|
180
|
+
continue;
|
|
181
|
+
const lineLength = line.length + (i < lines.length - 1 ? 1 : 0); // +1 for \n
|
|
182
|
+
if (charCount + lineLength > cursorPos || i === lines.length - 1) {
|
|
183
|
+
currentLineIndex = i;
|
|
184
|
+
posInLine = cursorPos - charCount;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
charCount += lineLength;
|
|
188
|
+
}
|
|
189
|
+
// Move to next line if possible
|
|
190
|
+
if (currentLineIndex < lines.length - 1) {
|
|
191
|
+
const nextLine = lines[currentLineIndex + 1];
|
|
192
|
+
const currentLine = lines[currentLineIndex];
|
|
193
|
+
if (nextLine && currentLine) {
|
|
194
|
+
const nextLineStart = charCount + currentLine.length + 1;
|
|
195
|
+
const targetPos = Math.min(posInLine, nextLine.length);
|
|
196
|
+
const newCursorPos = nextLineStart + targetPos;
|
|
197
|
+
setCursorOffset(newCursorPos - value.length);
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
// Regular character input and paste detection
|
|
203
|
+
// Ink automatically detects paste and sends the whole string at once
|
|
204
|
+
if (!key.ctrl && !key.meta && input.length > 0) {
|
|
205
|
+
const cursorPos = value.length + cursorOffset;
|
|
206
|
+
// Check if this is a paste with more than 3 lines
|
|
207
|
+
let contentToInsert = input;
|
|
208
|
+
if (input.length > 1) {
|
|
209
|
+
// Pasted content (more than 1 char at once)
|
|
210
|
+
const lines = input.split("\n");
|
|
211
|
+
if (lines.length > 3) {
|
|
212
|
+
contentToInsert = `[Pasted +${lines.length} lines]`;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
const newValue = value.slice(0, cursorPos) + contentToInsert + value.slice(cursorPos);
|
|
216
|
+
onChange(newValue);
|
|
217
|
+
// Keep cursor at the same relative position
|
|
218
|
+
if (cursorOffset < 0) {
|
|
219
|
+
setCursorOffset(cursorOffset - contentToInsert.length);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
// Reset cursor when value changes externally (e.g., after submit)
|
|
224
|
+
React.useEffect(() => {
|
|
225
|
+
if (value.length === 0) {
|
|
226
|
+
setCursorOffset(0);
|
|
227
|
+
}
|
|
228
|
+
}, [value]);
|
|
229
|
+
// Display the input with cursor
|
|
230
|
+
const cursorPos = value.length + cursorOffset;
|
|
231
|
+
// Show placeholder if empty
|
|
232
|
+
if (value.length === 0) {
|
|
233
|
+
return (_jsxs(_Fragment, { children: [_jsx(Text, { inverse: true, children: " " }), _jsx(Text, { dimColor: true, children: placeholder })] }));
|
|
234
|
+
}
|
|
235
|
+
// Show value with cursor
|
|
236
|
+
const before = value.slice(0, cursorPos);
|
|
237
|
+
const cursor = value[cursorPos] || " ";
|
|
238
|
+
const after = value.slice(cursorPos + 1);
|
|
239
|
+
return (_jsxs(Text, { children: [before, _jsx(Text, { inverse: true, children: cursor }), after] }));
|
|
240
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReadlineInput.js","sourceRoot":"","sources":["../../../src/tui/components/ReadlineInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAUrC,MAAM,UAAU,aAAa,CAAC,EAC5B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,GAAG,EAAE,GACG;IACnB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEpD,QAAQ,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;QACtB,kCAAkC;QAClC,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,IAAI,QAAQ,EAAE,CAAC;gBACb,QAAQ,EAAE,CAAC;YACb,CAAC;YACD,OAAO;QACT,CAAC;QAED,sBAAsB;QACtB,IAAI,GAAG,CAAC,MAAM,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,GAAG,YAAY,CAAC;YAE9C,4CAA4C;YAC5C,IAAI,GAAG,CAAC,KAAK,EAAE,CAAC;gBACd,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;gBAC7E,QAAQ,CAAC,QAAQ,CAAC,CAAC;gBACnB,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;oBACrB,eAAe,CAAC,YAAY,G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SelectProps {
|
|
7
|
+
options: SingleSelectOption[];
|
|
8
|
+
selected: string | null;
|
|
9
|
+
onChange: (selected: string) => void;
|
|
10
|
+
onSubmit: (selected: string) => void;
|
|
11
|
+
onCancel?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function SingleSelect({ options, selected: _selected, onChange, onSubmit, onCancel, }: SingleSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from "ink";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
export function SingleSelect({ options, selected: _selected, onChange, onSubmit, onCancel, }) {
|
|
5
|
+
const [focusedIndex, setFocusedIndex] = useState(0);
|
|
6
|
+
const totalItems = options.length;
|
|
7
|
+
useInput((input, key) => {
|
|
8
|
+
// Handle Escape: Cancel
|
|
9
|
+
if (key.escape) {
|
|
10
|
+
onCancel?.();
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
// Handle Enter: Select option and submit immediately
|
|
14
|
+
if (key.return) {
|
|
15
|
+
const currentOption = options[focusedIndex];
|
|
16
|
+
if (currentOption) {
|
|
17
|
+
onChange(currentOption.value);
|
|
18
|
+
onSubmit(currentOption.value);
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
// Handle Arrow Up: Move focus up
|
|
23
|
+
if (key.upArrow) {
|
|
24
|
+
setFocusedIndex((prev) => (prev > 0 ? prev - 1 : totalItems - 1));
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
// Handle Arrow Down: Move focus down
|
|
28
|
+
if (key.downArrow) {
|
|
29
|
+
setFocusedIndex((prev) => (prev < totalItems - 1 ? prev + 1 : 0));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
// Handle Spacebar: Select option and submit immediately
|
|
33
|
+
if (input === " ") {
|
|
34
|
+
const currentOption = options[focusedIndex];
|
|
35
|
+
if (currentOption) {
|
|
36
|
+
onChange(currentOption.value);
|
|
37
|
+
onSubmit(currentOption.value);
|
|
38
|
+
}
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
return (_jsxs(Box, { flexDirection: "column", children: [options.map((option, index) => {
|
|
43
|
+
const isFocused = index === focusedIndex;
|
|
44
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsx(Box, { children: _jsxs(Text, { inverse: isFocused, children: [isFocused ? ">" : " ", " ", option.label] }) }), option.description && (_jsx(Box, { paddingLeft: 2, children: _jsx(Text, { dimColor: true, children: option.description }) }))] }, option.value));
|
|
45
|
+
}), _jsx(Box, { marginTop: 1, children: _jsx(Text, { dimColor: true, children: "\u2191/\u2193: Navigate \u2022 Space/Enter: Select and continue \u2022 Esc: Cancel" }) })] }));
|
|
46
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ConnectionStatus } from "../../core/index.js";
|
|
2
|
+
export interface StatusBarProps {
|
|
3
|
+
connectionStatus: ConnectionStatus;
|
|
4
|
+
sessionId: string | null;
|
|
5
|
+
isStreaming: boolean;
|
|
6
|
+
streamingStartTime: number | null;
|
|
7
|
+
hasStreamingContent: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function StatusBar({ connectionStatus, isStreaming, streamingStartTime, hasStreamingContent, }: StatusBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,cAAc;IAC7B,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAoFD,wBAAgB,SAAS,CAAC,EACxB,gBAAgB,EAChB,SAAS,EACT,WAAW,EACX,kBAAkB,EAClB,mBAAmB,GACpB,EAAE,cAAc,2CA0BhB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from "ink";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
// Synonyms of "thinking" in multiple languages
|
|
5
|
+
const THINKING_WORDS = [
|
|
6
|
+
"Thinking", // English
|
|
7
|
+
"Pensando", // Spanish/Portuguese
|
|
8
|
+
"Pensant", // French
|
|
9
|
+
"Denkend", // German
|
|
10
|
+
"Pensando", // Italian
|
|
11
|
+
"考えている", // Japanese (kangaeteiru)
|
|
12
|
+
"생각 중", // Korean (saenggak jung)
|
|
13
|
+
"思考中", // Chinese (sīkǎo zhōng)
|
|
14
|
+
"Размышляя", // Russian (razmyshlyaya)
|
|
15
|
+
"Düşünüyor", // Turkish
|
|
16
|
+
"Myślący", // Polish
|
|
17
|
+
"Tänkande", // Swedish
|
|
18
|
+
"Pensando", // Dutch
|
|
19
|
+
"Ajatellen", // Finnish
|
|
20
|
+
"Σκεπτόμενος", // Greek (skeptomenos)
|
|
21
|
+
"חושב", // Hebrew (choshev)
|
|
22
|
+
"सोच रहा है", // Hindi (soch raha hai)
|
|
23
|
+
"Berpikir", // Indonesian
|
|
24
|
+
];
|
|
25
|
+
// Animated dot patterns for bouncing/jumping effect
|
|
26
|
+
// Using regular dots (.) and middle dots (·) to create height illusion
|
|
27
|
+
const DOT_ANIMATIONS = [
|
|
28
|
+
"...", // All dots down
|
|
29
|
+
"·..", // First dot up
|
|
30
|
+
".·.", // Middle dot up
|
|
31
|
+
"..·", // Last dot up
|
|
32
|
+
".·.", // Middle dot up
|
|
33
|
+
"·..", // First dot up
|
|
34
|
+
];
|
|
35
|
+
/**
|
|
36
|
+
* Component that displays elapsed time for waiting/streaming
|
|
37
|
+
*/
|
|
38
|
+
function WaitingElapsedTime({ startTime }) {
|
|
39
|
+
const [elapsed, setElapsed] = useState(0);
|
|
40
|
+
const [thinkingWord, setThinkingWord] = useState(() => THINKING_WORDS[Math.floor(Math.random() * THINKING_WORDS.length)]);
|
|
41
|
+
const [dotIndex, setDotIndex] = useState(0);
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
// Update elapsed time every 100ms for smooth updates
|
|
44
|
+
const interval = setInterval(() => {
|
|
45
|
+
const now = Date.now();
|
|
46
|
+
const elapsedMs = now - startTime;
|
|
47
|
+
setElapsed(elapsedMs);
|
|
48
|
+
}, 100);
|
|
49
|
+
return () => clearInterval(interval);
|
|
50
|
+
}, [startTime]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
// Change to random thinking word every 1.5 seconds
|
|
53
|
+
const wordInterval = setInterval(() => {
|
|
54
|
+
const randomIndex = Math.floor(Math.random() * THINKING_WORDS.length);
|
|
55
|
+
setThinkingWord(THINKING_WORDS[randomIndex]);
|
|
56
|
+
}, 1500);
|
|
57
|
+
return () => clearInterval(wordInterval);
|
|
58
|
+
}, []);
|
|
59
|
+
useEffect(() => {
|
|
60
|
+
// Animate dots every 100ms for bouncing effect
|
|
61
|
+
const dotInterval = setInterval(() => {
|
|
62
|
+
setDotIndex((prev) => (prev + 1) % DOT_ANIMATIONS.length);
|
|
63
|
+
}, 100);
|
|
64
|
+
return () => clearInterval(dotInterval);
|
|
65
|
+
}, []);
|
|
66
|
+
// Format elapsed time as seconds with 1 decimal place
|
|
67
|
+
const seconds = (elapsed / 1000).toFixed(1);
|
|
68
|
+
const animatedDots = DOT_ANIMATIONS[dotIndex];
|
|
69
|
+
return (_jsxs(Text, { color: "red", children: [thinkingWord, animatedDots, " ", seconds, "s"] }));
|
|
70
|
+
}
|
|
71
|
+
export function StatusBar({ connectionStatus, isStreaming, streamingStartTime, hasStreamingContent, }) {
|
|
72
|
+
const statusColor = connectionStatus === "connected"
|
|
73
|
+
? "green"
|
|
74
|
+
: connectionStatus === "connecting"
|
|
75
|
+
? "yellow"
|
|
76
|
+
: connectionStatus === "error"
|
|
77
|
+
? "red"
|
|
78
|
+
: "gray";
|
|
79
|
+
// Only show waiting indicator when streaming but haven't received content yet
|
|
80
|
+
const showWaiting = isStreaming && streamingStartTime && !hasStreamingContent;
|
|
81
|
+
return (_jsxs(Box, { flexDirection: "row", gap: 2, paddingY: 1, children: [_jsxs(Text, { children: ["Status: ", _jsx(Text, { color: statusColor, children: connectionStatus })] }), showWaiting && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(WaitingElapsedTime, { startTime: streamingStartTime })] }))] }));
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAWhC,+CAA+C;AAC/C,MAAM,cAAc,GAAG;IACrB,UAAU,EAAO,UAAU;IAC3B,UAAU,EAAO,qBAAqB;IACtC,SAAS,EAAQ,SAAS;IAC1B,SAAS,EAAQ,SAAS;IAC1B,UAAU,EAAO,UAAU;IAC3B,OAAO,EAAM,yBAAyB;IACtC,MAAM,EAAS,yBAAyB;IACxC,KAAK,EAAU,wBAAwB;IACvC,WAAW,EAAM,yBAAyB;IAC1C,WAAW,EAAM,UAAU;IAC3B,SAAS,EAAQ,SAAS;IAC1B,UAAU,EAAO,UAAU;IAC3B,UAAU,EAAO,QAAQ;IACzB,WAAW,EAAM,UAAU;IAC3B,aAAa,EAAI,sBAAsB;IACvC,MAAM,EAAW,mBAAmB;IACpC,YAAY,EAAK,wBAAwB;IACzC,UAAU,EAAO,aAAa;CAC/B,CAAC;AAEF,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KAAK,EAAC,GAAG,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,aAC1C,MAAC,IAAI,2BACK,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,YAAG,gBAAgB,GAAQ,IACtD,EACN,WAAW,IAAI,CACd,8BACE,KAAC,IAAI,oBAAS,EACd,KAAC,kBAAkB,IAAC,SAAS,EAAE,kBAAkB,GAAI,IACpD,CACJ,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export all TUI components
|
|
3
|
+
*/
|
|
4
|
+
export * from "./ChatView.js";
|
|
5
|
+
export * from "./GameOfLife.js";
|
|
6
|
+
export * from "./InputBox.js";
|
|
7
|
+
export * from "./MessageList.js";
|
|
8
|
+
export * from "./MultiSelect.js";
|
|
9
|
+
export * from "./ReadlineInput.js";
|
|
10
|
+
export * from "./SingleSelect.js";
|
|
11
|
+
export * from "./StatusBar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Export all TUI components
|
|
3
|
+
*/
|
|
4
|
+
export * from "./ChatView.js";
|
|
5
|
+
export * from "./GameOfLife.js";
|
|
6
|
+
export * from "./InputBox.js";
|
|
7
|
+
export * from "./MessageList.js";
|
|
8
|
+
export * from "./MultiSelect.js";
|
|
9
|
+
export * from "./ReadlineInput.js";
|
|
10
|
+
export * from "./SingleSelect.js";
|
|
11
|
+
export * from "./StatusBar.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tui/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tui/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,uBAAuB,CAAC"}
|