@theia/ai-ide 1.71.0-next.8 → 1.71.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.
- package/lib/browser/agent-mode-confirmation-service.d.ts.map +1 -1
- package/lib/browser/agent-mode-confirmation-service.js +15 -15
- package/lib/browser/agent-mode-confirmation-service.js.map +1 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +2 -2
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +1 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +1 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +2 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.js +2 -1
- package/lib/browser/ai-configuration/skills-configuration-widget.js.map +1 -1
- package/lib/browser/ai-ide-activation-service.d.ts +10 -1
- package/lib/browser/ai-ide-activation-service.d.ts.map +1 -1
- package/lib/browser/ai-ide-activation-service.js +41 -1
- package/lib/browser/ai-ide-activation-service.js.map +1 -1
- package/lib/browser/ai-workspace-restriction-contribution.d.ts +7 -0
- package/lib/browser/ai-workspace-restriction-contribution.d.ts.map +1 -0
- package/lib/browser/ai-workspace-restriction-contribution.js +42 -0
- package/lib/browser/ai-workspace-restriction-contribution.js.map +1 -0
- package/lib/browser/app-tester-prompt-template.js +1 -1
- package/lib/browser/architect-agent.d.ts +1 -0
- package/lib/browser/architect-agent.d.ts.map +1 -1
- package/lib/browser/architect-agent.js +5 -3
- package/lib/browser/architect-agent.js.map +1 -1
- package/lib/browser/architect-prompt-template.js +3 -3
- package/lib/browser/chat-session-card-action-contribution.js +1 -1
- package/lib/browser/chat-session-card-action-contribution.js.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.d.ts +1 -0
- package/lib/browser/chat-sessions-welcome-message-provider.d.ts.map +1 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js +7 -1
- package/lib/browser/chat-sessions-welcome-message-provider.js.map +1 -1
- package/lib/browser/code-reviewer-agent.d.ts +1 -0
- package/lib/browser/code-reviewer-agent.d.ts.map +1 -1
- package/lib/browser/code-reviewer-agent.js +1 -0
- package/lib/browser/code-reviewer-agent.js.map +1 -1
- package/lib/browser/coder-agent.d.ts +4 -0
- package/lib/browser/coder-agent.d.ts.map +1 -1
- package/lib/browser/coder-agent.js +28 -4
- package/lib/browser/coder-agent.js.map +1 -1
- package/lib/browser/create-skill-agent.d.ts +1 -0
- package/lib/browser/create-skill-agent.d.ts.map +1 -1
- package/lib/browser/create-skill-agent.js +1 -0
- package/lib/browser/create-skill-agent.js.map +1 -1
- package/lib/browser/explore-agent.d.ts +1 -0
- package/lib/browser/explore-agent.d.ts.map +1 -1
- package/lib/browser/explore-agent.js +1 -0
- package/lib/browser/explore-agent.js.map +1 -1
- package/lib/browser/file-changeset-functions.d.ts.map +1 -1
- package/lib/browser/file-changeset-functions.js +17 -9
- package/lib/browser/file-changeset-functions.js.map +1 -1
- package/lib/browser/frontend-module.d.ts.map +1 -1
- package/lib/browser/frontend-module.js +12 -10
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/github-capability-contribution.js +1 -1
- package/lib/browser/github-capability-contribution.js.map +1 -1
- package/lib/browser/github-prompt-template.js +1 -1
- package/lib/browser/ide-chat-welcome-message-provider.d.ts +4 -0
- package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -1
- package/lib/browser/ide-chat-welcome-message-provider.js +34 -0
- package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -1
- package/lib/browser/project-info-agent.d.ts +1 -0
- package/lib/browser/project-info-agent.d.ts.map +1 -1
- package/lib/browser/project-info-agent.js +1 -0
- package/lib/browser/project-info-agent.js.map +1 -1
- package/lib/browser/{junior-agent.d.ts → review/pr-review-agent.d.ts} +7 -5
- package/lib/browser/review/pr-review-agent.d.ts.map +1 -0
- package/lib/browser/{junior-agent.js → review/pr-review-agent.js} +17 -15
- package/lib/browser/review/pr-review-agent.js.map +1 -0
- package/lib/browser/review/pr-review-prompt-template.d.ts +4 -0
- package/lib/browser/review/pr-review-prompt-template.d.ts.map +1 -0
- package/lib/browser/review/pr-review-prompt-template.js +437 -0
- package/lib/browser/review/pr-review-prompt-template.js.map +1 -0
- package/lib/browser/template-preference-contribution.d.ts +2 -0
- package/lib/browser/template-preference-contribution.d.ts.map +1 -1
- package/lib/browser/template-preference-contribution.js +43 -14
- package/lib/browser/template-preference-contribution.js.map +1 -1
- package/lib/browser/todo-tool-renderer.d.ts +1 -1
- package/lib/browser/todo-tool-renderer.d.ts.map +1 -1
- package/lib/browser/todo-tool-renderer.js +1 -1
- package/lib/browser/todo-tool-renderer.js.map +1 -1
- package/lib/browser/todo-tool.d.ts +0 -1
- package/lib/browser/todo-tool.d.ts.map +1 -1
- package/lib/browser/todo-tool.js +36 -16
- package/lib/browser/todo-tool.js.map +1 -1
- package/lib/browser/todo-tool.spec.d.ts +2 -0
- package/lib/browser/todo-tool.spec.d.ts.map +1 -0
- package/lib/browser/todo-tool.spec.js +44 -0
- package/lib/browser/todo-tool.spec.js.map +1 -0
- package/lib/browser/user-interaction-tool-renderer.d.ts +18 -0
- package/lib/browser/user-interaction-tool-renderer.d.ts.map +1 -0
- package/lib/browser/user-interaction-tool-renderer.js +330 -0
- package/lib/browser/user-interaction-tool-renderer.js.map +1 -0
- package/lib/browser/user-interaction-tool.d.ts +47 -0
- package/lib/browser/user-interaction-tool.d.ts.map +1 -0
- package/lib/browser/user-interaction-tool.js +397 -0
- package/lib/browser/user-interaction-tool.js.map +1 -0
- package/lib/browser/user-interaction-tool.spec.d.ts +2 -0
- package/lib/browser/user-interaction-tool.spec.d.ts.map +1 -0
- package/lib/browser/user-interaction-tool.spec.js +336 -0
- package/lib/browser/user-interaction-tool.spec.js.map +1 -0
- package/lib/browser/workspace-functions.d.ts.map +1 -1
- package/lib/browser/workspace-functions.js +9 -2
- package/lib/browser/workspace-functions.js.map +1 -1
- package/lib/browser/workspace-launch-provider.d.ts.map +1 -1
- package/lib/browser/workspace-launch-provider.js +9 -4
- package/lib/browser/workspace-launch-provider.js.map +1 -1
- package/lib/browser/workspace-launch-provider.spec.js +4 -4
- package/lib/browser/workspace-launch-provider.spec.js.map +1 -1
- package/lib/browser/workspace-task-provider.d.ts.map +1 -1
- package/lib/browser/workspace-task-provider.js +4 -1
- package/lib/browser/workspace-task-provider.js.map +1 -1
- package/lib/browser/workspace-task-provider.spec.js +90 -1
- package/lib/browser/workspace-task-provider.spec.js.map +1 -1
- package/lib/common/ai-ide-preferences.d.ts +1 -1
- package/lib/common/ai-ide-preferences.d.ts.map +1 -1
- package/lib/common/ai-ide-preferences.js +6 -6
- package/lib/common/ai-ide-preferences.js.map +1 -1
- package/lib/common/coder-replace-prompt-template.d.ts.map +1 -1
- package/lib/common/coder-replace-prompt-template.js +133 -17
- package/lib/common/coder-replace-prompt-template.js.map +1 -1
- package/lib/common/command-chat-agents.d.ts +1 -0
- package/lib/common/command-chat-agents.d.ts.map +1 -1
- package/lib/common/command-chat-agents.js +1 -0
- package/lib/common/command-chat-agents.js.map +1 -1
- package/lib/common/command-prompt-template.js +1 -1
- package/lib/common/orchestrator-chat-agent.d.ts.map +1 -1
- package/lib/common/orchestrator-chat-agent.js +2 -2
- package/lib/common/orchestrator-chat-agent.js.map +1 -1
- package/lib/common/universal-chat-agent.d.ts +1 -0
- package/lib/common/universal-chat-agent.d.ts.map +1 -1
- package/lib/common/universal-chat-agent.js +1 -0
- package/lib/common/universal-chat-agent.js.map +1 -1
- package/lib/common/universal-prompt-template.js +1 -1
- package/lib/common/user-interaction-tool.d.ts +53 -0
- package/lib/common/user-interaction-tool.d.ts.map +1 -0
- package/lib/common/user-interaction-tool.js +176 -0
- package/lib/common/user-interaction-tool.js.map +1 -0
- package/lib/common/user-interaction-tool.spec.d.ts +2 -0
- package/lib/common/user-interaction-tool.spec.d.ts.map +1 -0
- package/lib/common/user-interaction-tool.spec.js +216 -0
- package/lib/common/user-interaction-tool.spec.js.map +1 -0
- package/package.json +27 -27
- package/src/browser/agent-mode-confirmation-service.ts +19 -18
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +2 -2
- package/src/browser/ai-configuration/ai-configuration-view-contribution.ts +1 -1
- package/src/browser/ai-configuration/prompt-fragments-configuration-widget.tsx +2 -1
- package/src/browser/ai-configuration/skills-configuration-widget.tsx +2 -1
- package/src/browser/ai-ide-activation-service.ts +43 -3
- package/src/browser/ai-workspace-restriction-contribution.ts +39 -0
- package/src/browser/app-tester-prompt-template.ts +1 -1
- package/src/browser/architect-agent.ts +6 -3
- package/src/browser/architect-prompt-template.ts +3 -3
- package/src/browser/chat-session-card-action-contribution.ts +1 -1
- package/src/browser/chat-sessions-welcome-message-provider.tsx +11 -2
- package/src/browser/code-reviewer-agent.ts +1 -0
- package/src/browser/coder-agent.ts +31 -4
- package/src/browser/create-skill-agent.ts +1 -0
- package/src/browser/explore-agent.ts +1 -0
- package/src/browser/file-changeset-functions.ts +17 -8
- package/src/browser/frontend-module.ts +14 -12
- package/src/browser/github-capability-contribution.ts +1 -1
- package/src/browser/github-prompt-template.ts +1 -1
- package/src/browser/ide-chat-welcome-message-provider.tsx +53 -0
- package/src/browser/project-info-agent.ts +1 -1
- package/src/browser/{context-reviewer-agent.ts → review/pr-review-agent.ts} +13 -11
- package/src/browser/review/pr-review-prompt-template.ts +449 -0
- package/src/browser/style/index.css +299 -0
- package/src/browser/template-preference-contribution.ts +40 -14
- package/src/browser/todo-tool-renderer.tsx +1 -1
- package/src/browser/todo-tool.spec.ts +49 -0
- package/src/browser/todo-tool.ts +35 -14
- package/src/browser/user-interaction-tool-renderer.tsx +531 -0
- package/src/browser/user-interaction-tool.spec.ts +396 -0
- package/src/browser/user-interaction-tool.ts +423 -0
- package/src/browser/workspace-functions.ts +10 -3
- package/src/browser/workspace-launch-provider.spec.ts +4 -4
- package/src/browser/workspace-launch-provider.ts +10 -6
- package/src/browser/workspace-task-provider.spec.ts +119 -1
- package/src/browser/workspace-task-provider.ts +4 -1
- package/src/common/ai-ide-preferences.ts +7 -7
- package/src/common/coder-replace-prompt-template.ts +133 -17
- package/src/common/command-chat-agents.ts +1 -0
- package/src/common/command-prompt-template.ts +1 -1
- package/src/common/orchestrator-chat-agent.ts +2 -2
- package/src/common/universal-chat-agent.ts +1 -0
- package/src/common/universal-prompt-template.ts +1 -1
- package/src/common/user-interaction-tool.spec.ts +241 -0
- package/src/common/user-interaction-tool.ts +237 -0
- package/lib/browser/context-reviewer-agent.d.ts +0 -17
- package/lib/browser/context-reviewer-agent.d.ts.map +0 -1
- package/lib/browser/context-reviewer-agent.js +0 -45
- package/lib/browser/context-reviewer-agent.js.map +0 -1
- package/lib/browser/context-reviewer-prompt-template.d.ts +0 -4
- package/lib/browser/context-reviewer-prompt-template.d.ts.map +0 -1
- package/lib/browser/context-reviewer-prompt-template.js +0 -160
- package/lib/browser/context-reviewer-prompt-template.js.map +0 -1
- package/lib/browser/junior-agent.d.ts.map +0 -1
- package/lib/browser/junior-agent.js.map +0 -1
- package/lib/browser/junior-plan-capability-contribution.d.ts +0 -8
- package/lib/browser/junior-plan-capability-contribution.d.ts.map +0 -1
- package/lib/browser/junior-plan-capability-contribution.js +0 -131
- package/lib/browser/junior-plan-capability-contribution.js.map +0 -1
- package/lib/browser/junior-prompt-template.d.ts +0 -4
- package/lib/browser/junior-prompt-template.d.ts.map +0 -1
- package/lib/browser/junior-prompt-template.js +0 -149
- package/lib/browser/junior-prompt-template.js.map +0 -1
- package/src/browser/context-reviewer-prompt-template.ts +0 -160
- package/src/browser/junior-agent.ts +0 -40
- package/src/browser/junior-plan-capability-contribution.ts +0 -129
- package/src/browser/junior-prompt-template.ts +0 -149
|
@@ -43,7 +43,7 @@ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-
|
|
|
43
43
|
|
|
44
44
|
# Identity
|
|
45
45
|
|
|
46
|
-
You are an AI planning assistant embedded in
|
|
46
|
+
You are an AI planning assistant embedded in {{productName}}. Your purpose is to help developers \
|
|
47
47
|
design implementation plans for features, bug fixes, and refactoring tasks.
|
|
48
48
|
|
|
49
49
|
You create plans that will be executed by the ${CoderAgentId} agent. Your plans should be thorough \
|
|
@@ -201,7 +201,7 @@ Made improvements or adaptations to this prompt template? We'd love for you to s
|
|
|
201
201
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
202
202
|
# Instructions
|
|
203
203
|
|
|
204
|
-
You are an AI assistant integrated into
|
|
204
|
+
You are an AI assistant integrated into {{productName}}, designed to assist software developers. You can't change any files, but you can navigate and read the users workspace using \
|
|
205
205
|
the provided functions. Therefore describe and explain the details or procedures necessary to achieve the desired outcome. If file changes are necessary to help the user, be \
|
|
206
206
|
aware that there is another agent called '${CoderAgentId}' that can suggest file changes. In this case you can create a description on what to do and tell the user to ask '@${CoderAgentId}' to \
|
|
207
207
|
implement the change plan. If you refer to files, always mention the workspace-relative path.\
|
|
@@ -234,7 +234,7 @@ https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-
|
|
|
234
234
|
|
|
235
235
|
# Role
|
|
236
236
|
|
|
237
|
-
You are an **AI planning assistant** embedded in
|
|
237
|
+
You are an **AI planning assistant** embedded in {{productName}}. Your purpose is to help developers design implementation plans for features, bug fixes, and refactoring tasks.
|
|
238
238
|
|
|
239
239
|
You create plans that will be executed by the ${CoderAgentId} agent. Your plans must be thorough enough that the ${CoderAgentId} agent can implement without rediscovering files or patterns.
|
|
240
240
|
|
|
@@ -58,7 +58,7 @@ export class DefaultChatSessionCardActionContribution implements ChatSessionCard
|
|
|
58
58
|
{
|
|
59
59
|
commandId: ChatCommands.AI_CHAT_RENAME_SESSION.id,
|
|
60
60
|
iconClass: codicon('edit'),
|
|
61
|
-
tooltip: nls.
|
|
61
|
+
tooltip: nls.localizeByDefault('Rename Chat'),
|
|
62
62
|
priority: 0,
|
|
63
63
|
},
|
|
64
64
|
{
|
|
@@ -22,7 +22,7 @@ import { AI_CHAT_SHOW_CHATS_COMMAND } from '@theia/ai-chat-ui/lib/browser/chat-v
|
|
|
22
22
|
import { ChatSessionCardActionContribution } from './chat-session-card-action-contribution';
|
|
23
23
|
import { FrontendLanguageModelRegistry } from '@theia/ai-core/lib/common';
|
|
24
24
|
import { CommandRegistry, ContributionProvider, DisposableCollection, Emitter, Event, PreferenceService } from '@theia/core';
|
|
25
|
-
import { Card, CardActionButton, codicon, HoverService } from '@theia/core/lib/browser';
|
|
25
|
+
import { Card, CardActionButton, codicon, HoverService, buttonKeyboardProps, isActivationKey } from '@theia/core/lib/browser';
|
|
26
26
|
import { MarkdownRenderer, MarkdownRendererFactory } from '@theia/core/lib/browser/markdown-rendering/markdown-renderer';
|
|
27
27
|
import { nls } from '@theia/core/lib/common/nls';
|
|
28
28
|
import { inject, injectable, named, postConstruct } from '@theia/core/shared/inversify';
|
|
@@ -535,7 +535,9 @@ export class ChatSessionsWelcomeMessageProvider implements ChatWelcomeMessagePro
|
|
|
535
535
|
renderCard={this.renderSessionCard}
|
|
536
536
|
/>
|
|
537
537
|
<div className="theia-WelcomeMessage-BrowseAllLink">
|
|
538
|
-
<a
|
|
538
|
+
<a {...buttonKeyboardProps(nls.localize('theia/ai/ide/browseAllChats', 'Browse all chats...'))}
|
|
539
|
+
onClick={this.handleBrowseAllChats}
|
|
540
|
+
onKeyDown={this.handleBrowseAllChatsKeyDown}>
|
|
539
541
|
{nls.localize('theia/ai/ide/browseAllChats', 'Browse all chats...')}
|
|
540
542
|
</a>
|
|
541
543
|
</div>
|
|
@@ -581,4 +583,11 @@ export class ChatSessionsWelcomeMessageProvider implements ChatWelcomeMessagePro
|
|
|
581
583
|
protected handleBrowseAllChats = (): void => {
|
|
582
584
|
this.commandRegistry.executeCommand(AI_CHAT_SHOW_CHATS_COMMAND.id);
|
|
583
585
|
};
|
|
586
|
+
|
|
587
|
+
protected handleBrowseAllChatsKeyDown = (e: React.KeyboardEvent): void => {
|
|
588
|
+
if (isActivationKey(e)) {
|
|
589
|
+
e.preventDefault();
|
|
590
|
+
this.handleBrowseAllChats();
|
|
591
|
+
}
|
|
592
|
+
};
|
|
584
593
|
}
|
|
@@ -37,4 +37,5 @@ export class CodeReviewerAgent extends AbstractStreamParsingChatAgent {
|
|
|
37
37
|
|
|
38
38
|
override prompts = [{ id: CODE_REVIEWER_SYSTEM_PROMPT_ID, defaultVariant: codeReviewerSystemPrompt, variants: [] }];
|
|
39
39
|
protected override systemPromptId: string = CODE_REVIEWER_SYSTEM_PROMPT_ID;
|
|
40
|
+
override iconClass: string = 'codicon codicon-code-review';
|
|
40
41
|
}
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
} from '../common/coder-replace-prompt-template';
|
|
31
31
|
import { LanguageModelRequirement, PromptVariantSet } from '@theia/ai-core';
|
|
32
32
|
import { nls } from '@theia/core';
|
|
33
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
33
34
|
import { MarkdownStringImpl } from '@theia/core/lib/common/markdown-rendering';
|
|
34
35
|
import { AI_CHAT_NEW_CHAT_WINDOW_COMMAND, ChatCommands } from '@theia/ai-chat-ui/lib/browser/chat-view-commands';
|
|
35
36
|
import { AbstractModeAwareChatAgent } from './mode-aware-chat-agent';
|
|
@@ -48,11 +49,13 @@ export class CoderAgent extends AbstractModeAwareChatAgent {
|
|
|
48
49
|
identifier: 'default/code',
|
|
49
50
|
}];
|
|
50
51
|
protected defaultLanguageModelPurpose: string = 'chat';
|
|
52
|
+
override iconClass: string = 'codicon codicon-code';
|
|
51
53
|
|
|
52
54
|
override description = nls.localize('theia/ai/workspace/coderAgent/description',
|
|
53
|
-
'An AI assistant integrated into
|
|
54
|
-
and folders and retrieve their content. Furthermore, it can suggest modifications of files to the user. It can therefore assist the user with coding tasks or other
|
|
55
|
-
tasks involving file changes.'
|
|
55
|
+
'An AI assistant integrated into {0}, designed to assist software developers. This agent can access the users workspace, it can get a list of all available files' +
|
|
56
|
+
' and folders and retrieve their content. Furthermore, it can suggest modifications of files to the user. It can therefore assist the user with coding tasks or other' +
|
|
57
|
+
' tasks involving file changes.',
|
|
58
|
+
FrontendApplicationConfigProvider.get().applicationName);
|
|
56
59
|
|
|
57
60
|
protected readonly modeDefinitions: Omit<ChatMode, 'isDefault'>[] = [
|
|
58
61
|
{
|
|
@@ -76,11 +79,22 @@ export class CoderAgent extends AbstractModeAwareChatAgent {
|
|
|
76
79
|
}];
|
|
77
80
|
protected override systemPromptId: string | undefined = CODER_SYSTEM_PROMPT_ID;
|
|
78
81
|
|
|
82
|
+
private useSettingsDefaultMode = false;
|
|
83
|
+
|
|
79
84
|
override async invoke(request: MutableChatRequestModel): Promise<void> {
|
|
80
85
|
if (this.isAgentModeRequest(request) && !this.agentModeConfirmation.isAcknowledged()) {
|
|
81
86
|
const confirmed = await this.agentModeConfirmation.requestConfirmation(request);
|
|
82
87
|
if (!confirmed) {
|
|
83
|
-
|
|
88
|
+
await this.switchToEditMode();
|
|
89
|
+
// Continue the same request using Edit Mode's prompt by ignoring
|
|
90
|
+
// the request's original agent mode modeId for variant resolution.
|
|
91
|
+
this.useSettingsDefaultMode = true;
|
|
92
|
+
try {
|
|
93
|
+
await super.invoke(request);
|
|
94
|
+
this.suggest(request);
|
|
95
|
+
} finally {
|
|
96
|
+
this.useSettingsDefaultMode = false;
|
|
97
|
+
}
|
|
84
98
|
return;
|
|
85
99
|
}
|
|
86
100
|
}
|
|
@@ -88,6 +102,19 @@ export class CoderAgent extends AbstractModeAwareChatAgent {
|
|
|
88
102
|
this.suggest(request);
|
|
89
103
|
}
|
|
90
104
|
|
|
105
|
+
protected override getEffectiveVariantIdWithMode(modeId?: string): string | undefined {
|
|
106
|
+
if (this.useSettingsDefaultMode) {
|
|
107
|
+
return super.getEffectiveVariantIdWithMode(undefined);
|
|
108
|
+
}
|
|
109
|
+
return super.getEffectiveVariantIdWithMode(modeId);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
protected async switchToEditMode(): Promise<void> {
|
|
113
|
+
if (this.systemPromptId) {
|
|
114
|
+
await this.promptService.updateSelectedVariantId(this.id, this.systemPromptId, CODER_EDIT_TEMPLATE_ID);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
91
118
|
protected isAgentModeRequest(request: MutableChatRequestModel): boolean {
|
|
92
119
|
const modeId = request.request.modeId;
|
|
93
120
|
if (modeId) {
|
|
@@ -35,6 +35,7 @@ export class CreateSkillAgent extends AbstractModeAwareChatAgent {
|
|
|
35
35
|
identifier: 'default/universal',
|
|
36
36
|
}];
|
|
37
37
|
protected defaultLanguageModelPurpose: string = 'chat';
|
|
38
|
+
override iconClass: string = 'codicon codicon-wand';
|
|
38
39
|
|
|
39
40
|
override description = nls.localize('theia/ai/workspace/createSkillAgent/description',
|
|
40
41
|
'An AI assistant for creating new skills. Skills provide reusable instructions and domain knowledge for AI agents. ' +
|
|
@@ -37,4 +37,5 @@ export class ExploreAgent extends AbstractStreamParsingChatAgent {
|
|
|
37
37
|
|
|
38
38
|
override prompts = [{ id: EXPLORE_SYSTEM_PROMPT_ID, defaultVariant: exploreSystemPrompt, variants: [] }];
|
|
39
39
|
protected override systemPromptId: string = EXPLORE_SYSTEM_PROMPT_ID;
|
|
40
|
+
override iconClass: string = 'codicon codicon-compass';
|
|
40
41
|
}
|
|
@@ -25,6 +25,7 @@ import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
|
25
25
|
import { WorkspaceFunctionScope } from './workspace-functions';
|
|
26
26
|
|
|
27
27
|
import { nls } from '@theia/core';
|
|
28
|
+
import { extractJsonStringField } from '@theia/ai-chat-ui/lib/browser/chat-response-renderer/toolcall-utils';
|
|
28
29
|
import {
|
|
29
30
|
CLEAR_FILE_CHANGES_ID,
|
|
30
31
|
GET_PROPOSED_CHANGES_ID,
|
|
@@ -37,13 +38,9 @@ import {
|
|
|
37
38
|
} from '../common/file-changeset-function-ids';
|
|
38
39
|
|
|
39
40
|
function createPathShortLabel(args: string, hasMore: boolean): { label: string; hasMore: boolean } | undefined {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return { label: String(parsed.path), hasMore };
|
|
44
|
-
}
|
|
45
|
-
} catch {
|
|
46
|
-
// ignore parse errors
|
|
41
|
+
const path = extractJsonStringField(args, 'path');
|
|
42
|
+
if (path) {
|
|
43
|
+
return { label: path, hasMore };
|
|
47
44
|
}
|
|
48
45
|
return undefined;
|
|
49
46
|
}
|
|
@@ -696,7 +693,19 @@ export class WriteFileReplacements implements ToolProvider {
|
|
|
696
693
|
return {
|
|
697
694
|
id: WriteFileReplacements.ID,
|
|
698
695
|
name: WriteFileReplacements.ID,
|
|
699
|
-
description:
|
|
696
|
+
description: `Immediately replaces sections of content in an existing file — changes are applied to disk without user confirmation.
|
|
697
|
+
Each replacement consists of oldContent to be matched and newContent to insert in its place.
|
|
698
|
+
By default, a single occurrence of each oldContent is expected. If the 'multiple' flag is set to true, all occurrences will be replaced.
|
|
699
|
+
For deletions, use an empty newContent.
|
|
700
|
+
Make sure you use the same line endings and whitespace as in the original file content.
|
|
701
|
+
Multiple calls for the same file will merge replacements unless the reset parameter is set to true.
|
|
702
|
+
|
|
703
|
+
IMPORTANT: Each oldContent must appear exactly once in the file (unless 'multiple' is true).
|
|
704
|
+
If you see "Expected 1 occurrence but found X" errors:
|
|
705
|
+
- If found 0: The content doesn't exist, has different whitespace/indentation, or the file changed. Re-read the file first.
|
|
706
|
+
- If found 2+: Add more surrounding lines to oldContent to make it unique.
|
|
707
|
+
Common mistakes: Missing/extra trailing newlines, wrong indentation, outdated content.
|
|
708
|
+
Always read the file with getFileContent before attempting replacements.`,
|
|
700
709
|
parameters: metadata.parameters,
|
|
701
710
|
handler: async (args: string, ctx?: ToolInvocationContext): Promise<string> => {
|
|
702
711
|
assertChatContext(ctx);
|
|
@@ -99,12 +99,16 @@ import { aiIdePreferenceSchema } from '../common/ai-ide-preferences';
|
|
|
99
99
|
import { AIActivationService } from '@theia/ai-core/lib/browser';
|
|
100
100
|
import { AIIdeActivationServiceImpl } from './ai-ide-activation-service';
|
|
101
101
|
import { AiConfigurationPreferences } from '../common/ai-configuration-preferences';
|
|
102
|
+
import { WorkspaceRestrictionContribution } from '@theia/workspace/lib/browser/workspace-trust-service';
|
|
103
|
+
import { AIWorkspaceRestrictionContribution } from './ai-workspace-restriction-contribution';
|
|
102
104
|
|
|
103
105
|
import { ProjectInfoAgent } from './project-info-agent';
|
|
104
106
|
import { CreateSkillAgent } from './create-skill-agent';
|
|
105
107
|
import { SuggestTerminalCommand } from './ai-terminal-functions';
|
|
106
108
|
import { TodoWriteTool } from './todo-tool';
|
|
107
109
|
import { TodoToolRenderer } from './todo-tool-renderer';
|
|
110
|
+
import { UserInteractionTool } from './user-interaction-tool';
|
|
111
|
+
import { UserInteractionToolRenderer } from './user-interaction-tool-renderer';
|
|
108
112
|
import { ChatResponsePartRenderer } from '@theia/ai-chat-ui/lib/browser/chat-response-part-renderer';
|
|
109
113
|
import { ContextFileValidationService } from '@theia/ai-chat/lib/browser/context-file-validation-service';
|
|
110
114
|
import { ContextFileValidationServiceImpl } from './context-file-validation-service-impl';
|
|
@@ -116,14 +120,11 @@ import { AddressGhReviewCommandContribution } from './address-pr-review-command-
|
|
|
116
120
|
import { AppTesterCapabilityContribution } from './apptester-capability-contribution';
|
|
117
121
|
import { GitHubCapabilityContribution } from './github-capability-contribution';
|
|
118
122
|
import { ShellExecutionCapabilityContribution } from './shell-execution-capability-contribution';
|
|
119
|
-
import { JuniorAgent } from './junior-agent';
|
|
120
123
|
import { AgentModeConfirmationService, AgentModeConfirmationServiceImpl } from './agent-mode-confirmation-service';
|
|
121
|
-
|
|
122
124
|
import { ExploreAgent } from './explore-agent';
|
|
123
125
|
import { CodeReviewerAgent } from './code-reviewer-agent';
|
|
124
|
-
import { ContextReviewerAgent } from './context-reviewer-agent';
|
|
125
126
|
import { CodeReviewCapabilityContribution } from './code-review-capability-contribution';
|
|
126
|
-
import {
|
|
127
|
+
import { PRReviewAgent } from './review/pr-review-agent';
|
|
127
128
|
|
|
128
129
|
export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
129
130
|
bind(PreferenceContribution).toConstantValue({ schema: aiIdePreferenceSchema });
|
|
@@ -136,6 +137,9 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
136
137
|
// rebinds the default implementation of '@theia/ai-core'
|
|
137
138
|
rebind(AIActivationService).toService(AIIdeActivationServiceImpl);
|
|
138
139
|
|
|
140
|
+
bind(AIWorkspaceRestrictionContribution).toSelf().inSingletonScope();
|
|
141
|
+
bind(WorkspaceRestrictionContribution).toService(AIWorkspaceRestrictionContribution);
|
|
142
|
+
|
|
139
143
|
bind(ArchitectAgent).toSelf().inSingletonScope();
|
|
140
144
|
bind(Agent).toService(ArchitectAgent);
|
|
141
145
|
bind(ChatAgent).toService(ArchitectAgent);
|
|
@@ -176,10 +180,6 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
176
180
|
bind(Agent).toService(CommandChatAgent);
|
|
177
181
|
bind(ChatAgent).toService(CommandChatAgent);
|
|
178
182
|
|
|
179
|
-
bind(JuniorAgent).toSelf().inSingletonScope();
|
|
180
|
-
bind(Agent).toService(JuniorAgent);
|
|
181
|
-
bind(ChatAgent).toService(JuniorAgent);
|
|
182
|
-
|
|
183
183
|
bind(ExploreAgent).toSelf().inSingletonScope();
|
|
184
184
|
bind(Agent).toService(ExploreAgent);
|
|
185
185
|
bind(ChatAgent).toService(ExploreAgent);
|
|
@@ -188,9 +188,9 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
188
188
|
bind(Agent).toService(CodeReviewerAgent);
|
|
189
189
|
bind(ChatAgent).toService(CodeReviewerAgent);
|
|
190
190
|
|
|
191
|
-
bind(
|
|
192
|
-
bind(Agent).toService(
|
|
193
|
-
bind(ChatAgent).toService(
|
|
191
|
+
bind(PRReviewAgent).toSelf().inSingletonScope();
|
|
192
|
+
bind(Agent).toService(PRReviewAgent);
|
|
193
|
+
bind(ChatAgent).toService(PRReviewAgent);
|
|
194
194
|
|
|
195
195
|
bind(ChatWelcomeMessageProvider).to(IdeChatWelcomeMessageProvider).inSingletonScope();
|
|
196
196
|
bind(ChatWelcomeMessageProvider).to(ChatSessionsWelcomeMessageProvider).inSingletonScope();
|
|
@@ -339,7 +339,9 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
339
339
|
bindToolProvider(ListTaskContextsFunction, bind);
|
|
340
340
|
bindToolProvider(RewriteTaskContextFunction, bind);
|
|
341
341
|
bindToolProvider(TodoWriteTool, bind);
|
|
342
|
+
bindToolProvider(UserInteractionTool, bind);
|
|
342
343
|
bind(ChatResponsePartRenderer).to(TodoToolRenderer).inSingletonScope();
|
|
344
|
+
bind(ChatResponsePartRenderer).to(UserInteractionToolRenderer).inSingletonScope();
|
|
343
345
|
|
|
344
346
|
bind(ContextFileValidationServiceImpl).toSelf().inSingletonScope();
|
|
345
347
|
bind(ContextFileValidationService).toService(ContextFileValidationServiceImpl);
|
|
@@ -351,6 +353,6 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
|
|
|
351
353
|
bind(FrontendApplicationContribution).to(AppTesterCapabilityContribution);
|
|
352
354
|
bind(FrontendApplicationContribution).to(GitHubCapabilityContribution);
|
|
353
355
|
bind(FrontendApplicationContribution).to(ShellExecutionCapabilityContribution);
|
|
356
|
+
|
|
354
357
|
bind(FrontendApplicationContribution).to(CodeReviewCapabilityContribution);
|
|
355
|
-
bind(FrontendApplicationContribution).to(JuniorPlanCapabilityContribution);
|
|
356
358
|
});
|
|
@@ -34,7 +34,7 @@ export class GitHubCapabilityContribution implements FrontendApplicationContribu
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
protected buildTemplate(): string {
|
|
37
|
-
const name = nls.
|
|
37
|
+
const name = nls.localizeByDefault('GitHub');
|
|
38
38
|
const description = nls.localize('theia/ai/ide/githubCapability/description',
|
|
39
39
|
'Allows the agent to interact with GitHub. For this, the agent can delegate to the GitHub agent, \
|
|
40
40
|
which can read and write issues, pull requests, comments, and repository contents.');
|
|
@@ -34,7 +34,7 @@ export const githubTemplate: BasePromptFragment = {
|
|
|
34
34
|
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
35
35
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
36
36
|
|
|
37
|
-
You are GitHub Agent, an AI assistant integrated into
|
|
37
|
+
You are GitHub Agent, an AI assistant integrated into {{productName}} specifically designed to help developers interact with GitHub repositories.
|
|
38
38
|
Your role is to help users manage GitHub repositories, issues, pull requests, and other GitHub-related tasks through the GitHub MCP server.
|
|
39
39
|
|
|
40
40
|
## Current Repository Context
|
|
@@ -25,6 +25,8 @@ import { PreferenceService } from '@theia/core/lib/common';
|
|
|
25
25
|
import { DEFAULT_CHAT_AGENT_PREF, BYPASS_MODEL_REQUIREMENT_PREF } from '@theia/ai-chat/lib/common/ai-chat-preferences';
|
|
26
26
|
import { ChatAgentRecommendationService, ChatAgentService } from '@theia/ai-chat/lib/common';
|
|
27
27
|
import { OPEN_AI_CONFIG_VIEW } from './ai-configuration/ai-configuration-view-contribution';
|
|
28
|
+
import { AIActivationService } from '@theia/ai-core/lib/browser';
|
|
29
|
+
import { WorkspaceCommands } from '@theia/workspace/lib/browser/workspace-commands';
|
|
28
30
|
|
|
29
31
|
const TheiaIdeAiLogo = ({ width = 120, height = 120, className = '' }) =>
|
|
30
32
|
<svg
|
|
@@ -80,6 +82,9 @@ export class IdeChatWelcomeMessageProvider implements ChatWelcomeMessageProvider
|
|
|
80
82
|
@inject(AgentService)
|
|
81
83
|
protected agentService: AgentService;
|
|
82
84
|
|
|
85
|
+
@inject(AIActivationService)
|
|
86
|
+
protected readonly activationService: AIActivationService;
|
|
87
|
+
|
|
83
88
|
protected readonly toDispose = new DisposableCollection();
|
|
84
89
|
protected _hasReadyModels = false;
|
|
85
90
|
protected _modelRequirementBypassed = false;
|
|
@@ -133,6 +138,17 @@ export class IdeChatWelcomeMessageProvider implements ChatWelcomeMessageProvider
|
|
|
133
138
|
this._modelRequirementBypassed = bypassValue;
|
|
134
139
|
this.notifyStateChanged();
|
|
135
140
|
});
|
|
141
|
+
// Listen to both canRun and activeStatus changes. They may change independent from each other.
|
|
142
|
+
this.toDispose.push(
|
|
143
|
+
this.activationService.onDidChangeCanRun(() => {
|
|
144
|
+
this.notifyStateChanged();
|
|
145
|
+
})
|
|
146
|
+
);
|
|
147
|
+
this.toDispose.push(
|
|
148
|
+
this.activationService.onDidChangeActiveStatus(() => {
|
|
149
|
+
this.notifyStateChanged();
|
|
150
|
+
})
|
|
151
|
+
);
|
|
136
152
|
}
|
|
137
153
|
|
|
138
154
|
protected async checkLanguageModelStatus(): Promise<void> {
|
|
@@ -358,6 +374,43 @@ Choose the agent to use by default. You can always override this by mentioning *
|
|
|
358
374
|
}
|
|
359
375
|
|
|
360
376
|
renderDisabledMessage(): React.ReactNode {
|
|
377
|
+
if (this.activationService.isActive && !this.activationService.canRun) {
|
|
378
|
+
return this.renderTrustRestrictedMessage();
|
|
379
|
+
}
|
|
380
|
+
return this.renderPreferenceDisabledMessage();
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
protected renderTrustRestrictedMessage(): React.ReactNode {
|
|
384
|
+
return <div className={'theia-WelcomeMessage theia-WelcomeMessage-Main theia-WelcomeMessage-Disabled'} key="trust-restricted-message">
|
|
385
|
+
<TheiaIdeAiLogo className="theia-WelcomeMessage-Logo" />
|
|
386
|
+
<div className="theia-WelcomeMessage-Content">
|
|
387
|
+
<h2>{nls.localize('theia/ai/ide/chatRestrictedMessage/title', 'AI Features are Restricted')}</h2>
|
|
388
|
+
</div>
|
|
389
|
+
<div className="theia-alert theia-warning-alert theia-WelcomeMessage-Alert">
|
|
390
|
+
<div className="theia-message-header">
|
|
391
|
+
<span className={codicon('shield')}></span>
|
|
392
|
+
<span>{nls.localizeByDefault('Restricted Mode')}</span>
|
|
393
|
+
</div>
|
|
394
|
+
<div className="theia-message-content">
|
|
395
|
+
<LocalizedMarkdown
|
|
396
|
+
localizationKey="theia/ai/ide/chatRestrictedMessage/explanation"
|
|
397
|
+
defaultMarkdown={'AI features are disabled because this workspace is not trusted. '
|
|
398
|
+
+ 'Grant trust to enable AI chat, inline suggestions, code actions, and prompt templates.'}
|
|
399
|
+
markdownRenderer={this.markdownRenderer}
|
|
400
|
+
/>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
<div className="theia-WelcomeMessage-Actions">
|
|
404
|
+
<button
|
|
405
|
+
className="theia-button main"
|
|
406
|
+
onClick={() => this.commandRegistry.executeCommand(WorkspaceCommands.MANAGE_WORKSPACE_TRUST.id)}>
|
|
407
|
+
{nls.localizeByDefault('Manage Workspace Trust')}
|
|
408
|
+
</button>
|
|
409
|
+
</div>
|
|
410
|
+
</div>;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
protected renderPreferenceDisabledMessage(): React.ReactNode {
|
|
361
414
|
const openAiHistory = 'aiHistory:open';
|
|
362
415
|
|
|
363
416
|
return <div className={'theia-WelcomeMessage theia-WelcomeMessage-Main theia-WelcomeMessage-Disabled'} key="disabled-message">
|
|
@@ -36,5 +36,5 @@ export class ProjectInfoAgent extends AbstractStreamParsingChatAgent {
|
|
|
36
36
|
|
|
37
37
|
override prompts = [projectInfoSystemVariants, projectInfoTemplateVariants];
|
|
38
38
|
protected override systemPromptId: string | undefined = projectInfoSystemVariants.id;
|
|
39
|
-
|
|
39
|
+
override iconClass: string = 'codicon codicon-repo';
|
|
40
40
|
}
|
|
@@ -14,27 +14,29 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
|
-
import { AbstractStreamParsingChatAgent } from '@theia/ai-chat
|
|
17
|
+
import { AbstractStreamParsingChatAgent } from '@theia/ai-chat';
|
|
18
18
|
import { LanguageModelRequirement } from '@theia/ai-core/lib/common';
|
|
19
19
|
import { nls } from '@theia/core';
|
|
20
20
|
import { injectable } from '@theia/core/shared/inversify';
|
|
21
|
-
import {
|
|
21
|
+
import { PR_REVIEW_SYSTEM_PROMPT_ID, prReviewSystemPrompt } from './pr-review-prompt-template';
|
|
22
22
|
|
|
23
|
-
export const
|
|
23
|
+
export const PRReviewAgentId = 'pr-reviewer';
|
|
24
24
|
|
|
25
25
|
@injectable()
|
|
26
|
-
export class
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
export class PRReviewAgent extends AbstractStreamParsingChatAgent {
|
|
27
|
+
id = PRReviewAgentId;
|
|
28
|
+
name = 'PR Reviewer';
|
|
29
29
|
languageModelRequirements: LanguageModelRequirement[] = [{
|
|
30
30
|
purpose: 'chat',
|
|
31
31
|
identifier: 'default/code',
|
|
32
32
|
}];
|
|
33
33
|
protected defaultLanguageModelPurpose: string = 'chat';
|
|
34
|
-
override description = nls.localize('theia/ai/ide/
|
|
35
|
-
'
|
|
36
|
-
|
|
34
|
+
override description = nls.localize('theia/ai/ide/prReviewAgent/description',
|
|
35
|
+
'An AI-powered PR review agent that orchestrates a full code review workflow: fetches PR info, explores the codebase, ' +
|
|
36
|
+
'performs structured analysis, interactively walks the user through findings with diff viewers, and optionally creates a pending review on GitHub.');
|
|
37
37
|
|
|
38
|
-
override
|
|
39
|
-
|
|
38
|
+
override iconClass: string = 'codicon codicon-git-pull-request-go-to-changes';
|
|
39
|
+
override prompts = [{ id: PR_REVIEW_SYSTEM_PROMPT_ID, defaultVariant: prReviewSystemPrompt, variants: [] }];
|
|
40
|
+
protected override systemPromptId: string = PR_REVIEW_SYSTEM_PROMPT_ID;
|
|
41
|
+
override tags: string[] = [...this.tags, 'Alpha'];
|
|
40
42
|
}
|