Skip to content

Commit

Permalink
Label AI as alpha
Browse files Browse the repository at this point in the history
fixed #14967
  • Loading branch information
JonasHelming committed Feb 19, 2025
1 parent 32ff943 commit 6ece8c7
Show file tree
Hide file tree
Showing 10 changed files with 67 additions and 46 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,38 +153,42 @@ export class ChatViewTreeWidget extends TreeWidget {
<div className='theia-ResponseNode-Content' key={'disabled-message'}>
<div className="disable-message">
<span className="section-header">{
nls.localize('theia/ai/chat-ui/chat-view-tree-widget/experimentalFeatureHeader', '🚀 Experimental AI Feature Available!')}
nls.localize('theia/ai/chat-ui/chat-view-tree-widget/aiFeatureHeader', '🚀 AI Features Available (in alpha)!')}
</span>
<div className="section-title">
<p><code>{nls.localize('theia/ai/chat-ui/chat-view-tree-widget/featuresDisabled', 'Currently, all AI Features are disabled!')}</code></p>
</div>
<div className="section-title">
<p>{nls.localize('theia/ai/chat-ui/chat-view-tree-widget/howToEnable', 'How to Enable Experimental AI Features:')}</p>
<p>{nls.localize('theia/ai/chat-ui/chat-view-tree-widget/howToEnable', 'How to Enable the AI Features:')}</p>
</div>
<div className="section-content">
<p>To enable the experimental AI features, please go to &nbsp;
<p>To enable the AI features, please go to &nbsp;
{this.renderLinkButton(nls.localize('theia/ai/chat-ui/chat-view-tree-widget/settingsMenu', 'the settings menu'), CommonCommands.OPEN_PREFERENCES.id)}
&nbsp;and locate the <strong>AI Features</strong> section.</p>
<ol>
<li>Toggle the switch for <strong>{nls.localize('theia/ai/chat-ui/chat-view-tree-widget/aiFeaturesEnable', 'Ai-features: Enable')}</strong>.</li>
<li>Provide at least one LLM provider (e.g. OpenAI), also see <a href="https://theia-ide.org/docs/user_ai/" target="_blank">the documentation</a>
for more information.</li>
</ol>
<p>This will activate the new AI capabilities in the app. Please remember, these features are still in development, so they may change or be unstable. 🚧</p>
<p>This will activate the AI capabilities in the app. Please remember, these features are <strong>in alpha</strong>,
so they may change and we are working on improving them 🚧.<br></br>
Please support us by <a href="https://github.com/eclipse-theia/theia">providing feedback
</a>!</p>
</div>

<div className="section-title">
<p>Currently Supported Views and Features:</p>
</div>
<div className="section-content">
<p>Once the experimental AI features are enabled, you can access the following views and features:</p>
<p>Once the AI features are enabled, you can access the following views and features:</p>
<ul>
<li>Code Completion</li>
<li>Terminal Assistance (via CTRL+I in a terminal)</li>
<li>This Chat View (features the following agents):
<ul>
<li>Universal Chat Agent</li>
<li>Workspace Chat Agent</li>
<li>Coder Chat Agent</li>
<li>Architect Chat Agent</li>
<li>Command Chat Agent</li>
<li>Orchestrator Chat Agent</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-chat-ui/src/browser/chat-view-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export namespace ChatViewWidget {
export class ChatViewWidget extends BaseWidget implements ExtractableWidget, StatefulWidget {

public static ID = 'chat-view-widget';
static LABEL = `✨ ${nls.localizeByDefault('Chat')} [Experimental]`;
static LABEL = `✨ ${nls.localizeByDefault('Chat')} [Alpha]`;

@inject(ChatService)
protected chatService: ChatService;
Expand Down
22 changes: 11 additions & 11 deletions packages/ai-core/src/browser/ai-activation-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import { inject, injectable } from '@theia/core/shared/inversify';
import { FrontendApplicationContribution, PreferenceService } from '@theia/core/lib/browser';
import { Emitter, MaybePromise, Event, } from '@theia/core';
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
import { PREFERENCE_NAME_ENABLE_EXPERIMENTAL } from './ai-core-preferences';
import { PREFERENCE_NAME_ENABLE_AI } from './ai-core-preferences';

/**
* Context key for the experimental AI feature. It is set to `true` if the feature is enabled.
* Context key for the AI features. It is set to `true` if the feature is enabled.
*/
// We reuse the enablement preference for the context key
export const EXPERIMENTAL_AI_CONTEXT_KEY = PREFERENCE_NAME_ENABLE_EXPERIMENTAL;
export const ENABLE_AI_CONTEXT_KEY = PREFERENCE_NAME_ENABLE_AI;

@injectable()
export class AIActivationService implements FrontendApplicationContribution {
Expand All @@ -33,23 +33,23 @@ export class AIActivationService implements FrontendApplicationContribution {
@inject(PreferenceService)
protected preferenceService: PreferenceService;

protected isExperimentalEnabledKey: ContextKey<boolean>;
protected isAIEnabledKey: ContextKey<boolean>;

protected onDidChangeExperimental = new Emitter<boolean>();
protected onDidChangeAIEnabled = new Emitter<boolean>();
get onDidChangeActiveStatus(): Event<boolean> {
return this.onDidChangeExperimental.event;
return this.onDidChangeAIEnabled.event;
}

get isActive(): boolean {
return this.isExperimentalEnabledKey.get() ?? false;
return this.isAIEnabledKey.get() ?? false;
}

initialize(): MaybePromise<void> {
this.isExperimentalEnabledKey = this.contextKeyService.createKey(EXPERIMENTAL_AI_CONTEXT_KEY, false);
this.isAIEnabledKey = this.contextKeyService.createKey(ENABLE_AI_CONTEXT_KEY, false);
this.preferenceService.onPreferenceChanged(e => {
if (e.preferenceName === PREFERENCE_NAME_ENABLE_EXPERIMENTAL) {
this.isExperimentalEnabledKey.set(e.newValue);
this.onDidChangeExperimental.fire(e.newValue);
if (e.preferenceName === PREFERENCE_NAME_ENABLE_AI) {
this.isAIEnabledKey.set(e.newValue);
this.onDidChangeAIEnabled.fire(e.newValue);
}
});
}
Expand Down
16 changes: 8 additions & 8 deletions packages/ai-core/src/browser/ai-core-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,21 @@ import { PreferenceContribution, PreferenceProxy, PreferenceSchema } from '@thei
import { PreferenceProxyFactory } from '@theia/core/lib/browser/preferences/injectable-preference-proxy';
import { interfaces } from '@theia/core/shared/inversify';

export const AI_CORE_PREFERENCES_TITLE = nls.localize('theia/ai/core/prefs/title', '✨ AI Features [Experimental]');
export const PREFERENCE_NAME_ENABLE_EXPERIMENTAL = 'ai-features.AiEnable.enableAI';
export const AI_CORE_PREFERENCES_TITLE = nls.localize('theia/ai/core/prefs/title', '✨ AI Features [Alpha]');
export const PREFERENCE_NAME_ENABLE_AI = 'ai-features.AiEnable.enableAI';
export const PREFERENCE_NAME_PROMPT_TEMPLATES = 'ai-features.promptTemplates.promptTemplatesFolder';
export const PREFERENCE_NAME_REQUEST_SETTINGS = 'ai-features.modelSettings.requestSettings';

export const aiCorePreferenceSchema: PreferenceSchema = {
type: 'object',
properties: {
[PREFERENCE_NAME_ENABLE_EXPERIMENTAL]: {
[PREFERENCE_NAME_ENABLE_AI]: {
title: AI_CORE_PREFERENCES_TITLE,
markdownDescription: nls.localize('theia/ai/core/enableExperimental/mdDescription',
'❗ This setting allows you to access and experiment with the latest AI capabilities.\
markdownDescription: nls.localize('theia/ai/core/enableAI/mdDescription',
'❗ This setting allows you to access the latest AI capabilities (in alpha).\
\n\
Please note that these features are in an experimental phase, which means they may be unstable and\
undergo significant changes. It is important to be aware that these experimental features may generate\
Please note that these features are in an alpha phase, which means they may \
undergo changes and will be further improved. It is important to be aware that these features may generate\
continuous requests to the language models (LLMs) you provide access to. This might incur costs that you\
need to monitor closely. By enabling this option, you acknowledge these risks.\
\n\
Expand Down Expand Up @@ -91,7 +91,7 @@ export const aiCorePreferenceSchema: PreferenceSchema = {
}
};
export interface AICoreConfiguration {
[PREFERENCE_NAME_ENABLE_EXPERIMENTAL]: boolean | undefined;
[PREFERENCE_NAME_ENABLE_AI]: boolean | undefined;
[PREFERENCE_NAME_PROMPT_TEMPLATES]: string | undefined;
[PREFERENCE_NAME_REQUEST_SETTINGS]: Array<{
modelId: string;
Expand Down
8 changes: 4 additions & 4 deletions packages/ai-core/src/browser/ai-view-contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import { CommandRegistry, MenuModelRegistry } from '@theia/core';
import { AbstractViewContribution, CommonMenus, KeybindingRegistry, PreferenceService, Widget } from '@theia/core/lib/browser';
import { inject, injectable, postConstruct } from '@theia/core/shared/inversify';
import { AIActivationService, EXPERIMENTAL_AI_CONTEXT_KEY } from './ai-activation-service';
import { AIActivationService, ENABLE_AI_CONTEXT_KEY } from './ai-activation-service';
import { AICommandHandlerFactory } from './ai-command-handler-factory';

@injectable()
Expand Down Expand Up @@ -49,7 +49,7 @@ export class AIViewContribution<T extends Widget> extends AbstractViewContributi
}
this.quickView?.registerItem({
label: this.viewLabel,
when: EXPERIMENTAL_AI_CONTEXT_KEY,
when: ENABLE_AI_CONTEXT_KEY,
open: () => this.openView({ activate: true })
});

Expand All @@ -59,7 +59,7 @@ export class AIViewContribution<T extends Widget> extends AbstractViewContributi
if (this.toggleCommand) {
menus.registerMenuAction(CommonMenus.VIEW_VIEWS, {
commandId: this.toggleCommand.id,
when: EXPERIMENTAL_AI_CONTEXT_KEY,
when: ENABLE_AI_CONTEXT_KEY,
label: this.viewLabel
});
}
Expand All @@ -68,7 +68,7 @@ export class AIViewContribution<T extends Widget> extends AbstractViewContributi
if (this.toggleCommand && this.options.toggleKeybinding) {
keybindings.registerKeybinding({
command: this.toggleCommand.id,
when: EXPERIMENTAL_AI_CONTEXT_KEY,
when: ENABLE_AI_CONTEXT_KEY,
keybinding: this.options.toggleKeybinding
});
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-history/src/browser/ai-history-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class AIHistoryView extends ReactWidget implements StatefulWidget {
protected readonly agentService: AgentService;

public static ID = 'ai-history-widget';
static LABEL = nls.localize('theia/ai/history/view/label', '✨ AI Agent History [Experimental]');
static LABEL = nls.localize('theia/ai/history/view/label', '✨ AI Agent History [Alpha]');

protected selectedAgent?: Agent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { nls } from '@theia/core';
export class AIConfigurationContainerWidget extends BaseWidget {

static readonly ID = 'ai-configuration';
static readonly LABEL = nls.localize('theia/ai/core/aiConfiguration/label', '✨ AI Configuration [Experimental]');
static readonly LABEL = nls.localize('theia/ai/core/aiConfiguration/label', '✨ AI Configuration [Alpha]');
protected dockpanel: DockPanel;

@inject(TheiaDockPanel.Factory)
Expand Down
6 changes: 3 additions & 3 deletions packages/ai-terminal/src/browser/ai-terminal-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 { EXPERIMENTAL_AI_CONTEXT_KEY } from '@theia/ai-core/lib/browser';
import { ENABLE_AI_CONTEXT_KEY } from '@theia/ai-core/lib/browser';
import { Command, CommandContribution, CommandRegistry, MenuContribution, MenuModelRegistry } from '@theia/core';
import { KeybindingContribution, KeybindingRegistry } from '@theia/core/lib/browser';
import { inject, injectable } from '@theia/core/shared/inversify';
Expand Down Expand Up @@ -50,12 +50,12 @@ export class AiTerminalCommandContribution implements CommandContribution, MenuC
keybindings.registerKeybinding({
command: AI_TERMINAL_COMMAND.id,
keybinding: 'ctrlcmd+i',
when: `terminalFocus && ${EXPERIMENTAL_AI_CONTEXT_KEY}`
when: `terminalFocus && ${ENABLE_AI_CONTEXT_KEY}`
});
}
registerMenus(menus: MenuModelRegistry): void {
menus.registerMenuAction([...TerminalMenus.TERMINAL_CONTEXT_MENU, '_5'], {
when: EXPERIMENTAL_AI_CONTEXT_KEY,
when: ENABLE_AI_CONTEXT_KEY,
commandId: AI_TERMINAL_COMMAND.id
});
}
Expand Down
26 changes: 18 additions & 8 deletions packages/getting-started/src/browser/getting-started-widget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ export class GettingStartedWidget extends ReactWidget {
protected readonly compatibilityUrl = 'https://eclipse-theia.github.io/vscode-theia-comparator/status.html';
protected readonly extensionUrl = 'https://www.theia-ide.org/docs/authoring_extensions';
protected readonly pluginUrl = 'https://www.theia-ide.org/docs/authoring_plugins';
protected readonly theiaAIDocUrl = 'https://theia-ide.org/docs/user_ai/';
protected readonly userAIDocUrl = 'https://theia-ide.org/docs/user_ai/';
protected readonly theiaAIDocUrl = 'https://theia-ide.org/docs/theia_ai/';
protected readonly ghProjectUrl = 'https://github.com/eclipse-theia/theia/issues/new/choose';

@inject(ApplicationServer)
Expand Down Expand Up @@ -403,30 +404,30 @@ export class GettingStartedWidget extends ReactWidget {
}

protected renderAIBanner(): React.ReactNode {
return <div className='gs-container gs-experimental-container'>
return <div className='gs-container gs-aifeature-container'>
<div className='flex-grid'>
<div className='col'>
<h3 className='gs-section-header'> 🚀 AI Support in the Theia IDE is available! [Experimental]</h3>
<h3 className='gs-section-header'> 🚀 AI Support in the Theia IDE is available (in alpha)!</h3>
<br />
<div className='gs-action-container'>
Theia IDE now contains experimental AI support, which offers early access to cutting-edge AI capabilities within your IDE.
Theia IDE now contains AI support, which offers early access to cutting-edge AI capabilities within your IDE.
<br />
<br />
Please note that these features are disabled by default, ensuring that users can opt-in at their discretion.
For those who choose to enable AI support, it is important to be aware that these experimental features may generate continuous
For those who choose to enable AI support, it is important to be aware that these may generate continuous
requests to the language models (LLMs) you provide access to. This might incur costs that you need to monitor closely.
<br />
For more details, please visit &nbsp;
<a
role={'button'}
tabIndex={0}
onClick={() => this.doOpenExternalLink(this.theiaAIDocUrl)}
onKeyDown={(e: React.KeyboardEvent) => this.doOpenExternalLinkEnter(e, this.theiaAIDocUrl)}>
onClick={() => this.doOpenExternalLink(this.userAIDocUrl)}
onKeyDown={(e: React.KeyboardEvent) => this.doOpenExternalLinkEnter(e, this.userAIDocUrl)}>
{'the documentation'}
</a>.
<br />
<br />
🚧 Please note that this feature is currently in development and may undergo frequent changes.
🚧 Please note that this feature is currently in alpha and may undergo frequent changes.
We welcome your feedback, contributions, and sponsorship! To support the ongoing development of the AI capabilities please visit the&nbsp;
<a
role={'button'}
Expand All @@ -436,6 +437,15 @@ export class GettingStartedWidget extends ReactWidget {
{'Github Project'}
</a>.
&nbsp;Thank you for being part of our community!
<br />
The AI features are built on the framework Theia AI. If you want to build a custom AI-powered tool or IDE, Theia AI has been published as stable release.
Check out <a
role={'button'}
tabIndex={0}
onClick={() => this.doOpenExternalLink(this.theiaAIDocUrl)}
onKeyDown={(e: React.KeyboardEvent) => this.doOpenExternalLinkEnter(e, this.theiaAIDocUrl)}>
{'the Theia AI documentation'}
</a>!
</div>
<br />
<div className='gs-action-container'>
Expand Down
13 changes: 10 additions & 3 deletions packages/getting-started/src/browser/style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ body {
margin-top: 100px;
}

.gs-container.gs-experimental-container {
.gs-container.gs-aifeature-container {
border: 1px solid var(--theia-focusBorder);
padding: 15px;
}
Expand All @@ -124,6 +124,13 @@ body {
}

@keyframes shadowPulse {
0%, 100% { box-shadow: 0 0 0 rgba(0, 0, 0, 0); }
50% { box-shadow: 0 0 15px rgba(0, 0, 0, 0.4); }

0%,
100% {
box-shadow: 0 0 0 rgba(0, 0, 0, 0);
}

50% {
box-shadow: 0 0 15px rgba(0, 0, 0, 0.4);
}
}

0 comments on commit 6ece8c7

Please sign in to comment.