Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions packages/ai-core/src/browser/file-variable-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { Path, URI } from '@theia/core';
import { nls, Path, URI } from '@theia/core';
import { OpenerService, codiconArray, open } from '@theia/core/lib/browser';
import { inject, injectable } from '@theia/core/shared/inversify';
import { FileService } from '@theia/filesystem/lib/browser/file-service';
Expand All @@ -36,12 +36,12 @@ export namespace FileVariableArgs {

export const FILE_VARIABLE: AIVariable = {
id: 'file-provider',
description: 'Resolves the contents of a file',
description: nls.localize('theia/ai/core/fileVariable/description', 'Resolves the contents of a file'),
name: 'file',
label: 'File',
label: nls.localizeByDefault('File'),
iconClasses: codiconArray('file'),
isContextVariable: true,
args: [{ name: FileVariableArgs.uri, description: 'The URI of the requested file.' }]
args: [{ name: FileVariableArgs.uri, description: nls.localize('theia/ai/core/fileVariable/uri/description', 'The URI of the requested file.') }]
};

@injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// *****************************************************************************

import { injectable, inject, postConstruct } from '@theia/core/shared/inversify';
import { Emitter, Event } from '@theia/core';
import { Emitter, Event, nls } from '@theia/core';
import { LanguageModelAlias, LanguageModelAliasRegistry } from '../common/language-model-alias';
import { PreferenceScope, PreferenceService } from '@theia/core/lib/common';
import { LANGUAGE_MODEL_ALIASES_PREFERENCE } from '../common/ai-core-preferences';
Expand All @@ -32,7 +32,7 @@ export class DefaultLanguageModelAliasRegistry implements LanguageModelAliasRegi
'openai/gpt-4.1',
'google/gemini-2.5-pro-exp-03-25'
],
description: 'Optimized for code understanding and generation tasks.'
description: nls.localize('theia/ai/core/defaultModelAliases/code/description', 'Optimized for code understanding and generation tasks.')
},
{
id: 'default/universal',
Expand All @@ -41,7 +41,7 @@ export class DefaultLanguageModelAliasRegistry implements LanguageModelAliasRegi
'anthropic/claude-3-7-sonnet-latest',
'google/gemini-2.5-pro-exp-03-25'
],
description: 'Well-balanced for both code and general language use.'
description: nls.localize('theia/ai/core/defaultModelAliases/universal/description', 'Well-balanced for both code and general language use.')
},
{
id: 'default/code-completion',
Expand All @@ -50,7 +50,7 @@ export class DefaultLanguageModelAliasRegistry implements LanguageModelAliasRegi
'anthropic/claude-3-7-sonnet-latest',
'google/gemini-2.5-pro-exp-03-25'
],
description: 'Best suited for code autocompletion scenarios.'
description: nls.localize('theia/ai/core/defaultModelAliases/code-completion/description', 'Best suited for code autocompletion scenarios.')
},
{
id: 'default/summarize',
Expand All @@ -59,7 +59,7 @@ export class DefaultLanguageModelAliasRegistry implements LanguageModelAliasRegi
'anthropic/claude-3-7-sonnet-latest',
'google/gemini-2.5-pro-exp-03-25'
],
description: 'Models prioritized for summarization and condensation of content.'
description: nls.localize('theia/ai/core/defaultModelAliases/summarize/description', 'Models prioritized for summarization and condensation of content.')
}
];
protected readonly onDidChangeEmitter = new Emitter<void>();
Expand Down Expand Up @@ -163,4 +163,3 @@ export class DefaultLanguageModelAliasRegistry implements LanguageModelAliasRegi
this.preferenceService.set(LANGUAGE_MODEL_ALIASES_PREFERENCE, map, PreferenceScope.User);
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { DisposableCollection, URI, Event, Emitter } from '@theia/core';
import { DisposableCollection, URI, Event, Emitter, nls } from '@theia/core';
import { OpenerService } from '@theia/core/lib/browser';
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
import { PromptFragmentCustomizationService, CustomAgentDescription, CustomizedPromptFragment } from '../common';
Expand All @@ -32,7 +32,7 @@ import { PROMPT_TEMPLATE_EXTENSION } from './prompttemplate-contribution';
const newCustomAgentEntry = {
id: 'my_agent',
name: 'My Agent',
description: 'This is an example agent. Please adapt the properties to fit your needs.',
description: nls.localize('theia/ai/core/customAgentTemplate/description', 'This is an example agent. Please adapt the properties to fit your needs.'),
prompt: `{{!-- Note: The context section below will resolve all context elements (e.g. files) to their full content
in the system prompt. Context elements can be added by the user in the default chat view (e.g. via DnD or the "+" button).
If you want a more fine-grained, on demand resolvement of context elements, you can also resolve files to their paths only
Expand Down
8 changes: 4 additions & 4 deletions packages/ai-core/src/browser/frontend-variable-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

import { Disposable, MessageService, Prioritizeable } from '@theia/core';
import { Disposable, MessageService, nls, Prioritizeable } from '@theia/core';
import { FrontendApplicationContribution, OpenerService, open } from '@theia/core/lib/browser';
import { inject, injectable } from '@theia/core/shared/inversify';
import {
Expand Down Expand Up @@ -192,22 +192,22 @@ export class DefaultFrontendVariableService extends DefaultAIVariableService imp
const { variableName, arg } = this.parseRequest(request);
const variable = this.getVariable(variableName);
if (!variable) {
this.messageService.warn('No variable found for open request.');
this.messageService.warn(nls.localize('theia/ai/core/noVariableFoundForOpenRequest', 'No variable found for open request.'));
return;
}
const opener = await this.getOpener(variableName, arg, context);
try {
return opener ? opener.open({ variable, arg }, context ?? {}) : this.openReadonly({ variable, arg }, context);
} catch (err) {
console.error('Unable to open variable:', err);
this.messageService.error('Unable to display variable value.');
this.messageService.error(nls.localize('theia/ai/core/unableToDisplayVariableValue', 'Unable to display variable value.'));
}
}

protected async openReadonly(request: AIVariableResolutionRequest, context: AIVariableContext = {}): Promise<void> {
const resolved = await this.resolveVariable(request, context);
if (resolved === undefined) {
this.messageService.warn('Unable to resolve variable.');
this.messageService.warn(nls.localize('theia/ai/core/unableToResolveVariable', 'Unable to resolve variable.'));
return;
}
const resource = this.aiResourceResolver.getOrCreate(request, context, resolved.value);
Expand Down
8 changes: 4 additions & 4 deletions packages/ai-core/src/browser/window-blink-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// *****************************************************************************

import { injectable } from '@theia/core/shared/inversify';
import { environment } from '@theia/core';
import { environment, nls } from '@theia/core';

/**
* Result of a window blink attempt
Expand Down Expand Up @@ -96,9 +96,9 @@ export class WindowBlinkService {

private async blinkDocumentTitle(agentName?: string): Promise<void> {
const originalTitle = document.title;
const alertTitle = agentName
? `🔔 Theia - Agent "${agentName}" Completed`
: '🔔 Theia - Agent Completed';
const alertTitle = '🔔 ' + (agentName
? nls.localize('theia/ai/core/blinkTitle/namedAgentCompleted', 'Theia - Agent "{0}" Completed', agentName)
: nls.localize('theia/ai/core/blinkTitle/agentCompleted', 'Theia - Agent Completed'));

let blinkCount = 0;
const maxBlinks = 6;
Expand Down
26 changes: 15 additions & 11 deletions packages/ai-core/src/common/ai-core-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
} from './notification-types';
import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema';

export const AI_CORE_PREFERENCES_TITLE = nls.localize('theia/ai/core/prefs/title', 'AI Features [Beta]');
export const AI_CORE_PREFERENCES_TITLE = '✨ ' + nls.localize('theia/ai/core/prefs/title', 'AI Features [Beta]');
export const PREFERENCE_NAME_PROMPT_TEMPLATES = 'ai-features.promptTemplates.promptTemplatesFolder';
export const PREFERENCE_NAME_REQUEST_SETTINGS = 'ai-features.modelSettings.requestSettings';
export const PREFERENCE_NAME_MAX_RETRIES = 'ai-features.modelSettings.maxRetries';
Expand All @@ -44,7 +44,7 @@ export const aiCorePreferenceSchema: PreferenceSchema = {
typeDetails: {
isFilepath: true,
selectionProps: {
openLabel: 'Select Folder',
openLabel: nls.localize('theia/ai/core/promptTemplates/openLabel', 'Select Folder'),
canSelectFiles: false,
canSelectFolders: true,
canSelectMany: false
Expand Down Expand Up @@ -74,37 +74,41 @@ export const aiCorePreferenceSchema: PreferenceSchema = {
properties: {
modelId: {
type: 'string',
description: 'The (optional) model id'
description: nls.localize('theia/ai/core/requestSettings/scope/modelId/description', 'The (optional) model id')
},
providerId: {
type: 'string',
description: 'The (optional) provider id to apply the settings to.',
}, agentId: {
description: nls.localize('theia/ai/core/requestSettings/scope/providerId/description', 'The (optional) provider id to apply the settings to.'),
},
agentId: {
type: 'string',
description: 'The (optional) agent id to apply the settings to.',
description: nls.localize('theia/ai/core/requestSettings/scope/agentId/description', 'The (optional) agent id to apply the settings to.'),
},
}
},
requestSettings: {
type: 'object',
additionalProperties: true,
description: 'Settings for the specific model ID.',
description: nls.localize('theia/ai/core/requestSettings/modelSpecificSettings/description', 'Settings for the specific model ID.'),
},
clientSettings: {
type: 'object',
additionalProperties: false,
description: 'Client settings for how to handle messages that are send back to the llm.',
description: nls.localize('theia/ai/core/requestSettings/clientSettings/description',
'Client settings for how to handle messages that are send back to the llm.'),
properties: {
keepToolCalls: {
type: 'boolean',
default: true,
description: 'If set to false, all tool request and tool responses will be filtered \
before sending the next user request in a multi-turn conversation.'
description: nls.localize('theia/ai/core/requestSettings/clientSettings/keepToolCalls/description',
'If set to false, all tool request and tool responses will be filtered \
before sending the next user request in a multi-turn conversation.')
},
keepThinking: {
type: 'boolean',
default: true,
description: 'If set to false, all thinking output will be filtered before sending the next user request in a multi-turn conversation.'
description: nls.localize('theia/ai/core/requestSettings/clientSettings/keepThinking/description',
'If set to false, all thinking output will be filtered before sending the next user request in a multi-turn conversation.')
}
}
},
Expand Down
Loading