@theia/ai-ide 1.71.0-next.72 → 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.
Files changed (41) hide show
  1. package/lib/browser/frontend-module.d.ts.map +1 -1
  2. package/lib/browser/frontend-module.js +8 -0
  3. package/lib/browser/frontend-module.js.map +1 -1
  4. package/lib/browser/review/pr-review-agent.d.ts +19 -0
  5. package/lib/browser/review/pr-review-agent.d.ts.map +1 -0
  6. package/lib/browser/review/pr-review-agent.js +47 -0
  7. package/lib/browser/review/pr-review-agent.js.map +1 -0
  8. package/lib/browser/review/pr-review-prompt-template.d.ts +4 -0
  9. package/lib/browser/review/pr-review-prompt-template.d.ts.map +1 -0
  10. package/lib/browser/review/pr-review-prompt-template.js +437 -0
  11. package/lib/browser/review/pr-review-prompt-template.js.map +1 -0
  12. package/lib/browser/user-interaction-tool-renderer.d.ts +18 -0
  13. package/lib/browser/user-interaction-tool-renderer.d.ts.map +1 -0
  14. package/lib/browser/user-interaction-tool-renderer.js +330 -0
  15. package/lib/browser/user-interaction-tool-renderer.js.map +1 -0
  16. package/lib/browser/user-interaction-tool.d.ts +47 -0
  17. package/lib/browser/user-interaction-tool.d.ts.map +1 -0
  18. package/lib/browser/user-interaction-tool.js +397 -0
  19. package/lib/browser/user-interaction-tool.js.map +1 -0
  20. package/lib/browser/user-interaction-tool.spec.d.ts +2 -0
  21. package/lib/browser/user-interaction-tool.spec.d.ts.map +1 -0
  22. package/lib/browser/user-interaction-tool.spec.js +336 -0
  23. package/lib/browser/user-interaction-tool.spec.js.map +1 -0
  24. package/lib/common/user-interaction-tool.d.ts +53 -0
  25. package/lib/common/user-interaction-tool.d.ts.map +1 -0
  26. package/lib/common/user-interaction-tool.js +176 -0
  27. package/lib/common/user-interaction-tool.js.map +1 -0
  28. package/lib/common/user-interaction-tool.spec.d.ts +2 -0
  29. package/lib/common/user-interaction-tool.spec.d.ts.map +1 -0
  30. package/lib/common/user-interaction-tool.spec.js +216 -0
  31. package/lib/common/user-interaction-tool.spec.js.map +1 -0
  32. package/package.json +22 -22
  33. package/src/browser/frontend-module.ts +9 -0
  34. package/src/browser/review/pr-review-agent.ts +42 -0
  35. package/src/browser/review/pr-review-prompt-template.ts +449 -0
  36. package/src/browser/style/index.css +299 -0
  37. package/src/browser/user-interaction-tool-renderer.tsx +531 -0
  38. package/src/browser/user-interaction-tool.spec.ts +396 -0
  39. package/src/browser/user-interaction-tool.ts +423 -0
  40. package/src/common/user-interaction-tool.spec.ts +241 -0
  41. package/src/common/user-interaction-tool.ts +237 -0
@@ -0,0 +1,216 @@
1
+ "use strict";
2
+ // *****************************************************************************
3
+ // Copyright (C) 2026 EclipseSource GmbH.
4
+ //
5
+ // This program and the accompanying materials are made available under the
6
+ // terms of the Eclipse Public License v. 2.0 which is available at
7
+ // http://www.eclipse.org/legal/epl-2.0.
8
+ //
9
+ // This Source Code may also be made available under the following Secondary
10
+ // Licenses when the conditions for such availability set forth in the Eclipse
11
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
+ // with the GNU Classpath Exception which is available at
13
+ // https://www.gnu.org/software/classpath/license.html.
14
+ //
15
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
+ // *****************************************************************************
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const chai_1 = require("chai");
19
+ const user_interaction_tool_1 = require("./user-interaction-tool");
20
+ describe('parseUserInteractionArgs', () => {
21
+ it('should return undefined for undefined input', () => {
22
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionArgs)(undefined)).to.be.undefined;
23
+ });
24
+ it('should return undefined for invalid JSON', () => {
25
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionArgs)('not json')).to.be.undefined;
26
+ });
27
+ it('should return undefined when interactions is missing', () => {
28
+ const input = JSON.stringify({ foo: 'bar' });
29
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionArgs)(input)).to.be.undefined;
30
+ });
31
+ it('should return undefined when interactions is not an array', () => {
32
+ const input = JSON.stringify({ interactions: 'nope' });
33
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionArgs)(input)).to.be.undefined;
34
+ });
35
+ it('should return undefined when no step is valid', () => {
36
+ const input = JSON.stringify({ interactions: [{ foo: 'bar' }, { title: 1 }] });
37
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionArgs)(input)).to.be.undefined;
38
+ });
39
+ it('should drop steps that are missing title or message', () => {
40
+ const input = JSON.stringify({
41
+ interactions: [
42
+ { title: 'Valid', message: 'Hello' },
43
+ { title: 'No message' },
44
+ { message: 'No title' }
45
+ ]
46
+ });
47
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
48
+ (0, chai_1.expect)(result).to.not.be.undefined;
49
+ (0, chai_1.expect)(result.interactions).to.have.length(1);
50
+ (0, chai_1.expect)(result.interactions[0].title).to.equal('Valid');
51
+ });
52
+ it('should accept a step without options (informational)', () => {
53
+ const input = JSON.stringify({
54
+ interactions: [{ title: 'Info', message: 'Just so you know' }]
55
+ });
56
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
57
+ (0, chai_1.expect)(result).to.not.be.undefined;
58
+ (0, chai_1.expect)(result.interactions[0].options).to.be.undefined;
59
+ });
60
+ it('should filter out invalid options within a step', () => {
61
+ const input = JSON.stringify({
62
+ interactions: [{
63
+ title: 'T', message: 'M',
64
+ options: [{ text: 'A', value: 'a' }, { bad: true }, { text: 'B', value: 'b' }]
65
+ }]
66
+ });
67
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
68
+ (0, chai_1.expect)(result.interactions[0].options).to.have.length(2);
69
+ });
70
+ it('should drop options array if no options are valid', () => {
71
+ const input = JSON.stringify({
72
+ interactions: [{
73
+ title: 'T', message: 'M',
74
+ options: [{ bad: true }]
75
+ }]
76
+ });
77
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
78
+ (0, chai_1.expect)(result.interactions[0].options).to.be.undefined;
79
+ });
80
+ it('should normalize singular link into a links array on a step', () => {
81
+ const input = JSON.stringify({
82
+ interactions: [{
83
+ title: 'T', message: 'M',
84
+ options: [{ text: 'A', value: 'a' }],
85
+ link: { ref: 'src/index.ts' }
86
+ }]
87
+ });
88
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
89
+ (0, chai_1.expect)(result.interactions[0].links).to.deep.equal([{ ref: 'src/index.ts' }]);
90
+ });
91
+ it('should accept a links array with multiple entries', () => {
92
+ const input = JSON.stringify({
93
+ interactions: [{
94
+ title: 'T', message: 'M',
95
+ options: [{ text: 'A', value: 'a' }],
96
+ links: [
97
+ { ref: 'src/a.ts' },
98
+ { ref: 'src/old.ts', rightRef: 'src/new.ts' }
99
+ ]
100
+ }]
101
+ });
102
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
103
+ (0, chai_1.expect)(result.interactions[0].links).to.have.length(2);
104
+ });
105
+ it('should filter out invalid links from a step', () => {
106
+ const input = JSON.stringify({
107
+ interactions: [{
108
+ title: 'T', message: 'M',
109
+ options: [{ text: 'A', value: 'a' }],
110
+ links: [
111
+ { ref: 'src/a.ts' },
112
+ { noRef: true },
113
+ { ref: '' }
114
+ ]
115
+ }]
116
+ });
117
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
118
+ (0, chai_1.expect)(result.interactions[0].links).to.have.length(1);
119
+ });
120
+ it('should accept multiple steps in order', () => {
121
+ const input = JSON.stringify({
122
+ interactions: [
123
+ { title: 'Overview', message: 'PR summary' },
124
+ { title: 'Area 1', message: 'finding', options: [{ text: 'OK', value: 'approve' }] },
125
+ { title: 'Area 2', message: 'no findings' }
126
+ ]
127
+ });
128
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
129
+ (0, chai_1.expect)(result.interactions).to.have.length(3);
130
+ (0, chai_1.expect)(result.interactions[1].options).to.have.length(1);
131
+ (0, chai_1.expect)(result.interactions[2].options).to.be.undefined;
132
+ });
133
+ it('should preserve buttonLabel in options', () => {
134
+ const input = JSON.stringify({
135
+ interactions: [{
136
+ title: 'T', message: 'M',
137
+ options: [{ text: 'Confirm changes', value: 'confirm', buttonLabel: '✅ Confirm' }]
138
+ }]
139
+ });
140
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
141
+ (0, chai_1.expect)(result.interactions[0].options[0].buttonLabel).to.equal('✅ Confirm');
142
+ });
143
+ it('should reject step links with empty path in object ref', () => {
144
+ const input = JSON.stringify({
145
+ interactions: [{
146
+ title: 'T', message: 'M',
147
+ links: [{ ref: { path: '' } }]
148
+ }]
149
+ });
150
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
151
+ (0, chai_1.expect)(result.interactions[0].links).to.be.undefined;
152
+ });
153
+ it('should accept step links with EmptyContentRef', () => {
154
+ const input = JSON.stringify({
155
+ interactions: [{
156
+ title: 'T', message: 'M',
157
+ links: [{ ref: { empty: true, label: 'New file' } }]
158
+ }]
159
+ });
160
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
161
+ (0, chai_1.expect)(result.interactions[0].links[0].ref).to.deep.equal({ empty: true, label: 'New file' });
162
+ });
163
+ it('should accept step links with EmptyContentRef as rightRef', () => {
164
+ const input = JSON.stringify({
165
+ interactions: [{
166
+ title: 'T', message: 'M',
167
+ links: [{ ref: 'src/old.ts', rightRef: { empty: true } }]
168
+ }]
169
+ });
170
+ const result = (0, user_interaction_tool_1.parseUserInteractionArgs)(input);
171
+ (0, chai_1.expect)(result.interactions[0].links[0].rightRef).to.deep.equal({ empty: true });
172
+ });
173
+ });
174
+ describe('parseUserInteractionInput', () => {
175
+ it('should return empty result for undefined input', () => {
176
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)(undefined)).to.deep.equal({ title: '', stepCount: 0 });
177
+ });
178
+ it('should return empty result for empty string', () => {
179
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)('')).to.deep.equal({ title: '', stepCount: 0 });
180
+ });
181
+ it('should extract first step title and step count from valid JSON', () => {
182
+ const input = JSON.stringify({ interactions: [{ title: 'First' }, { title: 'Second' }] });
183
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)(input)).to.deep.equal({ title: 'First', stepCount: 2 });
184
+ });
185
+ it('should return empty title and 0 count when interactions array is empty', () => {
186
+ const input = JSON.stringify({ interactions: [] });
187
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)(input)).to.deep.equal({ title: '', stepCount: 0 });
188
+ });
189
+ it('should fall back to regex-based title extraction for incomplete JSON', () => {
190
+ const input = '{"interactions": [{"title": "Streaming Title", "message": "incom';
191
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)(input).title).to.equal('Streaming Title');
192
+ });
193
+ it('should return empty title from incomplete JSON without title field', () => {
194
+ const input = '{"interactions": [{"message": "no title here';
195
+ (0, chai_1.expect)((0, user_interaction_tool_1.parseUserInteractionInput)(input).title).to.equal('');
196
+ });
197
+ });
198
+ describe('buildDiffLabel', () => {
199
+ it('formats two empty refs', () => {
200
+ (0, chai_1.expect)((0, user_interaction_tool_1.buildDiffLabel)({ empty: true, label: 'New' }, { empty: true, label: 'Deleted' }))
201
+ .to.equal('New ⟷ Deleted');
202
+ });
203
+ it('formats empty left vs path with gitRef', () => {
204
+ (0, chai_1.expect)((0, user_interaction_tool_1.buildDiffLabel)({ empty: true, label: 'New' }, { path: 'src/x.ts', gitRef: 'abcdef0123' }))
205
+ .to.equal('src/x.ts (New ⟷ abcdef0)');
206
+ });
207
+ it('formats path with gitRef vs working copy of same path', () => {
208
+ (0, chai_1.expect)((0, user_interaction_tool_1.buildDiffLabel)({ path: 'src/x.ts', gitRef: 'abcdef0123' }, { path: 'src/x.ts' }))
209
+ .to.equal('src/x.ts (abcdef0 ⟷ Working Copy)');
210
+ });
211
+ it('formats two different paths', () => {
212
+ (0, chai_1.expect)((0, user_interaction_tool_1.buildDiffLabel)({ path: 'src/old.ts' }, { path: 'src/new.ts' }))
213
+ .to.equal('src/old.ts ⟷ src/new.ts');
214
+ });
215
+ });
216
+ //# sourceMappingURL=user-interaction-tool.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"user-interaction-tool.spec.js","sourceRoot":"","sources":["../../src/common/user-interaction-tool.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,+BAA8B;AAC9B,mEAA8G;AAE9G,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;IACtC,EAAE,CAAC,6CAA6C,EAAE,GAAG,EAAE;QACnD,IAAA,aAAM,EAAC,IAAA,gDAAwB,EAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IAChE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;QAChD,IAAA,aAAM,EAAC,IAAA,gDAAwB,EAAC,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IACjE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC5D,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7C,IAAA,aAAM,EAAC,IAAA,gDAAwB,EAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,SAAS,CAAC;IAC5D,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACjE,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CA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,wCAAwC,EAAE,GAAG,EAAE;QAC9C,IAAA,aAAM,EAAC,IAAA,sCAAc,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;aAC5F,EAAE,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;QAC7D,IAAA,aAAM,EAAC,IAAA,sCAAc,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;aACnF,EAAE,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACnC,IAAA,aAAM,EAAC,IAAA,sCAAc,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;aACjE,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/ai-ide",
3
- "version": "1.71.0-next.72+95c8dba0e",
3
+ "version": "1.71.0",
4
4
  "description": "AI IDE Agents Extension",
5
5
  "license": "EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0",
6
6
  "repository": {
@@ -15,24 +15,24 @@
15
15
  "theia-extension"
16
16
  ],
17
17
  "dependencies": {
18
- "@theia/ai-chat": "1.71.0-next.72+95c8dba0e",
19
- "@theia/ai-chat-ui": "1.71.0-next.72+95c8dba0e",
20
- "@theia/ai-core": "1.71.0-next.72+95c8dba0e",
21
- "@theia/ai-mcp": "1.71.0-next.72+95c8dba0e",
22
- "@theia/ai-terminal": "1.71.0-next.72+95c8dba0e",
23
- "@theia/core": "1.71.0-next.72+95c8dba0e",
24
- "@theia/debug": "1.71.0-next.72+95c8dba0e",
25
- "@theia/editor": "1.71.0-next.72+95c8dba0e",
26
- "@theia/filesystem": "1.71.0-next.72+95c8dba0e",
27
- "@theia/markers": "1.71.0-next.72+95c8dba0e",
28
- "@theia/monaco": "1.71.0-next.72+95c8dba0e",
29
- "@theia/navigator": "1.71.0-next.72+95c8dba0e",
30
- "@theia/preferences": "1.71.0-next.72+95c8dba0e",
31
- "@theia/scm": "1.71.0-next.72+95c8dba0e",
32
- "@theia/search-in-workspace": "1.71.0-next.72+95c8dba0e",
33
- "@theia/task": "1.71.0-next.72+95c8dba0e",
34
- "@theia/terminal": "1.71.0-next.72+95c8dba0e",
35
- "@theia/workspace": "1.71.0-next.72+95c8dba0e",
18
+ "@theia/ai-chat": "1.71.0",
19
+ "@theia/ai-chat-ui": "1.71.0",
20
+ "@theia/ai-core": "1.71.0",
21
+ "@theia/ai-mcp": "1.71.0",
22
+ "@theia/ai-terminal": "1.71.0",
23
+ "@theia/core": "1.71.0",
24
+ "@theia/debug": "1.71.0",
25
+ "@theia/editor": "1.71.0",
26
+ "@theia/filesystem": "1.71.0",
27
+ "@theia/markers": "1.71.0",
28
+ "@theia/monaco": "1.71.0",
29
+ "@theia/navigator": "1.71.0",
30
+ "@theia/preferences": "1.71.0",
31
+ "@theia/scm": "1.71.0",
32
+ "@theia/search-in-workspace": "1.71.0",
33
+ "@theia/task": "1.71.0",
34
+ "@theia/terminal": "1.71.0",
35
+ "@theia/workspace": "1.71.0",
36
36
  "date-fns": "^4.1.0",
37
37
  "ignore": "^6.0.2",
38
38
  "js-yaml": "^4.1.1",
@@ -44,8 +44,8 @@
44
44
  "access": "public"
45
45
  },
46
46
  "devDependencies": {
47
- "@theia/cli": "1.71.0-next.72+95c8dba0e",
48
- "@theia/test": "1.71.0-next.72+95c8dba0e"
47
+ "@theia/cli": "1.71.0",
48
+ "@theia/test": "1.71.0"
49
49
  },
50
50
  "theiaExtensions": [
51
51
  {
@@ -69,5 +69,5 @@
69
69
  "nyc": {
70
70
  "extends": "../../configs/nyc.json"
71
71
  },
72
- "gitHead": "95c8dba0ee6349c6be262ac2cf383909a3b62761"
72
+ "gitHead": "d8a596fc99f0a8e68b466828ed162569d79e3a71"
73
73
  }
@@ -107,6 +107,8 @@ import { CreateSkillAgent } from './create-skill-agent';
107
107
  import { SuggestTerminalCommand } from './ai-terminal-functions';
108
108
  import { TodoWriteTool } from './todo-tool';
109
109
  import { TodoToolRenderer } from './todo-tool-renderer';
110
+ import { UserInteractionTool } from './user-interaction-tool';
111
+ import { UserInteractionToolRenderer } from './user-interaction-tool-renderer';
110
112
  import { ChatResponsePartRenderer } from '@theia/ai-chat-ui/lib/browser/chat-response-part-renderer';
111
113
  import { ContextFileValidationService } from '@theia/ai-chat/lib/browser/context-file-validation-service';
112
114
  import { ContextFileValidationServiceImpl } from './context-file-validation-service-impl';
@@ -122,6 +124,7 @@ import { AgentModeConfirmationService, AgentModeConfirmationServiceImpl } from '
122
124
  import { ExploreAgent } from './explore-agent';
123
125
  import { CodeReviewerAgent } from './code-reviewer-agent';
124
126
  import { CodeReviewCapabilityContribution } from './code-review-capability-contribution';
127
+ import { PRReviewAgent } from './review/pr-review-agent';
125
128
 
126
129
  export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
127
130
  bind(PreferenceContribution).toConstantValue({ schema: aiIdePreferenceSchema });
@@ -185,6 +188,10 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
185
188
  bind(Agent).toService(CodeReviewerAgent);
186
189
  bind(ChatAgent).toService(CodeReviewerAgent);
187
190
 
191
+ bind(PRReviewAgent).toSelf().inSingletonScope();
192
+ bind(Agent).toService(PRReviewAgent);
193
+ bind(ChatAgent).toService(PRReviewAgent);
194
+
188
195
  bind(ChatWelcomeMessageProvider).to(IdeChatWelcomeMessageProvider).inSingletonScope();
189
196
  bind(ChatWelcomeMessageProvider).to(ChatSessionsWelcomeMessageProvider).inSingletonScope();
190
197
  bindContributionProvider(bind, ChatSessionCardActionContribution);
@@ -332,7 +339,9 @@ export default new ContainerModule((bind, _unbind, _isBound, rebind) => {
332
339
  bindToolProvider(ListTaskContextsFunction, bind);
333
340
  bindToolProvider(RewriteTaskContextFunction, bind);
334
341
  bindToolProvider(TodoWriteTool, bind);
342
+ bindToolProvider(UserInteractionTool, bind);
335
343
  bind(ChatResponsePartRenderer).to(TodoToolRenderer).inSingletonScope();
344
+ bind(ChatResponsePartRenderer).to(UserInteractionToolRenderer).inSingletonScope();
336
345
 
337
346
  bind(ContextFileValidationServiceImpl).toSelf().inSingletonScope();
338
347
  bind(ContextFileValidationService).toService(ContextFileValidationServiceImpl);
@@ -0,0 +1,42 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2026 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { AbstractStreamParsingChatAgent } from '@theia/ai-chat';
18
+ import { LanguageModelRequirement } from '@theia/ai-core/lib/common';
19
+ import { nls } from '@theia/core';
20
+ import { injectable } from '@theia/core/shared/inversify';
21
+ import { PR_REVIEW_SYSTEM_PROMPT_ID, prReviewSystemPrompt } from './pr-review-prompt-template';
22
+
23
+ export const PRReviewAgentId = 'pr-reviewer';
24
+
25
+ @injectable()
26
+ export class PRReviewAgent extends AbstractStreamParsingChatAgent {
27
+ id = PRReviewAgentId;
28
+ name = 'PR Reviewer';
29
+ languageModelRequirements: LanguageModelRequirement[] = [{
30
+ purpose: 'chat',
31
+ identifier: 'default/code',
32
+ }];
33
+ protected defaultLanguageModelPurpose: string = 'chat';
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
+
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'];
42
+ }