@lvce-editor/chat-view 6.16.0 → 6.17.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.
@@ -1702,7 +1702,10 @@ const createDefaultState = () => {
1702
1702
  messagesScrollTop: 0,
1703
1703
  mockAiResponseDelay: 800,
1704
1704
  mockApiCommandId: '',
1705
+ modelPickerOpen: false,
1706
+ modelPickerSearchValue: '',
1705
1707
  models: getDefaultModels(),
1708
+ newChatModelPickerEnabled: false,
1706
1709
  nextMessageId: 1,
1707
1710
  openApiApiBaseUrl: 'https://api.openai.com/v1',
1708
1711
  openApiApiKey: '',
@@ -2560,7 +2563,7 @@ const isEqualProjectExpandedIds = (a, b) => {
2560
2563
  return true;
2561
2564
  };
2562
2565
  const isEqual = (oldState, newState) => {
2563
- return oldState.addContextButtonEnabled === newState.addContextButtonEnabled && oldState.authEnabled === newState.authEnabled && oldState.authErrorMessage === newState.authErrorMessage && oldState.authStatus === newState.authStatus && oldState.composerDropActive === newState.composerDropActive && oldState.composerDropEnabled === newState.composerDropEnabled && oldState.composerValue === newState.composerValue && oldState.initial === newState.initial && isEqualProjectExpandedIds(oldState.projectExpandedIds, newState.projectExpandedIds) && oldState.projectListScrollTop === newState.projectListScrollTop && oldState.renamingSessionId === newState.renamingSessionId && oldState.selectedModelId === newState.selectedModelId && oldState.selectedProjectId === newState.selectedProjectId && oldState.selectedSessionId === newState.selectedSessionId && oldState.showRunMode === newState.showRunMode && oldState.runMode === newState.runMode && oldState.sessions === newState.sessions && oldState.tokensMax === newState.tokensMax && oldState.tokensUsed === newState.tokensUsed && oldState.usageOverviewEnabled === newState.usageOverviewEnabled && oldState.useChatMathWorker === newState.useChatMathWorker && oldState.viewMode === newState.viewMode && oldState.voiceDictationEnabled === newState.voiceDictationEnabled;
2566
+ return oldState.addContextButtonEnabled === newState.addContextButtonEnabled && oldState.authEnabled === newState.authEnabled && oldState.authErrorMessage === newState.authErrorMessage && oldState.authStatus === newState.authStatus && oldState.composerDropActive === newState.composerDropActive && oldState.composerDropEnabled === newState.composerDropEnabled && oldState.composerValue === newState.composerValue && oldState.initial === newState.initial && oldState.modelPickerOpen === newState.modelPickerOpen && oldState.modelPickerSearchValue === newState.modelPickerSearchValue && oldState.newChatModelPickerEnabled === newState.newChatModelPickerEnabled && isEqualProjectExpandedIds(oldState.projectExpandedIds, newState.projectExpandedIds) && oldState.projectListScrollTop === newState.projectListScrollTop && oldState.renamingSessionId === newState.renamingSessionId && oldState.selectedModelId === newState.selectedModelId && oldState.selectedProjectId === newState.selectedProjectId && oldState.selectedSessionId === newState.selectedSessionId && oldState.showRunMode === newState.showRunMode && oldState.runMode === newState.runMode && oldState.sessions === newState.sessions && oldState.tokensMax === newState.tokensMax && oldState.tokensUsed === newState.tokensUsed && oldState.usageOverviewEnabled === newState.usageOverviewEnabled && oldState.useChatMathWorker === newState.useChatMathWorker && oldState.viewMode === newState.viewMode && oldState.voiceDictationEnabled === newState.voiceDictationEnabled;
2564
2567
  };
2565
2568
 
2566
2569
  const diffScrollTop = (oldState, newState) => {
@@ -7688,6 +7691,9 @@ const Dictate = 'dictate';
7688
7691
  const Send = 'send';
7689
7692
  const Back = 'back';
7690
7693
  const Model = 'model';
7694
+ const ModelPickerToggle = 'model-picker-toggle';
7695
+ const ModelPickerSearch = 'model-picker-search';
7696
+ const ModelPickerSettings = 'model-picker-settings';
7691
7697
  const RunMode = 'runMode';
7692
7698
  const ToggleChatFocus = 'toggle-chat-focus';
7693
7699
  const ToggleSearch = 'toggle-search';
@@ -7703,6 +7709,7 @@ const SessionDelete = 'SessionDelete';
7703
7709
  const ProjectPrefix = 'project:';
7704
7710
  const SessionPrefix = 'session:';
7705
7711
  const RenamePrefix = 'session-rename:';
7712
+ const ModelPickerItemPrefix = 'model-picker-item:';
7706
7713
  const getProjectInputName = projectId => {
7707
7714
  return `${ProjectPrefix}${projectId}`;
7708
7715
  };
@@ -7736,6 +7743,15 @@ const isRenameInputName = name => {
7736
7743
  const getRenameIdFromInputName = name => {
7737
7744
  return name.slice(RenamePrefix.length);
7738
7745
  };
7746
+ const getModelPickerItemInputName = modelId => {
7747
+ return `${ModelPickerItemPrefix}${modelId}`;
7748
+ };
7749
+ const isModelPickerItemInputName = name => {
7750
+ return name.startsWith(ModelPickerItemPrefix);
7751
+ };
7752
+ const getModelIdFromModelPickerItemInputName = name => {
7753
+ return name.slice(ModelPickerItemPrefix.length);
7754
+ };
7739
7755
 
7740
7756
  const OpenApiApiKeyInput = 'open-api-api-key';
7741
7757
  const SaveOpenApiApiKey = 'save-openapi-api-key';
@@ -7875,6 +7891,22 @@ const handleClick = async (state, name, id = '') => {
7875
7891
  searchFieldVisible: !state.searchFieldVisible,
7876
7892
  searchValue: state.searchFieldVisible ? '' : state.searchValue
7877
7893
  };
7894
+ case name === ModelPickerToggle:
7895
+ return {
7896
+ ...state,
7897
+ modelPickerOpen: !state.modelPickerOpen,
7898
+ modelPickerSearchValue: state.modelPickerOpen ? '' : state.modelPickerSearchValue
7899
+ };
7900
+ case isModelPickerItemInputName(name):
7901
+ {
7902
+ const modelId = getModelIdFromModelPickerItemInputName(name);
7903
+ return {
7904
+ ...state,
7905
+ modelPickerOpen: false,
7906
+ modelPickerSearchValue: '',
7907
+ selectedModelId: modelId
7908
+ };
7909
+ }
7878
7910
  case isProjectInputName(name):
7879
7911
  {
7880
7912
  const projectId = getProjectIdFromInputName(name);
@@ -8078,6 +8110,12 @@ const handleInput = async (state, name, value, inputSource = 'user') => {
8078
8110
  if (name === Search) {
8079
8111
  return handleSearchValueChange(state, value);
8080
8112
  }
8113
+ if (name === ModelPickerSearch) {
8114
+ return {
8115
+ ...state,
8116
+ modelPickerSearchValue: value
8117
+ };
8118
+ }
8081
8119
  if (name !== Composer) {
8082
8120
  return state;
8083
8121
  }
@@ -8208,6 +8246,8 @@ const handleMissingApiKeySubmit = async (state, submitterName = '') => {
8208
8246
  const handleModelChange = async (state, value) => {
8209
8247
  return {
8210
8248
  ...state,
8249
+ modelPickerOpen: false,
8250
+ modelPickerSearchValue: '',
8211
8251
  selectedModelId: value
8212
8252
  };
8213
8253
  };
@@ -8779,6 +8819,9 @@ const loadContent = async (state, savedState) => {
8779
8819
  initial: false,
8780
8820
  lastNormalViewMode,
8781
8821
  messagesScrollTop,
8822
+ modelPickerOpen: false,
8823
+ modelPickerSearchValue: '',
8824
+ newChatModelPickerEnabled: state.newChatModelPickerEnabled,
8782
8825
  openApiApiKey,
8783
8826
  openApiApiKeyInput: openApiApiKey,
8784
8827
  openRouterApiKey,
@@ -9006,6 +9049,12 @@ const ChatViewDropOverlay = 'ChatViewDropOverlay';
9006
9049
  const ChatViewDropOverlayActive = 'ChatViewDropOverlayActive';
9007
9050
  const SendButtonDisabled = 'SendButtonDisabled';
9008
9051
  const ChatSendAreaBottom = 'ChatSendAreaBottom';
9052
+ const ChatModelPickerContainer = 'ChatModelPickerContainer';
9053
+ const ChatModelPicker = 'ChatModelPicker';
9054
+ const ChatModelPickerHeader = 'ChatModelPickerHeader';
9055
+ const ChatModelPickerList = 'ChatModelPickerList';
9056
+ const ChatModelPickerItem = 'ChatModelPickerItem';
9057
+ const ChatModelPickerItemSelected = 'ChatModelPickerItemSelected';
9009
9058
  const ChatSendAreaContent = 'ChatSendAreaContent';
9010
9059
  const ChatTodoList = 'ChatTodoList';
9011
9060
  const ChatTodoListHeader = 'ChatTodoListHeader';
@@ -9050,6 +9099,7 @@ const Markdown = 'Markdown';
9050
9099
  const MarkdownQuote = 'MarkdownQuote';
9051
9100
  const MarkdownMathBlock = 'MarkdownMathBlock';
9052
9101
  const MarkdownTable = 'MarkdownTable';
9102
+ const ChatTableWrapper = 'ChatTableWrapper';
9053
9103
  const Message = 'Message';
9054
9104
  const ChatMessageContent = 'ChatMessageContent';
9055
9105
  const ChatToolCalls = 'ChatToolCalls';
@@ -9130,6 +9180,66 @@ const getModelLabel = model => {
9130
9180
  return model.name;
9131
9181
  };
9132
9182
 
9183
+ const getChatModelPickerVirtualDom = (models, selectedModelId, modelPickerOpen, modelPickerSearchValue) => {
9184
+ const selectedModel = models.find(model => model.id === selectedModelId);
9185
+ const selectedModelLabel = selectedModel ? selectedModel.name : selectedModelId;
9186
+ const normalizedSearch = modelPickerSearchValue.trim().toLowerCase();
9187
+ const visibleModels = normalizedSearch ? models.filter(model => getModelLabel(model).toLowerCase().includes(normalizedSearch)) : models;
9188
+ return [{
9189
+ childCount: modelPickerOpen ? 2 : 1,
9190
+ className: ChatModelPickerContainer,
9191
+ type: Div
9192
+ }, {
9193
+ childCount: 2,
9194
+ className: Select,
9195
+ name: ModelPickerToggle,
9196
+ onClick: HandleClick,
9197
+ title: selectedModelLabel,
9198
+ type: Button$1
9199
+ }, {
9200
+ childCount: 0,
9201
+ className: 'MaskIcon MaskIconChevronUp',
9202
+ type: Div
9203
+ }, text(selectedModelLabel), ...(modelPickerOpen ? [{
9204
+ childCount: 3 + visibleModels.length,
9205
+ className: ChatModelPicker,
9206
+ type: Div
9207
+ }, {
9208
+ childCount: 2,
9209
+ className: ChatModelPickerHeader,
9210
+ type: Div
9211
+ }, {
9212
+ childCount: 0,
9213
+ className: InputBox,
9214
+ name: ModelPickerSearch,
9215
+ onInput: HandleInput,
9216
+ placeholder: 'Search models',
9217
+ type: Input,
9218
+ value: modelPickerSearchValue
9219
+ }, {
9220
+ childCount: 1,
9221
+ className: IconButton,
9222
+ name: ModelPickerSettings,
9223
+ onClick: HandleClick,
9224
+ title: 'Settings',
9225
+ type: Button$1
9226
+ }, {
9227
+ childCount: 0,
9228
+ className: 'MaskIcon MaskIconSettingsGear',
9229
+ type: Div
9230
+ }, {
9231
+ childCount: visibleModels.length,
9232
+ className: ChatModelPickerList,
9233
+ type: Div
9234
+ }, ...visibleModels.flatMap(model => [{
9235
+ childCount: 1,
9236
+ className: `${ChatModelPickerItem}${model.id === selectedModelId ? ` ${ChatModelPickerItemSelected}` : ''}`,
9237
+ name: getModelPickerItemInputName(model.id),
9238
+ onClick: HandleClick,
9239
+ type: Button$1
9240
+ }, text(getModelLabel(model))])] : [])];
9241
+ };
9242
+
9133
9243
  const getModelOptionDOm = (model, selectedModelId) => {
9134
9244
  return [{
9135
9245
  childCount: 1,
@@ -9253,7 +9363,7 @@ const getUsageOverviewDom = (tokensUsed, tokensMax) => {
9253
9363
  }, text(usageLabel)];
9254
9364
  };
9255
9365
 
9256
- const getChatSendAreaDom = (composerValue, models, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled = false) => {
9366
+ const getChatSendAreaDom = (composerValue, modelPickerOpen, modelPickerSearchValue, models, newChatModelPickerEnabled, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled = false) => {
9257
9367
  const isSendDisabled = composerValue.trim() === '';
9258
9368
  const controlsCount = 2 + (usageOverviewEnabled ? 1 : 0) + (showRunMode ? 1 : 0) + (addContextButtonEnabled ? 1 : 0);
9259
9369
  const hasTodoList = todoListToolEnabled && todoListItems.length > 0;
@@ -9307,7 +9417,7 @@ const getChatSendAreaDom = (composerValue, models, selectedModelId, usageOvervie
9307
9417
  childCount: voiceDictationEnabled ? controlsCount + 1 : controlsCount,
9308
9418
  className: ChatSendAreaBottom,
9309
9419
  type: Div
9310
- }, ...getChatSelectVirtualDom(models, selectedModelId), ...(showRunMode ? getRunModeSelectVirtualDom(runMode) : []), ...(usageOverviewEnabled ? getUsageOverviewDom(tokensUsed, tokensMax) : []), ...(addContextButtonEnabled ? getAddContextButtonDom() : []), ...getSendButtonDom(isSendDisabled, voiceDictationEnabled)];
9420
+ }, ...(newChatModelPickerEnabled ? getChatModelPickerVirtualDom(models, selectedModelId, modelPickerOpen, modelPickerSearchValue) : getChatSelectVirtualDom(models, selectedModelId)), ...(showRunMode ? getRunModeSelectVirtualDom(runMode) : []), ...(usageOverviewEnabled ? getUsageOverviewDom(tokensUsed, tokensMax) : []), ...(addContextButtonEnabled ? getAddContextButtonDom() : []), ...getSendButtonDom(isSendDisabled, voiceDictationEnabled)];
9311
9421
  };
9312
9422
 
9313
9423
  const getImageAltText = alt => {
@@ -9544,6 +9654,9 @@ const highlightCode = (code, language) => {
9544
9654
  }];
9545
9655
  };
9546
9656
 
9657
+ const hasVisibleInlineContent = children => {
9658
+ return children.some(child => child.type !== 'text' || child.text.trim() !== '');
9659
+ };
9547
9660
  const getTokenDom = token => {
9548
9661
  if (!token.className) {
9549
9662
  return [text(token.text)];
@@ -9605,6 +9718,11 @@ const getTableRowDom = (row, useChatMathWorker) => {
9605
9718
  };
9606
9719
  const getTableDom = (node, useChatMathWorker) => {
9607
9720
  return [{
9721
+ childCount: 1,
9722
+ className: ChatTableWrapper,
9723
+ style: 'padding-bottom: 8px;',
9724
+ type: Div
9725
+ }, {
9608
9726
  childCount: 2,
9609
9727
  className: MarkdownTable,
9610
9728
  type: Table
@@ -9650,6 +9768,9 @@ const getBlockQuoteDom = (node, useChatMathWorker) => {
9650
9768
  };
9651
9769
  const getMessageNodeDom = (node, useChatMathWorker = false) => {
9652
9770
  if (node.type === 'text') {
9771
+ if (!hasVisibleInlineContent(node.children)) {
9772
+ return [];
9773
+ }
9653
9774
  return [{
9654
9775
  childCount: node.children.length,
9655
9776
  className: Markdown,
@@ -10563,7 +10684,8 @@ const getChatMessageDom = (message, parsedMessageContent, _openRouterApiKeyInput
10563
10684
  const messageDom = getMessageContentDom(parsedMessageContent, useChatMathWorker);
10564
10685
  const toolCallsDom = getToolCallsDom(message);
10565
10686
  const toolCallsChildCount = toolCallsDom.length > 0 ? 1 : 0;
10566
- const extraChildCount = isOpenApiApiKeyMissingMessage || isOpenRouterApiKeyMissingMessage || isOpenRouterRequestFailedMessage || isOpenRouterTooManyRequestsMessage ? parsedMessageContent.length + 1 + toolCallsChildCount : parsedMessageContent.length + toolCallsChildCount;
10687
+ const messageDomChildCount = messageDom.filter(node => node.type !== Text).length;
10688
+ const extraChildCount = isOpenApiApiKeyMissingMessage || isOpenRouterApiKeyMissingMessage || isOpenRouterRequestFailedMessage || isOpenRouterTooManyRequestsMessage ? messageDomChildCount + 1 + toolCallsChildCount : messageDomChildCount + toolCallsChildCount;
10567
10689
  return [{
10568
10690
  childCount: 1,
10569
10691
  className: mergeClassNames(Message, roleClassName),
@@ -10737,7 +10859,10 @@ const getChatModeChatFocusVirtualDom = ({
10737
10859
  composerLineHeight = 20,
10738
10860
  composerValue,
10739
10861
  messagesScrollTop = 0,
10862
+ modelPickerOpen = false,
10863
+ modelPickerSearchValue = '',
10740
10864
  models,
10865
+ newChatModelPickerEnabled = false,
10741
10866
  openApiApiKeyInput,
10742
10867
  openRouterApiKeyInput,
10743
10868
  openRouterApiKeyState = 'idle',
@@ -10768,7 +10893,7 @@ const getChatModeChatFocusVirtualDom = ({
10768
10893
  onDragEnter: HandleDragEnterChatView,
10769
10894
  onDragOver: HandleDragOverChatView,
10770
10895
  type: Div
10771
- }, ...getProjectListDom(projects, sessions, projectExpandedIds, selectedProjectId, selectedSessionId, projectListScrollTop), ...getMessagesDom(messages, parsedMessages, openRouterApiKeyInput, openApiApiKeyInput, openRouterApiKeyState, messagesScrollTop, useChatMathWorker, true), ...getChatSendAreaDom(composerValue, models, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
10896
+ }, ...getProjectListDom(projects, sessions, projectExpandedIds, selectedProjectId, selectedSessionId, projectListScrollTop), ...getMessagesDom(messages, parsedMessages, openRouterApiKeyInput, openApiApiKeyInput, openRouterApiKeyState, messagesScrollTop, useChatMathWorker, true), ...getChatSendAreaDom(composerValue, modelPickerOpen, modelPickerSearchValue, models, newChatModelPickerEnabled, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
10772
10897
  childCount: 1,
10773
10898
  className: mergeClassNames(ChatViewDropOverlay, ChatViewDropOverlayActive),
10774
10899
  name: ComposerDropTarget,
@@ -10902,7 +11027,10 @@ const getChatModeDetailVirtualDom = ({
10902
11027
  composerLineHeight = 20,
10903
11028
  composerValue,
10904
11029
  messagesScrollTop = 0,
11030
+ modelPickerOpen = false,
11031
+ modelPickerSearchValue = '',
10905
11032
  models,
11033
+ newChatModelPickerEnabled = false,
10906
11034
  openApiApiKeyInput,
10907
11035
  openRouterApiKeyInput,
10908
11036
  openRouterApiKeyState = 'idle',
@@ -10930,7 +11058,7 @@ const getChatModeDetailVirtualDom = ({
10930
11058
  onDragEnter: HandleDragEnterChatView,
10931
11059
  onDragOver: HandleDragOverChatView,
10932
11060
  type: Div
10933
- }, ...getChatHeaderDomDetailMode(selectedSessionTitle, authEnabled, authStatus, authErrorMessage), ...getMessagesDom(messages, parsedMessages, openRouterApiKeyInput, openApiApiKeyInput, openRouterApiKeyState, messagesScrollTop, useChatMathWorker), ...getChatSendAreaDom(composerValue, models, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
11061
+ }, ...getChatHeaderDomDetailMode(selectedSessionTitle, authEnabled, authStatus, authErrorMessage), ...getMessagesDom(messages, parsedMessages, openRouterApiKeyInput, openApiApiKeyInput, openRouterApiKeyState, messagesScrollTop, useChatMathWorker), ...getChatSendAreaDom(composerValue, modelPickerOpen, modelPickerSearchValue, models, newChatModelPickerEnabled, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
10934
11062
  childCount: 1,
10935
11063
  className: mergeClassNames(ChatViewDropOverlay, ChatViewDropOverlayActive),
10936
11064
  name: ComposerDropTarget,
@@ -11044,7 +11172,10 @@ const getChatModeListVirtualDom = ({
11044
11172
  composerHeight = 28,
11045
11173
  composerLineHeight = 20,
11046
11174
  composerValue,
11175
+ modelPickerOpen = false,
11176
+ modelPickerSearchValue = '',
11047
11177
  models,
11178
+ newChatModelPickerEnabled = false,
11048
11179
  runMode,
11049
11180
  searchEnabled = false,
11050
11181
  searchFieldVisible = false,
@@ -11069,7 +11200,7 @@ const getChatModeListVirtualDom = ({
11069
11200
  onDragEnter: HandleDragEnterChatView,
11070
11201
  onDragOver: HandleDragOverChatView,
11071
11202
  type: Div
11072
- }, ...getChatHeaderListModeDom(authEnabled, authStatus, authErrorMessage, searchEnabled, searchFieldVisible, searchValue), ...getChatListDom(visibleSessions, selectedSessionId, chatListScrollTop), ...getChatSendAreaDom(composerValue, models, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
11203
+ }, ...getChatHeaderListModeDom(authEnabled, authStatus, authErrorMessage, searchEnabled, searchFieldVisible, searchValue), ...getChatListDom(visibleSessions, selectedSessionId, chatListScrollTop), ...getChatSendAreaDom(composerValue, modelPickerOpen, modelPickerSearchValue, models, newChatModelPickerEnabled, selectedModelId, usageOverviewEnabled, tokensUsed, tokensMax, addContextButtonEnabled, showRunMode, runMode, todoListToolEnabled, todoListItems, voiceDictationEnabled), ...(isDropOverlayVisible ? [{
11073
11204
  childCount: 1,
11074
11205
  className: mergeClassNames(ChatViewDropOverlay, ChatViewDropOverlayActive),
11075
11206
  name: ComposerDropTarget,
@@ -11177,7 +11308,10 @@ const getChatVirtualDom = options => {
11177
11308
  composerLineHeight,
11178
11309
  composerValue,
11179
11310
  messagesScrollTop,
11311
+ modelPickerOpen = false,
11312
+ modelPickerSearchValue = '',
11180
11313
  models,
11314
+ newChatModelPickerEnabled = false,
11181
11315
  openApiApiKeyInput,
11182
11316
  openRouterApiKeyInput,
11183
11317
  openRouterApiKeyState,
@@ -11219,7 +11353,10 @@ const getChatVirtualDom = options => {
11219
11353
  composerLineHeight,
11220
11354
  composerValue,
11221
11355
  messagesScrollTop,
11356
+ modelPickerOpen,
11357
+ modelPickerSearchValue,
11222
11358
  models,
11359
+ newChatModelPickerEnabled,
11223
11360
  openApiApiKeyInput,
11224
11361
  openRouterApiKeyInput,
11225
11362
  openRouterApiKeyState,
@@ -11255,7 +11392,10 @@ const getChatVirtualDom = options => {
11255
11392
  composerLineHeight,
11256
11393
  composerValue,
11257
11394
  messagesScrollTop,
11395
+ modelPickerOpen,
11396
+ modelPickerSearchValue,
11258
11397
  models,
11398
+ newChatModelPickerEnabled,
11259
11399
  openApiApiKeyInput,
11260
11400
  openRouterApiKeyInput,
11261
11401
  openRouterApiKeyState,
@@ -11287,7 +11427,10 @@ const getChatVirtualDom = options => {
11287
11427
  composerHeight,
11288
11428
  composerLineHeight,
11289
11429
  composerValue,
11430
+ modelPickerOpen,
11431
+ modelPickerSearchValue,
11290
11432
  models,
11433
+ newChatModelPickerEnabled,
11291
11434
  runMode,
11292
11435
  searchEnabled,
11293
11436
  searchFieldVisible,
@@ -11324,7 +11467,10 @@ const renderItems = (oldState, newState) => {
11324
11467
  composerValue,
11325
11468
  initial,
11326
11469
  messagesScrollTop,
11470
+ modelPickerOpen,
11471
+ modelPickerSearchValue,
11327
11472
  models,
11473
+ newChatModelPickerEnabled,
11328
11474
  openApiApiKeyInput,
11329
11475
  openRouterApiKeyInput,
11330
11476
  openRouterApiKeyState,
@@ -11367,7 +11513,10 @@ const renderItems = (oldState, newState) => {
11367
11513
  composerLineHeight,
11368
11514
  composerValue,
11369
11515
  messagesScrollTop,
11516
+ modelPickerOpen,
11517
+ modelPickerSearchValue,
11370
11518
  models,
11519
+ newChatModelPickerEnabled,
11371
11520
  openApiApiKeyInput,
11372
11521
  openRouterApiKeyInput,
11373
11522
  openRouterApiKeyState,
@@ -11649,6 +11798,8 @@ const reset = async state => {
11649
11798
  composerHeight: getMinComposerHeightForState(state),
11650
11799
  composerValue: '',
11651
11800
  mockAiResponseDelay: 0,
11801
+ modelPickerOpen: false,
11802
+ modelPickerSearchValue: '',
11652
11803
  openApiApiKey: '',
11653
11804
  openRouterApiKey: '',
11654
11805
  openRouterApiKeyInput: '',
@@ -11757,6 +11908,15 @@ const setEmitStreamingFunctionCallEvents = (state, emitStreamingFunctionCallEven
11757
11908
  };
11758
11909
  };
11759
11910
 
11911
+ const setNewChatModelPickerEnabled = (state, newChatModelPickerEnabled) => {
11912
+ return {
11913
+ ...state,
11914
+ modelPickerOpen: newChatModelPickerEnabled ? state.modelPickerOpen : false,
11915
+ modelPickerSearchValue: newChatModelPickerEnabled ? state.modelPickerSearchValue : '',
11916
+ newChatModelPickerEnabled
11917
+ };
11918
+ };
11919
+
11760
11920
  const setQuestionToolEnabled = (state, questionToolEnabled) => {
11761
11921
  return {
11762
11922
  ...state,
@@ -11911,6 +12071,7 @@ const commandMap = {
11911
12071
  'Chat.setBackendUrl': wrapCommand(setBackendUrl),
11912
12072
  'Chat.setChatList': wrapCommand(setChatList),
11913
12073
  'Chat.setEmitStreamingFunctionCallEvents': wrapCommand(setEmitStreamingFunctionCallEvents),
12074
+ 'Chat.setNewChatModelPickerEnabled': wrapCommand(setNewChatModelPickerEnabled),
11914
12075
  'Chat.setOpenRouterApiKey': wrapCommand(setOpenRouterApiKey),
11915
12076
  'Chat.setQuestionToolEnabled': wrapCommand(setQuestionToolEnabled),
11916
12077
  'Chat.setSearchEnabled': wrapCommand(setSearchEnabled),
@@ -11958,6 +12119,18 @@ const initializeChatNetworkWorker = async () => {
11958
12119
  set$6(rpc);
11959
12120
  };
11960
12121
 
12122
+ const sendMessagePortToChatStorageWorker = async port => {
12123
+ // @ts-ignore
12124
+ await undefined(port, 0);
12125
+ };
12126
+ const initializeChatStorageWorker = async () => {
12127
+ const rpc = await create$4({
12128
+ commandMap: {},
12129
+ send: sendMessagePortToChatStorageWorker
12130
+ });
12131
+ set$3(rpc);
12132
+ };
12133
+
11961
12134
  const send = port => {
11962
12135
  return sendMessagePortToChatToolWorker(port);
11963
12136
  };
@@ -11986,7 +12159,7 @@ const listen = async () => {
11986
12159
  commandMap: commandMap
11987
12160
  });
11988
12161
  set$2(rpc);
11989
- await Promise.all([initializeChatNetworkWorker(), initializeChatMathWorker(), initializeChatCoordinatorWorker(), initializeChatToolWorker(), initializeOpenerWorker()]);
12162
+ await Promise.all([initializeChatNetworkWorker(), initializeChatMathWorker(), initializeChatCoordinatorWorker(), initializeChatToolWorker(), initializeOpenerWorker(), initializeChatStorageWorker()]);
11990
12163
  };
11991
12164
 
11992
12165
  const main = async () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lvce-editor/chat-view",
3
- "version": "6.16.0",
3
+ "version": "6.17.0",
4
4
  "description": "Chat View Worker",
5
5
  "repository": {
6
6
  "type": "git",