@curie-agent/tui 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/dist/src/agents-tab.d.ts +15 -0
- package/dist/src/agents-tab.d.ts.map +1 -0
- package/dist/src/agents-tab.js +32 -0
- package/dist/src/agents-tab.js.map +1 -0
- package/dist/src/approval-picker.d.ts +11 -0
- package/dist/src/approval-picker.d.ts.map +1 -0
- package/dist/src/approval-picker.js +14 -0
- package/dist/src/approval-picker.js.map +1 -0
- package/dist/src/channels-tab.d.ts +19 -0
- package/dist/src/channels-tab.d.ts.map +1 -0
- package/dist/src/channels-tab.js +37 -0
- package/dist/src/channels-tab.js.map +1 -0
- package/dist/src/chat-surface.d.ts +59 -0
- package/dist/src/chat-surface.d.ts.map +1 -0
- package/dist/src/chat-surface.js +408 -0
- package/dist/src/chat-surface.js.map +1 -0
- package/dist/src/effort-picker.d.ts +10 -0
- package/dist/src/effort-picker.d.ts.map +1 -0
- package/dist/src/effort-picker.js +30 -0
- package/dist/src/effort-picker.js.map +1 -0
- package/dist/src/footer.d.ts +17 -0
- package/dist/src/footer.d.ts.map +1 -0
- package/dist/src/footer.js +20 -0
- package/dist/src/footer.js.map +1 -0
- package/dist/src/header.d.ts +7 -0
- package/dist/src/header.d.ts.map +1 -0
- package/dist/src/header.js +7 -0
- package/dist/src/header.js.map +1 -0
- package/dist/src/index.d.ts +27 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +19 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/init-wizard.d.ts +37 -0
- package/dist/src/init-wizard.d.ts.map +1 -0
- package/dist/src/init-wizard.js +507 -0
- package/dist/src/init-wizard.js.map +1 -0
- package/dist/src/kitt-indicator.d.ts +9 -0
- package/dist/src/kitt-indicator.d.ts.map +1 -0
- package/dist/src/kitt-indicator.js +41 -0
- package/dist/src/kitt-indicator.js.map +1 -0
- package/dist/src/mascot.d.ts +2 -0
- package/dist/src/mascot.d.ts.map +1 -0
- package/dist/src/mascot.js +6 -0
- package/dist/src/mascot.js.map +1 -0
- package/dist/src/mode-picker.d.ts +10 -0
- package/dist/src/mode-picker.d.ts.map +1 -0
- package/dist/src/mode-picker.js +29 -0
- package/dist/src/mode-picker.js.map +1 -0
- package/dist/src/projects-tab.d.ts +16 -0
- package/dist/src/projects-tab.d.ts.map +1 -0
- package/dist/src/projects-tab.js +76 -0
- package/dist/src/projects-tab.js.map +1 -0
- package/dist/src/slash-commands.d.ts +103 -0
- package/dist/src/slash-commands.d.ts.map +1 -0
- package/dist/src/slash-commands.js +985 -0
- package/dist/src/slash-commands.js.map +1 -0
- package/dist/src/stats-data.d.ts +15 -0
- package/dist/src/stats-data.d.ts.map +1 -0
- package/dist/src/stats-data.js +76 -0
- package/dist/src/stats-data.js.map +1 -0
- package/dist/src/stats-tab.d.ts +16 -0
- package/dist/src/stats-tab.d.ts.map +1 -0
- package/dist/src/stats-tab.js +103 -0
- package/dist/src/stats-tab.js.map +1 -0
- package/dist/src/status-line.d.ts +13 -0
- package/dist/src/status-line.d.ts.map +1 -0
- package/dist/src/status-line.js +31 -0
- package/dist/src/status-line.js.map +1 -0
- package/dist/src/tab-bar.d.ts +14 -0
- package/dist/src/tab-bar.d.ts.map +1 -0
- package/dist/src/tab-bar.js +22 -0
- package/dist/src/tab-bar.js.map +1 -0
- package/dist/src/waiting-dot.d.ts +7 -0
- package/dist/src/waiting-dot.d.ts.map +1 -0
- package/dist/src/waiting-dot.js +15 -0
- package/dist/src/waiting-dot.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ThemeColors } from '../../render/src/themes.js';
|
|
2
|
+
export interface AgentEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
output: string;
|
|
6
|
+
status: 'running' | 'completed' | 'error';
|
|
7
|
+
}
|
|
8
|
+
interface AgentsTabProps {
|
|
9
|
+
agents: Map<string, AgentEntry>;
|
|
10
|
+
isActive: boolean;
|
|
11
|
+
theme?: ThemeColors;
|
|
12
|
+
}
|
|
13
|
+
export declare function AgentsTab({ agents, theme }: AgentsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=agents-tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agents-tab.d.ts","sourceRoot":"","sources":["../../src/agents-tab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;CAC3C;AAED,UAAU,cAAc;IACtB,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAID,wBAAgB,SAAS,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,cAAc,2CAuE1D"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useStdout } from 'ink';
|
|
3
|
+
const MAX_OUTPUT_LINES = 20;
|
|
4
|
+
export function AgentsTab({ agents, theme }) {
|
|
5
|
+
const primary = theme?.primary || '#7aa2f7';
|
|
6
|
+
const muted = theme?.muted || '#565f89';
|
|
7
|
+
const fg = theme?.foreground || '#a9b1d6';
|
|
8
|
+
const runningColor = theme?.primary || '#7aa2f7';
|
|
9
|
+
const completedColor = theme?.success || '#9ece6a';
|
|
10
|
+
const errorColor = theme?.error || '#f7768e';
|
|
11
|
+
const { stdout } = useStdout();
|
|
12
|
+
const cols = stdout?.columns ?? 100;
|
|
13
|
+
const agentArray = Array.from(agents.entries());
|
|
14
|
+
if (agentArray.length === 0) {
|
|
15
|
+
return (_jsx(Box, { paddingX: 1, paddingY: 1, children: _jsx(Text, { color: muted, children: "No active agents. Use /agent <prompt> to launch one." }) }));
|
|
16
|
+
}
|
|
17
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, paddingY: 1, children: [_jsx(Text, { color: primary, bold: true, children: "Agents" }), _jsx(Box, { borderBottom: true, borderColor: muted, marginTop: 1, marginBottom: 1 }), agentArray.map(([id, agent]) => {
|
|
18
|
+
const statusColor = agent.status === 'running' ? runningColor :
|
|
19
|
+
agent.status === 'completed' ? completedColor :
|
|
20
|
+
errorColor;
|
|
21
|
+
const statusText = agent.status === 'running' ? 'running' :
|
|
22
|
+
agent.status === 'completed' ? 'done' :
|
|
23
|
+
'error';
|
|
24
|
+
const promptTruncated = agent.prompt.length > cols - 30 ? agent.prompt.slice(0, cols - 33) + '...' : agent.prompt;
|
|
25
|
+
// Split output into lines and trim to last MAX_OUTPUT_LINES
|
|
26
|
+
const outputLines = agent.output.split('\n').filter(Boolean);
|
|
27
|
+
const visibleLines = outputLines.slice(-MAX_OUTPUT_LINES);
|
|
28
|
+
const hasMore = outputLines.length > MAX_OUTPUT_LINES;
|
|
29
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsxs(Box, { children: [_jsxs(Text, { color: statusColor, bold: true, children: ["[", statusText, "]"] }), _jsxs(Text, { color: fg, children: [" Agent: ", promptTruncated] })] }), visibleLines.length > 0 && (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [hasMore && (_jsxs(Text, { color: muted, children: ["... (", outputLines.length - MAX_OUTPUT_LINES, " more lines)"] })), visibleLines.map((line, i) => (_jsx(Text, { color: muted, wrap: "truncate", children: line }, i)))] }))] }, id));
|
|
30
|
+
})] }));
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=agents-tab.js.map
|
|
@@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K,EAAE,EAAE,yBAAW,eAAe,IAAQ,IAC7C,EACL,YAAY,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1B,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,aACpC,OAAO,IAAI,CACV,MAAC,IAAI,IAAC,KAAK,EAAE,KAAK,sBACV,WAAW,CAAC,MAAM,GAAG,gBAAgB,oBACtC,CACR,EACA,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC7B,KAAC,IAAI,IAAS,KAAK,EAAE,KAAK,EAAE,IAAI,EAAC,UAAU,YACxC,IAAI,IADI,CAAC,CAEL,CACR,CAAC,IACE,CACP,KApBO,EAAE,CAqBN,CACP,CAAC;YACJ,CAAC,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ThemeColors } from '../../render/src/themes.js';
|
|
2
|
+
interface ApprovalPickerProps {
|
|
3
|
+
toolName: string;
|
|
4
|
+
input: Record<string, unknown>;
|
|
5
|
+
reason: string;
|
|
6
|
+
selected: 'allow' | 'deny';
|
|
7
|
+
theme?: ThemeColors;
|
|
8
|
+
}
|
|
9
|
+
export declare function ApprovalPicker({ toolName, input, reason, selected, theme }: ApprovalPickerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=approval-picker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-picker.d.ts","sourceRoot":"","sources":["../../src/approval-picker.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,WAAW,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAiC/F"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export function ApprovalPicker({ toolName, input, reason, selected, theme }) {
|
|
4
|
+
const primary = theme?.primary || '#7aa2f7';
|
|
5
|
+
const muted = theme?.muted || '#565f89';
|
|
6
|
+
const border = theme?.border || '#414868';
|
|
7
|
+
const fg = theme?.foreground || '#a9b1d6';
|
|
8
|
+
const bg = theme?.background || '#1a1b26';
|
|
9
|
+
const warning = theme?.warning || '#e0af68';
|
|
10
|
+
const preview = JSON.stringify(input);
|
|
11
|
+
const truncated = preview.length > 80 ? preview.slice(0, 77) + '…' : preview;
|
|
12
|
+
return (_jsx(Box, { justifyContent: "center", alignItems: "center", flexGrow: 1, children: _jsxs(Box, { flexDirection: "column", borderStyle: "round", borderColor: warning, paddingX: 1, children: [_jsx(Text, { bold: true, color: warning, backgroundColor: bg, children: ' Approval required ' }), _jsx(Text, { backgroundColor: bg, children: ' ' }), _jsx(Text, { color: fg, backgroundColor: bg, children: ` ${toolName}(${truncated}) ` }), _jsx(Text, { color: muted, backgroundColor: bg, children: ` ${reason} ` }), _jsx(Text, { backgroundColor: bg, children: ' ' }), _jsxs(Box, { backgroundColor: bg, children: [_jsx(Text, { color: selected === 'allow' ? primary : fg, backgroundColor: selected === 'allow' ? border : bg, bold: selected === 'allow', children: selected === 'allow' ? ' › Allow ' : ' Allow ' }), _jsx(Text, { children: " " }), _jsx(Text, { color: selected === 'deny' ? primary : fg, backgroundColor: selected === 'deny' ? border : bg, bold: selected === 'deny', children: selected === 'deny' ? ' › Deny ' : ' Deny ' })] }), _jsx(Text, { backgroundColor: bg, children: ' ' }), _jsx(Text, { color: muted, backgroundColor: bg, children: ' y=allow · n=deny · Tab · Enter ' })] }) }));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=approval-picker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"approval-picker.js","sourceRoot":"","sources":["../../src/approval-picker.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAWhC,MAAM,UAAU,cAAc,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAuB;IAC9F,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC;IAC5C,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,SAAS,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,SAAS,CAAC;IAC1C,MAAM,EAAE,GAAG,KAAK,EAAE,UAAU,IAAI,SAAS,CAAC;IAC1C,MAAM,EAAE,GAAG,KAAK,EAAE,UAAU,IAAI,SAAS,CAAC;IAC1C,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC;IAE5C,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC;IAE7E,OAAO,CACL,KAAC,GAAG,IAAC,cAAc,EAAC,QAAQ,EAAC,UAAU,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,YAC1D,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAC,OAAO,EAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,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E,eAAe,EAAE,EAAE,YAAG,kCAAkC,GAAQ,IAChF,GACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ThemeColors } from '../../render/src/themes.js';
|
|
2
|
+
export interface ChannelTabEntry {
|
|
3
|
+
id: string;
|
|
4
|
+
type: 'cli' | 'telegram';
|
|
5
|
+
identifier: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
messageCount: number;
|
|
9
|
+
isActive: boolean;
|
|
10
|
+
}
|
|
11
|
+
interface ChannelsTabProps {
|
|
12
|
+
channels: ChannelTabEntry[];
|
|
13
|
+
theme?: ThemeColors;
|
|
14
|
+
isActive: boolean;
|
|
15
|
+
onSelectChannel?: (channelId: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function ChannelsTab({ channels, theme, isActive, onSelectChannel, }: ChannelsTabProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=channels-tab.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels-tab.d.ts","sourceRoot":"","sources":["../../src/channels-tab.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,KAAK,GAAG,UAAU,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,UAAU,gBAAgB;IACxB,QAAQ,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAED,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,eAAe,GAChB,EAAE,gBAAgB,2CAwDlB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { Box, Text, useInput } from 'ink';
|
|
4
|
+
export function ChannelsTab({ channels, theme, isActive, onSelectChannel, }) {
|
|
5
|
+
const primary = theme?.primary || '#7aa2f7';
|
|
6
|
+
const muted = theme?.muted || '#565f89';
|
|
7
|
+
const border = theme?.border || '#414868';
|
|
8
|
+
const secondary = theme?.secondary || '#2ac3de';
|
|
9
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
10
|
+
useInput((_, key) => {
|
|
11
|
+
if (!isActive)
|
|
12
|
+
return;
|
|
13
|
+
if (key.downArrow) {
|
|
14
|
+
setSelectedIndex(i => Math.min(channels.length - 1, i + 1));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
if (key.upArrow) {
|
|
18
|
+
setSelectedIndex(i => Math.max(0, i - 1));
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (key.return && channels.length > 0) {
|
|
22
|
+
const channel = channels[selectedIndex];
|
|
23
|
+
if (channel && onSelectChannel)
|
|
24
|
+
onSelectChannel(channel.id);
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsx(Text, { color: primary, bold: true, children: ' Channels ' }), _jsx(Box, { flexDirection: "column", marginTop: 1, children: channels.length === 0 ? (_jsx(Text, { color: muted, children: " No channels yet. Start chatting to create one." })) : (channels.map((ch, i) => {
|
|
29
|
+
const isSelected = i === selectedIndex;
|
|
30
|
+
const typeIcon = ch.type === 'cli' ? '◉' : '✉';
|
|
31
|
+
const typeColor = ch.type === 'cli' ? primary : secondary;
|
|
32
|
+
const nameColor = isSelected ? primary : muted;
|
|
33
|
+
const prefix = isSelected ? '› ' : ch.isActive ? '▶ ' : ' ';
|
|
34
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: isSelected ? primary : muted, children: prefix }), _jsx(Text, { color: typeColor, children: typeIcon }), _jsx(Text, { color: nameColor, children: ` ${ch.displayName}` }), _jsx(Text, { color: muted, children: ` (${ch.messageCount} msgs)` })] }, ch.id));
|
|
35
|
+
})) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: muted, children: "\u2191\u2193 navigate \u00B7 Enter select" }) })] }));
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=channels-tab.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"channels-tab.js","sourceRoot":"","sources":["../../src/channels-tab.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAoB1C,MAAM,UAAU,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,eAAe,GACE;IACjB,MAAM,OAAO,GAAG,KAAK,EAAE,OAAO,IAAI,SAAS,CAAC;IAC5C,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,SAAS,CAAC;IACxC,MAAM,MAAM,GAAG,KAAK,EAAE,MAAM,IAAI,SAAS,CAAC;IAC1C,MAAM,SAAS,GAAG,KAAK,EAAE,SAAS,IAAI,SAAS,CAAC;IAEhD,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEtD,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE;QAClB,IAAI,CAAC,QAAQ;YAAE,OAAO;QAEtB,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;YAClB,gBA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,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC1D,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;oBAC/C,MAAM,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;oBAE7D,OAAO,CACL,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,YAAG,MAAM,GAAQ,EAC1D,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,QAAQ,GAAQ,EACzC,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YAAG,IAAI,EAAE,CAAC,WAAW,EAAE,GAAQ,EACrD,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,KAAK,EAAE,CAAC,YAAY,QAAQ,GAAQ,KAJjD,EAAE,CAAC,EAAE,CAKT,CACP,CAAC;gBACJ,CAAC,CAAC,CACH,GACG,EACN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,0DAAmC,GACjD,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type TabId } from './tab-bar.js';
|
|
2
|
+
import { type EffortLevel } from './effort-picker.js';
|
|
3
|
+
import { type ModeLevel } from './mode-picker.js';
|
|
4
|
+
import type { ProjectEntry } from './projects-tab.js';
|
|
5
|
+
import { type AgentEntry } from './agents-tab.js';
|
|
6
|
+
import { type ChannelTabEntry } from './channels-tab.js';
|
|
7
|
+
import type { Event } from '../../core/src/event-bus.js';
|
|
8
|
+
import type { ThemeColors } from '../../render/src/themes.js';
|
|
9
|
+
export interface SlashCommandInput {
|
|
10
|
+
command: string;
|
|
11
|
+
args: string;
|
|
12
|
+
}
|
|
13
|
+
export interface ChatMessage {
|
|
14
|
+
role: 'user' | 'assistant' | 'tool' | 'tool-group' | 'system' | 'decision' | 'heartbeat';
|
|
15
|
+
content: string;
|
|
16
|
+
title?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const COLD_START_BANNER: string;
|
|
19
|
+
interface ChatSurfaceProps {
|
|
20
|
+
messages: ChatMessage[];
|
|
21
|
+
model: string;
|
|
22
|
+
provider: string;
|
|
23
|
+
approvalMode: string;
|
|
24
|
+
effort?: string;
|
|
25
|
+
inputTokens?: number;
|
|
26
|
+
outputTokens?: number;
|
|
27
|
+
contextWindowSize?: number;
|
|
28
|
+
project?: string;
|
|
29
|
+
duration?: string;
|
|
30
|
+
costUsd?: number;
|
|
31
|
+
activeTab?: TabId;
|
|
32
|
+
status?: string;
|
|
33
|
+
contextMode?: string;
|
|
34
|
+
agent?: string;
|
|
35
|
+
onSubmit: (text: string) => void;
|
|
36
|
+
onCancel: () => void;
|
|
37
|
+
onInterrupt?: () => void;
|
|
38
|
+
onSlashCommand?: (input: SlashCommandInput) => void;
|
|
39
|
+
onBashCommand?: (command: string) => void;
|
|
40
|
+
onEffortChange?: (effort: EffortLevel) => void;
|
|
41
|
+
onModeChange?: (mode: ModeLevel) => void;
|
|
42
|
+
theme?: ThemeColors;
|
|
43
|
+
events?: Event[];
|
|
44
|
+
projects?: ProjectEntry[];
|
|
45
|
+
agents?: Map<string, AgentEntry>;
|
|
46
|
+
pendingApproval?: {
|
|
47
|
+
toolName: string;
|
|
48
|
+
input: Record<string, unknown>;
|
|
49
|
+
reason: string;
|
|
50
|
+
} | null;
|
|
51
|
+
onApprovalDecision?: (decision: 'allow' | 'deny') => void;
|
|
52
|
+
onSelectProject?: (project: ProjectEntry) => void;
|
|
53
|
+
channels?: ChannelTabEntry[];
|
|
54
|
+
onChannelSelect?: (channelId: string) => void;
|
|
55
|
+
debug?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export declare function ChatSurface({ messages, model, approvalMode, effort, inputTokens, outputTokens, contextWindowSize, project, duration, costUsd, activeTab, status, contextMode, agent, onSubmit, onCancel, onInterrupt, onSlashCommand, onBashCommand, onEffortChange, onModeChange, theme, projects, agents, pendingApproval, onApprovalDecision, onSelectProject, channels, onChannelSelect, debug, }: ChatSurfaceProps): import("react/jsx-runtime").JSX.Element;
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=chat-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-surface.d.ts","sourceRoot":"","sources":["../../src/chat-surface.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,KAAK,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EAA+B,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACnF,OAAO,EAA2B,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAI3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAa,KAAK,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;IACzF,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,QAIlB,CAAC;AAEb,UAAU,gBAAgB;IACxB,QAAQ,E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/B,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,IAAI,CAAC;IACT,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC1D,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAC;IAC7B,eAAe,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAKD,wBAAgB,WAAW,CAAC,EAC1B,QAAQ,EACR,KAAK,EACL,YAAY,EACZ,MAAM,EACN,WAAe,EACf,YAAgB,EAChB,iBAA2B,EAC3B,OAAkC,EAClC,QAAqB,EACrB,OAAW,EACX,SAAuB,EACvB,MAAe,EACf,WAA+B,EAC/B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,cAAc,EACd,aAAa,EACb,cAAc,EACd,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,MAAM,EACN,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,QAAQ,EACR,eAAe,EACf,KAAK,GACN,EAAE,gBAAgB,2CAmiBlB"}
|
|
@@ -0,0 +1,408 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useEffect } from 'react';
|
|
3
|
+
import { Box, Text, Static, useInput, useApp, useStdout } from 'ink';
|
|
4
|
+
import { TAB_IDS } from './tab-bar.js';
|
|
5
|
+
import { Footer } from './footer.js';
|
|
6
|
+
import { EffortPicker, EFFORT_LEVELS } from './effort-picker.js';
|
|
7
|
+
import { ModePicker, MODE_LEVELS } from './mode-picker.js';
|
|
8
|
+
import { ApprovalPicker } from './approval-picker.js';
|
|
9
|
+
import { parseSlashCommand } from './slash-commands.js';
|
|
10
|
+
import { ProjectsTab } from './projects-tab.js';
|
|
11
|
+
import { StatsTab } from './stats-tab.js';
|
|
12
|
+
import { AgentsTab } from './agents-tab.js';
|
|
13
|
+
import { ChannelsTab } from './channels-tab.js';
|
|
14
|
+
import { Markdown } from '@curie-agent/render';
|
|
15
|
+
export const COLD_START_BANNER = [
|
|
16
|
+
'████ █ █ ████ ████ █ ████ █ ████ ████ ██ █ █████',
|
|
17
|
+
'█ █ █ █ █ █ █ █ ██ ███ █ ▀█ █▀▀ ████ █ ',
|
|
18
|
+
'████ ████ █ █ █ █ █ ████ █ █ ████ ████ █ ██ █ '
|
|
19
|
+
].join('\n');
|
|
20
|
+
// Fixed row counts for chrome layout.
|
|
21
|
+
const INPUT_BASE_ROWS = 1;
|
|
22
|
+
export function ChatSurface({ messages, model, approvalMode, effort, inputTokens = 0, outputTokens = 0, contextWindowSize = 200_000, project = 'homepage-refactor-0422', duration = '00:00:00', costUsd = 0, activeTab = 'assistant', status = 'idle', contextMode = 'CodeContext Zen', agent, onSubmit, onCancel, onInterrupt, onSlashCommand, onBashCommand, onEffortChange, onModeChange, theme, projects, agents, pendingApproval, onApprovalDecision, onSelectProject, channels, onChannelSelect, debug, }) {
|
|
23
|
+
const [inputText, setInputText] = useState('');
|
|
24
|
+
const [currentTab, setCurrentTab] = useState(activeTab);
|
|
25
|
+
React.useEffect(() => { setCurrentTab(activeTab); }, [activeTab]);
|
|
26
|
+
const [history, setHistory] = useState([]);
|
|
27
|
+
// historyIndex: null = not browsing (showing live draft); otherwise index
|
|
28
|
+
// into `history` from the end (0 = most recent).
|
|
29
|
+
const [historyIndex, setHistoryIndex] = useState(null);
|
|
30
|
+
const draftRef = React.useRef('');
|
|
31
|
+
// Cursor position for left/right arrow navigation in the text input.
|
|
32
|
+
const [cursorPos, setCursorPos] = useState(0);
|
|
33
|
+
const [exitHint, setExitHint] = useState(null);
|
|
34
|
+
const exitArmedRef = React.useRef(null);
|
|
35
|
+
const [approvalSelection, setApprovalSelection] = useState('allow');
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (pendingApproval)
|
|
38
|
+
setApprovalSelection('allow');
|
|
39
|
+
}, [pendingApproval]);
|
|
40
|
+
const [effortPickerOpen, setEffortPickerOpen] = useState(false);
|
|
41
|
+
const [effortIndex, setEffortIndex] = useState(0);
|
|
42
|
+
const [modePickerOpen, setModePickerOpen] = useState(false);
|
|
43
|
+
const [modeIndex, setModeIndex] = useState(0);
|
|
44
|
+
const { exit } = useApp();
|
|
45
|
+
const { stdout } = useStdout();
|
|
46
|
+
const [size, setSize] = useState({
|
|
47
|
+
rows: stdout?.rows ?? 30,
|
|
48
|
+
cols: stdout?.columns ?? 100,
|
|
49
|
+
});
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
if (!stdout)
|
|
52
|
+
return;
|
|
53
|
+
const onResize = () => setSize({ rows: stdout.rows ?? 30, cols: stdout.columns ?? 100 });
|
|
54
|
+
stdout.on('resize', onResize);
|
|
55
|
+
return () => {
|
|
56
|
+
stdout.off('resize', onResize);
|
|
57
|
+
};
|
|
58
|
+
}, [stdout]);
|
|
59
|
+
const inputLineCount = inputText.split('\n').length;
|
|
60
|
+
const shellHintRows = inputText.startsWith('!') ? 1 : 0;
|
|
61
|
+
const exitHintRows = exitHint ? 1 : 0;
|
|
62
|
+
const inputRows = Math.max(INPUT_BASE_ROWS, inputLineCount) + shellHintRows + exitHintRows;
|
|
63
|
+
const displayMessages = messages;
|
|
64
|
+
useInput((char, key) => {
|
|
65
|
+
// Approval modal has the highest priority — blocks everything else.
|
|
66
|
+
if (pendingApproval) {
|
|
67
|
+
if (char === 'y' || char === 'Y') {
|
|
68
|
+
onApprovalDecision?.('allow');
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (char === 'n' || char === 'N') {
|
|
72
|
+
onApprovalDecision?.('deny');
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (key.escape) {
|
|
76
|
+
onApprovalDecision?.('deny');
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (key.tab || key.leftArrow || key.rightArrow) {
|
|
80
|
+
setApprovalSelection(s => s === 'allow' ? 'deny' : 'allow');
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
if (key.return) {
|
|
84
|
+
onApprovalDecision?.(approvalSelection);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
// While the effort picker is open, it captures all input.
|
|
90
|
+
if (effortPickerOpen) {
|
|
91
|
+
if (key.escape) {
|
|
92
|
+
setEffortPickerOpen(false);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (key.tab) {
|
|
96
|
+
const dir = key.shift ? -1 : 1;
|
|
97
|
+
setEffortIndex(i => (i + dir + EFFORT_LEVELS.length) % EFFORT_LEVELS.length);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (key.upArrow) {
|
|
101
|
+
setEffortIndex(i => (i - 1 + EFFORT_LEVELS.length) % EFFORT_LEVELS.length);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (key.downArrow) {
|
|
105
|
+
setEffortIndex(i => (i + 1) % EFFORT_LEVELS.length);
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
if (key.return) {
|
|
109
|
+
const chosen = EFFORT_LEVELS[effortIndex];
|
|
110
|
+
onEffortChange?.(chosen);
|
|
111
|
+
setEffortPickerOpen(false);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
// Ctrl+E toggles the picker closed as well
|
|
115
|
+
if (key.ctrl && char === 'e') {
|
|
116
|
+
setEffortPickerOpen(false);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
return; // swallow everything else
|
|
120
|
+
}
|
|
121
|
+
// While the mode picker is open, it captures all input.
|
|
122
|
+
if (modePickerOpen) {
|
|
123
|
+
// Ctrl+F closes the picker
|
|
124
|
+
if (key.ctrl && char === 'f') {
|
|
125
|
+
setModePickerOpen(false);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (key.escape) {
|
|
129
|
+
setModePickerOpen(false);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (key.tab) {
|
|
133
|
+
const dir = key.shift ? -1 : 1;
|
|
134
|
+
setModeIndex(i => (i + dir + MODE_LEVELS.length) % MODE_LEVELS.length);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (key.upArrow) {
|
|
138
|
+
setModeIndex(i => (i - 1 + MODE_LEVELS.length) % MODE_LEVELS.length);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
if (key.downArrow) {
|
|
142
|
+
setModeIndex(i => (i + 1) % MODE_LEVELS.length);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (key.return) {
|
|
146
|
+
const chosen = MODE_LEVELS[modeIndex];
|
|
147
|
+
onModeChange?.(chosen);
|
|
148
|
+
setModePickerOpen(false);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// Ctrl+E opens the effort picker.
|
|
154
|
+
if (key.ctrl && char === 'e') {
|
|
155
|
+
const current = EFFORT_LEVELS.indexOf(effort);
|
|
156
|
+
setEffortIndex(current >= 0 ? current : 0);
|
|
157
|
+
setEffortPickerOpen(true);
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
160
|
+
// Ctrl+F opens the approval mode picker.
|
|
161
|
+
// (Ctrl+M = carriage return byte 0x0D — indistinguishable from Enter)
|
|
162
|
+
if (key.ctrl && char === 'f') {
|
|
163
|
+
const idx = MODE_LEVELS.indexOf(approvalMode);
|
|
164
|
+
setModeIndex(idx >= 0 ? idx : 0);
|
|
165
|
+
setModePickerOpen(true);
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
if (key.escape) {
|
|
169
|
+
// ESC aborts the in-flight agent turn / shell command but does not
|
|
170
|
+
// quit the app. Use /exit, Ctrl+C×2, or Ctrl+D×2 to exit.
|
|
171
|
+
onInterrupt?.();
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
if (key.tab) {
|
|
175
|
+
const idx = TAB_IDS.indexOf(currentTab);
|
|
176
|
+
const delta = key.shift ? -1 : 1;
|
|
177
|
+
const next = TAB_IDS[(idx + delta + TAB_IDS.length) % TAB_IDS.length];
|
|
178
|
+
setCurrentTab(next);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (currentTab === 'channels' && channels?.length && key.return) {
|
|
182
|
+
// Enter selects the first channel (ChannelsTab manages its own selection)
|
|
183
|
+
const first = channels[0];
|
|
184
|
+
if (first)
|
|
185
|
+
onChannelSelect?.(first.id);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
// Ctrl+D twice in quick succession exits. First press arms the sequence
|
|
189
|
+
// and shows a hint; a second Ctrl+D within 1500ms triggers the exit.
|
|
190
|
+
if (key.ctrl && char === 'd') {
|
|
191
|
+
const now = Date.now();
|
|
192
|
+
const armed = exitArmedRef.current;
|
|
193
|
+
if (armed && armed.key === 'd' && now < armed.expiresAt) {
|
|
194
|
+
exit();
|
|
195
|
+
onCancel();
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
exitArmedRef.current = { key: 'd', expiresAt: now + 1500 };
|
|
199
|
+
setExitHint('Press Ctrl+D again to exit');
|
|
200
|
+
setTimeout(() => {
|
|
201
|
+
if (exitArmedRef.current && Date.now() >= exitArmedRef.current.expiresAt) {
|
|
202
|
+
exitArmedRef.current = null;
|
|
203
|
+
setExitHint(null);
|
|
204
|
+
}
|
|
205
|
+
}, 1600);
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (key.upArrow) {
|
|
209
|
+
// History navigation (only on assistant tab, only when not browsing history).
|
|
210
|
+
if (currentTab !== 'assistant')
|
|
211
|
+
return;
|
|
212
|
+
if (historyIndex !== null)
|
|
213
|
+
return;
|
|
214
|
+
if (history.length === 0)
|
|
215
|
+
return;
|
|
216
|
+
setHistoryIndex(prev => {
|
|
217
|
+
if (prev === null) {
|
|
218
|
+
draftRef.current = inputText;
|
|
219
|
+
const next = history.length - 1;
|
|
220
|
+
setInputText(history[next] ?? '');
|
|
221
|
+
setCursorPos(history[next]?.length ?? 0);
|
|
222
|
+
return next;
|
|
223
|
+
}
|
|
224
|
+
const next = Math.max(0, prev - 1);
|
|
225
|
+
setInputText(history[next] ?? '');
|
|
226
|
+
setCursorPos(history[next]?.length ?? 0);
|
|
227
|
+
return next;
|
|
228
|
+
});
|
|
229
|
+
return;
|
|
230
|
+
}
|
|
231
|
+
if (key.downArrow) {
|
|
232
|
+
if (currentTab !== 'assistant')
|
|
233
|
+
return;
|
|
234
|
+
if (historyIndex === null)
|
|
235
|
+
return;
|
|
236
|
+
setHistoryIndex(prev => {
|
|
237
|
+
if (prev === null)
|
|
238
|
+
return null;
|
|
239
|
+
const next = prev + 1;
|
|
240
|
+
if (next >= history.length) {
|
|
241
|
+
setInputText(draftRef.current);
|
|
242
|
+
setCursorPos(draftRef.current.length);
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
setInputText(history[next] ?? '');
|
|
246
|
+
setCursorPos(history[next]?.length ?? 0);
|
|
247
|
+
return next;
|
|
248
|
+
});
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
// Left/right arrow — cursor movement (only in assistant tab text input).
|
|
252
|
+
if (key.leftArrow && currentTab === 'assistant') {
|
|
253
|
+
setCursorPos(Math.max(0, cursorPos - 1));
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (key.rightArrow && currentTab === 'assistant') {
|
|
257
|
+
setCursorPos(Math.min(inputText.length, cursorPos + 1));
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (key.return) {
|
|
261
|
+
// Shift+Enter or Alt+Enter insert a newline. Works only when the
|
|
262
|
+
// terminal emits a distinct sequence for the modifier (most modern
|
|
263
|
+
// terminals do; see the raw stdin listener below for CSI-u fallback).
|
|
264
|
+
if (key.shift || key.meta) {
|
|
265
|
+
const c = cursorPos;
|
|
266
|
+
setInputText(prev => prev.slice(0, c) + '\n' + prev.slice(c));
|
|
267
|
+
setCursorPos(c + 1);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
const text = inputText.trim();
|
|
271
|
+
if (text) {
|
|
272
|
+
setInputText('');
|
|
273
|
+
setCursorPos(0);
|
|
274
|
+
// Record in history, deduping consecutive repeats.
|
|
275
|
+
setHistory(prev => (prev[prev.length - 1] === text ? prev : [...prev, text]));
|
|
276
|
+
setHistoryIndex(null);
|
|
277
|
+
draftRef.current = '';
|
|
278
|
+
if (text.startsWith('!') && onBashCommand) {
|
|
279
|
+
const cmd = text.slice(1).trim();
|
|
280
|
+
if (cmd)
|
|
281
|
+
onBashCommand(cmd);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
const parsed = parseSlashCommand(text);
|
|
285
|
+
if (parsed && onSlashCommand) {
|
|
286
|
+
onSlashCommand(parsed);
|
|
287
|
+
}
|
|
288
|
+
else {
|
|
289
|
+
onSubmit(text);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
return;
|
|
293
|
+
}
|
|
294
|
+
if (key.ctrl && char === 'c') {
|
|
295
|
+
const now = Date.now();
|
|
296
|
+
const armed = exitArmedRef.current;
|
|
297
|
+
if (armed && armed.key === 'c' && now < armed.expiresAt) {
|
|
298
|
+
exit();
|
|
299
|
+
// Trigger the app's onCancel so the host (CLI) can run any cleanup
|
|
300
|
+
// (e.g. restoring the terminal and printing the resume hint) even if
|
|
301
|
+
// Ink would otherwise keep the event loop alive.
|
|
302
|
+
onCancel();
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
exitArmedRef.current = { key: 'c', expiresAt: now + 1500 };
|
|
306
|
+
setExitHint('Press Ctrl+C again to exit');
|
|
307
|
+
setTimeout(() => {
|
|
308
|
+
if (exitArmedRef.current && Date.now() >= exitArmedRef.current.expiresAt) {
|
|
309
|
+
exitArmedRef.current = null;
|
|
310
|
+
setExitHint(null);
|
|
311
|
+
}
|
|
312
|
+
}, 1600);
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
if (key.backspace || key.delete) {
|
|
316
|
+
if (historyIndex !== null)
|
|
317
|
+
setHistoryIndex(null);
|
|
318
|
+
const c = cursorPos;
|
|
319
|
+
const newC = key.backspace ? Math.max(0, c - 1) : c;
|
|
320
|
+
setInputText(prev => {
|
|
321
|
+
const before = prev.slice(0, c - (key.backspace ? 1 : 0));
|
|
322
|
+
const after = prev.slice(c + (key.delete ? 1 : 0));
|
|
323
|
+
return before + after;
|
|
324
|
+
});
|
|
325
|
+
setCursorPos(newC);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
if (char && !key.ctrl && !key.meta) {
|
|
329
|
+
if (historyIndex !== null)
|
|
330
|
+
setHistoryIndex(null);
|
|
331
|
+
const c = cursorPos;
|
|
332
|
+
setInputText(prev => prev.slice(0, c) + char + prev.slice(c));
|
|
333
|
+
setCursorPos(c + 1);
|
|
334
|
+
return;
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
const muted = theme?.muted || '#565f89';
|
|
338
|
+
const primary = theme?.primary || '#7aa2f7';
|
|
339
|
+
const warning = theme?.warning || '#e0af68';
|
|
340
|
+
const success = theme?.success || '#9ece6a';
|
|
341
|
+
const fg = theme?.foreground || '#a9b1d6';
|
|
342
|
+
const bg = theme?.background || '#1a1b26';
|
|
343
|
+
const totalTokens = inputTokens + outputTokens;
|
|
344
|
+
// Settled messages go into <Static> — printed once, never redrawn.
|
|
345
|
+
// Only the last message stays live so the status indicator / duration ticks
|
|
346
|
+
// don't scroll the terminal back down when the user has scrolled up to read history.
|
|
347
|
+
const staticMessages = displayMessages.length > 0 ? displayMessages.slice(0, -1) : [];
|
|
348
|
+
const liveMessages = displayMessages.length > 0 ? displayMessages.slice(-1) : [];
|
|
349
|
+
const renderMessage = (msg, key) => {
|
|
350
|
+
if (msg.role === 'user') {
|
|
351
|
+
const rowWidth = Math.max(1, size.cols - 3);
|
|
352
|
+
const gap = ' ';
|
|
353
|
+
const innerWidth = Math.max(1, rowWidth - gap.length);
|
|
354
|
+
const filler = gap + ' '.repeat(innerWidth);
|
|
355
|
+
const userBg = theme?.userBackground ?? bg;
|
|
356
|
+
const userFg = theme?.userForeground ?? fg;
|
|
357
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: primary, borderTop: false, borderRight: false, borderBottom: false, marginTop: 1, marginBottom: 1, children: [_jsx(Text, { backgroundColor: userBg, children: filler }), msg.content.split('\n').map((line, li) => {
|
|
358
|
+
const pad = Math.max(0, innerWidth - line.length);
|
|
359
|
+
return (_jsx(Text, { backgroundColor: userBg, color: userFg, children: gap + line + ' '.repeat(pad) }, li));
|
|
360
|
+
}), _jsx(Text, { backgroundColor: userBg, children: filler })] }, String(key)));
|
|
361
|
+
}
|
|
362
|
+
if (msg.role === 'decision') {
|
|
363
|
+
return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: warning, paddingX: 1, marginY: 1, children: [msg.title && (_jsx(Text, { color: warning, bold: true, children: msg.title })), _jsx(Text, { color: warning, children: msg.content })] }, String(key)));
|
|
364
|
+
}
|
|
365
|
+
if (msg.role === 'tool-group') {
|
|
366
|
+
if (debug) {
|
|
367
|
+
const tools = msg.content.split(' · ').map(s => s.trim()).filter(Boolean);
|
|
368
|
+
const lines = tools.map((t) => {
|
|
369
|
+
const colonIdx = t.indexOf(':');
|
|
370
|
+
if (colonIdx > 0) {
|
|
371
|
+
return ` ⎿ ${t.slice(0, colonIdx)}: ${t.slice(colonIdx + 1)}`;
|
|
372
|
+
}
|
|
373
|
+
return ` ⎿ ${t}`;
|
|
374
|
+
});
|
|
375
|
+
return (_jsx(Box, { flexDirection: "column", children: lines.map((line, ti) => (_jsx(Text, { color: muted, children: line }, ti))) }, String(key)));
|
|
376
|
+
}
|
|
377
|
+
return (_jsx(Box, { marginTop: 1, children: _jsx(Text, { color: muted, children: msg.content }) }, String(key)));
|
|
378
|
+
}
|
|
379
|
+
if (msg.role === 'tool') {
|
|
380
|
+
return (_jsx(Box, { flexDirection: "column", marginTop: 1, marginBottom: 1, children: _jsxs(Box, { children: [_jsx(Text, { color: success, children: '[✔] ' }), _jsx(Text, { color: fg, children: msg.content })] }) }, String(key)));
|
|
381
|
+
}
|
|
382
|
+
if (msg.role === 'heartbeat') {
|
|
383
|
+
const lines = msg.content.split('\n');
|
|
384
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: warning, borderTop: false, borderRight: false, borderBottom: false, marginTop: 1, children: _jsx(Text, { color: success, bold: true, children: '[heartbeat] ' + (msg.title ?? '') }) }, String(key) + '-title'), lines.map((line, li) => (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: warning, borderTop: false, borderRight: false, borderBottom: false, paddingLeft: 1, children: _jsx(Text, { color: fg, children: line }) }, String(key) + '-' + li))), _jsx(Box, { flexDirection: "column", marginTop: 1, children: _jsx(Text, { children: " " }) }, String(key) + '-sep')] }));
|
|
385
|
+
}
|
|
386
|
+
if (msg.role === 'system') {
|
|
387
|
+
const isReminder = msg.content.startsWith('Hopper reminder:');
|
|
388
|
+
if (isReminder) {
|
|
389
|
+
return (_jsx(Box, { flexDirection: "column", borderStyle: "single", borderColor: warning, borderTop: false, borderRight: false, borderBottom: false, marginLeft: 1, marginTop: 1, marginBottom: 1, paddingX: 1, children: _jsx(Text, { color: muted, children: msg.content }) }, String(key)));
|
|
390
|
+
}
|
|
391
|
+
return (_jsx(Box, { children: _jsx(Text, { color: muted, children: msg.content }) }, String(key)));
|
|
392
|
+
}
|
|
393
|
+
return (_jsx(Box, { flexDirection: "column", marginLeft: 1, children: _jsx(Markdown, { value: msg.content }) }, String(key)));
|
|
394
|
+
};
|
|
395
|
+
return (_jsxs(Box, { flexDirection: "column", width: "100%", children: [_jsx(Box, { flexDirection: "column", paddingX: 1, children: currentTab === 'projects' ? (_jsx(ProjectsTab, { projects: projects ?? [], theme: theme, isActive: currentTab === 'projects', onSelectProject: onSelectProject })) : currentTab === 'stats' ? (_jsx(StatsTab, { theme: theme, isActive: currentTab === 'stats', model: model, inputTokens: inputTokens, outputTokens: outputTokens, contextWindowSize: contextWindowSize })) : currentTab === 'channels' ? (_jsx(ChannelsTab, { channels: channels ?? [], theme: theme, isActive: currentTab === 'channels', onSelectChannel: onChannelSelect })) : currentTab === 'agents' ? (_jsx(AgentsTab, { agents: agents ?? new Map(), isActive: currentTab === 'agents', theme: theme })) : (_jsxs(_Fragment, { children: [pendingApproval && (_jsx(ApprovalPicker, { toolName: pendingApproval.toolName, input: pendingApproval.input, reason: pendingApproval.reason, selected: approvalSelection, theme: theme })), !pendingApproval && effortPickerOpen && (_jsx(EffortPicker, { selectedIndex: effortIndex, theme: theme })), !pendingApproval && modePickerOpen && (_jsx(ModePicker, { selectedIndex: modeIndex, theme: theme })), !pendingApproval && !effortPickerOpen && !modePickerOpen && (_jsxs(_Fragment, { children: [_jsx(Static, { items: staticMessages, children: (msg, idx) => renderMessage(msg, idx) }), liveMessages.map((msg, idx) => renderMessage(msg, staticMessages.length + idx))] }))] })) }), _jsxs(Box, { flexDirection: "column", paddingX: 1, marginTop: 1, children: [exitHint && (_jsx(Box, { children: _jsx(Text, { color: warning, children: exitHint }) })), inputText.startsWith('!') && (_jsx(Box, { children: _jsx(Text, { color: warning, children: "(shell mode \u2014 Enter to run, Shift/Alt+Enter for newline)" }) })), (() => {
|
|
396
|
+
const lines = inputText.split('\n');
|
|
397
|
+
const isShell = inputText.startsWith('!');
|
|
398
|
+
const promptColor = isShell ? warning : primary;
|
|
399
|
+
const promptGlyph = isShell ? '$' : '>';
|
|
400
|
+
return lines.map((line, li) => {
|
|
401
|
+
const isFirst = li === 0;
|
|
402
|
+
const isLast = li === lines.length - 1;
|
|
403
|
+
const cursorOnThisLine = isLast ? cursorPos - inputText.split('\n').slice(0, li).join('\n').length : 0;
|
|
404
|
+
return (_jsxs(Box, { children: [_jsx(Text, { color: promptColor, children: isFirst ? `curie-agent${promptGlyph} ` : ' ' }), isLast ? (_jsxs(_Fragment, { children: [_jsx(Text, { color: fg, children: line.slice(0, cursorOnThisLine) }), _jsx(Text, { color: fg, inverse: true, bold: true, children: line[cursorOnThisLine] ?? ' ' }), cursorOnThisLine < line.length - 1 && (_jsx(Text, { color: fg, children: line.slice(cursorOnThisLine + 1) }))] })) : (_jsx(Text, { color: fg, children: line }))] }, li));
|
|
405
|
+
});
|
|
406
|
+
})()] }), _jsx(Footer, { status: status, mode: approvalMode, effort: effort, model: model, project: project, duration: duration, totalTokens: totalTokens, costUsd: costUsd, activeTab: currentTab, theme: theme })] }));
|
|
407
|
+
}
|
|
408
|
+
//# sourceMappingURL=chat-surface.js.map
|