@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
|
@@ -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,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE,CAAC,CAAC;QACvD,IAAA,a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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
|
|
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,37 +15,37 @@
|
|
|
15
15
|
"theia-extension"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
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
|
|
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
|
-
"ignore": "^6.0.
|
|
38
|
-
"js-yaml": "^4.1.
|
|
39
|
-
"minimatch": "^10.
|
|
40
|
-
"puppeteer-core": "^24.
|
|
41
|
-
"simple-git": "^3.
|
|
37
|
+
"ignore": "^6.0.2",
|
|
38
|
+
"js-yaml": "^4.1.1",
|
|
39
|
+
"minimatch": "^10.2.5",
|
|
40
|
+
"puppeteer-core": "^24.40.0",
|
|
41
|
+
"simple-git": "^3.33.0"
|
|
42
42
|
},
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@theia/cli": "1.71.0
|
|
48
|
-
"@theia/test": "1.71.0
|
|
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": "
|
|
72
|
+
"gitHead": "d8a596fc99f0a8e68b466828ed162569d79e3a71"
|
|
73
73
|
}
|
|
@@ -20,9 +20,9 @@ import {
|
|
|
20
20
|
QuestionResponseContentImpl
|
|
21
21
|
} from '@theia/ai-chat/lib/common';
|
|
22
22
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
23
|
-
import { nls, PreferenceService } from '@theia/core';
|
|
23
|
+
import { nls, PreferenceScope, PreferenceService } from '@theia/core';
|
|
24
24
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
25
|
-
import {
|
|
25
|
+
import { PREFERENCE_NAME_AGENT_MODE_ENABLED } from '../common/ai-ide-preferences';
|
|
26
26
|
|
|
27
27
|
export const AgentModeConfirmationService = Symbol('AgentModeConfirmationService');
|
|
28
28
|
export interface AgentModeConfirmationService {
|
|
@@ -36,32 +36,35 @@ export class AgentModeConfirmationServiceImpl implements AgentModeConfirmationSe
|
|
|
36
36
|
@inject(PreferenceService) protected readonly preferenceService: PreferenceService;
|
|
37
37
|
|
|
38
38
|
isAcknowledged(): boolean {
|
|
39
|
-
return !!this.preferenceService.get<boolean>(
|
|
39
|
+
return !!this.preferenceService.get<boolean>(PREFERENCE_NAME_AGENT_MODE_ENABLED, false);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
async requestConfirmation(request: MutableChatRequestModel): Promise<boolean> {
|
|
43
43
|
const deferred = new Deferred<boolean>();
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
const
|
|
45
|
+
const agentModeLabel = nls.localize('theia/ai/ide/agentModeConfirmation/continueAgentMode', 'Continue with Agent Mode');
|
|
46
|
+
const editModeLabel = nls.localize('theia/ai/ide/agentModeConfirmation/continueEditMode', 'Continue with Edit Mode');
|
|
47
47
|
|
|
48
48
|
request.response.response.addContent(new MarkdownChatResponseContentImpl(
|
|
49
49
|
nls.localize('theia/ai/ide/agentModeConfirmation/msg',
|
|
50
|
-
'
|
|
51
|
-
+ '
|
|
52
|
-
+ '
|
|
53
|
-
+ '
|
|
54
|
-
+ '
|
|
55
|
-
+ '
|
|
50
|
+
'You are about to use **Agent Mode**. In this mode, the agent can **read, create, and modify files** '
|
|
51
|
+
+ 'in your workspace autonomously, without asking for confirmation on each change.\n\n'
|
|
52
|
+
+ 'We recommend using **version control** (e.g. Git) so you can easily review and revert any changes.\n\n'
|
|
53
|
+
+ 'If you prefer more control, you can continue with **Edit Mode** instead, '
|
|
54
|
+
+ 'where changes are presented as suggestions for you to apply.\n\n'
|
|
55
|
+
+ 'How would you like to proceed?')
|
|
56
56
|
));
|
|
57
57
|
|
|
58
58
|
request.response.response.addContent(new QuestionResponseContentImpl(
|
|
59
|
-
nls.localize('theia/ai/ide/agentModeConfirmation/
|
|
60
|
-
|
|
59
|
+
nls.localize('theia/ai/ide/agentModeConfirmation/info',
|
|
60
|
+
'Continuing with Agent Mode saves your confirmation. You can revoke this later again via the `ai-features.agentMode.enabled` setting.\n\n'
|
|
61
|
+
+ 'Continuing with Edit Mode changes your default mode to Edit Mode.\n\n'
|
|
62
|
+
+ 'You can change modes anytime via the mode selector or in the AI Configuration.'),
|
|
63
|
+
[{ text: agentModeLabel }, { text: editModeLabel }],
|
|
61
64
|
request,
|
|
62
65
|
async selectedOption => {
|
|
63
|
-
if (selectedOption.text ===
|
|
64
|
-
await this.preferenceService.set(
|
|
66
|
+
if (selectedOption.text === agentModeLabel) {
|
|
67
|
+
await this.preferenceService.set(PREFERENCE_NAME_AGENT_MODE_ENABLED, true, PreferenceScope.User);
|
|
65
68
|
request.response.stopWaitingForInput();
|
|
66
69
|
deferred.resolve(true);
|
|
67
70
|
} else {
|
|
@@ -79,9 +82,7 @@ export class AgentModeConfirmationServiceImpl implements AgentModeConfirmationSe
|
|
|
79
82
|
|
|
80
83
|
return deferred.promise.then(result => {
|
|
81
84
|
request.response.updateProgressMessage({ ...progressMessage, show: 'untilFirstContent', status: 'completed' });
|
|
82
|
-
|
|
83
|
-
request.response.response.clearContent();
|
|
84
|
-
}
|
|
85
|
+
request.response.response.clearContent();
|
|
85
86
|
return result;
|
|
86
87
|
});
|
|
87
88
|
}
|
|
@@ -310,7 +310,7 @@ export class AIAgentConfigurationWidget extends AIListDetailConfigurationWidget<
|
|
|
310
310
|
<tr>
|
|
311
311
|
<th>{nls.localize('theia/ai/core/agentConfiguration/templateName', 'Template')}</th>
|
|
312
312
|
<th>{nls.localize('theia/ai/core/agentConfiguration/variant', 'Variant')}</th>
|
|
313
|
-
<th className="template-actions-header">{nls.
|
|
313
|
+
<th className="template-actions-header">{nls.localize('theia/ai/core/agentConfiguration/actions', 'Actions')}</th>
|
|
314
314
|
</tr>
|
|
315
315
|
</thead>
|
|
316
316
|
<tbody>
|
|
@@ -841,7 +841,7 @@ const AgentGenericCapabilitiesSettings = ({ agentId, savedSelections, aiSettings
|
|
|
841
841
|
<tr>
|
|
842
842
|
<th>{nls.localizeByDefault('Type')}</th>
|
|
843
843
|
<th>{nls.localize('theia/ai/ide/agentConfiguration/selections', 'Selections')}</th>
|
|
844
|
-
<th className="template-actions-header">{nls.
|
|
844
|
+
<th className="template-actions-header">{nls.localize('theia/ai/core/agentConfiguration/actions', 'Actions')}</th>
|
|
845
845
|
</tr>
|
|
846
846
|
</thead>
|
|
847
847
|
<tbody>
|
|
@@ -66,7 +66,7 @@ export class AIAgentConfigurationViewContribution extends AIViewContribution<AIC
|
|
|
66
66
|
registry.registerItem({
|
|
67
67
|
id: 'chat-view.' + OPEN_AI_CONFIG_VIEW.id,
|
|
68
68
|
command: OPEN_AI_CONFIG_VIEW.id,
|
|
69
|
-
tooltip: nls.localize('theia/ai-ide/open-
|
|
69
|
+
tooltip: nls.localize('theia/ai-ide/open-ai-configuration-tooltip', 'Open AI Configuration'),
|
|
70
70
|
group: 'ai-settings',
|
|
71
71
|
priority: 2,
|
|
72
72
|
isVisible: widget => this.activationService.isActive && widget instanceof ChatViewWidget
|
|
@@ -29,6 +29,7 @@ import * as React from '@theia/core/shared/react';
|
|
|
29
29
|
import { AgentService } from '@theia/ai-core/lib/common/agent-service';
|
|
30
30
|
import { Agent } from '@theia/ai-core/lib/common/agent';
|
|
31
31
|
import { CustomizationSource } from '@theia/ai-core/lib/browser/frontend-prompt-customization-service';
|
|
32
|
+
import { isChatAgent } from '@theia/ai-chat/';
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* Widget for configuring AI prompt fragments and prompt variant sets.
|
|
@@ -464,7 +465,7 @@ export class AIPromptFragmentsConfigurationWidget extends ReactWidget {
|
|
|
464
465
|
<span key={agent.id} className="agent-chip"
|
|
465
466
|
title={nls.localize('theia/ai/core/promptFragmentsConfiguration/usedByAgentTitle', 'Used by agent: {0}', agent.name)}
|
|
466
467
|
onClick={e => e.stopPropagation()}>
|
|
467
|
-
<span className={codicon('copilot')}></span>
|
|
468
|
+
<span className={(isChatAgent(agent) && agent.iconClass) ? agent.iconClass : codicon('copilot')}></span>
|
|
468
469
|
{agent.name}
|
|
469
470
|
</span>
|
|
470
471
|
))}
|
|
@@ -22,6 +22,7 @@ import { Skill } from '@theia/ai-core/lib/common/skill';
|
|
|
22
22
|
import { SkillService } from '@theia/ai-core/lib/browser/skill-service';
|
|
23
23
|
import { PromptFragment, PromptService } from '@theia/ai-core/lib/common/prompt-service';
|
|
24
24
|
import { Agent, AgentService } from '@theia/ai-core';
|
|
25
|
+
import { isChatAgent } from '@theia/ai-chat';
|
|
25
26
|
|
|
26
27
|
@injectable()
|
|
27
28
|
export class AISkillsConfigurationWidget extends ReactWidget {
|
|
@@ -215,7 +216,7 @@ export class AISkillsConfigurationWidget extends ReactWidget {
|
|
|
215
216
|
<div className="slash-command-agent-chips">
|
|
216
217
|
{agents.map(agent => (
|
|
217
218
|
<span key={agent.id} className="agent-chip" title={agent.description}>
|
|
218
|
-
<span className={codicon('copilot')}></span>
|
|
219
|
+
<span className={(isChatAgent(agent) && agent.iconClass) ? agent.iconClass : codicon('copilot')}></span>
|
|
219
220
|
{agent.name}
|
|
220
221
|
</span>
|
|
221
222
|
))}
|
|
@@ -13,12 +13,13 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
16
|
+
import { inject, injectable, preDestroy } from '@theia/core/shared/inversify';
|
|
17
17
|
import { FrontendApplicationContribution } from '@theia/core/lib/browser';
|
|
18
|
-
import { Emitter, MaybePromise, Event, PreferenceService
|
|
18
|
+
import { DisposableCollection, Emitter, MaybePromise, Event, PreferenceService } from '@theia/core';
|
|
19
19
|
import { ContextKeyService, ContextKey } from '@theia/core/lib/browser/context-key-service';
|
|
20
20
|
import { AIActivationService, ENABLE_AI_CONTEXT_KEY } from '@theia/ai-core/lib/browser/ai-activation-service';
|
|
21
21
|
import { PREFERENCE_NAME_ENABLE_AI } from '../common/ai-ide-preferences';
|
|
22
|
+
import { WorkspaceTrustService } from '@theia/workspace/lib/browser/workspace-trust-service';
|
|
22
23
|
|
|
23
24
|
/**
|
|
24
25
|
* Implements AI Activation Service based on preferences.
|
|
@@ -31,22 +32,55 @@ export class AIIdeActivationServiceImpl implements AIActivationService, Frontend
|
|
|
31
32
|
@inject(PreferenceService)
|
|
32
33
|
protected preferenceService: PreferenceService;
|
|
33
34
|
|
|
35
|
+
@inject(WorkspaceTrustService)
|
|
36
|
+
protected workspaceTrustService: WorkspaceTrustService;
|
|
37
|
+
|
|
34
38
|
protected isAiEnabledKey: ContextKey<boolean>;
|
|
35
39
|
|
|
40
|
+
protected workspaceTrusted = false;
|
|
41
|
+
|
|
36
42
|
protected onDidChangeAIEnabled = new Emitter<boolean>();
|
|
37
43
|
get onDidChangeActiveStatus(): Event<boolean> {
|
|
38
44
|
return this.onDidChangeAIEnabled.event;
|
|
39
45
|
}
|
|
40
46
|
|
|
47
|
+
protected onDidChangeCanRunEmitter = new Emitter<boolean>();
|
|
48
|
+
get onDidChangeCanRun(): Event<boolean> {
|
|
49
|
+
return this.onDidChangeCanRunEmitter.event;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
protected readonly toDispose = new DisposableCollection(this.onDidChangeAIEnabled, this.onDidChangeCanRunEmitter);
|
|
53
|
+
|
|
54
|
+
@preDestroy()
|
|
55
|
+
protected dispose(): void {
|
|
56
|
+
this.toDispose.dispose();
|
|
57
|
+
}
|
|
58
|
+
|
|
41
59
|
get isActive(): boolean {
|
|
42
60
|
return this.isAiEnabledKey.get() ?? false;
|
|
43
61
|
}
|
|
44
62
|
|
|
63
|
+
get canRun(): boolean {
|
|
64
|
+
return this.isActive && this.workspaceTrusted;
|
|
65
|
+
}
|
|
66
|
+
|
|
45
67
|
protected updateEnableValue(value: boolean): void {
|
|
68
|
+
const oldCanRun = this.canRun;
|
|
46
69
|
if (value !== this.isAiEnabledKey.get()) {
|
|
47
70
|
this.isAiEnabledKey.set(value);
|
|
48
71
|
this.onDidChangeAIEnabled.fire(value);
|
|
49
72
|
}
|
|
73
|
+
if (this.canRun !== oldCanRun) {
|
|
74
|
+
this.onDidChangeCanRunEmitter.fire(this.canRun);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
protected updateTrustValue(trusted: boolean): void {
|
|
79
|
+
const oldCanRun = this.canRun;
|
|
80
|
+
this.workspaceTrusted = trusted;
|
|
81
|
+
if (this.canRun !== oldCanRun) {
|
|
82
|
+
this.onDidChangeCanRunEmitter.fire(this.canRun);
|
|
83
|
+
}
|
|
50
84
|
}
|
|
51
85
|
|
|
52
86
|
initialize(): MaybePromise<void> {
|
|
@@ -56,10 +90,16 @@ export class AIIdeActivationServiceImpl implements AIActivationService, Frontend
|
|
|
56
90
|
const enableValue = this.preferenceService.get<boolean>(PREFERENCE_NAME_ENABLE_AI, false);
|
|
57
91
|
this.updateEnableValue(enableValue);
|
|
58
92
|
});
|
|
59
|
-
this.preferenceService.onPreferenceChanged(e => {
|
|
93
|
+
this.toDispose.push(this.preferenceService.onPreferenceChanged(e => {
|
|
60
94
|
if (e.preferenceName === PREFERENCE_NAME_ENABLE_AI) {
|
|
61
95
|
this.updateEnableValue(this.preferenceService.get<boolean>(PREFERENCE_NAME_ENABLE_AI, false));
|
|
62
96
|
}
|
|
97
|
+
}));
|
|
98
|
+
this.workspaceTrustService.getWorkspaceTrust().then(trusted => {
|
|
99
|
+
this.updateTrustValue(trusted);
|
|
63
100
|
});
|
|
101
|
+
this.toDispose.push(this.workspaceTrustService.onDidChangeWorkspaceTrust(trusted => {
|
|
102
|
+
this.updateTrustValue(trusted);
|
|
103
|
+
}));
|
|
64
104
|
}
|
|
65
105
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { nls } from '@theia/core/lib/common/nls';
|
|
19
|
+
import { WorkspaceRestrictionContribution, WorkspaceRestriction } from '@theia/workspace/lib/browser/workspace-trust-service';
|
|
20
|
+
import { AIActivationService } from '@theia/ai-core/lib/browser';
|
|
21
|
+
|
|
22
|
+
@injectable()
|
|
23
|
+
export class AIWorkspaceRestrictionContribution implements WorkspaceRestrictionContribution {
|
|
24
|
+
|
|
25
|
+
@inject(AIActivationService)
|
|
26
|
+
protected readonly activationService: AIActivationService;
|
|
27
|
+
|
|
28
|
+
getRestrictions(): WorkspaceRestriction[] {
|
|
29
|
+
if (this.activationService.isActive && !this.activationService.canRun) {
|
|
30
|
+
return [{
|
|
31
|
+
label: nls.localize('theia/ai/ide/restrictedModeLabel',
|
|
32
|
+
'AI Features (disabled in Restricted Mode)'),
|
|
33
|
+
details: [nls.localize('theia/ai/ide/restrictedModeDetails',
|
|
34
|
+
'AI chat, inline suggestions, code actions, and prompt templates are disabled')]
|
|
35
|
+
}];
|
|
36
|
+
}
|
|
37
|
+
return [];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -57,7 +57,7 @@ export const appTesterPlaywrightTemplate: BasePromptFragment = {
|
|
|
57
57
|
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
58
58
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
59
59
|
|
|
60
|
-
You are AppTester, an AI assistant integrated into
|
|
60
|
+
You are AppTester, an AI assistant integrated into {{productName}} specifically designed to help developers test running applications using Playwright.
|
|
61
61
|
Your role is to inspect the application for user-specified test scenarios through the Playwright MCP server.
|
|
62
62
|
|
|
63
63
|
## Your Workflow
|
|
@@ -22,6 +22,7 @@ import { LanguageModelRequirement } from '@theia/ai-core';
|
|
|
22
22
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
23
23
|
import { architectSystemVariants, ARCHITECT_PLANNING_PROMPT_ID, ARCHITECT_SIMPLE_PROMPT_ID, ARCHITECT_PLANNING_NEXT_PROMPT_ID } from './architect-prompt-template';
|
|
24
24
|
import { nls } from '@theia/core';
|
|
25
|
+
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
|
|
25
26
|
import { MarkdownStringImpl } from '@theia/core/lib/common/markdown-rendering';
|
|
26
27
|
import { AI_EXECUTE_PLAN_WITH_CODER } from '../common/summarize-session-commands';
|
|
27
28
|
import { AbstractModeAwareChatAgent } from './mode-aware-chat-agent';
|
|
@@ -40,11 +41,13 @@ export class ArchitectAgent extends AbstractModeAwareChatAgent {
|
|
|
40
41
|
identifier: 'default/code',
|
|
41
42
|
}];
|
|
42
43
|
protected defaultLanguageModelPurpose: string = 'chat';
|
|
44
|
+
override iconClass: string = 'codicon codicon-map';
|
|
43
45
|
|
|
44
46
|
override description = nls.localize('theia/ai/workspace/workspaceAgent/description',
|
|
45
|
-
'An AI assistant integrated into
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
'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' +
|
|
48
|
+
' and folders and retrieve their content. It cannot modify files. It can therefore answer questions about the current project, project files and source code in the' +
|
|
49
|
+
' workspace, such as how to build the project, where to put source code, where to find specific code or configurations, etc.',
|
|
50
|
+
FrontendApplicationConfigProvider.get().applicationName);
|
|
48
51
|
|
|
49
52
|
protected readonly modeDefinitions: Omit<ChatMode, 'isDefault'>[] = [
|
|
50
53
|
{
|