@theia/ai-ide 1.67.0-next.3 → 1.67.0-next.56
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/README.md +1 -0
- package/package.json +21 -21
- package/src/browser/ai-configuration/agent-configuration-widget.tsx +3 -3
- package/src/browser/context-file-validation-service-impl.spec.ts +405 -0
- package/src/browser/context-file-validation-service-impl.ts +120 -0
- package/src/browser/context-functions.spec.ts +155 -1
- package/src/browser/context-functions.ts +40 -6
- package/src/browser/file-changeset-functions.spec.ts +13 -13
- package/src/browser/file-changeset-functions.ts +9 -9
- package/src/browser/frontend-module.ts +12 -4
- package/src/browser/ide-chat-welcome-message-provider.tsx +64 -70
- package/src/browser/remember-command-contribution.ts +105 -0
- package/src/browser/workspace-functions.ts +68 -1
- package/src/common/ai-ide-preferences.ts +1 -1
- package/src/common/coder-replace-prompt-template.ts +8 -9
- package/src/common/command-prompt-template.ts +5 -5
- package/src/common/file-changeset-function-ids.ts +15 -1
- package/src/common/orchestrator-chat-agent.ts +2 -2
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts +0 -41
- package/lib/browser/ai-configuration/agent-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/agent-configuration-widget.js +0 -333
- package/lib/browser/ai-configuration/agent-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts +0 -18
- package/lib/browser/ai-configuration/ai-configuration-service.d.ts.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-service.js +0 -53
- package/lib/browser/ai-configuration/ai-configuration-service.js.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts +0 -14
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.d.ts.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js +0 -67
- package/lib/browser/ai-configuration/ai-configuration-view-contribution.js.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts +0 -29
- package/lib/browser/ai-configuration/ai-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/ai-configuration-widget.js +0 -118
- package/lib/browser/ai-configuration/ai-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/language-model-renderer.d.ts +0 -13
- package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +0 -1
- package/lib/browser/ai-configuration/language-model-renderer.js +0 -104
- package/lib/browser/ai-configuration/language-model-renderer.js.map +0 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts +0 -43
- package/lib/browser/ai-configuration/mcp-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/mcp-configuration-widget.js +0 -302
- package/lib/browser/ai-configuration/mcp-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts +0 -41
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js +0 -226
- package/lib/browser/ai-configuration/model-aliases-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts +0 -141
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js +0 -508
- package/lib/browser/ai-configuration/prompt-fragments-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts +0 -10
- package/lib/browser/ai-configuration/template-settings-renderer.d.ts.map +0 -1
- package/lib/browser/ai-configuration/template-settings-renderer.js +0 -48
- package/lib/browser/ai-configuration/template-settings-renderer.js.map +0 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts +0 -22
- package/lib/browser/ai-configuration/token-usage-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js +0 -156
- package/lib/browser/ai-configuration/token-usage-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts +0 -30
- package/lib/browser/ai-configuration/tools-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/tools-configuration-widget.js +0 -150
- package/lib/browser/ai-configuration/tools-configuration-widget.js.map +0 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts +0 -19
- package/lib/browser/ai-configuration/variable-configuration-widget.d.ts.map +0 -1
- package/lib/browser/ai-configuration/variable-configuration-widget.js +0 -99
- package/lib/browser/ai-configuration/variable-configuration-widget.js.map +0 -1
- package/lib/browser/ai-ide-activation-service.d.ts +0 -18
- package/lib/browser/ai-ide-activation-service.d.ts.map +0 -1
- package/lib/browser/ai-ide-activation-service.js +0 -71
- package/lib/browser/ai-ide-activation-service.js.map +0 -1
- package/lib/browser/ai-terminal-functions.d.ts +0 -13
- package/lib/browser/ai-terminal-functions.d.ts.map +0 -1
- package/lib/browser/ai-terminal-functions.js +0 -114
- package/lib/browser/ai-terminal-functions.js.map +0 -1
- package/lib/browser/app-tester-chat-agent.d.ts +0 -35
- package/lib/browser/app-tester-chat-agent.d.ts.map +0 -1
- package/lib/browser/app-tester-chat-agent.js +0 -142
- package/lib/browser/app-tester-chat-agent.js.map +0 -1
- package/lib/browser/app-tester-chat-functions.d.ts +0 -25
- package/lib/browser/app-tester-chat-functions.d.ts.map +0 -1
- package/lib/browser/app-tester-chat-functions.js +0 -170
- package/lib/browser/app-tester-chat-functions.js.map +0 -1
- package/lib/browser/app-tester-prompt-template.d.ts +0 -6
- package/lib/browser/app-tester-prompt-template.d.ts.map +0 -1
- package/lib/browser/app-tester-prompt-template.js +0 -83
- package/lib/browser/app-tester-prompt-template.js.map +0 -1
- package/lib/browser/architect-agent.d.ts +0 -15
- package/lib/browser/architect-agent.d.ts.map +0 -1
- package/lib/browser/architect-agent.js +0 -68
- package/lib/browser/architect-agent.js.map +0 -1
- package/lib/browser/coder-agent.d.ts +0 -15
- package/lib/browser/coder-agent.d.ts.map +0 -1
- package/lib/browser/coder-agent.js +0 -81
- package/lib/browser/coder-agent.js.map +0 -1
- package/lib/browser/context-functions.d.ts +0 -14
- package/lib/browser/context-functions.d.ts.map +0 -1
- package/lib/browser/context-functions.js +0 -130
- package/lib/browser/context-functions.js.map +0 -1
- package/lib/browser/context-functions.spec.d.ts +0 -2
- package/lib/browser/context-functions.spec.d.ts.map +0 -1
- package/lib/browser/context-functions.spec.js +0 -93
- package/lib/browser/context-functions.spec.js.map +0 -1
- package/lib/browser/file-changeset-function.spec.d.ts +0 -2
- package/lib/browser/file-changeset-function.spec.d.ts.map +0 -1
- package/lib/browser/file-changeset-function.spec.js +0 -45
- package/lib/browser/file-changeset-function.spec.js.map +0 -1
- package/lib/browser/file-changeset-functions.d.ts +0 -87
- package/lib/browser/file-changeset-functions.d.ts.map +0 -1
- package/lib/browser/file-changeset-functions.js +0 -645
- package/lib/browser/file-changeset-functions.js.map +0 -1
- package/lib/browser/file-changeset-functions.spec.d.ts +0 -2
- package/lib/browser/file-changeset-functions.spec.d.ts.map +0 -1
- package/lib/browser/file-changeset-functions.spec.js +0 -179
- package/lib/browser/file-changeset-functions.spec.js.map +0 -1
- package/lib/browser/frontend-module.d.ts +0 -5
- package/lib/browser/frontend-module.d.ts.map +0 -1
- package/lib/browser/frontend-module.js +0 -214
- package/lib/browser/frontend-module.js.map +0 -1
- package/lib/browser/github-chat-agent.d.ts +0 -48
- package/lib/browser/github-chat-agent.d.ts.map +0 -1
- package/lib/browser/github-chat-agent.js +0 -222
- package/lib/browser/github-chat-agent.js.map +0 -1
- package/lib/browser/github-prompt-template.d.ts +0 -6
- package/lib/browser/github-prompt-template.d.ts.map +0 -1
- package/lib/browser/github-prompt-template.js +0 -53
- package/lib/browser/github-prompt-template.js.map +0 -1
- package/lib/browser/github-repo-variable-contribution.d.ts +0 -15
- package/lib/browser/github-repo-variable-contribution.d.ts.map +0 -1
- package/lib/browser/github-repo-variable-contribution.js +0 -82
- package/lib/browser/github-repo-variable-contribution.js.map +0 -1
- package/lib/browser/ide-chat-welcome-message-provider.d.ts +0 -11
- package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +0 -1
- package/lib/browser/ide-chat-welcome-message-provider.js +0 -142
- package/lib/browser/ide-chat-welcome-message-provider.js.map +0 -1
- package/lib/browser/project-info-agent.d.ts +0 -13
- package/lib/browser/project-info-agent.d.ts.map +0 -1
- package/lib/browser/project-info-agent.js +0 -45
- package/lib/browser/project-info-agent.js.map +0 -1
- package/lib/browser/summarize-session-command-contribution.d.ts +0 -19
- package/lib/browser/summarize-session-command-contribution.d.ts.map +0 -1
- package/lib/browser/summarize-session-command-contribution.js +0 -118
- package/lib/browser/summarize-session-command-contribution.js.map +0 -1
- package/lib/browser/task-background-summary-variable.d.ts +0 -9
- package/lib/browser/task-background-summary-variable.d.ts.map +0 -1
- package/lib/browser/task-background-summary-variable.js +0 -60
- package/lib/browser/task-background-summary-variable.js.map +0 -1
- package/lib/browser/task-context-agent.d.ts +0 -13
- package/lib/browser/task-context-agent.d.ts.map +0 -1
- package/lib/browser/task-context-agent.js +0 -45
- package/lib/browser/task-context-agent.js.map +0 -1
- package/lib/browser/task-context-file-storage-service.d.ts +0 -40
- package/lib/browser/task-context-file-storage-service.d.ts.map +0 -1
- package/lib/browser/task-context-file-storage-service.js +0 -232
- package/lib/browser/task-context-file-storage-service.js.map +0 -1
- package/lib/browser/template-preference-contribution.d.ts +0 -17
- package/lib/browser/template-preference-contribution.d.ts.map +0 -1
- package/lib/browser/template-preference-contribution.js +0 -94
- package/lib/browser/template-preference-contribution.js.map +0 -1
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts +0 -2
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.d.ts.map +0 -1
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js +0 -52
- package/lib/browser/test/tool-provider-cancellation-test-util.spec.js.map +0 -1
- package/lib/browser/workspace-functions.d.ts +0 -75
- package/lib/browser/workspace-functions.d.ts.map +0 -1
- package/lib/browser/workspace-functions.js +0 -641
- package/lib/browser/workspace-functions.js.map +0 -1
- package/lib/browser/workspace-functions.spec.d.ts +0 -2
- package/lib/browser/workspace-functions.spec.d.ts.map +0 -1
- package/lib/browser/workspace-functions.spec.js +0 -161
- package/lib/browser/workspace-functions.spec.js.map +0 -1
- package/lib/browser/workspace-launch-provider.d.ts +0 -24
- package/lib/browser/workspace-launch-provider.d.ts.map +0 -1
- package/lib/browser/workspace-launch-provider.js +0 -216
- package/lib/browser/workspace-launch-provider.js.map +0 -1
- package/lib/browser/workspace-launch-provider.spec.d.ts +0 -2
- package/lib/browser/workspace-launch-provider.spec.d.ts.map +0 -1
- package/lib/browser/workspace-launch-provider.spec.js +0 -245
- package/lib/browser/workspace-launch-provider.spec.js.map +0 -1
- package/lib/browser/workspace-search-provider.d.ts +0 -15
- package/lib/browser/workspace-search-provider.d.ts.map +0 -1
- package/lib/browser/workspace-search-provider.js +0 -204
- package/lib/browser/workspace-search-provider.js.map +0 -1
- package/lib/browser/workspace-search-provider.spec.d.ts +0 -2
- package/lib/browser/workspace-search-provider.spec.d.ts.map +0 -1
- package/lib/browser/workspace-search-provider.spec.js +0 -82
- package/lib/browser/workspace-search-provider.spec.js.map +0 -1
- package/lib/browser/workspace-task-provider.d.ts +0 -15
- package/lib/browser/workspace-task-provider.d.ts.map +0 -1
- package/lib/browser/workspace-task-provider.js +0 -138
- package/lib/browser/workspace-task-provider.js.map +0 -1
- package/lib/browser/workspace-task-provider.spec.d.ts +0 -2
- package/lib/browser/workspace-task-provider.spec.d.ts.map +0 -1
- package/lib/browser/workspace-task-provider.spec.js +0 -109
- package/lib/browser/workspace-task-provider.spec.js.map +0 -1
- package/lib/common/ai-configuration-preferences.d.ts +0 -8
- package/lib/common/ai-configuration-preferences.d.ts.map +0 -1
- package/lib/common/ai-configuration-preferences.js +0 -41
- package/lib/common/ai-configuration-preferences.js.map +0 -1
- package/lib/common/ai-ide-preferences.d.ts +0 -5
- package/lib/common/ai-ide-preferences.d.ts.map +0 -1
- package/lib/common/ai-ide-preferences.js +0 -53
- package/lib/common/ai-ide-preferences.js.map +0 -1
- package/lib/common/ai-terminal-functions.d.ts +0 -2
- package/lib/common/ai-terminal-functions.d.ts.map +0 -1
- package/lib/common/ai-terminal-functions.js +0 -20
- package/lib/common/ai-terminal-functions.js.map +0 -1
- package/lib/common/app-tester-chat-functions.d.ts +0 -5
- package/lib/common/app-tester-chat-functions.d.ts.map +0 -1
- package/lib/common/app-tester-chat-functions.js +0 -23
- package/lib/common/app-tester-chat-functions.js.map +0 -1
- package/lib/common/architect-prompt-template.d.ts +0 -3
- package/lib/common/architect-prompt-template.d.ts.map +0 -1
- package/lib/common/architect-prompt-template.js +0 -81
- package/lib/common/architect-prompt-template.js.map +0 -1
- package/lib/common/browser-automation-protocol.d.ts +0 -15
- package/lib/common/browser-automation-protocol.d.ts.map +0 -1
- package/lib/common/browser-automation-protocol.js +0 -22
- package/lib/common/browser-automation-protocol.js.map +0 -1
- package/lib/common/coder-replace-prompt-template.d.ts +0 -11
- package/lib/common/coder-replace-prompt-template.d.ts.map +0 -1
- package/lib/common/coder-replace-prompt-template.js +0 -295
- package/lib/common/coder-replace-prompt-template.js.map +0 -1
- package/lib/common/command-chat-agents.d.ts +0 -36
- package/lib/common/command-chat-agents.d.ts.map +0 -1
- package/lib/common/command-chat-agents.js +0 -122
- package/lib/common/command-chat-agents.js.map +0 -1
- package/lib/common/command-prompt-template.d.ts +0 -3
- package/lib/common/command-prompt-template.d.ts.map +0 -1
- package/lib/common/command-prompt-template.js +0 -226
- package/lib/common/command-prompt-template.js.map +0 -1
- package/lib/common/context-files-variable.d.ts +0 -9
- package/lib/common/context-files-variable.d.ts.map +0 -1
- package/lib/common/context-files-variable.js +0 -52
- package/lib/common/context-files-variable.js.map +0 -1
- package/lib/common/context-functions.d.ts +0 -4
- package/lib/common/context-functions.d.ts.map +0 -1
- package/lib/common/context-functions.js +0 -22
- package/lib/common/context-functions.js.map +0 -1
- package/lib/common/context-variables.d.ts +0 -3
- package/lib/common/context-variables.d.ts.map +0 -1
- package/lib/common/context-variables.js +0 -21
- package/lib/common/context-variables.js.map +0 -1
- package/lib/common/file-changeset-function-ids.d.ts +0 -8
- package/lib/common/file-changeset-function-ids.d.ts.map +0 -1
- package/lib/common/file-changeset-function-ids.js +0 -26
- package/lib/common/file-changeset-function-ids.js.map +0 -1
- package/lib/common/github-repo-protocol.d.ts +0 -15
- package/lib/common/github-repo-protocol.d.ts.map +0 -1
- package/lib/common/github-repo-protocol.js +0 -21
- package/lib/common/github-repo-protocol.js.map +0 -1
- package/lib/common/orchestrator-chat-agent.d.ts +0 -36
- package/lib/common/orchestrator-chat-agent.d.ts.map +0 -1
- package/lib/common/orchestrator-chat-agent.js +0 -167
- package/lib/common/orchestrator-chat-agent.js.map +0 -1
- package/lib/common/orchestrator-prompt-template.d.ts +0 -3
- package/lib/common/orchestrator-prompt-template.d.ts.map +0 -1
- package/lib/common/orchestrator-prompt-template.js +0 -55
- package/lib/common/orchestrator-prompt-template.js.map +0 -1
- package/lib/common/project-info-prompt-template.d.ts +0 -6
- package/lib/common/project-info-prompt-template.d.ts.map +0 -1
- package/lib/common/project-info-prompt-template.js +0 -145
- package/lib/common/project-info-prompt-template.js.map +0 -1
- package/lib/common/summarize-session-commands.d.ts +0 -4
- package/lib/common/summarize-session-commands.d.ts.map +0 -1
- package/lib/common/summarize-session-commands.js +0 -28
- package/lib/common/summarize-session-commands.js.map +0 -1
- package/lib/common/task-context-prompt-template.d.ts +0 -8
- package/lib/common/task-context-prompt-template.d.ts.map +0 -1
- package/lib/common/task-context-prompt-template.js +0 -217
- package/lib/common/task-context-prompt-template.js.map +0 -1
- package/lib/common/universal-chat-agent.d.ts +0 -17
- package/lib/common/universal-chat-agent.d.ts.map +0 -1
- package/lib/common/universal-chat-agent.js +0 -47
- package/lib/common/universal-chat-agent.js.map +0 -1
- package/lib/common/universal-prompt-template.d.ts +0 -4
- package/lib/common/universal-prompt-template.d.ts.map +0 -1
- package/lib/common/universal-prompt-template.js +0 -32
- package/lib/common/universal-prompt-template.js.map +0 -1
- package/lib/common/workspace-functions.d.ts +0 -12
- package/lib/common/workspace-functions.d.ts.map +0 -1
- package/lib/common/workspace-functions.js +0 -30
- package/lib/common/workspace-functions.js.map +0 -1
- package/lib/common/workspace-preferences.d.ts +0 -10
- package/lib/common/workspace-preferences.d.ts.map +0 -1
- package/lib/common/workspace-preferences.js +0 -89
- package/lib/common/workspace-preferences.js.map +0 -1
- package/lib/common/workspace-search-provider-util.d.ts +0 -17
- package/lib/common/workspace-search-provider-util.d.ts.map +0 -1
- package/lib/common/workspace-search-provider-util.js +0 -51
- package/lib/common/workspace-search-provider-util.js.map +0 -1
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts +0 -18
- package/lib/node/app-tester-agent/browser-automation-impl.d.ts.map +0 -1
- package/lib/node/app-tester-agent/browser-automation-impl.js +0 -96
- package/lib/node/app-tester-agent/browser-automation-impl.js.map +0 -1
- package/lib/node/backend-module.d.ts +0 -4
- package/lib/node/backend-module.d.ts.map +0 -1
- package/lib/node/backend-module.js +0 -45
- package/lib/node/backend-module.js.map +0 -1
- package/lib/node/github-repo-service-impl.d.ts +0 -7
- package/lib/node/github-repo-service-impl.d.ts.map +0 -1
- package/lib/node/github-repo-service-impl.js +0 -86
- package/lib/node/github-repo-service-impl.js.map +0 -1
- package/lib/package.spec.d.ts +0 -1
- package/lib/package.spec.d.ts.map +0 -1
- package/lib/package.spec.js +0 -26
- package/lib/package.spec.js.map +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Contribution that registers the `/remember` slash command for AI chat agents.
|
|
25
|
+
*
|
|
26
|
+
* This command allows Architect and Coder agents to extract important topics
|
|
27
|
+
* from the current conversation and delegate to the ProjectInfo agent to update
|
|
28
|
+
* the persistent project context file.
|
|
29
|
+
*/
|
|
30
|
+
@injectable()
|
|
31
|
+
export class RememberCommandContribution implements FrontendApplicationContribution {
|
|
32
|
+
|
|
33
|
+
@inject(PromptService)
|
|
34
|
+
protected readonly promptService: PromptService;
|
|
35
|
+
|
|
36
|
+
onStart(): void {
|
|
37
|
+
this.registerRememberCommand();
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
protected registerRememberCommand(): void {
|
|
41
|
+
const commandTemplate = this.buildCommandTemplate();
|
|
42
|
+
|
|
43
|
+
this.promptService.addBuiltInPromptFragment({
|
|
44
|
+
id: 'remember-conversation-context',
|
|
45
|
+
template: commandTemplate,
|
|
46
|
+
isCommand: true,
|
|
47
|
+
commandName: 'remember',
|
|
48
|
+
commandDescription: nls.localize(
|
|
49
|
+
'theia/ai-ide/rememberCommand/description',
|
|
50
|
+
'Extract topics from conversation and update project info'
|
|
51
|
+
),
|
|
52
|
+
commandArgumentHint: nls.localize(
|
|
53
|
+
'theia/ai-ide/rememberCommand/argumentHint',
|
|
54
|
+
'[topic-hint]'
|
|
55
|
+
),
|
|
56
|
+
commandAgents: ['Architect', 'Coder']
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected buildCommandTemplate(): string {
|
|
61
|
+
return `You have been asked to extract and remember important information from the current conversation.
|
|
62
|
+
|
|
63
|
+
## Task Overview
|
|
64
|
+
Review the conversation history and identify specific information that should be added to the persistent project context.
|
|
65
|
+
|
|
66
|
+
## Focus Area
|
|
67
|
+
$ARGUMENTS
|
|
68
|
+
|
|
69
|
+
## What to Extract
|
|
70
|
+
**If a focus area is provided above**: ONLY extract information related to that specific focus area. Ignore all other topics.
|
|
71
|
+
|
|
72
|
+
**If no focus area is provided**: Look specifically for information where the user had to correct you or provide clarification:
|
|
73
|
+
- **User corrections**: When the user corrected your assumptions about the codebase, architecture, or processes
|
|
74
|
+
- **User-provided context**: Information the user explicitly provided that you couldn't discover yourself
|
|
75
|
+
- **Project-specific knowledge**: Details about the project that the user shared when you made incorrect assumptions
|
|
76
|
+
|
|
77
|
+
**Do NOT extract**:
|
|
78
|
+
- General information you discovered through code analysis
|
|
79
|
+
- Standard coding practices you identified yourself
|
|
80
|
+
- Information you found by exploring the codebase
|
|
81
|
+
- Common knowledge or widely-known patterns
|
|
82
|
+
- Details that are already well-documented in the code
|
|
83
|
+
|
|
84
|
+
## Instructions
|
|
85
|
+
1. **Analyze the conversation**: Review messages for the specific criteria above
|
|
86
|
+
2. **Extract only relevant information**: For each qualifying item, prepare a clear description that captures:
|
|
87
|
+
- What the user corrected or clarified
|
|
88
|
+
- Why your initial understanding was incomplete
|
|
89
|
+
- The specific project context that was provided
|
|
90
|
+
3. **Delegate to ProjectInfo agent**: Use the ~{${AGENT_DELEGATION_FUNCTION_ID}} tool to send the extracted information to the ProjectInfo agent:
|
|
91
|
+
- Agent ID: 'ProjectInfo'
|
|
92
|
+
- Prompt: Ask the ProjectInfo agent to review the extracted information and update the project information file
|
|
93
|
+
|
|
94
|
+
## Example Delegation
|
|
95
|
+
\`\`\`
|
|
96
|
+
Please review and incorporate the following user corrections/clarifications into the project context:
|
|
97
|
+
|
|
98
|
+
[Your extracted corrections and user-provided context here]
|
|
99
|
+
|
|
100
|
+
Update /.prompts/project-info.prompttemplate by adding this information to the appropriate sections. Focus on information that prevents future misunderstandings.
|
|
101
|
+
\`\`\`
|
|
102
|
+
|
|
103
|
+
Remember: Only extract information that prevents future AI agents from making the same mistakes or assumptions you made that were corrected by the user.`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
import { ToolProvider, ToolRequest } from '@theia/ai-core';
|
|
17
|
-
import { CancellationToken, Disposable, PreferenceService, URI } from '@theia/core';
|
|
17
|
+
import { CancellationToken, Disposable, PreferenceService, URI, Path } from '@theia/core';
|
|
18
18
|
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
19
19
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
20
20
|
import { FileStat } from '@theia/filesystem/lib/common/files';
|
|
@@ -69,6 +69,73 @@ export class WorkspaceFunctionScope {
|
|
|
69
69
|
return workspaceRoot.resolve(relativePath);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
isInWorkspace(uri: URI): boolean {
|
|
73
|
+
try {
|
|
74
|
+
const wsRoots = this.workspaceService.tryGetRoots();
|
|
75
|
+
|
|
76
|
+
if (wsRoots.length === 0) {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
for (const root of wsRoots) {
|
|
81
|
+
const rootUri = root.resource;
|
|
82
|
+
if (rootUri.scheme === uri.scheme && rootUri.isEqualOrParent(uri)) {
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return false;
|
|
88
|
+
} catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
isInPrimaryWorkspace(uri: URI): boolean {
|
|
94
|
+
try {
|
|
95
|
+
const wsRoots = this.workspaceService.tryGetRoots();
|
|
96
|
+
|
|
97
|
+
if (wsRoots.length === 0) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const primaryRoot = wsRoots[0].resource;
|
|
102
|
+
return primaryRoot.scheme === uri.scheme && primaryRoot.isEqualOrParent(uri);
|
|
103
|
+
} catch {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
async resolveToUri(pathOrUri: string | URI): Promise<URI | undefined> {
|
|
109
|
+
if (pathOrUri instanceof URI) {
|
|
110
|
+
return pathOrUri;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!pathOrUri) {
|
|
114
|
+
return undefined;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (pathOrUri.includes('://')) {
|
|
118
|
+
try {
|
|
119
|
+
const uri = new URI(pathOrUri);
|
|
120
|
+
return uri;
|
|
121
|
+
} catch (error) {
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const normalizedPath = Path.normalizePathSeparator(pathOrUri);
|
|
126
|
+
const path = new Path(normalizedPath);
|
|
127
|
+
|
|
128
|
+
if (normalizedPath.includes('..')) {
|
|
129
|
+
return undefined;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (path.isAbsolute) {
|
|
133
|
+
return URI.fromFilePath(normalizedPath);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return this.resolveRelativePath(normalizedPath);
|
|
137
|
+
}
|
|
138
|
+
|
|
72
139
|
private async initializeGitignoreWatcher(workspaceRoot: URI): Promise<void> {
|
|
73
140
|
if (this.gitignoreWatcherInitialized) {
|
|
74
141
|
return;
|
|
@@ -28,8 +28,7 @@ import {
|
|
|
28
28
|
SUGGEST_FILE_REPLACEMENTS_ID,
|
|
29
29
|
WRITE_FILE_REPLACEMENTS_ID,
|
|
30
30
|
CLEAR_FILE_CHANGES_ID,
|
|
31
|
-
GET_PROPOSED_CHANGES_ID
|
|
32
|
-
SUGGEST_FILE_REPLACEMENTS_NEXT_ID
|
|
31
|
+
GET_PROPOSED_CHANGES_ID
|
|
33
32
|
} from './file-changeset-function-ids';
|
|
34
33
|
|
|
35
34
|
export const CODER_SYSTEM_PROMPT_ID = 'coder-system';
|
|
@@ -161,7 +160,7 @@ You are an autonomous AI agent. Do not stop until:
|
|
|
161
160
|
};
|
|
162
161
|
}
|
|
163
162
|
|
|
164
|
-
function getCoderEditPromptTemplate(
|
|
163
|
+
function getCoderEditPromptTemplate(): string {
|
|
165
164
|
return `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
166
165
|
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
167
166
|
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
@@ -189,9 +188,9 @@ This also applies for newly created files!
|
|
|
189
188
|
- **Always Retrieve Current Content**: Use getFileContent to get the original content of the target file.
|
|
190
189
|
- **View Pending Changes**: Use ~{${GET_PROPOSED_CHANGES_ID}} to see the current proposed state of a file, including all pending changes.
|
|
191
190
|
- **Change Content**: Use one of these methods to propose changes:
|
|
192
|
-
- ~{${
|
|
193
|
-
- ~{${SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
|
|
194
|
-
- If ~{${
|
|
191
|
+
- ~{${SUGGEST_FILE_REPLACEMENTS_ID}}: For targeted replacements of specific text sections. Multiple calls will merge changes unless you set the reset parameter to true.
|
|
192
|
+
- ~{${SUGGEST_FILE_CONTENT_ID}}: For complete file rewrites when you need to replace the entire content.
|
|
193
|
+
- If ~{${SUGGEST_FILE_REPLACEMENTS_ID}} continuously fails use ~{${SUGGEST_FILE_CONTENT_ID}}.
|
|
195
194
|
- ~{${CLEAR_FILE_CHANGES_ID}}: To clear all pending changes for a file and start fresh.
|
|
196
195
|
|
|
197
196
|
The changes will be presented as an applicable diff to the user in any case. The user can then accept or reject each change individually. Before you run tasks that depend on the \
|
|
@@ -235,14 +234,14 @@ You have previously proposed changes for the following files. Some suggestions m
|
|
|
235
234
|
export function getCoderPromptTemplateEdit(): BasePromptFragment {
|
|
236
235
|
return {
|
|
237
236
|
id: CODER_EDIT_TEMPLATE_ID,
|
|
238
|
-
template: getCoderEditPromptTemplate(
|
|
237
|
+
template: getCoderEditPromptTemplate()
|
|
239
238
|
};
|
|
240
239
|
}
|
|
241
|
-
|
|
240
|
+
// Currently, the next template is identical to the regular edit prompt
|
|
242
241
|
export function getCoderPromptTemplateEditNext(): BasePromptFragment {
|
|
243
242
|
return {
|
|
244
243
|
id: CODER_EDIT_NEXT_TEMPLATE_ID,
|
|
245
|
-
template: getCoderEditPromptTemplate(
|
|
244
|
+
template: getCoderEditPromptTemplate(),
|
|
246
245
|
...({ variantOf: CODER_EDIT_TEMPLATE_ID })
|
|
247
246
|
};
|
|
248
247
|
}
|
|
@@ -33,25 +33,25 @@ Never under any circumstances may you reply with just the command-id!
|
|
|
33
33
|
|
|
34
34
|
## Example 1
|
|
35
35
|
|
|
36
|
-
This reply is to tell the user to execute the \`
|
|
36
|
+
This reply is to tell the user to execute the \`preferences:open\` command that is available in the Theia command registry.
|
|
37
37
|
|
|
38
38
|
\`\`\`json
|
|
39
39
|
{
|
|
40
40
|
"type": "theia-command",
|
|
41
|
-
"commandId": "
|
|
41
|
+
"commandId": "preferences:open"
|
|
42
42
|
}
|
|
43
43
|
\`\`\`
|
|
44
44
|
|
|
45
45
|
## Example 2
|
|
46
46
|
|
|
47
|
-
This reply is to tell the user to execute the \`
|
|
47
|
+
This reply is to tell the user to execute the \`preferences:open\` command that is available in the Theia command registry,
|
|
48
48
|
when the user want to pass arguments to the command.
|
|
49
49
|
|
|
50
50
|
\`\`\`json
|
|
51
51
|
{
|
|
52
52
|
"type": "theia-command",
|
|
53
|
-
"commandId": "
|
|
54
|
-
"arguments": ["
|
|
53
|
+
"commandId": "preferences:open",
|
|
54
|
+
"arguments": ["ai-features"]
|
|
55
55
|
}
|
|
56
56
|
\`\`\`
|
|
57
57
|
|
|
@@ -16,8 +16,22 @@
|
|
|
16
16
|
|
|
17
17
|
export const SUGGEST_FILE_CONTENT_ID = 'suggestFileContent';
|
|
18
18
|
export const WRITE_FILE_CONTENT_ID = 'writeFileContent';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Default function ID for suggesting file replacements.
|
|
22
|
+
* Uses the improved content replacer implementation (V2) with better matching and error handling.
|
|
23
|
+
* This replaced the previous simpler implementation which is now available as SUGGEST_FILE_REPLACEMENTS_SIMPLE_ID.
|
|
24
|
+
*/
|
|
19
25
|
export const SUGGEST_FILE_REPLACEMENTS_ID = 'suggestFileReplacements';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Legacy function ID for suggesting file replacements.
|
|
29
|
+
* Uses the original content replacer implementation (V1).
|
|
30
|
+
* @deprecated This is the older implementation. Consider using SUGGEST_FILE_REPLACEMENTS_ID (default) instead.
|
|
31
|
+
* This implementation may be removed in a future version.
|
|
32
|
+
*/
|
|
33
|
+
export const SUGGEST_FILE_REPLACEMENTS_SIMPLE_ID = 'suggestFileReplacements_Simple';
|
|
34
|
+
|
|
20
35
|
export const WRITE_FILE_REPLACEMENTS_ID = 'writeFileReplacements';
|
|
21
36
|
export const CLEAR_FILE_CHANGES_ID = 'clearFileChanges';
|
|
22
37
|
export const GET_PROPOSED_CHANGES_ID = 'getProposedFileState';
|
|
23
|
-
export const SUGGEST_FILE_REPLACEMENTS_NEXT_ID = 'suggestFileReplacements_Next';
|
|
@@ -64,7 +64,7 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent {
|
|
|
64
64
|
return undefined;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const excludedAgents = this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
|
|
67
|
+
const excludedAgents = this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode', 'Codex']);
|
|
68
68
|
const availableAgents = this.getAvailableAgentsForDelegation(excludedAgents);
|
|
69
69
|
const availableChatAgentsValue = availableAgents.map(agent => prettyPrintAgentInMd(agent)).join('\n');
|
|
70
70
|
|
|
@@ -88,7 +88,7 @@ export class OrchestratorChatAgent extends AbstractStreamParsingChatAgent {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
protected getExcludedAgentIds(): string[] {
|
|
91
|
-
return this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
|
|
91
|
+
return this.preferenceService.get<string[]>(PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode', 'Codex']);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
override async invoke(request: MutableChatRequestModel): Promise<void> {
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Agent, AgentService, AISettingsService, AIVariableService, FrontendLanguageModelRegistry, LanguageModel, PromptFragmentCustomizationService, PromptService } from '@theia/ai-core/lib/common';
|
|
3
|
-
import { QuickInputService, ReactWidget } from '@theia/core/lib/browser';
|
|
4
|
-
import * as React from '@theia/core/shared/react';
|
|
5
|
-
import { AIConfigurationSelectionService } from './ai-configuration-service';
|
|
6
|
-
import { LanguageModelAliasRegistry, LanguageModelAlias } from '@theia/ai-core/lib/common/language-model-alias';
|
|
7
|
-
interface ParsedPrompt {
|
|
8
|
-
functions: string[];
|
|
9
|
-
globalVariables: string[];
|
|
10
|
-
agentSpecificVariables: string[];
|
|
11
|
-
}
|
|
12
|
-
export declare class AIAgentConfigurationWidget extends ReactWidget {
|
|
13
|
-
static readonly ID = "ai-agent-configuration-container-widget";
|
|
14
|
-
static readonly LABEL: string;
|
|
15
|
-
protected readonly agentService: AgentService;
|
|
16
|
-
protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
|
|
17
|
-
protected readonly promptFragmentCustomizationService: PromptFragmentCustomizationService;
|
|
18
|
-
protected readonly languageModelAliasRegistry: LanguageModelAliasRegistry;
|
|
19
|
-
protected readonly aiSettingsService: AISettingsService;
|
|
20
|
-
protected readonly aiConfigurationSelectionService: AIConfigurationSelectionService;
|
|
21
|
-
protected readonly variableService: AIVariableService;
|
|
22
|
-
protected promptService: PromptService;
|
|
23
|
-
protected readonly quickInputService: QuickInputService;
|
|
24
|
-
protected languageModels: LanguageModel[] | undefined;
|
|
25
|
-
protected languageModelAliases: LanguageModelAlias[];
|
|
26
|
-
protected parsedPromptParts: ParsedPrompt | undefined;
|
|
27
|
-
protected isLoadingDetails: boolean;
|
|
28
|
-
protected init(): void;
|
|
29
|
-
protected updateParsedPromptParts(): Promise<void>;
|
|
30
|
-
protected render(): React.ReactNode;
|
|
31
|
-
protected renderAgentName(agent: Agent): React.ReactNode;
|
|
32
|
-
protected renderAgentDetails(): React.ReactNode;
|
|
33
|
-
protected parsePromptFragmentsForVariableAndFunction(agent: Agent): Promise<ParsedPrompt>;
|
|
34
|
-
protected extractVariablesAndFunctions(promptContent: string, result: ParsedPrompt, agent: Agent): void;
|
|
35
|
-
protected showVariableConfigurationTab(): void;
|
|
36
|
-
protected addCustomAgent(): Promise<void>;
|
|
37
|
-
protected setActiveAgent(agent: Agent): void;
|
|
38
|
-
private toggleAgentEnabled;
|
|
39
|
-
}
|
|
40
|
-
export {};
|
|
41
|
-
//# sourceMappingURL=agent-configuration-widget.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-configuration-widget.d.ts","sourceRoot":"","sources":["../../../src/browser/ai-configuration/agent-configuration-widget.tsx"],"names":[],"mappings":";AAgBA,OAAO,EACH,KAAK,EACL,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,6BAA6B,EAC7B,aAAa,EAIb,kCAAkC,EAClC,aAAa,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAW,iBAAiB,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGlF,OAAO,KAAK,KAAK,MAAM,0BAA0B,CAAC;AAClD,OAAO,EAAE,+BAA+B,EAAE,MAAM,4BAA4B,CAAC;AAE7E,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AAKhH,UAAU,YAAY;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,sBAAsB,EAAE,MAAM,EAAE,CAAC;CACpC;AAED,qBACa,0BAA2B,SAAQ,WAAW;IAEvD,MAAM,CAAC,QAAQ,CAAC,EAAE,6CAA6C;IAC/D,MAAM,CAAC,QAAQ,CAAC,KAAK,SAAoE;IAGzF,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAG9C,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAGxE,SAAS,CAAC,QAAQ,CAAC,kCAAkC,EAAE,kCAAkC,CAAC;IAG1F,SAAS,CAAC,QAAQ,CAAC,0BAA0B,EAAE,0BAA0B,CAAC;IAG1E,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,+BAA+B,EAAE,+BAA+B,CAAC;IAGpF,SAAS,CAAC,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC;IAGtD,SAAS,CAAC,aAAa,EAAE,aAAa,CAAC;IAGvC,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,SAAS,CAAC,cAAc,EAAE,aAAa,EAAE,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,oBAAoB,EAAE,kBAAkB,EAAE,CAAM;IAC1D,SAAS,CAAC,iBAAiB,EAAE,YAAY,GAAG,SAAS,CAAC;IACtD,SAAS,CAAC,gBAAgB,UAAS;IAGnC,SAAS,CAAC,IAAI,IAAI,IAAI;cA0CN,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;IAYxD,SAAS,CAAC,MAAM,IAAI,KAAK,CAAC,SAAS;IA2BnC,SAAS,CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC,SAAS;IAKxD,SAAS,CAAC,kBAAkB,IAAI,KAAK,CAAC,SAAS;cA0F/B,0CAA0C,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,YAAY,CAAC;IAmB/F,SAAS,CAAC,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI;IA2BvG,SAAS,CAAC,4BAA4B,IAAI,IAAI;cAI9B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAiC/C,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAK5C,OAAO,CAAC,kBAAkB,CAYxB;CACL"}
|