wiggum-cli 0.7.8 → 0.9.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/ai/conversation/conversation-manager.d.ts +11 -0
- package/dist/ai/conversation/conversation-manager.d.ts.map +1 -1
- package/dist/ai/conversation/conversation-manager.js +14 -0
- package/dist/ai/conversation/conversation-manager.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/new.d.ts +2 -0
- package/dist/commands/new.d.ts.map +1 -1
- package/dist/commands/new.js +63 -22
- package/dist/commands/new.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -22
- package/dist/index.js.map +1 -1
- package/dist/tui/app.d.ts +108 -0
- package/dist/tui/app.d.ts.map +1 -0
- package/dist/tui/app.js +169 -0
- package/dist/tui/app.js.map +1 -0
- package/dist/tui/components/ChatInput.d.ts +40 -0
- package/dist/tui/components/ChatInput.d.ts.map +1 -0
- package/dist/tui/components/ChatInput.js +61 -0
- package/dist/tui/components/ChatInput.js.map +1 -0
- package/dist/tui/components/MessageList.d.ts +79 -0
- package/dist/tui/components/MessageList.d.ts.map +1 -0
- package/dist/tui/components/MessageList.js +68 -0
- package/dist/tui/components/MessageList.js.map +1 -0
- package/dist/tui/components/PhaseHeader.d.ts +36 -0
- package/dist/tui/components/PhaseHeader.d.ts.map +1 -0
- package/dist/tui/components/PhaseHeader.js +31 -0
- package/dist/tui/components/PhaseHeader.js.map +1 -0
- package/dist/tui/components/StreamingText.d.ts +47 -0
- package/dist/tui/components/StreamingText.d.ts.map +1 -0
- package/dist/tui/components/StreamingText.js +38 -0
- package/dist/tui/components/StreamingText.js.map +1 -0
- package/dist/tui/components/ToolCallCard.d.ts +65 -0
- package/dist/tui/components/ToolCallCard.d.ts.map +1 -0
- package/dist/tui/components/ToolCallCard.js +100 -0
- package/dist/tui/components/ToolCallCard.js.map +1 -0
- package/dist/tui/components/WiggumBanner.d.ts +30 -0
- package/dist/tui/components/WiggumBanner.d.ts.map +1 -0
- package/dist/tui/components/WiggumBanner.js +34 -0
- package/dist/tui/components/WiggumBanner.js.map +1 -0
- package/dist/tui/components/WorkingIndicator.d.ts +45 -0
- package/dist/tui/components/WorkingIndicator.d.ts.map +1 -0
- package/dist/tui/components/WorkingIndicator.js +31 -0
- package/dist/tui/components/WorkingIndicator.js.map +1 -0
- package/dist/tui/components/index.d.ts +16 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js +10 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/demo.d.ts +8 -0
- package/dist/tui/demo.d.ts.map +1 -0
- package/dist/tui/demo.js +69 -0
- package/dist/tui/demo.js.map +1 -0
- package/dist/tui/hooks/index.d.ts +7 -0
- package/dist/tui/hooks/index.d.ts.map +1 -0
- package/dist/tui/hooks/index.js +6 -0
- package/dist/tui/hooks/index.js.map +1 -0
- package/dist/tui/hooks/useSpecGenerator.d.ts +184 -0
- package/dist/tui/hooks/useSpecGenerator.d.ts.map +1 -0
- package/dist/tui/hooks/useSpecGenerator.js +452 -0
- package/dist/tui/hooks/useSpecGenerator.js.map +1 -0
- package/dist/tui/index.d.ts +14 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +18 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/orchestration/index.d.ts +6 -0
- package/dist/tui/orchestration/index.d.ts.map +1 -0
- package/dist/tui/orchestration/index.js +6 -0
- package/dist/tui/orchestration/index.js.map +1 -0
- package/dist/tui/orchestration/interview-orchestrator.d.ts +136 -0
- package/dist/tui/orchestration/interview-orchestrator.d.ts.map +1 -0
- package/dist/tui/orchestration/interview-orchestrator.js +437 -0
- package/dist/tui/orchestration/interview-orchestrator.js.map +1 -0
- package/dist/tui/screens/InitScreen.d.ts +26 -0
- package/dist/tui/screens/InitScreen.d.ts.map +1 -0
- package/dist/tui/screens/InitScreen.js +30 -0
- package/dist/tui/screens/InitScreen.js.map +1 -0
- package/dist/tui/screens/InterviewScreen.d.ts +44 -0
- package/dist/tui/screens/InterviewScreen.d.ts.map +1 -0
- package/dist/tui/screens/InterviewScreen.js +212 -0
- package/dist/tui/screens/InterviewScreen.js.map +1 -0
- package/dist/tui/screens/MainShell.d.ts +46 -0
- package/dist/tui/screens/MainShell.d.ts.map +1 -0
- package/dist/tui/screens/MainShell.js +196 -0
- package/dist/tui/screens/MainShell.js.map +1 -0
- package/dist/tui/screens/WelcomeScreen.d.ts +45 -0
- package/dist/tui/screens/WelcomeScreen.d.ts.map +1 -0
- package/dist/tui/screens/WelcomeScreen.js +56 -0
- package/dist/tui/screens/WelcomeScreen.js.map +1 -0
- package/dist/tui/screens/index.d.ts +6 -0
- package/dist/tui/screens/index.d.ts.map +1 -0
- package/dist/tui/screens/index.js +5 -0
- package/dist/tui/screens/index.js.map +1 -0
- package/dist/tui/theme.d.ts +66 -0
- package/dist/tui/theme.d.ts.map +1 -0
- package/dist/tui/theme.js +62 -0
- package/dist/tui/theme.js.map +1 -0
- package/package.json +6 -1
- package/src/ai/conversation/conversation-manager.ts +22 -0
- package/src/cli.ts +4 -0
- package/src/commands/new.ts +79 -27
- package/src/index.ts +109 -27
- package/src/tui/app.tsx +297 -0
- package/src/tui/components/ChatInput.tsx +105 -0
- package/src/tui/components/MessageList.tsx +186 -0
- package/src/tui/components/PhaseHeader.tsx +63 -0
- package/src/tui/components/StreamingText.tsx +69 -0
- package/src/tui/components/ToolCallCard.tsx +215 -0
- package/src/tui/components/WiggumBanner.tsx +66 -0
- package/src/tui/components/WorkingIndicator.tsx +72 -0
- package/src/tui/components/index.ts +21 -0
- package/src/tui/demo.tsx +111 -0
- package/src/tui/hooks/index.ts +13 -0
- package/src/tui/hooks/useSpecGenerator.ts +662 -0
- package/src/tui/index.ts +23 -0
- package/src/tui/orchestration/index.ts +10 -0
- package/src/tui/orchestration/interview-orchestrator.ts +559 -0
- package/src/tui/screens/InitScreen.tsx +63 -0
- package/src/tui/screens/InterviewScreen.tsx +319 -0
- package/src/tui/screens/MainShell.tsx +290 -0
- package/src/tui/screens/WelcomeScreen.tsx +141 -0
- package/src/tui/screens/index.ts +6 -0
- package/src/tui/theme.ts +76 -0
- package/tsconfig.json +2 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ToolCallCard - Collapsible tool execution display
|
|
3
|
+
*
|
|
4
|
+
* Shows tool executions in a bordered card format, similar to Claude Code.
|
|
5
|
+
* Displays tool name, input, status indicator, and output/error.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Tool execution status
|
|
10
|
+
*/
|
|
11
|
+
export type ToolCallStatus = 'pending' | 'running' | 'complete' | 'error';
|
|
12
|
+
/**
|
|
13
|
+
* Props for the ToolCallCard component
|
|
14
|
+
*/
|
|
15
|
+
export interface ToolCallCardProps {
|
|
16
|
+
/** Name of the tool (e.g., "Read File", "Search Codebase") */
|
|
17
|
+
toolName: string;
|
|
18
|
+
/** Tool execution status */
|
|
19
|
+
status: ToolCallStatus;
|
|
20
|
+
/** Input passed to the tool (e.g., file path, search query) */
|
|
21
|
+
input: string;
|
|
22
|
+
/** Result summary when status is 'complete' */
|
|
23
|
+
output?: string;
|
|
24
|
+
/** Error message when status is 'error' */
|
|
25
|
+
error?: string;
|
|
26
|
+
/** Whether to show full details (default: false = collapsed) */
|
|
27
|
+
expanded?: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* ToolCallCard component
|
|
31
|
+
*
|
|
32
|
+
* Displays a tool execution in a bordered card format.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```tsx
|
|
36
|
+
* // Collapsed (default)
|
|
37
|
+
* <ToolCallCard
|
|
38
|
+
* toolName="Read File"
|
|
39
|
+
* status="complete"
|
|
40
|
+
* input="src/utils/config.ts"
|
|
41
|
+
* output="45 lines read"
|
|
42
|
+
* />
|
|
43
|
+
* // Renders:
|
|
44
|
+
* // ┌─ Read File ────────────────────────────────┐
|
|
45
|
+
* // │ src/utils/config.ts ✓ 45 lines read │
|
|
46
|
+
* // └────────────────────────────────────────────┘
|
|
47
|
+
*
|
|
48
|
+
* // Expanded
|
|
49
|
+
* <ToolCallCard
|
|
50
|
+
* toolName="Read File"
|
|
51
|
+
* status="complete"
|
|
52
|
+
* input="src/utils/config.ts"
|
|
53
|
+
* output="45 lines read"
|
|
54
|
+
* expanded={true}
|
|
55
|
+
* />
|
|
56
|
+
* // Renders:
|
|
57
|
+
* // ┌─ Read File ────────────────────────────────┐
|
|
58
|
+
* // │ Input: src/utils/config.ts │
|
|
59
|
+
* // │ Status: Complete │
|
|
60
|
+
* // │ Result: 45 lines read │
|
|
61
|
+
* // └────────────────────────────────────────────┘
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare function ToolCallCard({ toolName, status, input, output, error, expanded, }: ToolCallCardProps): React.ReactElement;
|
|
65
|
+
//# sourceMappingURL=ToolCallCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCallCard.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ToolCallCard.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,OAAO,CAAC;AAE1E;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8DAA8D;IAC9D,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,+DAA+D;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAkDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,KAAK,EACL,QAAgB,GACjB,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CA0FxC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { colors, box, phase } from '../theme.js';
|
|
4
|
+
/**
|
|
5
|
+
* Maps status to phase indicator character
|
|
6
|
+
*/
|
|
7
|
+
function getStatusIndicator(status) {
|
|
8
|
+
switch (status) {
|
|
9
|
+
case 'pending':
|
|
10
|
+
return phase.pending;
|
|
11
|
+
case 'running':
|
|
12
|
+
return phase.active;
|
|
13
|
+
case 'complete':
|
|
14
|
+
return phase.complete;
|
|
15
|
+
case 'error':
|
|
16
|
+
return phase.error;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Gets the color for the status indicator
|
|
21
|
+
*/
|
|
22
|
+
function getStatusColor(status) {
|
|
23
|
+
switch (status) {
|
|
24
|
+
case 'pending':
|
|
25
|
+
return colors.brown;
|
|
26
|
+
case 'running':
|
|
27
|
+
return colors.yellow;
|
|
28
|
+
case 'complete':
|
|
29
|
+
return colors.yellow;
|
|
30
|
+
case 'error':
|
|
31
|
+
return colors.pink;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets human-readable status text
|
|
36
|
+
*/
|
|
37
|
+
function getStatusText(status) {
|
|
38
|
+
switch (status) {
|
|
39
|
+
case 'pending':
|
|
40
|
+
return 'Pending';
|
|
41
|
+
case 'running':
|
|
42
|
+
return 'Running';
|
|
43
|
+
case 'complete':
|
|
44
|
+
return 'Complete';
|
|
45
|
+
case 'error':
|
|
46
|
+
return 'Error';
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* ToolCallCard component
|
|
51
|
+
*
|
|
52
|
+
* Displays a tool execution in a bordered card format.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```tsx
|
|
56
|
+
* // Collapsed (default)
|
|
57
|
+
* <ToolCallCard
|
|
58
|
+
* toolName="Read File"
|
|
59
|
+
* status="complete"
|
|
60
|
+
* input="src/utils/config.ts"
|
|
61
|
+
* output="45 lines read"
|
|
62
|
+
* />
|
|
63
|
+
* // Renders:
|
|
64
|
+
* // ┌─ Read File ────────────────────────────────┐
|
|
65
|
+
* // │ src/utils/config.ts ✓ 45 lines read │
|
|
66
|
+
* // └────────────────────────────────────────────┘
|
|
67
|
+
*
|
|
68
|
+
* // Expanded
|
|
69
|
+
* <ToolCallCard
|
|
70
|
+
* toolName="Read File"
|
|
71
|
+
* status="complete"
|
|
72
|
+
* input="src/utils/config.ts"
|
|
73
|
+
* output="45 lines read"
|
|
74
|
+
* expanded={true}
|
|
75
|
+
* />
|
|
76
|
+
* // Renders:
|
|
77
|
+
* // ┌─ Read File ────────────────────────────────┐
|
|
78
|
+
* // │ Input: src/utils/config.ts │
|
|
79
|
+
* // │ Status: Complete │
|
|
80
|
+
* // │ Result: 45 lines read │
|
|
81
|
+
* // └────────────────────────────────────────────┘
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
export function ToolCallCard({ toolName, status, input, output, error, expanded = false, }) {
|
|
85
|
+
const statusIndicator = getStatusIndicator(status);
|
|
86
|
+
const statusColor = getStatusColor(status);
|
|
87
|
+
const statusText = getStatusText(status);
|
|
88
|
+
// Build the title with box drawing
|
|
89
|
+
const titlePadding = box.horizontal.repeat(3);
|
|
90
|
+
const title = `${box.horizontal} ${toolName} ${titlePadding}`;
|
|
91
|
+
// Determine result text
|
|
92
|
+
const resultText = status === 'error' ? error : output;
|
|
93
|
+
if (expanded) {
|
|
94
|
+
// Expanded layout: multiple lines with labels
|
|
95
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: colors.brown, children: box.topLeft }), _jsx(Text, { color: colors.yellow, children: title })] }), _jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: colors.brown, children: [box.vertical, " "] }), _jsx(Text, { color: colors.brown, children: "Input: " }), _jsx(Text, { color: colors.white, children: input })] }), _jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: colors.brown, children: [box.vertical, " "] }), _jsx(Text, { color: colors.brown, children: "Status: " }), _jsxs(Text, { color: statusColor, children: [statusIndicator, " ", statusText] })] }), resultText && (_jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: colors.brown, children: [box.vertical, " "] }), _jsx(Text, { color: colors.brown, children: status === 'error' ? 'Error: ' : 'Result: ' }), _jsx(Text, { color: status === 'error' ? colors.pink : colors.white, children: resultText })] })), _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: colors.brown, children: [box.bottomLeft, box.horizontal.repeat(40)] }) })] }));
|
|
96
|
+
}
|
|
97
|
+
// Collapsed layout: single content line
|
|
98
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { flexDirection: "row", children: [_jsx(Text, { color: colors.brown, children: box.topLeft }), _jsx(Text, { color: colors.yellow, children: title })] }), _jsxs(Box, { flexDirection: "row", children: [_jsxs(Text, { color: colors.brown, children: [box.vertical, " "] }), _jsx(Text, { color: colors.white, children: input }), _jsx(Text, { children: " " }), _jsx(Text, { color: statusColor, children: statusIndicator }), resultText && (_jsxs(_Fragment, { children: [_jsx(Text, { children: " " }), _jsx(Text, { color: status === 'error' ? colors.pink : colors.white, children: resultText })] }))] }), _jsx(Box, { flexDirection: "row", children: _jsxs(Text, { color: colors.brown, children: [box.bottomLeft, box.horizontal.repeat(40)] }) })] }));
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=ToolCallCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolCallCard.js","sourceRoot":"","sources":["../../../src/tui/components/ToolCallCard.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAyBjD;;GAEG;AACH,SAAS,kBAAkB,CAAC,MAAsB;IAChD,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,OAAO,CAAC;QACvB,KAAK,SAAS;YACZ,OAAO,KAAK,CAAC,MAAM,CAAC;QACtB,KAAK,UAAU;YACb,OAAO,KAAK,CAAC,QAAQ,CAAC;QACxB,KAAK,OAAO;YACV,OAAO,KAAK,CAAC,KAAK,CAAC;IACvB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,MAAsB;IAC5C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,KAAK,CAAC;QACtB,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,MAAM,CAAC;QACvB,KAAK,UAAU;YACb,OAAO,MAAM,CAAC,MAAM,CAAC;QACvB,KAAK,OAAO;YACV,OAAO,MAAM,CAAC,IAAI,CAAC;IACvB,CAAC;AACH,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,MAAsB;IAC3C,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;QACnB,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;QACpB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,MAAM,UAAU,YAAY,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IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,YAAG,KAAK,GAAQ,EACzC,KAAC,IAAI,sBAAW,EAChB,KAAC,IAAI,IAAC,KAAK,EAAE,WAAW,YAAG,eAAe,GAAQ,EACjD,UAAU,IAAI,CACb,8BACE,KAAC,IAAI,oBAAS,EACd,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,YAAG,UAAU,GAAQ,IAChF,CACJ,IACG,EAGN,KAAC,GAAG,IAAC,aAAa,EAAC,KAAK,YACtB,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,aACtB,GAAG,CAAC,UAAU,EACd,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC,IACrB,GACH,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WiggumBanner - ASCII art banner component
|
|
3
|
+
*
|
|
4
|
+
* Displays the Wiggum CLI ASCII art logo in Simpson yellow.
|
|
5
|
+
* Inspired by Claude Code's welcome banner style.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Props for WiggumBanner component
|
|
10
|
+
*/
|
|
11
|
+
export interface WiggumBannerProps {
|
|
12
|
+
/** Optional color override (defaults to Simpson yellow) */
|
|
13
|
+
color?: string;
|
|
14
|
+
/** Whether to show a compact version */
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* WiggumBanner component
|
|
19
|
+
*
|
|
20
|
+
* Displays the Wiggum CLI ASCII art logo.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```tsx
|
|
24
|
+
* <WiggumBanner />
|
|
25
|
+
* <WiggumBanner color="blue" />
|
|
26
|
+
* <WiggumBanner compact />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function WiggumBanner({ color, compact, }: WiggumBannerProps): React.ReactElement;
|
|
30
|
+
//# sourceMappingURL=WiggumBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WiggumBanner.d.ts","sourceRoot":"","sources":["../../../src/tui/components/WiggumBanner.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAiB1B;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,wCAAwC;IACxC,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,EAC3B,KAAqB,EACrB,OAAe,GAChB,EAAE,iBAAiB,GAAG,KAAK,CAAC,YAAY,CAgBxC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text, Box } from 'ink';
|
|
3
|
+
import { colors } from '../theme.js';
|
|
4
|
+
/**
|
|
5
|
+
* ASCII art banner for Wiggum CLI
|
|
6
|
+
* Block-style font to match the cfonts 'block' style
|
|
7
|
+
*/
|
|
8
|
+
const BANNER = `
|
|
9
|
+
██╗ ██╗██╗ ██████╗ ██████╗ ██╗ ██╗███╗ ███╗
|
|
10
|
+
██║ ██║██║██╔════╝ ██╔════╝ ██║ ██║████╗ ████║
|
|
11
|
+
██║ █╗ ██║██║██║ ███╗██║ ███╗██║ ██║██╔████╔██║
|
|
12
|
+
██║███╗██║██║██║ ██║██║ ██║██║ ██║██║╚██╔╝██║
|
|
13
|
+
╚███╔███╔╝██║╚██████╔╝╚██████╔╝╚██████╔╝██║ ╚═╝ ██║
|
|
14
|
+
╚══╝╚══╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝
|
|
15
|
+
`;
|
|
16
|
+
/**
|
|
17
|
+
* WiggumBanner component
|
|
18
|
+
*
|
|
19
|
+
* Displays the Wiggum CLI ASCII art logo.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```tsx
|
|
23
|
+
* <WiggumBanner />
|
|
24
|
+
* <WiggumBanner color="blue" />
|
|
25
|
+
* <WiggumBanner compact />
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export function WiggumBanner({ color = colors.yellow, compact = false, }) {
|
|
29
|
+
if (compact) {
|
|
30
|
+
return (_jsx(Box, { children: _jsx(Text, { color: color, bold: true, children: "WIGGUM CLI" }) }));
|
|
31
|
+
}
|
|
32
|
+
return (_jsx(Box, { flexDirection: "column", children: _jsx(Text, { color: color, children: BANNER }) }));
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=WiggumBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WiggumBanner.js","sourceRoot":"","sources":["../../../src/tui/components/WiggumBanner.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;GAGG;AACH,MAAM,MAAM,GAAG;;;;;;;CAOd,CAAC;AAYF;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,GAAG,MAAM,CAAC,MAAM,EACrB,OAAO,GAAG,KAAK,GACG;IAClB,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,KAAC,GAAG,cACF,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,IAAI,iCAEjB,GACH,CACP,CAAC;IACJ,CAAC;IAED,OAAO,CACL,KAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,YACzB,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,YAAG,MAAM,GAAQ,GAC/B,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkingIndicator - Spinner + status display during AI calls
|
|
3
|
+
*
|
|
4
|
+
* Displays an animated spinner with status text when the AI is processing.
|
|
5
|
+
* Similar to Claude Code's "Thinking..." indicator.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
/**
|
|
9
|
+
* Working state object describing the current processing state
|
|
10
|
+
*/
|
|
11
|
+
export interface WorkingState {
|
|
12
|
+
/** Whether to show the indicator */
|
|
13
|
+
isWorking: boolean;
|
|
14
|
+
/** Status text (e.g., "Thinking...", "Reading files...", "Searching...") */
|
|
15
|
+
status: string;
|
|
16
|
+
/** Optional hint text (e.g., "esc to interrupt") */
|
|
17
|
+
hint?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Props for the WorkingIndicator component
|
|
21
|
+
*/
|
|
22
|
+
export interface WorkingIndicatorProps {
|
|
23
|
+
/** Working state object */
|
|
24
|
+
state: WorkingState;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* WorkingIndicator component
|
|
28
|
+
*
|
|
29
|
+
* Displays a spinner with status text when AI is processing.
|
|
30
|
+
* Returns null when not working.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <WorkingIndicator
|
|
35
|
+
* state={{
|
|
36
|
+
* isWorking: true,
|
|
37
|
+
* status: "Thinking...",
|
|
38
|
+
* hint: "esc to interrupt"
|
|
39
|
+
* }}
|
|
40
|
+
* />
|
|
41
|
+
* // Renders: ⠋ Thinking... (esc to interrupt)
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare function WorkingIndicator({ state }: WorkingIndicatorProps): React.ReactElement | null;
|
|
45
|
+
//# sourceMappingURL=WorkingIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkingIndicator.d.ts","sourceRoot":"","sources":["../../../src/tui/components/WorkingIndicator.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,oCAAoC;IACpC,SAAS,EAAE,OAAO,CAAC;IACnB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,CAAC;IACf,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,2BAA2B;IAC3B,KAAK,EAAE,YAAY,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE,qBAAqB,GAAG,KAAK,CAAC,YAAY,GAAG,IAAI,CAqB5F"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import Spinner from 'ink-spinner';
|
|
4
|
+
import { colors } from '../theme.js';
|
|
5
|
+
/**
|
|
6
|
+
* WorkingIndicator component
|
|
7
|
+
*
|
|
8
|
+
* Displays a spinner with status text when AI is processing.
|
|
9
|
+
* Returns null when not working.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <WorkingIndicator
|
|
14
|
+
* state={{
|
|
15
|
+
* isWorking: true,
|
|
16
|
+
* status: "Thinking...",
|
|
17
|
+
* hint: "esc to interrupt"
|
|
18
|
+
* }}
|
|
19
|
+
* />
|
|
20
|
+
* // Renders: ⠋ Thinking... (esc to interrupt)
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
export function WorkingIndicator({ state }) {
|
|
24
|
+
const { isWorking, status, hint } = state;
|
|
25
|
+
// Don't render anything when not working
|
|
26
|
+
if (!isWorking) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return (_jsxs(Box, { flexDirection: "row", gap: 1, children: [_jsx(Text, { color: colors.yellow, children: _jsx(Spinner, { type: "dots" }) }), _jsx(Text, { color: colors.yellow, children: status }), hint && (_jsxs(Text, { color: colors.brown, dimColor: true, children: ["(", hint, ")"] }))] }));
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=WorkingIndicator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkingIndicator.js","sourceRoot":"","sources":["../../../src/tui/components/WorkingIndicator.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,OAAO,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAsBrC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAyB;IAC/D,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC;IAE1C,yCAAyC;IACzC,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,KAAK,EAAC,GAAG,EAAE,CAAC,aAC7B,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YACxB,KAAC,OAAO,IAAC,IAAI,EAAC,MAAM,GAAG,GAClB,EACP,KAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,MAAM,YAAG,MAAM,GAAQ,EAC1C,IAAI,IAAI,CACP,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,QAAQ,wBAC/B,IAAI,SACD,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable Ink components for the Wiggum TUI
|
|
3
|
+
*/
|
|
4
|
+
export { WorkingIndicator } from './WorkingIndicator.js';
|
|
5
|
+
export type { WorkingIndicatorProps, WorkingState } from './WorkingIndicator.js';
|
|
6
|
+
export { PhaseHeader } from './PhaseHeader.js';
|
|
7
|
+
export type { PhaseHeaderProps } from './PhaseHeader.js';
|
|
8
|
+
export { StreamingText } from './StreamingText.js';
|
|
9
|
+
export type { StreamingTextProps } from './StreamingText.js';
|
|
10
|
+
export { ToolCallCard } from './ToolCallCard.js';
|
|
11
|
+
export type { ToolCallCardProps, ToolCallStatus } from './ToolCallCard.js';
|
|
12
|
+
export { MessageList } from './MessageList.js';
|
|
13
|
+
export type { MessageListProps, Message, ToolCall } from './MessageList.js';
|
|
14
|
+
export { ChatInput } from './ChatInput.js';
|
|
15
|
+
export type { ChatInputProps } from './ChatInput.js';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEjF,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reusable Ink components for the Wiggum TUI
|
|
3
|
+
*/
|
|
4
|
+
export { WorkingIndicator } from './WorkingIndicator.js';
|
|
5
|
+
export { PhaseHeader } from './PhaseHeader.js';
|
|
6
|
+
export { StreamingText } from './StreamingText.js';
|
|
7
|
+
export { ToolCallCard } from './ToolCallCard.js';
|
|
8
|
+
export { MessageList } from './MessageList.js';
|
|
9
|
+
export { ChatInput } from './ChatInput.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tui/components/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAGzD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.d.ts","sourceRoot":"","sources":["../../src/tui/demo.tsx"],"names":[],"mappings":";AACA;;;;GAIG"}
|
package/dist/tui/demo.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
/**
|
|
4
|
+
* TUI Demo - Test the Ink components visually
|
|
5
|
+
*
|
|
6
|
+
* Run with: npx tsx src/tui/demo.tsx
|
|
7
|
+
*/
|
|
8
|
+
import { useState } from 'react';
|
|
9
|
+
import { render, Box, Text, useInput } from 'ink';
|
|
10
|
+
import { PhaseHeader } from './components/PhaseHeader.js';
|
|
11
|
+
import { MessageList } from './components/MessageList.js';
|
|
12
|
+
import { WorkingIndicator } from './components/WorkingIndicator.js';
|
|
13
|
+
import { ChatInput } from './components/ChatInput.js';
|
|
14
|
+
import { colors } from './theme.js';
|
|
15
|
+
function Demo() {
|
|
16
|
+
const [messages, setMessages] = useState([
|
|
17
|
+
{ id: '1', role: 'system', content: 'Spec Generator initialized for feature: demo-feature' },
|
|
18
|
+
{ id: '2', role: 'assistant', content: 'Welcome! Let\'s create a specification for your feature.' },
|
|
19
|
+
]);
|
|
20
|
+
const [phase, setPhase] = useState(1);
|
|
21
|
+
const [isWorking, setIsWorking] = useState(false);
|
|
22
|
+
const [workingStatus, setWorkingStatus] = useState('');
|
|
23
|
+
// Handle user input
|
|
24
|
+
const handleSubmit = (value) => {
|
|
25
|
+
// Add user message
|
|
26
|
+
setMessages(prev => [...prev, {
|
|
27
|
+
id: String(Date.now()),
|
|
28
|
+
role: 'user',
|
|
29
|
+
content: value || '(empty - continue)',
|
|
30
|
+
}]);
|
|
31
|
+
// Simulate AI working
|
|
32
|
+
setIsWorking(true);
|
|
33
|
+
setWorkingStatus('Thinking...');
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
// Simulate tool call
|
|
36
|
+
setMessages(prev => [...prev, {
|
|
37
|
+
id: String(Date.now()),
|
|
38
|
+
role: 'assistant',
|
|
39
|
+
content: 'Great! Let me analyze that...',
|
|
40
|
+
toolCalls: [{
|
|
41
|
+
toolName: 'Read File',
|
|
42
|
+
status: 'complete',
|
|
43
|
+
input: 'package.json',
|
|
44
|
+
output: '42 lines read',
|
|
45
|
+
}],
|
|
46
|
+
}]);
|
|
47
|
+
setIsWorking(false);
|
|
48
|
+
setPhase(p => Math.min(p + 1, 4));
|
|
49
|
+
}, 1500);
|
|
50
|
+
};
|
|
51
|
+
// Handle escape to exit
|
|
52
|
+
useInput((input, key) => {
|
|
53
|
+
if (key.escape) {
|
|
54
|
+
process.exit(0);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const phaseNames = ['Context', 'Goals', 'Interview', 'Generation'];
|
|
58
|
+
return (_jsxs(Box, { flexDirection: "column", padding: 1, children: [_jsxs(Box, { marginBottom: 1, children: [_jsx(Text, { color: colors.yellow, bold: true, children: "Ink TUI Demo" }), _jsx(Text, { color: colors.brown, children: " - Press Esc to exit" })] }), _jsx(PhaseHeader, { currentPhase: phase, totalPhases: 4, phaseName: phaseNames[phase - 1] }), _jsx(Box, { marginY: 1, children: _jsx(MessageList, { messages: messages }) }), _jsx(Box, { marginY: 1, children: _jsx(WorkingIndicator, { state: {
|
|
59
|
+
isWorking,
|
|
60
|
+
status: workingStatus,
|
|
61
|
+
hint: 'esc to cancel',
|
|
62
|
+
} }) }), _jsx(Box, { marginTop: 1, children: _jsx(ChatInput, { onSubmit: handleSubmit, disabled: isWorking, allowEmpty: phase === 1, placeholder: phase === 1
|
|
63
|
+
? 'Enter URL or file path, or press Enter to continue...'
|
|
64
|
+
: 'Type your response...' }) })] }));
|
|
65
|
+
}
|
|
66
|
+
// Render the demo
|
|
67
|
+
console.clear();
|
|
68
|
+
render(_jsx(Demo, {}));
|
|
69
|
+
//# sourceMappingURL=demo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demo.js","sourceRoot":"","sources":["../../src/tui/demo.tsx"],"names":[],"mappings":";;AACA;;;;GAIG;AAEH,OAAc,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAgB,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kC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AS;wBACT,MAAM,EAAE,aAAa;wBACrB,IAAI,EAAE,eAAe;qBACtB,GACD,GACE,EAEN,KAAC,GAAG,IAAC,SAAS,EAAE,CAAC,YACf,KAAC,SAAS,IACR,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,UAAU,EAAE,KAAK,KAAK,CAAC,EACvB,WAAW,EACT,KAAK,KAAK,CAAC;wBACT,CAAC,CAAC,uDAAuD;wBACzD,CAAC,CAAC,uBAAuB,GAE7B,GACE,IACF,CACP,CAAC;AACJ,CAAC;AAED,kBAAkB;AAClB,OAAO,CAAC,KAAK,EAAE,CAAC;AAChB,MAAM,CAAC,KAAC,IAAI,KAAG,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom React hooks for the Wiggum TUI
|
|
3
|
+
*/
|
|
4
|
+
export { useSpecGenerator } from './useSpecGenerator.js';
|
|
5
|
+
export type { GeneratorPhase, PhaseConfig, SpecGeneratorState, SpecGeneratorOptions, UseSpecGeneratorReturn, } from './useSpecGenerator.js';
|
|
6
|
+
export { PHASE_CONFIGS, TOTAL_DISPLAY_PHASES } from './useSpecGenerator.js';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tui/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EACV,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/tui/hooks/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAQzD,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC"}
|