@lvce-editor/chat-view 6.14.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.
@@ -1118,14 +1118,14 @@ const create$2 = rpcId => {
1118
1118
  };
1119
1119
 
1120
1120
  const {
1121
- invoke: invoke$5,
1121
+ invoke: invoke$6,
1122
1122
  set: set$7
1123
1123
  } = create$2(6007);
1124
1124
  const getMathBlockDom = async node => {
1125
- return invoke$5('ChatMath.getMathBlockDom', node);
1125
+ return invoke$6('ChatMath.getMathBlockDom', node);
1126
1126
  };
1127
1127
  const getMathInlineDom = async node => {
1128
- return invoke$5('ChatMath.getMathInlineDom', node);
1128
+ return invoke$6('ChatMath.getMathInlineDom', node);
1129
1129
  };
1130
1130
 
1131
1131
  const Button$2 = 'button';
@@ -1218,23 +1218,27 @@ const SetPatches = 'Viewlet.setPatches';
1218
1218
  const FocusChatInput = 8000;
1219
1219
 
1220
1220
  const {
1221
- invoke: invoke$4,
1221
+ invoke: invoke$5,
1222
1222
  set: set$6
1223
1223
  } = create$2(ChatNetworkWorker);
1224
1224
 
1225
1225
  const {
1226
- invoke: invoke$3,
1226
+ invoke: invoke$4,
1227
1227
  set: set$5
1228
1228
  } = create$2(ChatToolWorker);
1229
1229
 
1230
1230
  const {
1231
- invoke: invoke$2,
1231
+ invoke: invoke$3,
1232
1232
  set: set$4
1233
1233
  } = create$2(ExtensionHostWorker);
1234
1234
 
1235
1235
  const {
1236
+ invoke: invoke$2,
1236
1237
  set: set$3
1237
1238
  } = create$2(OpenerWorker);
1239
+ const openExternal = async url => {
1240
+ return invoke$2('Open.openExternal', url);
1241
+ };
1238
1242
 
1239
1243
  const {
1240
1244
  invoke: invoke$1,
@@ -1275,9 +1279,6 @@ const activateByEvent$1 = (event, assetDir, platform) => {
1275
1279
  const getPreference = async key => {
1276
1280
  return await invoke$1('Preferences.get', key);
1277
1281
  };
1278
- const openExternal = async uri => {
1279
- await invoke$1('Open.openExternal', uri);
1280
- };
1281
1282
  const measureTextBlockHeight$1 = async (actualInput, fontFamily, fontSize, lineHeightPx, width) => {
1282
1283
  return invoke$1(`MeasureTextHeight.measureTextBlockHeight`, actualInput, fontFamily, fontSize, lineHeightPx, width);
1283
1284
  };
@@ -3364,10 +3365,10 @@ const getAiResponse$1 = async options => {
3364
3365
  };
3365
3366
 
3366
3367
  const execute = async (name, rawArguments, options) => {
3367
- return invoke$3('ChatTool.execute', name, rawArguments, options);
3368
+ return invoke$4('ChatTool.execute', name, rawArguments, options);
3368
3369
  };
3369
3370
  const getTools = async () => {
3370
- return invoke$3('ChatTool.getTools');
3371
+ return invoke$4('ChatTool.getTools');
3371
3372
  };
3372
3373
 
3373
3374
  const stringifyToolOutput = output => {
@@ -3867,7 +3868,7 @@ const executeProvider = async ({
3867
3868
  }) => {
3868
3869
  await activateByEvent(event, assetDir, platform);
3869
3870
  // @ts-ignore
3870
- const result = invoke$2(method, ...params);
3871
+ const result = invoke$3(method, ...params);
3871
3872
  return result;
3872
3873
  };
3873
3874
 
@@ -3999,10 +4000,10 @@ const getOpenApiApiEndpoint = openApiApiBaseUrl => {
3999
4000
  };
4000
4001
 
4001
4002
  const makeApiRequest = async options => {
4002
- return invoke$4('ChatNetwork.makeApiRequest', options);
4003
+ return invoke$5('ChatNetwork.makeApiRequest', options);
4003
4004
  };
4004
4005
  const makeStreamingApiRequest = async options => {
4005
- return invoke$4('ChatNetwork.makeStreamingApiRequest', options);
4006
+ return invoke$5('ChatNetwork.makeStreamingApiRequest', options);
4006
4007
  };
4007
4008
 
4008
4009
  const getTextContent = content => {
@@ -7939,19 +7940,13 @@ const handleClickDictationButton = async state => {
7939
7940
  return state;
7940
7941
  };
7941
7942
 
7942
- const handleClickNew = async state => {
7943
- const newState = await createSession(state);
7944
- const clearedState = await clearInput(newState);
7945
- return focusInput(clearedState);
7946
- };
7947
-
7948
7943
  const normalizeFileReferenceUri = uri => {
7949
7944
  if (uri.startsWith('vscode-references://')) {
7950
7945
  return `file://${uri.slice('vscode-references://'.length)}`;
7951
7946
  }
7952
7947
  return uri;
7953
7948
  };
7954
- const handleClickReadFile = async uri => {
7949
+ const handleClickFileName = async uri => {
7955
7950
  if (!uri) {
7956
7951
  return;
7957
7952
  }
@@ -7959,6 +7954,12 @@ const handleClickReadFile = async uri => {
7959
7954
  await invoke$1('Main.openUri', normalizedUri);
7960
7955
  };
7961
7956
 
7957
+ const handleClickNew = async state => {
7958
+ const newState = await createSession(state);
7959
+ const clearedState = await clearInput(newState);
7960
+ return focusInput(clearedState);
7961
+ };
7962
+
7962
7963
  const handleClickSessionDebug = async state => {
7963
7964
  await invoke$1('Main.openUri', `chat-debug://${state.selectedSessionId}`);
7964
7965
  return state;
@@ -8913,7 +8914,10 @@ const registerMockResponse = (state, mockResponse) => {
8913
8914
  };
8914
8915
 
8915
8916
  const getCss = (composerHeight, listItemHeight, chatMessageFontSize, chatMessageLineHeight, chatMessageFontFamily, textAreaPaddingTop, textAreaPaddingLeft, textAreaPaddingRight, textAreaPaddingBottom, chatSendAreaPaddingTop, chatSendAreaPaddingLeft, chatSendAreaPaddingRight, chatSendAreaPaddingBottom, renderHtmlCss) => {
8916
- const chatSendAreaHeight = composerHeight + chatSendAreaPaddingTop + chatSendAreaPaddingBottom;
8917
+ const buttonsHeight = 20;
8918
+ const gap = 10;
8919
+ const contentPadding = 10;
8920
+ const chatSendAreaHeight = composerHeight + chatSendAreaPaddingTop + chatSendAreaPaddingBottom + buttonsHeight + gap + contentPadding * 2;
8917
8921
  const baseCss = `:root {
8918
8922
  --ChatInputBoxHeight: ${composerHeight}px;
8919
8923
  --ChatTextAreaHeight: ${composerHeight}px;
@@ -8930,168 +8934,14 @@ const getCss = (composerHeight, listItemHeight, chatMessageFontSize, chatMessage
8930
8934
  --ChatMessageFontSize: ${chatMessageFontSize}px;
8931
8935
  --ChatMessageLineHeight: ${chatMessageLineHeight}px;
8932
8936
  --ChatMessageFontFamily: ${chatMessageFontFamily};
8933
- }`;
8934
- if (!renderHtmlCss.trim()) {
8935
- return `${baseCss}
8936
-
8937
- .ChatTodoList {
8938
- background: var(--vscode-editorWidget-background);
8939
- border: 1px solid var(--vscode-editorWidget-border);
8940
- border-radius: 6px;
8941
- margin-bottom: 8px;
8942
- overflow: hidden;
8943
- }
8944
-
8945
- .ChatTodoListHeader {
8946
- border-bottom: 1px solid var(--vscode-editorWidget-border);
8947
- color: var(--vscode-descriptionForeground);
8948
- font-size: 12px;
8949
- line-height: 18px;
8950
- padding: 6px 10px;
8951
- }
8952
-
8953
- .ChatTodoListItems {
8954
- list-style: none;
8955
- margin: 0;
8956
- max-height: 180px;
8957
- overflow: auto;
8958
- padding: 4px 0;
8959
- }
8960
-
8961
- .ChatTodoListItem {
8962
- align-items: center;
8963
- color: var(--vscode-foreground);
8964
- display: flex;
8965
- font-size: 12px;
8966
- line-height: 18px;
8967
- min-height: 24px;
8968
- padding: 0 10px;
8969
- }
8970
-
8971
- .ChatTodoListItem::before {
8972
- color: var(--vscode-descriptionForeground);
8973
- content: "○";
8974
- display: inline-block;
8975
- margin-right: 8px;
8976
- width: 1em;
8977
- }
8978
-
8979
- .ChatTodoListItemTodo::before {
8980
- content: "○";
8981
- }
8982
-
8983
- .ChatTodoListItem.todo::before {
8984
- content: "○";
8985
- }
8986
-
8987
- .ChatTodoListItemInProgress::before {
8988
- color: var(--vscode-textLink-foreground);
8989
- content: "◐";
8990
- }
8991
-
8992
- .ChatTodoListItem.inProgress::before {
8993
- color: var(--vscode-textLink-foreground);
8994
- content: "◐";
8995
- }
8996
-
8997
- .ChatTodoListItemCompleted {
8998
- color: var(--vscode-disabledForeground);
8999
8937
  }
9000
8938
 
9001
- .ChatTodoListItem.completed {
9002
- color: var(--vscode-disabledForeground);
8939
+ .ChatSendAreaBottom{
8940
+ height: ${buttonsHeight}px;
9003
8941
  }
9004
-
9005
- .ChatTodoListItemCompleted::before {
9006
- color: var(--vscode-testing-iconPassed);
9007
- content: "✓";
9008
- }
9009
-
9010
- .ChatTodoListItem.completed::before {
9011
- color: var(--vscode-testing-iconPassed);
9012
- content: "✓";
9013
- }`;
9014
- }
8942
+ `;
9015
8943
  return `${baseCss}
9016
8944
 
9017
- .ChatTodoList {
9018
- background: var(--vscode-editorWidget-background);
9019
- border: 1px solid var(--vscode-editorWidget-border);
9020
- border-radius: 6px;
9021
- margin-bottom: 8px;
9022
- overflow: hidden;
9023
- }
9024
-
9025
- .ChatTodoListHeader {
9026
- border-bottom: 1px solid var(--vscode-editorWidget-border);
9027
- color: var(--vscode-descriptionForeground);
9028
- font-size: 12px;
9029
- line-height: 18px;
9030
- padding: 6px 10px;
9031
- }
9032
-
9033
- .ChatTodoListItems {
9034
- list-style: none;
9035
- margin: 0;
9036
- max-height: 180px;
9037
- overflow: auto;
9038
- padding: 4px 0;
9039
- }
9040
-
9041
- .ChatTodoListItem {
9042
- align-items: center;
9043
- color: var(--vscode-foreground);
9044
- display: flex;
9045
- font-size: 12px;
9046
- line-height: 18px;
9047
- min-height: 24px;
9048
- padding: 0 10px;
9049
- }
9050
-
9051
- .ChatTodoListItem::before {
9052
- color: var(--vscode-descriptionForeground);
9053
- content: "○";
9054
- display: inline-block;
9055
- margin-right: 8px;
9056
- width: 1em;
9057
- }
9058
-
9059
- .ChatTodoListItemTodo::before {
9060
- content: "○";
9061
- }
9062
-
9063
- .ChatTodoListItem.todo::before {
9064
- content: "○";
9065
- }
9066
-
9067
- .ChatTodoListItemInProgress::before {
9068
- color: var(--vscode-textLink-foreground);
9069
- content: "◐";
9070
- }
9071
-
9072
- .ChatTodoListItem.inProgress::before {
9073
- color: var(--vscode-textLink-foreground);
9074
- content: "◐";
9075
- }
9076
-
9077
- .ChatTodoListItemCompleted {
9078
- color: var(--vscode-disabledForeground);
9079
- }
9080
-
9081
- .ChatTodoListItem.completed {
9082
- color: var(--vscode-disabledForeground);
9083
- }
9084
-
9085
- .ChatTodoListItemCompleted::before {
9086
- color: var(--vscode-testing-iconPassed);
9087
- content: "✓";
9088
- }
9089
-
9090
- .ChatTodoListItem.completed::before {
9091
- color: var(--vscode-testing-iconPassed);
9092
- content: "✓";
9093
- }
9094
-
9095
8945
  /* render_html tool css */
9096
8946
  ${renderHtmlCss}`;
9097
8947
  };
@@ -9255,6 +9105,7 @@ const HandleChatListScroll = 21;
9255
9105
  const HandleMessagesScroll = 22;
9256
9106
  const HandleClickSessionDebug = 23;
9257
9107
  const HandleClickReadFile = 24;
9108
+ const HandleClickFileName = 38;
9258
9109
  const HandleMessagesContextMenu = 25;
9259
9110
  const HandleDragEnter = 26;
9260
9111
  const HandleDragOver = 27;
@@ -10105,7 +9956,7 @@ const getToolCallEditFileVirtualDom = toolCall => {
10105
9956
  const fileName = getFileNameFromUri(target.title);
10106
9957
  const fileNameClickableProps = target.clickableUri ? {
10107
9958
  'data-uri': target.clickableUri,
10108
- onClick: HandleClickReadFile
9959
+ onClick: HandleClickFileName
10109
9960
  } : {};
10110
9961
  return [{
10111
9962
  childCount: 3,
@@ -10125,6 +9976,7 @@ const getToolCallEditFileVirtualDom = toolCall => {
10125
9976
  }, {
10126
9977
  childCount: 1,
10127
9978
  className: ChatToolCallFileName,
9979
+ ...fileNameClickableProps,
10128
9980
  type: Span
10129
9981
  }, text(fileName)];
10130
9982
  };
@@ -10135,6 +9987,10 @@ const getToolCallGetWorkspaceUriVirtualDom = toolCall => {
10135
9987
  }
10136
9988
  const statusLabel = getToolCallStatusLabel(toolCall);
10137
9989
  const fileName = getFileNameFromUri(toolCall.result);
9990
+ const fileNameClickableProps = {
9991
+ 'data-uri': toolCall.result,
9992
+ onClick: HandleClickFileName
9993
+ };
10138
9994
  return [{
10139
9995
  childCount: statusLabel ? 4 : 3,
10140
9996
  className: ChatOrderedListItem,
@@ -10147,12 +10003,12 @@ const getToolCallGetWorkspaceUriVirtualDom = toolCall => {
10147
10003
  }, text('get_workspace_uri '), {
10148
10004
  childCount: 1,
10149
10005
  className: ChatToolCallReadFileLink,
10150
- 'data-uri': toolCall.result,
10151
- onClick: HandleClickReadFile,
10006
+ ...fileNameClickableProps,
10152
10007
  type: Span
10153
10008
  }, {
10154
10009
  childCount: 1,
10155
10010
  className: ChatToolCallFileName,
10011
+ ...fileNameClickableProps,
10156
10012
  type: Span
10157
10013
  }, text(fileName), ...(statusLabel ? [text(statusLabel)] : [])];
10158
10014
  };
@@ -10223,7 +10079,7 @@ const getToolCallReadFileVirtualDom = toolCall => {
10223
10079
  const statusLabel = getToolCallStatusLabel(toolCall);
10224
10080
  const fileNameClickableProps = target.clickableUri ? {
10225
10081
  'data-uri': target.clickableUri,
10226
- onClick: HandleClickReadFile
10082
+ onClick: HandleClickFileName
10227
10083
  } : {};
10228
10084
  return [{
10229
10085
  childCount: statusLabel ? 4 : 3,
@@ -10242,6 +10098,7 @@ const getToolCallReadFileVirtualDom = toolCall => {
10242
10098
  }, {
10243
10099
  childCount: 1,
10244
10100
  className: ChatToolCallFileName,
10101
+ ...fileNameClickableProps,
10245
10102
  type: Span
10246
10103
  }, text(fileName), ...(statusLabel ? [text(statusLabel)] : [])];
10247
10104
  };
@@ -10601,7 +10458,7 @@ const getToolCallWriteFileVirtualDom = toolCall => {
10601
10458
  } = parseWriteFileLineCounts(toolCall.result);
10602
10459
  const fileNameClickableProps = target.clickableUri ? {
10603
10460
  'data-uri': target.clickableUri,
10604
- onClick: HandleClickReadFile
10461
+ onClick: HandleClickFileName
10605
10462
  } : {};
10606
10463
  return [{
10607
10464
  childCount: showDiffStats ? statusLabel ? 6 : 5 : statusLabel ? 4 : 3,
@@ -10620,6 +10477,7 @@ const getToolCallWriteFileVirtualDom = toolCall => {
10620
10477
  }, {
10621
10478
  childCount: 1,
10622
10479
  className: ChatToolCallFileName,
10480
+ ...fileNameClickableProps,
10623
10481
  type: Span
10624
10482
  }, text(fileName), ...(showDiffStats ? [{
10625
10483
  childCount: 1,
@@ -11685,7 +11543,10 @@ const renderEventListeners = () => {
11685
11543
  params: ['handleClickDictationButton', handleDictateClickExpression]
11686
11544
  }, {
11687
11545
  name: HandleClickReadFile,
11688
- params: ['handleClickReadFile', 'event.target.dataset.uri']
11546
+ params: ['handleClickFileName', 'event.target.dataset.uri']
11547
+ }, {
11548
+ name: HandleClickFileName,
11549
+ params: ['handleClickFileName', 'event.target.dataset.uri']
11689
11550
  }, {
11690
11551
  name: HandleClickDelete,
11691
11552
  params: ['handleClickDelete', 'event.target.dataset.id']
@@ -12004,9 +11865,10 @@ const commandMap = {
12004
11865
  'Chat.handleClickClose': handleClickClose,
12005
11866
  'Chat.handleClickDelete': wrapCommand(handleClickDelete),
12006
11867
  'Chat.handleClickDictationButton': wrapCommand(handleClickDictationButton),
11868
+ 'Chat.handleClickFileName': handleClickFileName,
12007
11869
  'Chat.handleClickList': wrapCommand(handleClickList),
12008
11870
  'Chat.handleClickNew': wrapCommand(handleClickNew),
12009
- 'Chat.handleClickReadFile': handleClickReadFile,
11871
+ 'Chat.handleClickReadFile': handleClickFileName,
12010
11872
  'Chat.handleClickSessionDebug': wrapCommand(handleClickSessionDebug),
12011
11873
  'Chat.handleClickSettings': handleClickSettings,
12012
11874
  'Chat.handleDragEnter': wrapCommand(handleDragEnter),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "6.14.0",
3
+ "version": "6.16.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",