@theia/ai-ide 1.67.0-next.59 → 1.67.0-next.86
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/address-pr-review-command-contribution.d.ts +9 -0
- package/lib/browser/address-pr-review-command-contribution.d.ts.map +1 -0
- package/lib/browser/address-pr-review-command-contribution.js +176 -0
- package/lib/browser/address-pr-review-command-contribution.js.map +1 -0
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +12 -6
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +156 -104
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts +32 -0
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js +55 -0
- package/lib/browser/ai-configuration/base/ai-card-grid-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts +14 -0
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js +35 -0
- package/lib/browser/ai-configuration/base/ai-configuration-base-widget.js.map +1 -0
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts +23 -0
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js +60 -0
- package/lib/browser/ai-configuration/base/ai-hierarchical-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts +56 -0
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js +96 -0
- package/lib/browser/ai-configuration/base/ai-list-detail-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts +45 -0
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.d.ts.map +1 -0
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js +66 -0
- package/lib/browser/ai-configuration/base/ai-table-configuration-widget.js.map +1 -0
- package/lib/browser/ai-configuration/components/configuration-section.d.ts +13 -0
- package/lib/browser/ai-configuration/components/configuration-section.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/configuration-section.js +28 -0
- package/lib/browser/ai-configuration/components/configuration-section.js.map +1 -0
- package/lib/browser/ai-configuration/components/empty-state.d.ts +11 -0
- package/lib/browser/ai-configuration/components/empty-state.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/empty-state.js +26 -0
- package/lib/browser/ai-configuration/components/empty-state.js.map +1 -0
- package/lib/browser/ai-configuration/components/expandable-section.d.ts +14 -0
- package/lib/browser/ai-configuration/components/expandable-section.d.ts.map +1 -0
- package/lib/browser/ai-configuration/components/expandable-section.js +31 -0
- package/lib/browser/ai-configuration/components/expandable-section.js.map +1 -0
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/language-model-renderer.js +23 -22
- package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +0 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.js +86 -80
- package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +8 -22
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +49 -78
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +1 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js +11 -11
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +1 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +7 -8
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js +92 -78
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +12 -7
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.js +43 -35
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +1 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +8 -4
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +1 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.js +61 -28
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +1 -1
- package/lib/browser/analyze-gh-ticket-command-contribution.d.ts +9 -0
- package/lib/browser/analyze-gh-ticket-command-contribution.d.ts.map +1 -0
- package/lib/browser/analyze-gh-ticket-command-contribution.js +172 -0
- package/lib/browser/analyze-gh-ticket-command-contribution.js.map +1 -0
- package/lib/browser/frontend-module.d.ts.map +1 -1
- package/lib/browser/frontend-module.js +6 -0
- package/lib/browser/frontend-module.js.map +1 -1
- package/lib/browser/implement-gh-ticket-command-contribution.d.ts +9 -0
- package/lib/browser/implement-gh-ticket-command-contribution.d.ts.map +1 -0
- package/lib/browser/implement-gh-ticket-command-contribution.js +156 -0
- package/lib/browser/implement-gh-ticket-command-contribution.js.map +1 -0
- package/package.json +21 -21
- package/src/browser/address-pr-review-command-contribution.ts +180 -0
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +256 -135
- package/src/browser/ai-configuration/base/ai-card-grid-configuration-widget.tsx +72 -0
- package/src/browser/ai-configuration/base/ai-configuration-base-widget.tsx +37 -0
- package/src/browser/ai-configuration/base/ai-hierarchical-configuration-widget.tsx +51 -0
- package/src/browser/ai-configuration/base/ai-list-detail-configuration-widget.tsx +140 -0
- package/src/browser/ai-configuration/base/ai-table-configuration-widget.tsx +107 -0
- package/src/browser/ai-configuration/components/configuration-section.tsx +37 -0
- package/src/browser/ai-configuration/components/empty-state.tsx +30 -0
- package/src/browser/ai-configuration/components/expandable-section.tsx +51 -0
- package/src/browser/ai-configuration/language-model-renderer.tsx +68 -63
- package/src/browser/ai-configuration/mcp-configuration-widget.tsx +80 -85
- package/src/browser/ai-configuration/model-aliases-configuration-widget.tsx +93 -107
- package/src/browser/ai-configuration/template-settings-renderer.tsx +25 -29
- package/src/browser/ai-configuration/token-usage-configuration-widget.tsx +130 -130
- package/src/browser/ai-configuration/tools-configuration-widget.tsx +68 -59
- package/src/browser/ai-configuration/variable-configuration-widget.tsx +95 -45
- package/src/browser/analyze-gh-ticket-command-contribution.ts +176 -0
- package/src/browser/frontend-module.ts +6 -0
- package/src/browser/implement-gh-ticket-command-contribution.ts +160 -0
- package/src/browser/style/ai-configuration-base.css +90 -0
- package/src/browser/style/ai-configuration-cards.css +60 -0
- package/src/browser/style/ai-configuration-hierarchical.css +61 -0
- package/src/browser/style/ai-configuration-list-detail.css +88 -0
- package/src/browser/style/ai-configuration-table.css +73 -0
- package/src/browser/style/index.css +458 -288
- package/src/browser/style/widgets/mcp-configuration.css +253 -0
- package/src/browser/style/widgets/model-aliases-configuration.css +74 -0
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2025 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 { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
|
+
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
|
+
import { PromptService } from '@theia/ai-core/lib/common';
|
|
20
|
+
import { nls } from '@theia/core';
|
|
21
|
+
import { AGENT_DELEGATION_FUNCTION_ID } from '@theia/ai-chat/lib/browser/agent-delegation-tool';
|
|
22
|
+
import { GitHubChatAgentId } from './github-chat-agent';
|
|
23
|
+
|
|
24
|
+
@injectable()
|
|
25
|
+
export class AddressGhReviewCommandContribution implements FrontendApplicationContribution {
|
|
26
|
+
|
|
27
|
+
@inject(PromptService)
|
|
28
|
+
protected readonly promptService: PromptService;
|
|
29
|
+
|
|
30
|
+
onStart(): void {
|
|
31
|
+
this.registerAddressGhReviewCommand();
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected registerAddressGhReviewCommand(): void {
|
|
35
|
+
const commandTemplate = this.buildCommandTemplate();
|
|
36
|
+
|
|
37
|
+
this.promptService.addBuiltInPromptFragment({
|
|
38
|
+
id: 'address-gh-review',
|
|
39
|
+
template: commandTemplate,
|
|
40
|
+
isCommand: true,
|
|
41
|
+
commandName: 'address-gh-review',
|
|
42
|
+
commandDescription: nls.localize(
|
|
43
|
+
'theia/ai-ide/addressGhReviewCommand/description',
|
|
44
|
+
'Address review comments on a GitHub pull request'
|
|
45
|
+
),
|
|
46
|
+
commandArgumentHint: nls.localize(
|
|
47
|
+
'theia/ai-ide/addressGhReviewCommand/argumentHint',
|
|
48
|
+
'<pr-number>'
|
|
49
|
+
),
|
|
50
|
+
commandAgents: ['Coder']
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
protected buildCommandTemplate(): string {
|
|
55
|
+
return `You have been asked to address review comments on a GitHub pull request.
|
|
56
|
+
|
|
57
|
+
## Pull Request Number
|
|
58
|
+
$ARGUMENTS
|
|
59
|
+
|
|
60
|
+
## Task Overview
|
|
61
|
+
You need to retrieve all details about the specified pull request, especially the review comments, assess whether you can safely address all comments, and if so,
|
|
62
|
+
implement the requested changes.
|
|
63
|
+
|
|
64
|
+
## Step 1: Retrieve Pull Request Information
|
|
65
|
+
Use the ~{${AGENT_DELEGATION_FUNCTION_ID}} tool to delegate to the GitHub agent and retrieve comprehensive information about the pull request.
|
|
66
|
+
|
|
67
|
+
**Agent ID:** '${GitHubChatAgentId}'
|
|
68
|
+
**Prompt:** Ask the GitHub agent to retrieve ALL details about PR #$ARGUMENTS, specifically requesting:
|
|
69
|
+
- The PR title and description
|
|
70
|
+
- The current state of the PR (open, closed, merged)
|
|
71
|
+
- ALL review comments - this is critical, every single review comment must be retrieved
|
|
72
|
+
- General PR comments (conversation)
|
|
73
|
+
- The list of files changed in the PR
|
|
74
|
+
- Any referenced issues
|
|
75
|
+
- Review status (approved, changes requested, etc.)
|
|
76
|
+
|
|
77
|
+
Example delegation prompt:
|
|
78
|
+
\`\`\`
|
|
79
|
+
Please retrieve comprehensive information about pull request #$ARGUMENTS. I need:
|
|
80
|
+
1. The PR title, description, and current state
|
|
81
|
+
2. ALL review comments on this PR - every single inline review comment is critical
|
|
82
|
+
3. ALL general conversation comments on the PR
|
|
83
|
+
4. The list of files changed in this PR
|
|
84
|
+
5. The current review status (approved, changes requested, pending)
|
|
85
|
+
6. Any linked or referenced issues
|
|
86
|
+
|
|
87
|
+
This is for addressing the review comments, so completeness is absolutely crucial. Make sure to get every review comment.
|
|
88
|
+
\`\`\`
|
|
89
|
+
|
|
90
|
+
## Step 2: Analyze and Categorize Review Comments
|
|
91
|
+
After receiving the PR information, analyze each review comment and categorize them:
|
|
92
|
+
|
|
93
|
+
### Categories of Review Comments:
|
|
94
|
+
1. **Clear code changes**: Comments requesting specific, unambiguous code modifications (e.g., "rename this variable", "add null check here", "fix this typo")
|
|
95
|
+
2. **Style/formatting fixes**: Comments about code style, formatting, or conventions
|
|
96
|
+
3. **Bug fixes**: Comments pointing out bugs or issues that need to be fixed
|
|
97
|
+
4. **Clarification questions**: Reviewers asking questions that need answers, not code changes
|
|
98
|
+
5. **Design discussions**: Comments about architectural or design decisions that require human judgment
|
|
99
|
+
6. **Ambiguous requests**: Comments that are unclear or could be interpreted multiple ways
|
|
100
|
+
|
|
101
|
+
### Criteria for Safely Addressable Comments:
|
|
102
|
+
- The requested change is clearly specified
|
|
103
|
+
- The change is localized and well-scoped
|
|
104
|
+
- No architectural or design decisions are required
|
|
105
|
+
- The change doesn't conflict with other review comments
|
|
106
|
+
- You have enough context to make the change correctly
|
|
107
|
+
|
|
108
|
+
### Criteria for Comments Requiring Clarification:
|
|
109
|
+
- The comment is ambiguous or vague
|
|
110
|
+
- Multiple valid interpretations exist
|
|
111
|
+
- The comment requires design decisions
|
|
112
|
+
- Comments conflict with each other
|
|
113
|
+
- The reviewer is asking a question rather than requesting a change
|
|
114
|
+
|
|
115
|
+
## Step 3: Respond Based on Analysis
|
|
116
|
+
|
|
117
|
+
### If ANY comments cannot be safely addressed:
|
|
118
|
+
List all comments and their status, then ask for clarification on the problematic ones:
|
|
119
|
+
|
|
120
|
+
Example response format:
|
|
121
|
+
\`\`\`
|
|
122
|
+
## PR Review Analysis
|
|
123
|
+
|
|
124
|
+
### Comments I Can Address:
|
|
125
|
+
1. [File: path/to/file.ts, Line X] - "[Comment summary]" - Will [action]
|
|
126
|
+
2. [File: path/to/file.ts, Line Y] - "[Comment summary]" - Will [action]
|
|
127
|
+
|
|
128
|
+
### Comments Requiring Clarification:
|
|
129
|
+
1. [File: path/to/file.ts, Line Z] - "[Comment summary]"
|
|
130
|
+
- **Issue**: [Why this needs clarification]
|
|
131
|
+
- **Question**: [Specific question to resolve ambiguity]
|
|
132
|
+
|
|
133
|
+
2. [File: path/to/other.ts, Line W] - "[Comment summary]"
|
|
134
|
+
- **Issue**: [Why this needs clarification]
|
|
135
|
+
- **Question**: [Specific question to resolve ambiguity]
|
|
136
|
+
|
|
137
|
+
### Conflicting Comments:
|
|
138
|
+
- [Describe any conflicts between review comments]
|
|
139
|
+
|
|
140
|
+
Please provide clarification on the above items. Once clarified, I can proceed to address all review comments.
|
|
141
|
+
|
|
142
|
+
Alternatively, if you'd like me to proceed with just the comments I can safely address, please confirm.
|
|
143
|
+
\`\`\`
|
|
144
|
+
|
|
145
|
+
### If ALL comments can be safely addressed:
|
|
146
|
+
Proceed with implementing all the requested changes:
|
|
147
|
+
|
|
148
|
+
1. **List all comments** and what you will do to address each one
|
|
149
|
+
2. **Implement the changes** file by file, addressing each review comment
|
|
150
|
+
3. **Explain each change** as you make it, referencing the original review comment
|
|
151
|
+
4. **Summarize** all changes made at the end
|
|
152
|
+
|
|
153
|
+
Example response format:
|
|
154
|
+
\`\`\`
|
|
155
|
+
## PR Review Analysis
|
|
156
|
+
|
|
157
|
+
All review comments can be safely addressed. Proceeding with implementation.
|
|
158
|
+
|
|
159
|
+
### Review Comments to Address:
|
|
160
|
+
1. [File: path/to/file.ts, Line X] - "[Comment summary]" - Will [action]
|
|
161
|
+
2. [File: path/to/file.ts, Line Y] - "[Comment summary]" - Will [action]
|
|
162
|
+
...
|
|
163
|
+
|
|
164
|
+
### Implementation
|
|
165
|
+
[Proceed to make changes, explaining each one]
|
|
166
|
+
|
|
167
|
+
### Summary
|
|
168
|
+
[List all changes made and which review comments they address]
|
|
169
|
+
\`\`\`
|
|
170
|
+
|
|
171
|
+
## Important Guidelines
|
|
172
|
+
- Always preserve the intent of the original code while addressing review comments
|
|
173
|
+
- If a review comment conflicts with the existing code style, follow the project's conventions
|
|
174
|
+
- Make minimal changes - only change what's necessary to address each comment
|
|
175
|
+
- If you discover issues beyond the review comments, mention them but don't fix them unless asked
|
|
176
|
+
- After implementation, provide a summary that maps each change to the review comment it addresses
|
|
177
|
+
|
|
178
|
+
Remember: It's better to ask for clarification than to make assumptions that could introduce bugs or go against the reviewer's intent.`;
|
|
179
|
+
}
|
|
180
|
+
}
|