thatgfsj-code 0.7.0 → 0.7.1
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/cmd/index.js +1 -1
- package/dist/tui/components/ChatList.d.ts +1 -1
- package/dist/tui/components/ChatList.d.ts.map +1 -1
- package/dist/tui/components/ChatList.js +4 -2
- package/dist/tui/components/ChatList.js.map +1 -1
- package/dist/tui/components/ChatMessage.d.ts +1 -1
- package/dist/tui/components/ChatMessage.d.ts.map +1 -1
- package/dist/tui/components/ChatMessage.js +4 -2
- package/dist/tui/components/ChatMessage.js.map +1 -1
- package/dist/tui/components/Header.d.ts +1 -1
- package/dist/tui/components/Header.d.ts.map +1 -1
- package/dist/tui/components/Header.js +5 -3
- package/dist/tui/components/Header.js.map +1 -1
- package/dist/tui/components/StatusBar.d.ts +1 -1
- package/dist/tui/components/StatusBar.d.ts.map +1 -1
- package/dist/tui/components/StatusBar.js +4 -2
- package/dist/tui/components/StatusBar.js.map +1 -1
- package/dist/tui/components/UserInput.d.ts +1 -1
- package/dist/tui/components/UserInput.d.ts.map +1 -1
- package/dist/tui/components/UserInput.js +5 -22
- package/dist/tui/components/UserInput.js.map +1 -1
- package/package.json +1 -1
- package/src/cmd/index.tsx +1 -1
- package/src/tui/components/ChatList.tsx +3 -3
- package/src/tui/components/ChatMessage.tsx +2 -2
- package/src/tui/components/Header.tsx +3 -3
- package/src/tui/components/StatusBar.tsx +2 -2
- package/src/tui/components/UserInput.tsx +8 -24
package/dist/cmd/index.js
CHANGED
|
@@ -33,7 +33,7 @@ process.on('unhandledRejection', (reason) => {
|
|
|
33
33
|
program
|
|
34
34
|
.name('gfcode')
|
|
35
35
|
.description('Thatgfsj Code - AI Coding Assistant')
|
|
36
|
-
.version('0.7.
|
|
36
|
+
.version('0.7.1')
|
|
37
37
|
.argument('[prompt]', 'Task to execute (omit to start interactive mode)')
|
|
38
38
|
.option('-m, --model <model>', 'Specify model')
|
|
39
39
|
.option('-i, --interactive', 'Force interactive mode')
|
|
@@ -8,6 +8,6 @@ interface Props {
|
|
|
8
8
|
streamingToolCalls?: ToolCallData[];
|
|
9
9
|
width?: number;
|
|
10
10
|
}
|
|
11
|
-
export declare
|
|
11
|
+
export declare const ChatList: React.NamedExoticComponent<Props>;
|
|
12
12
|
export {};
|
|
13
13
|
//# sourceMappingURL=ChatList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatList.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"ChatList.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatList.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAe,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAe,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,UAAU,KAAK;IACb,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,YAAY,EAAE,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,QAAQ,mCAkBnB,CAAC"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import { memo } from 'react';
|
|
2
4
|
import { Box } from 'ink';
|
|
3
5
|
import { ChatMessage } from './ChatMessage.js';
|
|
4
|
-
export function ChatList({ messages, streaming, streamingToolCalls, width }) {
|
|
6
|
+
export const ChatList = memo(function ChatList({ messages, streaming, streamingToolCalls, width }) {
|
|
5
7
|
return (_jsxs(Box, { flexDirection: "column", flexGrow: 1, children: [messages.map((msg, i) => (_jsx(ChatMessage, { message: msg, width: width }, i))), (streaming || streamingToolCalls) && (_jsx(ChatMessage, { message: {
|
|
6
8
|
role: 'assistant',
|
|
7
9
|
content: streaming || '',
|
|
8
10
|
toolCalls: streamingToolCalls,
|
|
9
11
|
}, width: width }))] }));
|
|
10
|
-
}
|
|
12
|
+
});
|
|
11
13
|
//# sourceMappingURL=ChatList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatList.js","sourceRoot":"","sources":["../../../src/tui/components/ChatList.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ChatList.js","sourceRoot":"","sources":["../../../src/tui/components/ChatList.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAoB,MAAM,kBAAkB,CAAC;AAUjE,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,QAAQ,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,kBAAkB,EAAE,KAAK,EAAS;IACtG,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,QAAQ,EAAE,CAAC,aACpC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACxB,KAAC,WAAW,IAAS,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,IAA7B,CAAC,CAAgC,CACpD,CAAC,EACD,CAAC,SAAS,IAAI,kBAAkB,CAAC,IAAI,CACpC,KAAC,WAAW,IACV,OAAO,EAAE;oBACP,IAAI,EAAE,WAAW;oBACjB,OAAO,EAAE,SAAS,IAAI,EAAE;oBACxB,SAAS,EAAE,kBAAkB;iBAC9B,EACD,KAAK,EAAE,KAAK,GACZ,CACH,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -10,6 +10,6 @@ interface Props {
|
|
|
10
10
|
message: MessageData;
|
|
11
11
|
width?: number;
|
|
12
12
|
}
|
|
13
|
-
export declare
|
|
13
|
+
export declare const ChatMessage: React.NamedExoticComponent<Props>;
|
|
14
14
|
export type { MessageData };
|
|
15
15
|
//# sourceMappingURL=ChatMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatMessage.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5D,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AAED,UAAU,KAAK;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+BD,
|
|
1
|
+
{"version":3,"file":"ChatMessage.d.ts","sourceRoot":"","sources":["../../../src/tui/components/ChatMessage.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAY,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAE5D,UAAU,WAAW;IACnB,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,EAAE,CAAC;CAC5B;AAED,UAAU,KAAK;IACb,OAAO,EAAE,WAAW,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA+BD,eAAO,MAAM,WAAW,mCAKtB,CAAC;AAEH,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { Box, Text } from 'ink';
|
|
3
5
|
import { Markdown } from './Markdown.js';
|
|
4
6
|
import { ToolCall } from './ToolCall.js';
|
|
@@ -8,10 +10,10 @@ function UserMessage({ content, width }) {
|
|
|
8
10
|
function AssistantMessage({ content, toolCalls, width }) {
|
|
9
11
|
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [toolCalls && toolCalls.map((tc, i) => (_jsx(ToolCall, { tool: tc, width: width }, i))), content && (_jsx(Box, { borderStyle: "round", borderLeft: true, borderColor: "#22D3EE", paddingLeft: 1, children: _jsxs(Box, { flexDirection: "column", width: width ? width - 4 : undefined, children: [_jsx(Text, { bold: true, color: "#22D3EE", children: "AI" }), _jsx(Markdown, { content: content })] }) }))] }));
|
|
10
12
|
}
|
|
11
|
-
export function ChatMessage({ message, width }) {
|
|
13
|
+
export const ChatMessage = React.memo(function ChatMessage({ message, width }) {
|
|
12
14
|
if (message.role === 'user') {
|
|
13
15
|
return _jsx(UserMessage, { content: message.content, width: width });
|
|
14
16
|
}
|
|
15
17
|
return _jsx(AssistantMessage, { content: message.content, toolCalls: message.toolCalls, width: width });
|
|
16
|
-
}
|
|
18
|
+
});
|
|
17
19
|
//# sourceMappingURL=ChatMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessage.js","sourceRoot":"","sources":["../../../src/tui/components/ChatMessage.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"ChatMessage.js","sourceRoot":"","sources":["../../../src/tui/components/ChatMessage.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAChC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,O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;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,WAAW,CAAC,EAAE,OAAO,EAAE,KAAK,EAAS;IAClF,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;QAC5B,OAAO,KAAC,WAAW,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;IACjE,CAAC;IACD,OAAO,KAAC,gBAAgB,IAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC;AACpG,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,eAAO,MAAM,MAAM,mCAkBjB,CAAC"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { Box, Text } from 'ink';
|
|
3
|
-
export function Header({ provider, model }) {
|
|
4
|
-
return (_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#06B6D4", bold: true, children: " \u26A1 " }), _jsx(Text, { color: "#22D3EE", bold: true, children: "THATGFSJ CODE" }), _jsx(Text, { dimColor: true, children: " v0.7.
|
|
5
|
-
}
|
|
5
|
+
export const Header = React.memo(function Header({ provider, model }) {
|
|
6
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 0, children: [_jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { color: "#06B6D4", bold: true, children: " \u26A1 " }), _jsx(Text, { color: "#22D3EE", bold: true, children: "THATGFSJ CODE" }), _jsx(Text, { dimColor: true, children: " v0.7.1" })] }), _jsxs(Box, { children: [_jsxs(Text, { color: "#06B6D4", bold: true, children: [" ", provider, " "] }), _jsx(Text, { dimColor: true, children: "/" }), _jsxs(Text, { color: "#22D3EE", children: [" ", model, " "] })] })] }), _jsx(Text, { color: "#374151", children: '─'.repeat(80) })] }));
|
|
7
|
+
});
|
|
6
8
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../../src/tui/components/Header.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,MAAM,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAS;IACzE,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,YAAY,EAAE,CAAC,aACzC,MAAC,GAAG,IAAC,cAAc,EAAC,eAAe,EAAC,KAAK,EAAC,MAAM,aAC9C,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,+BAAW,EACrC,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,oCAAqB,EAC/C,KAAC,IAAI,IAAC,QAAQ,8BAAe,IACzB,EACN,MAAC,GAAG,eACF,MAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,wBAAG,QAAQ,SAAS,EAC9C,KAAC,IAAI,IAAC,QAAQ,wBAAS,EACvB,MAAC,IAAI,IAAC,KAAK,EAAC,SAAS,kBAAG,KAAK,SAAS,IAClC,IACF,EACN,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,YAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,IACzC,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -4,6 +4,6 @@ interface Props {
|
|
|
4
4
|
messageCount: number;
|
|
5
5
|
skills: string[];
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const StatusBar: React.NamedExoticComponent<Props>;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=StatusBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,
|
|
1
|
+
{"version":3,"file":"StatusBar.d.ts","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,KAAK;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,eAAO,MAAM,SAAS,mCAoBpB,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @jsxImportSource react */
|
|
3
|
+
import React from 'react';
|
|
2
4
|
import { Box, Text } from 'ink';
|
|
3
|
-
export function StatusBar({ messageCount, skills }) {
|
|
5
|
+
export const StatusBar = React.memo(function StatusBar({ messageCount, skills }) {
|
|
4
6
|
const activeSkills = skills.slice(0, 3).join(', ');
|
|
5
7
|
const moreSkills = skills.length > 3 ? ` +${skills.length - 3}` : '';
|
|
6
8
|
return (_jsxs(Box, { flexDirection: "column", marginTop: 0, children: [_jsx(Text, { color: "#374151", children: '─'.repeat(80) }), _jsxs(Box, { justifyContent: "space-between", width: "100%", children: [_jsxs(Box, { children: [_jsx(Text, { backgroundColor: "#06B6D4", color: "#0F172A", bold: true, children: " \u26A1 THATGFSJ CODE " }), _jsxs(Text, { dimColor: true, children: [" \u2502 ", messageCount, " messages"] })] }), _jsx(Box, { children: skills.length > 0 && (_jsxs(Text, { dimColor: true, children: [" skills: ", activeSkills, moreSkills, " "] })) })] })] }));
|
|
7
|
-
}
|
|
9
|
+
});
|
|
8
10
|
//# sourceMappingURL=StatusBar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"StatusBar.js","sourceRoot":"","sources":["../../../src/tui/components/StatusBar.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAOhC,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,EAAE,YAAY,EAAE,MAAM,EAAS;IACpF,MAAM,YAAY,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAErE,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,aACtC,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,YAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAAQ,EAC7C,MAAC,GAAG,IAAC,cAAc,EAAC,eAAe,EAAC,KAAK,EAAC,MAAM,aAC9C,MAAC,GAAG,eACF,KAAC,IAAI,IAAC,eAAe,EAAC,SAAS,EAAC,KAAK,EAAC,SAAS,EAAC,IAAI,6CAAyB,EAC7E,MAAC,IAAI,IAAC,QAAQ,+BAAK,YAAY,iBAAiB,IAC5C,EACN,KAAC,GAAG,cACD,MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,MAAC,IAAI,IAAC,QAAQ,gCAAW,YAAY,EAAE,UAAU,SAAS,CAC3D,GACG,IACF,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -4,6 +4,6 @@ interface Props {
|
|
|
4
4
|
onSubmit: (input: string) => void;
|
|
5
5
|
disabled?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare
|
|
7
|
+
export declare const UserInput: React.NamedExoticComponent<Props>;
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=UserInput.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInput.d.ts","sourceRoot":"","sources":["../../../src/tui/components/UserInput.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,
|
|
1
|
+
{"version":3,"file":"UserInput.d.ts","sourceRoot":"","sources":["../../../src/tui/components/UserInput.tsx"],"names":[],"mappings":"AAAA,6BAA6B;AAC7B,OAAO,KAAyB,MAAM,OAAO,CAAC;AAG9C,UAAU,KAAK;IACb,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,mCAyDpB,CAAC"}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/** @jsxImportSource react */
|
|
3
|
-
import { useState } from 'react';
|
|
3
|
+
import { useState, memo } from 'react';
|
|
4
4
|
import { Box, Text, useInput, useApp } from 'ink';
|
|
5
|
-
export function UserInput({ onSubmit, disabled }) {
|
|
5
|
+
export const UserInput = memo(function UserInput({ onSubmit, disabled }) {
|
|
6
6
|
const [value, setValue] = useState('');
|
|
7
|
-
const [cursorPos, setCursorPos] = useState(0);
|
|
8
7
|
const [history, setHistory] = useState([]);
|
|
9
8
|
const [historyIdx, setHistoryIdx] = useState(-1);
|
|
10
9
|
const { exit } = useApp();
|
|
@@ -22,7 +21,6 @@ export function UserInput({ onSubmit, disabled }) {
|
|
|
22
21
|
setHistoryIdx(-1);
|
|
23
22
|
onSubmit(trimmed);
|
|
24
23
|
setValue('');
|
|
25
|
-
setCursorPos(0);
|
|
26
24
|
}
|
|
27
25
|
return;
|
|
28
26
|
}
|
|
@@ -30,7 +28,6 @@ export function UserInput({ onSubmit, disabled }) {
|
|
|
30
28
|
const newIdx = historyIdx === -1 ? history.length - 1 : Math.max(0, historyIdx - 1);
|
|
31
29
|
setHistoryIdx(newIdx);
|
|
32
30
|
setValue(history[newIdx]);
|
|
33
|
-
setCursorPos(history[newIdx].length);
|
|
34
31
|
return;
|
|
35
32
|
}
|
|
36
33
|
if (key.downArrow && historyIdx >= 0) {
|
|
@@ -38,28 +35,15 @@ export function UserInput({ onSubmit, disabled }) {
|
|
|
38
35
|
if (newIdx >= history.length) {
|
|
39
36
|
setHistoryIdx(-1);
|
|
40
37
|
setValue('');
|
|
41
|
-
setCursorPos(0);
|
|
42
38
|
}
|
|
43
39
|
else {
|
|
44
40
|
setHistoryIdx(newIdx);
|
|
45
41
|
setValue(history[newIdx]);
|
|
46
|
-
setCursorPos(history[newIdx].length);
|
|
47
42
|
}
|
|
48
43
|
return;
|
|
49
44
|
}
|
|
50
45
|
if (key.backspace || key.delete) {
|
|
51
|
-
|
|
52
|
-
setValue(v => v.slice(0, cursorPos - 1) + v.slice(cursorPos));
|
|
53
|
-
setCursorPos(p => p - 1);
|
|
54
|
-
}
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
if (key.leftArrow) {
|
|
58
|
-
setCursorPos(p => Math.max(0, p - 1));
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (key.rightArrow) {
|
|
62
|
-
setCursorPos(p => Math.min(value.length, p + 1));
|
|
46
|
+
setValue(v => v.slice(0, -1));
|
|
63
47
|
return;
|
|
64
48
|
}
|
|
65
49
|
if (key.ctrl && input === 'c') {
|
|
@@ -67,10 +51,9 @@ export function UserInput({ onSubmit, disabled }) {
|
|
|
67
51
|
return;
|
|
68
52
|
}
|
|
69
53
|
if (input && !key.ctrl && !key.meta) {
|
|
70
|
-
setValue(v => v
|
|
71
|
-
setCursorPos(p => p + input.length);
|
|
54
|
+
setValue(v => v + input);
|
|
72
55
|
}
|
|
73
56
|
});
|
|
74
57
|
return (_jsxs(Box, { paddingY: 0, children: [_jsx(Text, { color: "#06B6D4", bold: true, children: disabled ? ' ' : '❯ ' }), _jsx(Text, { children: value }), !disabled && _jsx(Text, { color: "#06B6D4", children: "\u2588" })] }));
|
|
75
|
-
}
|
|
58
|
+
});
|
|
76
59
|
//# sourceMappingURL=UserInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserInput.js","sourceRoot":"","sources":["../../../src/tui/components/UserInput.tsx"],"names":[],"mappings":";AAAA,6BAA6B;AAC7B,OAAc,EAAE,QAAQ,EAAE,MAAM,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AC,GAAG,KAAK,CAAC,CAAC;QAC3B,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,GAAG,IAAC,QAAQ,EAAE,CAAC,aACd,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,EAAC,IAAI,kBAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,GAAQ,EAC1D,KAAC,IAAI,cAAE,KAAK,GAAQ,EACnB,CAAC,QAAQ,IAAI,KAAC,IAAI,IAAC,KAAK,EAAC,SAAS,uBAAS,IACxC,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
package/src/cmd/index.tsx
CHANGED
|
@@ -39,7 +39,7 @@ process.on('unhandledRejection', (reason) => {
|
|
|
39
39
|
program
|
|
40
40
|
.name('gfcode')
|
|
41
41
|
.description('Thatgfsj Code - AI Coding Assistant')
|
|
42
|
-
.version('0.7.
|
|
42
|
+
.version('0.7.1')
|
|
43
43
|
.argument('[prompt]', 'Task to execute (omit to start interactive mode)')
|
|
44
44
|
.option('-m, --model <model>', 'Specify model')
|
|
45
45
|
.option('-i, --interactive', 'Force interactive mode')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource react */
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { memo } from 'react';
|
|
3
3
|
import { Box } from 'ink';
|
|
4
4
|
import { ChatMessage, type MessageData } from './ChatMessage.js';
|
|
5
5
|
import type { ToolCallData } from './ToolCall.js';
|
|
@@ -11,7 +11,7 @@ interface Props {
|
|
|
11
11
|
width?: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export function ChatList({ messages, streaming, streamingToolCalls, width }: Props) {
|
|
14
|
+
export const ChatList = memo(function ChatList({ messages, streaming, streamingToolCalls, width }: Props) {
|
|
15
15
|
return (
|
|
16
16
|
<Box flexDirection="column" flexGrow={1}>
|
|
17
17
|
{messages.map((msg, i) => (
|
|
@@ -29,4 +29,4 @@ export function ChatList({ messages, streaming, streamingToolCalls, width }: Pro
|
|
|
29
29
|
)}
|
|
30
30
|
</Box>
|
|
31
31
|
);
|
|
32
|
-
}
|
|
32
|
+
});
|
|
@@ -44,11 +44,11 @@ function AssistantMessage({ content, toolCalls, width }: { content: string; tool
|
|
|
44
44
|
);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export function ChatMessage({ message, width }: Props) {
|
|
47
|
+
export const ChatMessage = React.memo(function ChatMessage({ message, width }: Props) {
|
|
48
48
|
if (message.role === 'user') {
|
|
49
49
|
return <UserMessage content={message.content} width={width} />;
|
|
50
50
|
}
|
|
51
51
|
return <AssistantMessage content={message.content} toolCalls={message.toolCalls} width={width} />;
|
|
52
|
-
}
|
|
52
|
+
});
|
|
53
53
|
|
|
54
54
|
export type { MessageData };
|
|
@@ -7,14 +7,14 @@ interface Props {
|
|
|
7
7
|
model: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function Header({ provider, model }: Props) {
|
|
10
|
+
export const Header = React.memo(function Header({ provider, model }: Props) {
|
|
11
11
|
return (
|
|
12
12
|
<Box flexDirection="column" marginBottom={0}>
|
|
13
13
|
<Box justifyContent="space-between" width="100%">
|
|
14
14
|
<Box>
|
|
15
15
|
<Text color="#06B6D4" bold> ⚡ </Text>
|
|
16
16
|
<Text color="#22D3EE" bold>THATGFSJ CODE</Text>
|
|
17
|
-
<Text dimColor> v0.7.
|
|
17
|
+
<Text dimColor> v0.7.1</Text>
|
|
18
18
|
</Box>
|
|
19
19
|
<Box>
|
|
20
20
|
<Text color="#06B6D4" bold> {provider} </Text>
|
|
@@ -25,4 +25,4 @@ export function Header({ provider, model }: Props) {
|
|
|
25
25
|
<Text color="#374151">{'─'.repeat(80)}</Text>
|
|
26
26
|
</Box>
|
|
27
27
|
);
|
|
28
|
-
}
|
|
28
|
+
});
|
|
@@ -7,7 +7,7 @@ interface Props {
|
|
|
7
7
|
skills: string[];
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function StatusBar({ messageCount, skills }: Props) {
|
|
10
|
+
export const StatusBar = React.memo(function StatusBar({ messageCount, skills }: Props) {
|
|
11
11
|
const activeSkills = skills.slice(0, 3).join(', ');
|
|
12
12
|
const moreSkills = skills.length > 3 ? ` +${skills.length - 3}` : '';
|
|
13
13
|
|
|
@@ -27,4 +27,4 @@ export function StatusBar({ messageCount, skills }: Props) {
|
|
|
27
27
|
</Box>
|
|
28
28
|
</Box>
|
|
29
29
|
);
|
|
30
|
-
}
|
|
30
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** @jsxImportSource react */
|
|
2
|
-
import React, { useState } from 'react';
|
|
2
|
+
import React, { useState, memo } from 'react';
|
|
3
3
|
import { Box, Text, useInput, useApp } from 'ink';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
@@ -7,9 +7,8 @@ interface Props {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function UserInput({ onSubmit, disabled }: Props) {
|
|
10
|
+
export const UserInput = memo(function UserInput({ onSubmit, disabled }: Props) {
|
|
11
11
|
const [value, setValue] = useState('');
|
|
12
|
-
const [cursorPos, setCursorPos] = useState(0);
|
|
13
12
|
const [history, setHistory] = useState<string[]>([]);
|
|
14
13
|
const [historyIdx, setHistoryIdx] = useState(-1);
|
|
15
14
|
const { exit } = useApp();
|
|
@@ -20,15 +19,11 @@ export function UserInput({ onSubmit, disabled }: Props) {
|
|
|
20
19
|
if (key.return) {
|
|
21
20
|
const trimmed = value.trim();
|
|
22
21
|
if (trimmed) {
|
|
23
|
-
if (trimmed === 'exit' || trimmed === 'quit') {
|
|
24
|
-
exit();
|
|
25
|
-
return;
|
|
26
|
-
}
|
|
22
|
+
if (trimmed === 'exit' || trimmed === 'quit') { exit(); return; }
|
|
27
23
|
setHistory(prev => [...prev, trimmed]);
|
|
28
24
|
setHistoryIdx(-1);
|
|
29
25
|
onSubmit(trimmed);
|
|
30
26
|
setValue('');
|
|
31
|
-
setCursorPos(0);
|
|
32
27
|
}
|
|
33
28
|
return;
|
|
34
29
|
}
|
|
@@ -37,39 +32,28 @@ export function UserInput({ onSubmit, disabled }: Props) {
|
|
|
37
32
|
const newIdx = historyIdx === -1 ? history.length - 1 : Math.max(0, historyIdx - 1);
|
|
38
33
|
setHistoryIdx(newIdx);
|
|
39
34
|
setValue(history[newIdx]);
|
|
40
|
-
setCursorPos(history[newIdx].length);
|
|
41
35
|
return;
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
if (key.downArrow && historyIdx >= 0) {
|
|
45
39
|
const newIdx = historyIdx + 1;
|
|
46
40
|
if (newIdx >= history.length) {
|
|
47
|
-
setHistoryIdx(-1);
|
|
48
|
-
setValue('');
|
|
49
|
-
setCursorPos(0);
|
|
41
|
+
setHistoryIdx(-1); setValue('');
|
|
50
42
|
} else {
|
|
51
|
-
setHistoryIdx(newIdx);
|
|
52
|
-
setValue(history[newIdx]);
|
|
53
|
-
setCursorPos(history[newIdx].length);
|
|
43
|
+
setHistoryIdx(newIdx); setValue(history[newIdx]);
|
|
54
44
|
}
|
|
55
45
|
return;
|
|
56
46
|
}
|
|
57
47
|
|
|
58
48
|
if (key.backspace || key.delete) {
|
|
59
|
-
|
|
60
|
-
setValue(v => v.slice(0, cursorPos - 1) + v.slice(cursorPos));
|
|
61
|
-
setCursorPos(p => p - 1);
|
|
62
|
-
}
|
|
49
|
+
setValue(v => v.slice(0, -1));
|
|
63
50
|
return;
|
|
64
51
|
}
|
|
65
52
|
|
|
66
|
-
if (key.leftArrow) { setCursorPos(p => Math.max(0, p - 1)); return; }
|
|
67
|
-
if (key.rightArrow) { setCursorPos(p => Math.min(value.length, p + 1)); return; }
|
|
68
53
|
if (key.ctrl && input === 'c') { exit(); return; }
|
|
69
54
|
|
|
70
55
|
if (input && !key.ctrl && !key.meta) {
|
|
71
|
-
setValue(v => v
|
|
72
|
-
setCursorPos(p => p + input.length);
|
|
56
|
+
setValue(v => v + input);
|
|
73
57
|
}
|
|
74
58
|
});
|
|
75
59
|
|
|
@@ -80,4 +64,4 @@ export function UserInput({ onSubmit, disabled }: Props) {
|
|
|
80
64
|
{!disabled && <Text color="#06B6D4">█</Text>}
|
|
81
65
|
</Box>
|
|
82
66
|
);
|
|
83
|
-
}
|
|
67
|
+
});
|