@lvce-editor/chat-view 6.15.0 → 6.16.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/chatViewWorkerMain.js +33 -172
- package/package.json +1 -1
|
@@ -7940,19 +7940,13 @@ const handleClickDictationButton = async state => {
|
|
|
7940
7940
|
return state;
|
|
7941
7941
|
};
|
|
7942
7942
|
|
|
7943
|
-
const handleClickNew = async state => {
|
|
7944
|
-
const newState = await createSession(state);
|
|
7945
|
-
const clearedState = await clearInput(newState);
|
|
7946
|
-
return focusInput(clearedState);
|
|
7947
|
-
};
|
|
7948
|
-
|
|
7949
7943
|
const normalizeFileReferenceUri = uri => {
|
|
7950
7944
|
if (uri.startsWith('vscode-references://')) {
|
|
7951
7945
|
return `file://${uri.slice('vscode-references://'.length)}`;
|
|
7952
7946
|
}
|
|
7953
7947
|
return uri;
|
|
7954
7948
|
};
|
|
7955
|
-
const
|
|
7949
|
+
const handleClickFileName = async uri => {
|
|
7956
7950
|
if (!uri) {
|
|
7957
7951
|
return;
|
|
7958
7952
|
}
|
|
@@ -7960,6 +7954,12 @@ const handleClickReadFile = async uri => {
|
|
|
7960
7954
|
await invoke$1('Main.openUri', normalizedUri);
|
|
7961
7955
|
};
|
|
7962
7956
|
|
|
7957
|
+
const handleClickNew = async state => {
|
|
7958
|
+
const newState = await createSession(state);
|
|
7959
|
+
const clearedState = await clearInput(newState);
|
|
7960
|
+
return focusInput(clearedState);
|
|
7961
|
+
};
|
|
7962
|
+
|
|
7963
7963
|
const handleClickSessionDebug = async state => {
|
|
7964
7964
|
await invoke$1('Main.openUri', `chat-debug://${state.selectedSessionId}`);
|
|
7965
7965
|
return state;
|
|
@@ -8914,7 +8914,10 @@ const registerMockResponse = (state, mockResponse) => {
|
|
|
8914
8914
|
};
|
|
8915
8915
|
|
|
8916
8916
|
const getCss = (composerHeight, listItemHeight, chatMessageFontSize, chatMessageLineHeight, chatMessageFontFamily, textAreaPaddingTop, textAreaPaddingLeft, textAreaPaddingRight, textAreaPaddingBottom, chatSendAreaPaddingTop, chatSendAreaPaddingLeft, chatSendAreaPaddingRight, chatSendAreaPaddingBottom, renderHtmlCss) => {
|
|
8917
|
-
const
|
|
8917
|
+
const buttonsHeight = 20;
|
|
8918
|
+
const gap = 10;
|
|
8919
|
+
const contentPadding = 10;
|
|
8920
|
+
const chatSendAreaHeight = composerHeight + chatSendAreaPaddingTop + chatSendAreaPaddingBottom + buttonsHeight + gap + contentPadding * 2;
|
|
8918
8921
|
const baseCss = `:root {
|
|
8919
8922
|
--ChatInputBoxHeight: ${composerHeight}px;
|
|
8920
8923
|
--ChatTextAreaHeight: ${composerHeight}px;
|
|
@@ -8931,168 +8934,14 @@ const getCss = (composerHeight, listItemHeight, chatMessageFontSize, chatMessage
|
|
|
8931
8934
|
--ChatMessageFontSize: ${chatMessageFontSize}px;
|
|
8932
8935
|
--ChatMessageLineHeight: ${chatMessageLineHeight}px;
|
|
8933
8936
|
--ChatMessageFontFamily: ${chatMessageFontFamily};
|
|
8934
|
-
}`;
|
|
8935
|
-
if (!renderHtmlCss.trim()) {
|
|
8936
|
-
return `${baseCss}
|
|
8937
|
-
|
|
8938
|
-
.ChatTodoList {
|
|
8939
|
-
background: var(--vscode-editorWidget-background);
|
|
8940
|
-
border: 1px solid var(--vscode-editorWidget-border);
|
|
8941
|
-
border-radius: 6px;
|
|
8942
|
-
margin-bottom: 8px;
|
|
8943
|
-
overflow: hidden;
|
|
8944
|
-
}
|
|
8945
|
-
|
|
8946
|
-
.ChatTodoListHeader {
|
|
8947
|
-
border-bottom: 1px solid var(--vscode-editorWidget-border);
|
|
8948
|
-
color: var(--vscode-descriptionForeground);
|
|
8949
|
-
font-size: 12px;
|
|
8950
|
-
line-height: 18px;
|
|
8951
|
-
padding: 6px 10px;
|
|
8952
|
-
}
|
|
8953
|
-
|
|
8954
|
-
.ChatTodoListItems {
|
|
8955
|
-
list-style: none;
|
|
8956
|
-
margin: 0;
|
|
8957
|
-
max-height: 180px;
|
|
8958
|
-
overflow: auto;
|
|
8959
|
-
padding: 4px 0;
|
|
8960
|
-
}
|
|
8961
|
-
|
|
8962
|
-
.ChatTodoListItem {
|
|
8963
|
-
align-items: center;
|
|
8964
|
-
color: var(--vscode-foreground);
|
|
8965
|
-
display: flex;
|
|
8966
|
-
font-size: 12px;
|
|
8967
|
-
line-height: 18px;
|
|
8968
|
-
min-height: 24px;
|
|
8969
|
-
padding: 0 10px;
|
|
8970
8937
|
}
|
|
8971
8938
|
|
|
8972
|
-
.
|
|
8973
|
-
|
|
8974
|
-
content: "○";
|
|
8975
|
-
display: inline-block;
|
|
8976
|
-
margin-right: 8px;
|
|
8977
|
-
width: 1em;
|
|
8939
|
+
.ChatSendAreaBottom{
|
|
8940
|
+
height: ${buttonsHeight}px;
|
|
8978
8941
|
}
|
|
8979
|
-
|
|
8980
|
-
.ChatTodoListItemTodo::before {
|
|
8981
|
-
content: "○";
|
|
8982
|
-
}
|
|
8983
|
-
|
|
8984
|
-
.ChatTodoListItem.todo::before {
|
|
8985
|
-
content: "○";
|
|
8986
|
-
}
|
|
8987
|
-
|
|
8988
|
-
.ChatTodoListItemInProgress::before {
|
|
8989
|
-
color: var(--vscode-textLink-foreground);
|
|
8990
|
-
content: "◐";
|
|
8991
|
-
}
|
|
8992
|
-
|
|
8993
|
-
.ChatTodoListItem.inProgress::before {
|
|
8994
|
-
color: var(--vscode-textLink-foreground);
|
|
8995
|
-
content: "◐";
|
|
8996
|
-
}
|
|
8997
|
-
|
|
8998
|
-
.ChatTodoListItemCompleted {
|
|
8999
|
-
color: var(--vscode-disabledForeground);
|
|
9000
|
-
}
|
|
9001
|
-
|
|
9002
|
-
.ChatTodoListItem.completed {
|
|
9003
|
-
color: var(--vscode-disabledForeground);
|
|
9004
|
-
}
|
|
9005
|
-
|
|
9006
|
-
.ChatTodoListItemCompleted::before {
|
|
9007
|
-
color: var(--vscode-testing-iconPassed);
|
|
9008
|
-
content: "✓";
|
|
9009
|
-
}
|
|
9010
|
-
|
|
9011
|
-
.ChatTodoListItem.completed::before {
|
|
9012
|
-
color: var(--vscode-testing-iconPassed);
|
|
9013
|
-
content: "✓";
|
|
9014
|
-
}`;
|
|
9015
|
-
}
|
|
8942
|
+
`;
|
|
9016
8943
|
return `${baseCss}
|
|
9017
8944
|
|
|
9018
|
-
.ChatTodoList {
|
|
9019
|
-
background: var(--vscode-editorWidget-background);
|
|
9020
|
-
border: 1px solid var(--vscode-editorWidget-border);
|
|
9021
|
-
border-radius: 6px;
|
|
9022
|
-
margin-bottom: 8px;
|
|
9023
|
-
overflow: hidden;
|
|
9024
|
-
}
|
|
9025
|
-
|
|
9026
|
-
.ChatTodoListHeader {
|
|
9027
|
-
border-bottom: 1px solid var(--vscode-editorWidget-border);
|
|
9028
|
-
color: var(--vscode-descriptionForeground);
|
|
9029
|
-
font-size: 12px;
|
|
9030
|
-
line-height: 18px;
|
|
9031
|
-
padding: 6px 10px;
|
|
9032
|
-
}
|
|
9033
|
-
|
|
9034
|
-
.ChatTodoListItems {
|
|
9035
|
-
list-style: none;
|
|
9036
|
-
margin: 0;
|
|
9037
|
-
max-height: 180px;
|
|
9038
|
-
overflow: auto;
|
|
9039
|
-
padding: 4px 0;
|
|
9040
|
-
}
|
|
9041
|
-
|
|
9042
|
-
.ChatTodoListItem {
|
|
9043
|
-
align-items: center;
|
|
9044
|
-
color: var(--vscode-foreground);
|
|
9045
|
-
display: flex;
|
|
9046
|
-
font-size: 12px;
|
|
9047
|
-
line-height: 18px;
|
|
9048
|
-
min-height: 24px;
|
|
9049
|
-
padding: 0 10px;
|
|
9050
|
-
}
|
|
9051
|
-
|
|
9052
|
-
.ChatTodoListItem::before {
|
|
9053
|
-
color: var(--vscode-descriptionForeground);
|
|
9054
|
-
content: "○";
|
|
9055
|
-
display: inline-block;
|
|
9056
|
-
margin-right: 8px;
|
|
9057
|
-
width: 1em;
|
|
9058
|
-
}
|
|
9059
|
-
|
|
9060
|
-
.ChatTodoListItemTodo::before {
|
|
9061
|
-
content: "○";
|
|
9062
|
-
}
|
|
9063
|
-
|
|
9064
|
-
.ChatTodoListItem.todo::before {
|
|
9065
|
-
content: "○";
|
|
9066
|
-
}
|
|
9067
|
-
|
|
9068
|
-
.ChatTodoListItemInProgress::before {
|
|
9069
|
-
color: var(--vscode-textLink-foreground);
|
|
9070
|
-
content: "◐";
|
|
9071
|
-
}
|
|
9072
|
-
|
|
9073
|
-
.ChatTodoListItem.inProgress::before {
|
|
9074
|
-
color: var(--vscode-textLink-foreground);
|
|
9075
|
-
content: "◐";
|
|
9076
|
-
}
|
|
9077
|
-
|
|
9078
|
-
.ChatTodoListItemCompleted {
|
|
9079
|
-
color: var(--vscode-disabledForeground);
|
|
9080
|
-
}
|
|
9081
|
-
|
|
9082
|
-
.ChatTodoListItem.completed {
|
|
9083
|
-
color: var(--vscode-disabledForeground);
|
|
9084
|
-
}
|
|
9085
|
-
|
|
9086
|
-
.ChatTodoListItemCompleted::before {
|
|
9087
|
-
color: var(--vscode-testing-iconPassed);
|
|
9088
|
-
content: "✓";
|
|
9089
|
-
}
|
|
9090
|
-
|
|
9091
|
-
.ChatTodoListItem.completed::before {
|
|
9092
|
-
color: var(--vscode-testing-iconPassed);
|
|
9093
|
-
content: "✓";
|
|
9094
|
-
}
|
|
9095
|
-
|
|
9096
8945
|
/* render_html tool css */
|
|
9097
8946
|
${renderHtmlCss}`;
|
|
9098
8947
|
};
|
|
@@ -9256,6 +9105,7 @@ const HandleChatListScroll = 21;
|
|
|
9256
9105
|
const HandleMessagesScroll = 22;
|
|
9257
9106
|
const HandleClickSessionDebug = 23;
|
|
9258
9107
|
const HandleClickReadFile = 24;
|
|
9108
|
+
const HandleClickFileName = 38;
|
|
9259
9109
|
const HandleMessagesContextMenu = 25;
|
|
9260
9110
|
const HandleDragEnter = 26;
|
|
9261
9111
|
const HandleDragOver = 27;
|
|
@@ -10106,7 +9956,7 @@ const getToolCallEditFileVirtualDom = toolCall => {
|
|
|
10106
9956
|
const fileName = getFileNameFromUri(target.title);
|
|
10107
9957
|
const fileNameClickableProps = target.clickableUri ? {
|
|
10108
9958
|
'data-uri': target.clickableUri,
|
|
10109
|
-
onClick:
|
|
9959
|
+
onClick: HandleClickFileName
|
|
10110
9960
|
} : {};
|
|
10111
9961
|
return [{
|
|
10112
9962
|
childCount: 3,
|
|
@@ -10126,6 +9976,7 @@ const getToolCallEditFileVirtualDom = toolCall => {
|
|
|
10126
9976
|
}, {
|
|
10127
9977
|
childCount: 1,
|
|
10128
9978
|
className: ChatToolCallFileName,
|
|
9979
|
+
...fileNameClickableProps,
|
|
10129
9980
|
type: Span
|
|
10130
9981
|
}, text(fileName)];
|
|
10131
9982
|
};
|
|
@@ -10136,6 +9987,10 @@ const getToolCallGetWorkspaceUriVirtualDom = toolCall => {
|
|
|
10136
9987
|
}
|
|
10137
9988
|
const statusLabel = getToolCallStatusLabel(toolCall);
|
|
10138
9989
|
const fileName = getFileNameFromUri(toolCall.result);
|
|
9990
|
+
const fileNameClickableProps = {
|
|
9991
|
+
'data-uri': toolCall.result,
|
|
9992
|
+
onClick: HandleClickFileName
|
|
9993
|
+
};
|
|
10139
9994
|
return [{
|
|
10140
9995
|
childCount: statusLabel ? 4 : 3,
|
|
10141
9996
|
className: ChatOrderedListItem,
|
|
@@ -10148,12 +10003,12 @@ const getToolCallGetWorkspaceUriVirtualDom = toolCall => {
|
|
|
10148
10003
|
}, text('get_workspace_uri '), {
|
|
10149
10004
|
childCount: 1,
|
|
10150
10005
|
className: ChatToolCallReadFileLink,
|
|
10151
|
-
|
|
10152
|
-
onClick: HandleClickReadFile,
|
|
10006
|
+
...fileNameClickableProps,
|
|
10153
10007
|
type: Span
|
|
10154
10008
|
}, {
|
|
10155
10009
|
childCount: 1,
|
|
10156
10010
|
className: ChatToolCallFileName,
|
|
10011
|
+
...fileNameClickableProps,
|
|
10157
10012
|
type: Span
|
|
10158
10013
|
}, text(fileName), ...(statusLabel ? [text(statusLabel)] : [])];
|
|
10159
10014
|
};
|
|
@@ -10224,7 +10079,7 @@ const getToolCallReadFileVirtualDom = toolCall => {
|
|
|
10224
10079
|
const statusLabel = getToolCallStatusLabel(toolCall);
|
|
10225
10080
|
const fileNameClickableProps = target.clickableUri ? {
|
|
10226
10081
|
'data-uri': target.clickableUri,
|
|
10227
|
-
onClick:
|
|
10082
|
+
onClick: HandleClickFileName
|
|
10228
10083
|
} : {};
|
|
10229
10084
|
return [{
|
|
10230
10085
|
childCount: statusLabel ? 4 : 3,
|
|
@@ -10243,6 +10098,7 @@ const getToolCallReadFileVirtualDom = toolCall => {
|
|
|
10243
10098
|
}, {
|
|
10244
10099
|
childCount: 1,
|
|
10245
10100
|
className: ChatToolCallFileName,
|
|
10101
|
+
...fileNameClickableProps,
|
|
10246
10102
|
type: Span
|
|
10247
10103
|
}, text(fileName), ...(statusLabel ? [text(statusLabel)] : [])];
|
|
10248
10104
|
};
|
|
@@ -10602,7 +10458,7 @@ const getToolCallWriteFileVirtualDom = toolCall => {
|
|
|
10602
10458
|
} = parseWriteFileLineCounts(toolCall.result);
|
|
10603
10459
|
const fileNameClickableProps = target.clickableUri ? {
|
|
10604
10460
|
'data-uri': target.clickableUri,
|
|
10605
|
-
onClick:
|
|
10461
|
+
onClick: HandleClickFileName
|
|
10606
10462
|
} : {};
|
|
10607
10463
|
return [{
|
|
10608
10464
|
childCount: showDiffStats ? statusLabel ? 6 : 5 : statusLabel ? 4 : 3,
|
|
@@ -10621,6 +10477,7 @@ const getToolCallWriteFileVirtualDom = toolCall => {
|
|
|
10621
10477
|
}, {
|
|
10622
10478
|
childCount: 1,
|
|
10623
10479
|
className: ChatToolCallFileName,
|
|
10480
|
+
...fileNameClickableProps,
|
|
10624
10481
|
type: Span
|
|
10625
10482
|
}, text(fileName), ...(showDiffStats ? [{
|
|
10626
10483
|
childCount: 1,
|
|
@@ -11686,7 +11543,10 @@ const renderEventListeners = () => {
|
|
|
11686
11543
|
params: ['handleClickDictationButton', handleDictateClickExpression]
|
|
11687
11544
|
}, {
|
|
11688
11545
|
name: HandleClickReadFile,
|
|
11689
|
-
params: ['
|
|
11546
|
+
params: ['handleClickFileName', 'event.target.dataset.uri']
|
|
11547
|
+
}, {
|
|
11548
|
+
name: HandleClickFileName,
|
|
11549
|
+
params: ['handleClickFileName', 'event.target.dataset.uri']
|
|
11690
11550
|
}, {
|
|
11691
11551
|
name: HandleClickDelete,
|
|
11692
11552
|
params: ['handleClickDelete', 'event.target.dataset.id']
|
|
@@ -12005,9 +11865,10 @@ const commandMap = {
|
|
|
12005
11865
|
'Chat.handleClickClose': handleClickClose,
|
|
12006
11866
|
'Chat.handleClickDelete': wrapCommand(handleClickDelete),
|
|
12007
11867
|
'Chat.handleClickDictationButton': wrapCommand(handleClickDictationButton),
|
|
11868
|
+
'Chat.handleClickFileName': handleClickFileName,
|
|
12008
11869
|
'Chat.handleClickList': wrapCommand(handleClickList),
|
|
12009
11870
|
'Chat.handleClickNew': wrapCommand(handleClickNew),
|
|
12010
|
-
'Chat.handleClickReadFile':
|
|
11871
|
+
'Chat.handleClickReadFile': handleClickFileName,
|
|
12011
11872
|
'Chat.handleClickSessionDebug': wrapCommand(handleClickSessionDebug),
|
|
12012
11873
|
'Chat.handleClickSettings': handleClickSettings,
|
|
12013
11874
|
'Chat.handleDragEnter': wrapCommand(handleDragEnter),
|