@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
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2024 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
|
-
exports.OrchestratorChatAgent = exports.OrchestratorChatAgentId = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const ai_core_1 = require("@theia/ai-core");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const chat_agent_service_1 = require("@theia/ai-chat/lib/common/chat-agent-service");
|
|
23
|
-
const chat_agents_1 = require("@theia/ai-chat/lib/common/chat-agents");
|
|
24
|
-
const chat_model_1 = require("@theia/ai-chat/lib/common/chat-model");
|
|
25
|
-
const core_1 = require("@theia/core");
|
|
26
|
-
const orchestrator_prompt_template_1 = require("./orchestrator-prompt-template");
|
|
27
|
-
const ai_ide_preferences_1 = require("./ai-ide-preferences");
|
|
28
|
-
exports.OrchestratorChatAgentId = 'Orchestrator';
|
|
29
|
-
const OrchestratorRequestIdKey = 'orchestratorRequestIdKey';
|
|
30
|
-
let OrchestratorChatAgent = class OrchestratorChatAgent extends chat_agents_1.AbstractStreamParsingChatAgent {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
this.id = exports.OrchestratorChatAgentId;
|
|
34
|
-
this.name = exports.OrchestratorChatAgentId;
|
|
35
|
-
this.languageModelRequirements = [{
|
|
36
|
-
purpose: 'agent-selection',
|
|
37
|
-
identifier: 'default/universal',
|
|
38
|
-
}];
|
|
39
|
-
this.defaultLanguageModelPurpose = 'agent-selection';
|
|
40
|
-
this.prompts = [orchestrator_prompt_template_1.orchestratorTemplate];
|
|
41
|
-
this.description = core_1.nls.localize('theia/ai/chat/orchestrator/description', 'This agent analyzes the user request against the description of all available chat agents and selects the best fitting agent to answer the request \
|
|
42
|
-
(by using AI).The user\'s request will be directly delegated to the selected agent without further confirmation.');
|
|
43
|
-
this.iconClass = 'codicon codicon-symbol-boolean';
|
|
44
|
-
this.agentSpecificVariables = [{
|
|
45
|
-
name: 'availableChatAgents',
|
|
46
|
-
description: core_1.nls.localize('theia/ai/chat/orchestrator/vars/availableChatAgents/description', 'The list of chat agents that the orchestrator can delegate to, excluding agents specified in the exclusion list preference.'),
|
|
47
|
-
usedInPrompt: true
|
|
48
|
-
}];
|
|
49
|
-
this.systemPromptId = orchestrator_prompt_template_1.orchestratorTemplate.id;
|
|
50
|
-
this.fallBackChatAgentId = 'Universal';
|
|
51
|
-
}
|
|
52
|
-
async getSystemMessageDescription(context) {
|
|
53
|
-
if (this.systemPromptId === undefined) {
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
const excludedAgents = this.preferenceService.get(ai_ide_preferences_1.PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
|
|
57
|
-
const availableAgents = this.getAvailableAgentsForDelegation(excludedAgents);
|
|
58
|
-
const availableChatAgentsValue = availableAgents.map(agent => prettyPrintAgentInMd(agent)).join('\n');
|
|
59
|
-
const resolvedPrompt = await this.promptService.getResolvedPromptFragment(this.systemPromptId, { availableChatAgents: availableChatAgentsValue }, context);
|
|
60
|
-
return resolvedPrompt ? chat_agents_1.SystemMessageDescription.fromResolvedPromptFragment(resolvedPrompt) : undefined;
|
|
61
|
-
}
|
|
62
|
-
getAvailableAgentsForDelegation(excludedAgents) {
|
|
63
|
-
return this.chatAgentService.getAgents()
|
|
64
|
-
.filter(agent => agent.id !== this.id && !excludedAgents.includes(agent.id))
|
|
65
|
-
.map(agent => ({
|
|
66
|
-
id: agent.id,
|
|
67
|
-
name: agent.name,
|
|
68
|
-
description: agent.description
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
|
-
getExcludedAgentIds() {
|
|
72
|
-
return this.preferenceService.get(ai_ide_preferences_1.PREFERENCE_NAME_ORCHESTRATOR_EXCLUSION_LIST, ['ClaudeCode']);
|
|
73
|
-
}
|
|
74
|
-
async invoke(request) {
|
|
75
|
-
request.response.addProgressMessage({ content: core_1.nls.localize('theia/ai/ide/orchestrator/progressMessage', 'Determining the most appropriate agent'), status: 'inProgress' });
|
|
76
|
-
// We use a dedicated id for the orchestrator request
|
|
77
|
-
const orchestratorRequestId = (0, core_1.generateUuid)();
|
|
78
|
-
request.addData(OrchestratorRequestIdKey, orchestratorRequestId);
|
|
79
|
-
return super.invoke(request);
|
|
80
|
-
}
|
|
81
|
-
async sendLlmRequest(request, messages, toolRequests, languageModel) {
|
|
82
|
-
var _a;
|
|
83
|
-
const agentSettings = this.getLlmSettings();
|
|
84
|
-
const settings = { ...agentSettings, ...request.session.settings };
|
|
85
|
-
const tools = toolRequests.length > 0 ? toolRequests : undefined;
|
|
86
|
-
const subRequestId = (_a = request.getDataByKey(OrchestratorRequestIdKey)) !== null && _a !== void 0 ? _a : request.id;
|
|
87
|
-
request.removeData(OrchestratorRequestIdKey);
|
|
88
|
-
return this.languageModelService.sendRequest(languageModel, {
|
|
89
|
-
messages,
|
|
90
|
-
tools,
|
|
91
|
-
settings,
|
|
92
|
-
agentId: this.id,
|
|
93
|
-
sessionId: request.session.id,
|
|
94
|
-
requestId: request.id,
|
|
95
|
-
subRequestId: subRequestId,
|
|
96
|
-
cancellationToken: request.response.cancellationToken
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
async addContentsToResponse(response, request) {
|
|
100
|
-
var _a;
|
|
101
|
-
const responseText = await (0, ai_core_1.getTextOfResponse)(response);
|
|
102
|
-
let agentIds = [];
|
|
103
|
-
const excludedAgents = this.getExcludedAgentIds();
|
|
104
|
-
try {
|
|
105
|
-
const jsonResponse = await (0, ai_core_1.getJsonOfText)(responseText);
|
|
106
|
-
if (Array.isArray(jsonResponse)) {
|
|
107
|
-
agentIds = jsonResponse.filter((id) => id !== this.id && !excludedAgents.includes(id));
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
catch (error) {
|
|
111
|
-
// The llm sometimes does not return a parseable result
|
|
112
|
-
this.logger.error('Failed to parse JSON response', error);
|
|
113
|
-
}
|
|
114
|
-
if (agentIds.length < 1) {
|
|
115
|
-
this.logger.error('No agent was selected, delegating to fallback chat agent');
|
|
116
|
-
request.response.progressMessages.forEach(progressMessage => request.response.updateProgressMessage({ ...progressMessage, status: 'failed' }));
|
|
117
|
-
agentIds = [this.fallBackChatAgentId];
|
|
118
|
-
}
|
|
119
|
-
// check if selected (or fallback) agent exists and is not excluded
|
|
120
|
-
if (!this.chatAgentService.getAgent(agentIds[0]) || excludedAgents.includes(agentIds[0])) {
|
|
121
|
-
this.logger.error(`Chat agent ${agentIds[0]} not found or excluded. Falling back to first available agent.`);
|
|
122
|
-
const firstRegisteredAgent = (_a = this.chatAgentService.getAgents()
|
|
123
|
-
.filter(a => a.id !== this.id && !excludedAgents.includes(a.id))[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
124
|
-
if (firstRegisteredAgent) {
|
|
125
|
-
agentIds = [firstRegisteredAgent];
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
throw new Error(core_1.nls.localize('theia/ai/ide/orchestrator/error/noAgents', 'No chat agent available to handle request. Please check your configuration whether any are enabled.'));
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
// TODO support delegating to more than one agent
|
|
132
|
-
const delegatedToAgent = agentIds[0];
|
|
133
|
-
request.response.response.addContent(new chat_model_1.InformationalChatResponseContentImpl(`*Orchestrator*: ${core_1.nls.localize('theia/ai/ide/orchestrator/response/delegatingToAgent', 'Delegating to \`@{0}\`', delegatedToAgent)}
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
`));
|
|
138
|
-
request.response.overrideAgentId(delegatedToAgent);
|
|
139
|
-
request.response.progressMessages.forEach(progressMessage => request.response.updateProgressMessage({ ...progressMessage, status: 'completed' }));
|
|
140
|
-
const agent = this.chatAgentService.getAgent(delegatedToAgent);
|
|
141
|
-
if (!agent) {
|
|
142
|
-
throw new Error(`Chat agent ${delegatedToAgent} not found.`);
|
|
143
|
-
}
|
|
144
|
-
// Get the original request if available
|
|
145
|
-
const originalRequest = '__originalRequest' in request ? request.__originalRequest : request;
|
|
146
|
-
await agent.invoke(originalRequest);
|
|
147
|
-
}
|
|
148
|
-
};
|
|
149
|
-
exports.OrchestratorChatAgent = OrchestratorChatAgent;
|
|
150
|
-
tslib_1.__decorate([
|
|
151
|
-
(0, inversify_1.inject)(chat_agent_service_1.ChatAgentService),
|
|
152
|
-
tslib_1.__metadata("design:type", Object)
|
|
153
|
-
], OrchestratorChatAgent.prototype, "chatAgentService", void 0);
|
|
154
|
-
tslib_1.__decorate([
|
|
155
|
-
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
156
|
-
tslib_1.__metadata("design:type", Object)
|
|
157
|
-
], OrchestratorChatAgent.prototype, "preferenceService", void 0);
|
|
158
|
-
exports.OrchestratorChatAgent = OrchestratorChatAgent = tslib_1.__decorate([
|
|
159
|
-
(0, inversify_1.injectable)()
|
|
160
|
-
], OrchestratorChatAgent);
|
|
161
|
-
function prettyPrintAgentInMd(agent) {
|
|
162
|
-
return `- ${agent.id}
|
|
163
|
-
- *ID*: ${agent.id}
|
|
164
|
-
- *Name*: ${agent.name}
|
|
165
|
-
- *Description*: ${agent.description.replace(/\n/g, ' ')}`;
|
|
166
|
-
}
|
|
167
|
-
//# sourceMappingURL=orchestrator-chat-agent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-chat-agent.js","sourceRoot":"","sources":["../../src/common/orchestrator-chat-agent.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,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CAAC;CACJ,CAAA;AA7JY,sDAAqB;AA0BpB;IADT,IAAA,kBAAM,EAAC,qCAAgB,CAAC;;+DACoB;AAGnC;IADT,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;gEACqB;gCA7BtC,qBAAqB;IADjC,IAAA,sBAAU,GAAE;GACA,qBAAqB,CA6JjC;AAED,SAAS,oBAAoB,CAAC,KAAwD;IAClF,OAAO,KAAK,KAAK,CAAC,EAAE;YACZ,KAAK,CAAC,EAAE;cACN,KAAK,CAAC,IAAI;qBACH,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC;AAC7D,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/orchestrator-prompt-template.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,eAAO,MAAM,oBAAoB,EAAE,gBAuClC,CAAC"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* eslint-disable @typescript-eslint/tslint/config */
|
|
3
|
-
// *****************************************************************************
|
|
4
|
-
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
5
|
-
//
|
|
6
|
-
// This file is licensed under the MIT License.
|
|
7
|
-
// See LICENSE-MIT.txt in the project root for license information.
|
|
8
|
-
// https://opensource.org/license/mit.
|
|
9
|
-
//
|
|
10
|
-
// SPDX-License-Identifier: MIT
|
|
11
|
-
// *****************************************************************************
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.orchestratorTemplate = void 0;
|
|
14
|
-
exports.orchestratorTemplate = {
|
|
15
|
-
id: 'orchestrator-system',
|
|
16
|
-
defaultVariant: {
|
|
17
|
-
id: 'orchestrator-system-default',
|
|
18
|
-
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
19
|
-
Made improvements or adaptations to this prompt template? We’d love for you to share it with the community! Contribute back here:
|
|
20
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
21
|
-
# Instructions
|
|
22
|
-
|
|
23
|
-
Your task is to identify which Chat Agent(s) should best reply a given user's message.
|
|
24
|
-
You consider all messages of the conversation to ensure consistency and avoid agent switches without a clear context change.
|
|
25
|
-
You should select the best Chat Agent based on the name and description of the agents, matching them to the user message.
|
|
26
|
-
|
|
27
|
-
## Constraints
|
|
28
|
-
|
|
29
|
-
Your response must be a JSON array containing the id(s) of the selected Chat Agent(s).
|
|
30
|
-
|
|
31
|
-
* Do not use ids that are not provided in the list below.
|
|
32
|
-
* Do not include any additional information, explanations, or questions for the user.
|
|
33
|
-
* If there is no suitable choice, pick \`Universal\`.
|
|
34
|
-
* If there are multiple good choices, return all of them.
|
|
35
|
-
|
|
36
|
-
Unless there is a more specific agent available, select \`Universal\`, especially for general programming-related questions.
|
|
37
|
-
You must only use the \`id\` attribute of the agent, never the name.
|
|
38
|
-
|
|
39
|
-
### Example Results
|
|
40
|
-
|
|
41
|
-
\`\`\`json
|
|
42
|
-
["Universal"]
|
|
43
|
-
\`\`\`
|
|
44
|
-
|
|
45
|
-
\`\`\`json
|
|
46
|
-
["AnotherChatAgent", "Universal"]
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
## List of Currently Available Chat Agents
|
|
50
|
-
|
|
51
|
-
{{availableChatAgents}}
|
|
52
|
-
`
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
//# sourceMappingURL=orchestrator-prompt-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"orchestrator-prompt-template.js","sourceRoot":"","sources":["../../src/common/orchestrator-prompt-template.ts"],"names":[],"mappings":";AAAA,qDAAqD;AACrD,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,+CAA+C;AAC/C,mEAAmE;AACnE,sCAAsC;AACtC,EAAE;AACF,+BAA+B;AAC/B,gFAAgF;;;AAInE,QAAA,oBAAoB,GAAqB;IAClD,EAAE,EAAE,qBAAqB;IACzB,cAAc,EAAE;QACZ,EAAE,EAAE,6BAA6B;QACjC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCjB;KAAC;CACD,CAAC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { PromptVariantSet } from '@theia/ai-core/lib/common';
|
|
2
|
-
export declare const PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID = "project-info-system";
|
|
3
|
-
export declare const PROJECT_INFO_TEMPLATE_PROMPT_ID = "project-info-template";
|
|
4
|
-
export declare const projectInfoTemplateVariants: PromptVariantSet;
|
|
5
|
-
export declare const projectInfoSystemVariants: PromptVariantSet;
|
|
6
|
-
//# sourceMappingURL=project-info-prompt-template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-info-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/project-info-prompt-template.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAc7D,eAAO,MAAM,sCAAsC,wBAAwB,CAAC;AAC5E,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AAEvE,eAAO,MAAM,2BAA2B,kBAgCvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,kBAqGrC,CAAC"}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.projectInfoSystemVariants = exports.projectInfoTemplateVariants = exports.PROJECT_INFO_TEMPLATE_PROMPT_ID = exports.PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID = void 0;
|
|
4
|
-
const workspace_functions_1 = require("./workspace-functions");
|
|
5
|
-
const context_variables_1 = require("./context-variables");
|
|
6
|
-
const context_functions_1 = require("./context-functions");
|
|
7
|
-
const file_changeset_function_ids_1 = require("./file-changeset-function-ids");
|
|
8
|
-
exports.PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID = 'project-info-system';
|
|
9
|
-
exports.PROJECT_INFO_TEMPLATE_PROMPT_ID = 'project-info-template';
|
|
10
|
-
exports.projectInfoTemplateVariants = {
|
|
11
|
-
id: exports.PROJECT_INFO_TEMPLATE_PROMPT_ID,
|
|
12
|
-
defaultVariant: {
|
|
13
|
-
id: 'project-info-template-default',
|
|
14
|
-
template: `## Project Info Template Structure
|
|
15
|
-
|
|
16
|
-
### Architecture Overview
|
|
17
|
-
[Brief description of what the project does, Key architectural decisions, patterns, and structure.]
|
|
18
|
-
|
|
19
|
-
### Key Technologies
|
|
20
|
-
[List of main technologies, frameworks, libraries]
|
|
21
|
-
|
|
22
|
-
### Essential Development Patterns
|
|
23
|
-
Examples for key patterns (refer via relative file paths)
|
|
24
|
-
|
|
25
|
-
### File Structure
|
|
26
|
-
[Important directories/packages and their contents]
|
|
27
|
-
|
|
28
|
-
### Build & Development
|
|
29
|
-
[How to build and run the project.]
|
|
30
|
-
|
|
31
|
-
### Testing
|
|
32
|
-
[What kind of tests exist, test organization and test patterns. Examples for different types of tests (as relative file paths)]
|
|
33
|
-
|
|
34
|
-
### Coding Guidelines
|
|
35
|
-
[Coding standards, conventions, practices. Examples for key practices (as relative file paths), rules for imports, indentation]
|
|
36
|
-
|
|
37
|
-
### Additional Notes
|
|
38
|
-
[Any other important information for agents to understand the project and write code for it. Important files with more information (as relative file paths)]
|
|
39
|
-
\`\`\`
|
|
40
|
-
`
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
exports.projectInfoSystemVariants = {
|
|
44
|
-
id: exports.PROJECT_INFO_SYSTEM_PROMPT_TEMPLATE_ID,
|
|
45
|
-
defaultVariant: {
|
|
46
|
-
id: 'project-info-system-default',
|
|
47
|
-
template: `{{!-- This prompt is licensed under the MIT License (https://opensource.org/license/mit).
|
|
48
|
-
Made improvements or adaptations to this prompt template? We'd love for you to share it with the community! Contribute back here:
|
|
49
|
-
https://github.com/eclipse-theia/theia/discussions/new?category=prompt-template-contribution --}}
|
|
50
|
-
# Instructions
|
|
51
|
-
|
|
52
|
-
You are the ProjectInfo agent, an AI assistant specialized in managing project information files. Your role is to help users create, update,
|
|
53
|
-
and maintain the \`.prompts/project-info.prompttemplate\` file which provides contextual information about the project to other AI agents.
|
|
54
|
-
|
|
55
|
-
## Project Info Guidelines
|
|
56
|
-
The project info is an artifact that will be handed over to agents to understand the current workspace, project and codebase.
|
|
57
|
-
Do not include obvious instructions, generic information, generic development practices or things that can be very easily discovered.
|
|
58
|
-
Focus on non-obvious and project-specific facts as well as specific guidelines and patterns.
|
|
59
|
-
Try to keep the project info minimal and avoid duplicates.
|
|
60
|
-
|
|
61
|
-
## Your Capabilities
|
|
62
|
-
|
|
63
|
-
### Initially Create Project Info
|
|
64
|
-
For initial project info creation, start by determining the user's preferred working mode:
|
|
65
|
-
|
|
66
|
-
**Step 1: Define mode of working**
|
|
67
|
-
Ask the user about the preferred working mode:
|
|
68
|
-
|
|
69
|
-
1. "Auto-exploration - Agent explores and creates an initial suggestion",
|
|
70
|
-
2. "Manual - User provides all necessary input with your guidance"
|
|
71
|
-
|
|
72
|
-
IMPORTANT: Remember the chosen mode and stick to it until the user requests otherwise!
|
|
73
|
-
|
|
74
|
-
- In automatic mode, create an initial version of the project info yourself by exploring the workspace
|
|
75
|
-
- In manual mode, guide the user section by section and ask for additional information.
|
|
76
|
-
Whenever you ask a question to the user, offer the option that you answer the question for them.
|
|
77
|
-
|
|
78
|
-
**Step 2: Final tasks**
|
|
79
|
-
After completing all sections or if you feel the user is done, offer the user to do an automatic refinement:
|
|
80
|
-
"Would you like me to review and finalize the project information?",
|
|
81
|
-
- In this final refinement, particularly focus on relevance and potential duplications and the "Project Info Guidelines"
|
|
82
|
-
- Then, ask for final user review. Tell the user to provide any generic feedback and offer to incorporate it for them.
|
|
83
|
-
- Finally remind them to accept the final version in the change set
|
|
84
|
-
|
|
85
|
-
### Complete Project Info
|
|
86
|
-
- If a project info is incomplete, offer the user to complete it
|
|
87
|
-
|
|
88
|
-
### Update Project Info
|
|
89
|
-
- Modify existing project info based on user requirements
|
|
90
|
-
- Do not use a specific workflow for this
|
|
91
|
-
|
|
92
|
-
## Workspace Analysis Guidelines
|
|
93
|
-
|
|
94
|
-
**Auto-Discovery File Patterns**
|
|
95
|
-
When auto-discovering project information or exploring the workspace structure, ALWAYS prioritize examining these file patterns that commonly contain agent instructions
|
|
96
|
-
and project documentation:
|
|
97
|
-
- .github/copilot-instructions.md
|
|
98
|
-
- AGENT.md
|
|
99
|
-
- AGENTS.md
|
|
100
|
-
- CLAUDE.md
|
|
101
|
-
- .cursorrules
|
|
102
|
-
- .windsurfrules
|
|
103
|
-
- .clinerules
|
|
104
|
-
- .cursor
|
|
105
|
-
- rules/**
|
|
106
|
-
- .windsurf/rules/**
|
|
107
|
-
- .clinerules/**
|
|
108
|
-
- README.md
|
|
109
|
-
- .md files in the root level if they contain documentation
|
|
110
|
-
|
|
111
|
-
Use the **~{${workspace_functions_1.FIND_FILES_BY_PATTERN_FUNCTION_ID}}** function with these patterns to discover relevant configuration and documentation files.
|
|
112
|
-
|
|
113
|
-
## Context Retrieval
|
|
114
|
-
Use the following functions to interact with the workspace files when needed:
|
|
115
|
-
- **~{${workspace_functions_1.GET_WORKSPACE_FILE_LIST_FUNCTION_ID}}**: List files and directories
|
|
116
|
-
- **~{${workspace_functions_1.FILE_CONTENT_FUNCTION_ID}}**: Get content of specific files
|
|
117
|
-
- **~{${workspace_functions_1.FIND_FILES_BY_PATTERN_FUNCTION_ID}}**: Find files by glob patterns like '**/*.json'
|
|
118
|
-
- **~{${workspace_functions_1.SEARCH_IN_WORKSPACE_FUNCTION_ID}}**: Search file contents
|
|
119
|
-
|
|
120
|
-
Navigate step-by-step and confirm paths. Use **~{${context_functions_1.UPDATE_CONTEXT_FILES_FUNCTION_ID}}** to remember important files for later reference.
|
|
121
|
-
|
|
122
|
-
## File Modification - SUGGEST ONLY
|
|
123
|
-
Use these functions liberally to suggest file changes. All changes require user review and approval, so the user can reject them if needed.
|
|
124
|
-
|
|
125
|
-
- **~{${file_changeset_function_ids_1.SUGGEST_FILE_CONTENT_ID}}**: Propose complete file content (for creating new templates or complete rewrites)
|
|
126
|
-
- **~{${file_changeset_function_ids_1.SUGGEST_FILE_REPLACEMENTS_ID}}**: Propose targeted replacements of specific text sections
|
|
127
|
-
- **~{${file_changeset_function_ids_1.GET_PROPOSED_CHANGES_ID}}**: View current proposed changes before making additional ones
|
|
128
|
-
- **~{${file_changeset_function_ids_1.CLEAR_FILE_CHANGES_ID}}**: Clear all pending changes for a file to start fresh
|
|
129
|
-
|
|
130
|
-
{{prompt:${exports.PROJECT_INFO_TEMPLATE_PROMPT_ID}}}
|
|
131
|
-
|
|
132
|
-
## Additional Context
|
|
133
|
-
{{${context_variables_1.CONTEXT_FILES_VARIABLE_ID}}}
|
|
134
|
-
|
|
135
|
-
## Workflow Guidelines
|
|
136
|
-
|
|
137
|
-
When creating project info for the first time:
|
|
138
|
-
1. **Always start by asking about the user's preferred mode** (auto-exploration or manual) and stick to it
|
|
139
|
-
2. **After initial suggestions or provided content**: Always ask for refinement and additional information
|
|
140
|
-
|
|
141
|
-
Remember: Proactively help users maintain accurate project information for better AI assistance.
|
|
142
|
-
`
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
//# sourceMappingURL=project-info-prompt-template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"project-info-prompt-template.js","sourceRoot":"","sources":["../../src/common/project-info-prompt-template.ts"],"names":[],"mappings":";;;AAWA,+DAG+B;AAC/B,2DAAgE;AAChE,2DAAuE;AACvE,+EAKuC;AAE1B,QAAA,sCAAsC,GAAG,qBAAqB,CAAC;AAC/D,QAAA,+BAA+B,GAAG,uBAAuB,CAAC;AAE1D,QAAA,2BAA2B,GAAqB;IACzD,EAAE,EAAE,uCAA+B;IACnC,cAAc,EAAE;QACZ,EAAE,EAAE,+BAA+B;QACnC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BjB;KACI;CACJ,CAAC;AAEW,QAAA,yBAAyB,GAAqB;IACvD,EAAE,EAAE,8CAAsC;IAC1C,cAAc,EAAE;QACZ,EAAE,EAAE,6BAA6B;QACjC,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAgEJ,uDAAiC;;;;QAIvC,yDAAmC;QACnC,8CAAwB;QACxB,uDAAiC;QACjC,qDAA+B;;mDAEY,oDAAgC;;;;;QAK3E,qDAAuB;QACvB,0DAA4B;QAC5B,qDAAuB;QACvB,mDAAqB;;WAElB,uCAA+B;;;IAGtC,6CAAyB;;;;;;;;;CAS5B;KACI;CACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summarize-session-commands.d.ts","sourceRoot":"","sources":["../../src/common/summarize-session-commands.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,eAAO,MAAM,sCAAsC,SAGjD,CAAC;AAEH,eAAO,MAAM,8BAA8B,SAGzC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 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
|
-
exports.AI_UPDATE_TASK_CONTEXT_COMMAND = exports.AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = void 0;
|
|
19
|
-
const core_1 = require("@theia/core");
|
|
20
|
-
exports.AI_SUMMARIZE_SESSION_AS_TASK_FOR_CODER = core_1.Command.toLocalizedCommand({
|
|
21
|
-
id: 'ai-chat:summarize-session-as-task-for-coder',
|
|
22
|
-
label: 'Summarize Session as Task for Coder'
|
|
23
|
-
});
|
|
24
|
-
exports.AI_UPDATE_TASK_CONTEXT_COMMAND = core_1.Command.toLocalizedCommand({
|
|
25
|
-
id: 'ai.updateTaskContext',
|
|
26
|
-
label: 'Update Current Task Context'
|
|
27
|
-
});
|
|
28
|
-
//# sourceMappingURL=summarize-session-commands.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"summarize-session-commands.js","sourceRoot":"","sources":["../../src/common/summarize-session-commands.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,sCAAsC;AAEzB,QAAA,sCAAsC,GAAG,cAAO,CAAC,kBAAkB,CAAC;IAC7E,EAAE,EAAE,6CAA6C;IACjD,KAAK,EAAE,qCAAqC;CAC/C,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,cAAO,CAAC,kBAAkB,CAAC;IACrE,EAAE,EAAE,sBAAsB;IAC1B,KAAK,EAAE,6BAA6B;CACvC,CAAC,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PromptVariantSet } from '@theia/ai-core/lib/common';
|
|
2
|
-
export declare const TASK_CONTEXT_CREATE_PROMPT_ID = "task-context-create";
|
|
3
|
-
export declare const TASK_CONTEXT_TEMPLATE_PROMPT_ID = "task-context-template";
|
|
4
|
-
export declare const TASK_CONTEXT_UPDATE_PROMPT_ID = "task-context-update";
|
|
5
|
-
export declare const taskContextSystemVariants: PromptVariantSet;
|
|
6
|
-
export declare const taskContextTemplateVariants: PromptVariantSet;
|
|
7
|
-
export declare const taskContextUpdateVariants: PromptVariantSet;
|
|
8
|
-
//# sourceMappingURL=task-context-prompt-template.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"task-context-prompt-template.d.ts","sourceRoot":"","sources":["../../src/common/task-context-prompt-template.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AACnE,eAAO,MAAM,+BAA+B,0BAA0B,CAAC;AACvE,eAAO,MAAM,6BAA6B,wBAAwB,CAAC;AAEnE,eAAO,MAAM,yBAAyB,kBA4BrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,kBA8HvC,CAAC;AAEF,eAAO,MAAM,yBAAyB,kBAoDrC,CAAC"}
|