Skip to content

Commit e760265

Browse files
committed
feat: add new models selector
1 parent a3ddaf6 commit e760265

File tree

21 files changed

+1617
-22
lines changed

21 files changed

+1617
-22
lines changed

scripts/publish.ts

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,17 @@ const publish = async () => {
4343
{ cwd: root, stdio: 'inherit' }
4444
)
4545

46-
console.log('\nPublish to OVSE...\n')
47-
await execa(
48-
'npx',
49-
['ovsx', 'publish', '--no-dependencies', '-p', process.env.OVSX_TOKEN!],
50-
{ cwd: root, stdio: 'inherit' }
51-
)
46+
try {
47+
console.log('\nPublish to OVSE...\n')
48+
await execa(
49+
'npx',
50+
['ovsx', 'publish', ...publishFlags, '-p', process.env.OVSX_TOKEN!],
51+
{ cwd: root, stdio: 'inherit' }
52+
)
53+
} catch (error) {
54+
// Aide currently is too large can't be published to OVSE
55+
console.error('Failed to publish to OVSE', error)
56+
}
5257
} finally {
5358
await fs.writeFile(pkgPath, rawJSON, 'utf-8')
5459
}

src/extension/chat/strategies/chat-strategy/messages-constructors/conversation-message-constructor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export class ConversationMessageConstructor {
3535

3636
async buildMessages(): Promise<LangchainMessage[]> {
3737
if (this.conversation.role !== 'human') {
38+
if (!this.conversation.contents.length) return []
39+
3840
return [
3941
MessageBuilder.createMessage(
4042
this.conversation.role,

src/extension/chat/strategies/composer-strategy/messages-constructors/conversation-message-constructor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export class ConversationMessageConstructor {
3535

3636
async buildMessages(): Promise<LangchainMessage[]> {
3737
if (this.conversation.role !== 'human') {
38+
if (!this.conversation.contents.length) return []
39+
3840
return [
3941
MessageBuilder.createMessage(
4042
this.conversation.role,

src/extension/chat/strategies/no-prompt-strategy/messages-constructors/conversation-message-constructor.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export class ConversationMessageConstructor {
3535

3636
async buildMessages(): Promise<LangchainMessage[]> {
3737
if (this.conversation.role !== 'human') {
38+
if (!this.conversation.contents.length) return []
39+
3840
return [
3941
MessageBuilder.createMessage(
4042
this.conversation.role,

src/shared/localize/locales/en/webview.ts

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,24 @@ export default {
259259
setting: 'Setting',
260260
noModelsAvailable: 'No AI models available',
261261
addNewProvider: 'Add new provider',
262-
manageProviders: 'Manage providers'
262+
manageProviders: 'Manage providers',
263+
recentlyUsed: 'Recently Used',
264+
otherModels: 'Other Models',
265+
models: 'Models',
266+
providers: 'Providers',
267+
addProvider: 'Add Provider',
268+
popularModels: 'Popular Models',
269+
totalModels: 'Total Models',
270+
manage: 'Manage',
271+
noProvidersFound: 'No providers found',
272+
noModelsForProvider: 'No models available for this provider',
273+
noModelsFound: 'No models found',
274+
searchModelsOrProviders: 'Search models or providers...',
275+
defaultSettings: 'Default Settings',
276+
useDefaultSettings: 'Use default settings',
277+
currentDefaultModel: 'Current Default Model',
278+
defaultExplanation:
279+
'Default model is the model that will be used if no other model is selected'
263280
},
264281
cardList: {
265282
noItemsYet: 'No items yet',

src/shared/localize/locales/zh-cn/webview.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,23 @@ export default {
8989
setting: '设置',
9090
noModelsAvailable: '没有可用的 AI 模型',
9191
addNewProvider: '添加新提供商',
92-
manageProviders: '管理提供商'
92+
manageProviders: '管理提供商',
93+
recentlyUsed: '最近使用',
94+
otherModels: '其他模型',
95+
models: '模型',
96+
providers: '提供商',
97+
addProvider: '添加提供商',
98+
popularModels: '热门模型',
99+
totalModels: '总模型',
100+
manage: '管理',
101+
noProvidersFound: '没有找到提供商',
102+
noModelsForProvider: '没有找到模型',
103+
noModelsFound: '没有找到模型',
104+
searchModelsOrProviders: '搜索模型或提供商...',
105+
defaultSettings: '默认设置',
106+
useDefaultSettings: '使用默认设置',
107+
currentDefaultModel: '当前默认模型',
108+
defaultExplanation: '默认模型是当没有其他模型被选择时使用的模型'
93109
},
94110
webPreview: {
95111
presetNameRequired: '需要预设名称',

src/shared/plugins/mentions/fs-mention-plugin/fs-to-state.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,15 @@ import { FsMentionType, type FsMention } from './types'
77

88
export class FsToState extends BaseToState<FsMention> {
99
toMentionsState() {
10-
const isFileMentionExist = this.isMentionExit(FsMentionType.File)
11-
const isFolderMentionExist = this.isMentionExit(FsMentionType.Folder)
10+
// const isFileMentionExist = this.isMentionExit(FsMentionType.File)
11+
// const isFolderMentionExist = this.isMentionExit(FsMentionType.Folder)
1212
const isCodebaseMentionExist = this.isMentionExit(FsMentionType.Codebase)
13-
const isSelectedTreeMentionExist = this.isMentionExit(FsMentionType.Tree)
13+
// const isSelectedTreeMentionExist = this.isMentionExit(FsMentionType.Tree)
1414

15-
const enableReadFilesAgent =
16-
isFileMentionExist ||
17-
isFolderMentionExist ||
18-
isSelectedTreeMentionExist ||
19-
isCodebaseMentionExist
15+
const enableReadFilesAgent = isCodebaseMentionExist
16+
// isFileMentionExist ||
17+
// isFolderMentionExist
18+
// isSelectedTreeMentionExist
2019

2120
return {
2221
selectedFiles: this.getMentionDataByTypes([

src/webview/components/chat/messages/markdown/markdown.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
.message-markdown a {
2222
cursor: pointer;
23-
color: hsl(var(--primary));
23+
color: var(--color-primary);
2424
}
2525

2626
.message-markdown a:hover {
27-
color: hsl(var(--primary));
27+
color: var(--color-primary);
2828
text-decoration: underline;
2929
}
3030

@@ -55,8 +55,9 @@
5555
padding-inline: 0.4em;
5656
word-break: break-word;
5757
white-space: break-spaces;
58-
background: hsl(var(--primary));
59-
color: hsl(var(--primary-foreground));
58+
background: var(--color-primary);
59+
color: var(--color-primary-foreground);
60+
isolation: isolate;
6061
border-radius: 0.25em;
6162
font-size: 0.75rem;
6263
}

src/webview/components/chat/selectors/context-selector.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,13 @@ export const ContextSelector: React.FC<ContextSelectorProps> = ({
7070
}
7171
onOpenChange={isOpen => !isOpen && onFocusOnEditor?.()}
7272
renderTrigger={({ tooltip, title }) => (
73-
<ButtonWithTooltip tooltip={tooltip} variant="ghost" size="xs">
74-
{title}
73+
<ButtonWithTooltip
74+
tooltip={tooltip}
75+
variant="ghost"
76+
size="xs"
77+
className="max-w-[150px] overflow-hidden"
78+
>
79+
<div className="truncate">{title}</div>
7580
</ButtonWithTooltip>
7681
)}
7782
/>

0 commit comments

Comments
 (0)