@theia/ai-ide 1.76.0-next.7 → 1.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/lib/browser/ai-allow-all-mode-chat-banner.js +1 -1
  2. package/lib/browser/ai-allow-all-mode-chat-banner.js.map +1 -1
  3. package/lib/browser/ai-aware-scm-commit-widget.d.ts +27 -0
  4. package/lib/browser/ai-aware-scm-commit-widget.d.ts.map +1 -0
  5. package/lib/browser/ai-aware-scm-commit-widget.js +142 -0
  6. package/lib/browser/ai-aware-scm-commit-widget.js.map +1 -0
  7. package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts +10 -4
  8. package/lib/browser/ai-configuration/ai-configuration-detail-widget.d.ts.map +1 -1
  9. package/lib/browser/ai-configuration/ai-configuration-detail-widget.js +12 -7
  10. package/lib/browser/ai-configuration/ai-configuration-detail-widget.js.map +1 -1
  11. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js +14 -14
  12. package/lib/browser/ai-configuration/ai-configuration-detail-widget.spec.js.map +1 -1
  13. package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts +6 -0
  14. package/lib/browser/ai-configuration/ai-configuration-tree-widget.d.ts.map +1 -1
  15. package/lib/browser/ai-configuration/ai-configuration-tree-widget.js +9 -0
  16. package/lib/browser/ai-configuration/ai-configuration-tree-widget.js.map +1 -1
  17. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.d.ts.map +1 -1
  18. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js +2 -1
  19. package/lib/browser/ai-configuration/categories/agent-capabilities-settings.js.map +1 -1
  20. package/lib/browser/ai-configuration/categories/agent-chips.js +1 -1
  21. package/lib/browser/ai-configuration/categories/agent-chips.js.map +1 -1
  22. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts +8 -0
  23. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.d.ts.map +1 -1
  24. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js +27 -8
  25. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.js.map +1 -1
  26. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js +38 -2
  27. package/lib/browser/ai-configuration/categories/model-aliases-configuration-category.spec.js.map +1 -1
  28. package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts +13 -2
  29. package/lib/browser/ai-configuration/categories/models-configuration-category.d.ts.map +1 -1
  30. package/lib/browser/ai-configuration/categories/models-configuration-category.js +41 -2
  31. package/lib/browser/ai-configuration/categories/models-configuration-category.js.map +1 -1
  32. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js +32 -2
  33. package/lib/browser/ai-configuration/categories/models-configuration-category.spec.js.map +1 -1
  34. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.d.ts +26 -0
  35. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.d.ts.map +1 -0
  36. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js +212 -0
  37. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.js.map +1 -0
  38. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.d.ts +2 -0
  39. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.d.ts.map +1 -0
  40. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js +423 -0
  41. package/lib/browser/ai-configuration/categories/provider-model-discovery-section.spec.js.map +1 -0
  42. package/lib/browser/ai-configuration/language-model-renderer.d.ts.map +1 -1
  43. package/lib/browser/ai-configuration/language-model-renderer.js +10 -3
  44. package/lib/browser/ai-configuration/language-model-renderer.js.map +1 -1
  45. package/lib/browser/ai-getting-started-commands.d.ts +10 -0
  46. package/lib/browser/ai-getting-started-commands.d.ts.map +1 -0
  47. package/lib/browser/ai-getting-started-commands.js +34 -0
  48. package/lib/browser/ai-getting-started-commands.js.map +1 -0
  49. package/lib/browser/ai-getting-started-contribution.d.ts +20 -0
  50. package/lib/browser/ai-getting-started-contribution.d.ts.map +1 -0
  51. package/lib/browser/ai-getting-started-contribution.js +70 -0
  52. package/lib/browser/ai-getting-started-contribution.js.map +1 -0
  53. package/lib/browser/ai-getting-started-walkthrough.d.ts +41 -0
  54. package/lib/browser/ai-getting-started-walkthrough.d.ts.map +1 -0
  55. package/lib/browser/ai-getting-started-walkthrough.js +225 -0
  56. package/lib/browser/ai-getting-started-walkthrough.js.map +1 -0
  57. package/lib/browser/ai-getting-started-walkthrough.spec.d.ts +2 -0
  58. package/lib/browser/ai-getting-started-walkthrough.spec.d.ts.map +1 -0
  59. package/lib/browser/ai-getting-started-walkthrough.spec.js +124 -0
  60. package/lib/browser/ai-getting-started-walkthrough.spec.js.map +1 -0
  61. package/lib/browser/ai-walkthrough-context-keys.d.ts +55 -0
  62. package/lib/browser/ai-walkthrough-context-keys.d.ts.map +1 -0
  63. package/lib/browser/ai-walkthrough-context-keys.js +145 -0
  64. package/lib/browser/ai-walkthrough-context-keys.js.map +1 -0
  65. package/lib/browser/ai-walkthrough-context-keys.spec.d.ts +2 -0
  66. package/lib/browser/ai-walkthrough-context-keys.spec.d.ts.map +1 -0
  67. package/lib/browser/ai-walkthrough-context-keys.spec.js +166 -0
  68. package/lib/browser/ai-walkthrough-context-keys.spec.js.map +1 -0
  69. package/lib/browser/chat-session-item.js +2 -2
  70. package/lib/browser/chat-session-item.js.map +1 -1
  71. package/lib/browser/commit-message-agent.d.ts +31 -0
  72. package/lib/browser/commit-message-agent.d.ts.map +1 -0
  73. package/lib/browser/commit-message-agent.js +99 -0
  74. package/lib/browser/commit-message-agent.js.map +1 -0
  75. package/lib/browser/commit-message-agent.spec.d.ts +2 -0
  76. package/lib/browser/commit-message-agent.spec.d.ts.map +1 -0
  77. package/lib/browser/commit-message-agent.spec.js +82 -0
  78. package/lib/browser/commit-message-agent.spec.js.map +1 -0
  79. package/lib/browser/commit-message-command-contribution.d.ts +15 -0
  80. package/lib/browser/commit-message-command-contribution.d.ts.map +1 -0
  81. package/lib/browser/commit-message-command-contribution.js +73 -0
  82. package/lib/browser/commit-message-command-contribution.js.map +1 -0
  83. package/lib/browser/commit-message-commands.d.ts +5 -0
  84. package/lib/browser/commit-message-commands.d.ts.map +1 -0
  85. package/lib/browser/commit-message-commands.js +28 -0
  86. package/lib/browser/commit-message-commands.js.map +1 -0
  87. package/lib/browser/commit-message-prompt-template.d.ts +11 -0
  88. package/lib/browser/commit-message-prompt-template.d.ts.map +1 -0
  89. package/lib/browser/commit-message-prompt-template.js +63 -0
  90. package/lib/browser/commit-message-prompt-template.js.map +1 -0
  91. package/lib/browser/commit-message-runner.d.ts +41 -0
  92. package/lib/browser/commit-message-runner.d.ts.map +1 -0
  93. package/lib/browser/commit-message-runner.js +143 -0
  94. package/lib/browser/commit-message-runner.js.map +1 -0
  95. package/lib/browser/commit-message-runner.spec.d.ts +2 -0
  96. package/lib/browser/commit-message-runner.spec.d.ts.map +1 -0
  97. package/lib/browser/commit-message-runner.spec.js +206 -0
  98. package/lib/browser/commit-message-runner.spec.js.map +1 -0
  99. package/lib/browser/frontend-module.d.ts.map +1 -1
  100. package/lib/browser/frontend-module.js +25 -0
  101. package/lib/browser/frontend-module.js.map +1 -1
  102. package/lib/browser/git-changes-tool.d.ts +73 -0
  103. package/lib/browser/git-changes-tool.d.ts.map +1 -0
  104. package/lib/browser/git-changes-tool.js +217 -0
  105. package/lib/browser/git-changes-tool.js.map +1 -0
  106. package/lib/browser/git-changes-tool.spec.d.ts +2 -0
  107. package/lib/browser/git-changes-tool.spec.d.ts.map +1 -0
  108. package/lib/browser/git-changes-tool.spec.js +167 -0
  109. package/lib/browser/git-changes-tool.spec.js.map +1 -0
  110. package/lib/browser/ide-chat-welcome-message-provider.d.ts +26 -28
  111. package/lib/browser/ide-chat-welcome-message-provider.d.ts.map +1 -1
  112. package/lib/browser/ide-chat-welcome-message-provider.js +61 -151
  113. package/lib/browser/ide-chat-welcome-message-provider.js.map +1 -1
  114. package/lib/browser/review/pr-review-capability-contribution.js +1 -1
  115. package/lib/browser/review/pr-review-capability-contribution.js.map +1 -1
  116. package/lib/browser/user-interaction-tool-renderer.d.ts +6 -0
  117. package/lib/browser/user-interaction-tool-renderer.d.ts.map +1 -1
  118. package/lib/browser/user-interaction-tool-renderer.js +36 -7
  119. package/lib/browser/user-interaction-tool-renderer.js.map +1 -1
  120. package/lib/browser/user-interaction-tool.d.ts +23 -1
  121. package/lib/browser/user-interaction-tool.d.ts.map +1 -1
  122. package/lib/browser/user-interaction-tool.js +56 -17
  123. package/lib/browser/user-interaction-tool.js.map +1 -1
  124. package/lib/browser/user-interaction-tool.spec.js +151 -2
  125. package/lib/browser/user-interaction-tool.spec.js.map +1 -1
  126. package/lib/common/command-prompt-template.js +1 -1
  127. package/lib/common/user-interaction-tool.d.ts +19 -1
  128. package/lib/common/user-interaction-tool.d.ts.map +1 -1
  129. package/lib/common/user-interaction-tool.js +100 -29
  130. package/lib/common/user-interaction-tool.js.map +1 -1
  131. package/lib/common/user-interaction-tool.spec.js +215 -174
  132. package/lib/common/user-interaction-tool.spec.js.map +1 -1
  133. package/package.json +26 -25
  134. package/src/browser/ai-allow-all-mode-chat-banner.tsx +2 -2
  135. package/src/browser/ai-aware-scm-commit-widget.tsx +153 -0
  136. package/src/browser/ai-configuration/ai-configuration-detail-widget.spec.ts +14 -14
  137. package/src/browser/ai-configuration/ai-configuration-detail-widget.tsx +12 -7
  138. package/src/browser/ai-configuration/ai-configuration-tree-widget.tsx +8 -0
  139. package/src/browser/ai-configuration/categories/agent-capabilities-settings.tsx +7 -8
  140. package/src/browser/ai-configuration/categories/agent-chips.tsx +1 -1
  141. package/src/browser/ai-configuration/categories/model-aliases-configuration-category.spec.ts +40 -2
  142. package/src/browser/ai-configuration/categories/model-aliases-configuration-category.tsx +31 -10
  143. package/src/browser/ai-configuration/categories/models-configuration-category.spec.ts +47 -2
  144. package/src/browser/ai-configuration/categories/models-configuration-category.tsx +52 -5
  145. package/src/browser/ai-configuration/categories/provider-model-discovery-section.spec.tsx +451 -0
  146. package/src/browser/ai-configuration/categories/provider-model-discovery-section.tsx +341 -0
  147. package/src/browser/ai-configuration/language-model-renderer.tsx +11 -3
  148. package/src/browser/ai-getting-started-commands.ts +33 -0
  149. package/src/browser/ai-getting-started-contribution.ts +64 -0
  150. package/src/browser/ai-getting-started-walkthrough.spec.ts +146 -0
  151. package/src/browser/ai-getting-started-walkthrough.ts +249 -0
  152. package/src/browser/ai-walkthrough-context-keys.spec.ts +209 -0
  153. package/src/browser/ai-walkthrough-context-keys.ts +147 -0
  154. package/src/browser/chat-session-item.tsx +2 -2
  155. package/src/browser/commit-message-agent.spec.ts +97 -0
  156. package/src/browser/commit-message-agent.ts +113 -0
  157. package/src/browser/commit-message-command-contribution.ts +67 -0
  158. package/src/browser/commit-message-commands.ts +25 -0
  159. package/src/browser/commit-message-prompt-template.ts +65 -0
  160. package/src/browser/commit-message-runner.spec.ts +266 -0
  161. package/src/browser/commit-message-runner.ts +163 -0
  162. package/src/browser/frontend-module.ts +27 -0
  163. package/src/browser/git-changes-tool.spec.ts +200 -0
  164. package/src/browser/git-changes-tool.ts +239 -0
  165. package/src/browser/ide-chat-welcome-message-provider.tsx +93 -230
  166. package/src/browser/review/pr-review-capability-contribution.ts +1 -1
  167. package/src/browser/style/commit-message-overlay.css +64 -0
  168. package/src/browser/style/index.css +4 -42
  169. package/src/browser/user-interaction-tool-renderer.tsx +38 -8
  170. package/src/browser/user-interaction-tool.spec.ts +201 -2
  171. package/src/browser/user-interaction-tool.ts +69 -18
  172. package/src/common/command-prompt-template.ts +1 -1
  173. package/src/common/user-interaction-tool.spec.ts +217 -161
  174. package/src/common/user-interaction-tool.ts +127 -32
@@ -0,0 +1,70 @@
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
+ exports.AiGettingStartedContribution = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const preferences_1 = require("@theia/core/lib/common/preferences");
21
+ const message_service_1 = require("@theia/core/lib/common/message-service");
22
+ const nls_1 = require("@theia/core/lib/common/nls");
23
+ const common_1 = require("@theia/ai-chat/lib/common");
24
+ const ai_chat_preferences_1 = require("@theia/ai-chat/lib/common/ai-chat-preferences");
25
+ const walkthrough_commands_1 = require("@theia/getting-started/lib/common/walkthrough-commands");
26
+ const inversify_1 = require("@theia/core/shared/inversify");
27
+ const ai_getting_started_walkthrough_1 = require("./ai-getting-started-walkthrough");
28
+ const ai_getting_started_commands_1 = require("./ai-getting-started-commands");
29
+ /**
30
+ * Opens the AI getting started walkthrough from anywhere - the chat view, the command palette or a menu -
31
+ * without every caller having to know the walkthrough id.
32
+ */
33
+ let AiGettingStartedContribution = class AiGettingStartedContribution {
34
+ registerCommands(commands) {
35
+ // Deliberately not gated on the AI features being enabled: this is where they get enabled.
36
+ commands.registerCommand(ai_getting_started_commands_1.AI_OPEN_GETTING_STARTED_WALKTHROUGH, {
37
+ execute: () => commands.executeCommand(walkthrough_commands_1.WalkthroughCommands.OPEN_WALKTHROUGH.id, ai_getting_started_walkthrough_1.AI_GETTING_STARTED_WALKTHROUGH_ID)
38
+ });
39
+ commands.registerCommand(ai_getting_started_commands_1.AI_SET_DEFAULT_CHAT_AGENT, {
40
+ execute: (agentId) => this.setDefaultChatAgent(agentId),
41
+ isEnabled: (agentId) => typeof agentId === 'string' && !!agentId
42
+ });
43
+ }
44
+ /**
45
+ * Writes the default chat agent preference and says so: the walkthrough offers this as a button, and
46
+ * without the message the only feedback would be the step ticking itself off further up the page.
47
+ */
48
+ async setDefaultChatAgent(agentId) {
49
+ await this.preferenceService.set(ai_chat_preferences_1.DEFAULT_CHAT_AGENT_PREF, agentId, preferences_1.PreferenceScope.User);
50
+ const label = this.chatAgentService.getAgent(agentId)?.name ?? agentId;
51
+ this.messageService.info(nls_1.nls.localize('theia/ai/ide/defaultChatAgentSet', 'The default chat agent is now {0}.', label));
52
+ }
53
+ };
54
+ exports.AiGettingStartedContribution = AiGettingStartedContribution;
55
+ tslib_1.__decorate([
56
+ (0, inversify_1.inject)(preferences_1.PreferenceService),
57
+ tslib_1.__metadata("design:type", Object)
58
+ ], AiGettingStartedContribution.prototype, "preferenceService", void 0);
59
+ tslib_1.__decorate([
60
+ (0, inversify_1.inject)(message_service_1.MessageService),
61
+ tslib_1.__metadata("design:type", message_service_1.MessageService)
62
+ ], AiGettingStartedContribution.prototype, "messageService", void 0);
63
+ tslib_1.__decorate([
64
+ (0, inversify_1.inject)(common_1.ChatAgentService),
65
+ tslib_1.__metadata("design:type", Object)
66
+ ], AiGettingStartedContribution.prototype, "chatAgentService", void 0);
67
+ exports.AiGettingStartedContribution = AiGettingStartedContribution = tslib_1.__decorate([
68
+ (0, inversify_1.injectable)()
69
+ ], AiGettingStartedContribution);
70
+ //# sourceMappingURL=ai-getting-started-contribution.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-getting-started-contribution.js","sourceRoot":"","sources":["../../src/browser/ai-getting-started-contribution.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;;;;AAGhF,oEAAwF;AACxF,4EAAwE;AACxE,oDAAiD;AACj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C6B;uCAT7C,4BAA4B;IADxC,IAAA,sBAAU,GAAE;GACA,4BAA4B,CA+BxC"}
@@ -0,0 +1,41 @@
1
+ import { ChatAgentRecommendationService } from '@theia/ai-chat/lib/common';
2
+ import { WalkthroughProvider } from '@theia/getting-started/lib/common/walkthrough-provider';
3
+ import { WalkthroughDefinition, WalkthroughStepDefinition } from '@theia/getting-started/lib/common/walkthrough-types';
4
+ /**
5
+ * Id of the walkthrough that guides a new user through setting up and using the AI features.
6
+ * Also the argument of the `walkthrough.open` command.
7
+ */
8
+ export declare const AI_GETTING_STARTED_WALKTHROUGH_ID = "ai-features.getting-started";
9
+ /**
10
+ * Contributes the "Get started with AI" walkthrough to the welcome page: the single, progress-tracked path
11
+ * from disabled AI features to a first answer in the chat.
12
+ */
13
+ export declare class AiGettingStartedWalkthroughProvider implements WalkthroughProvider {
14
+ protected readonly recommendationService: ChatAgentRecommendationService;
15
+ protected walkthrough: WalkthroughDefinition | undefined;
16
+ getWalkthroughs(): WalkthroughDefinition[];
17
+ protected get applicationName(): string;
18
+ /** Deep-links into the AI Configuration view, which takes a category id or an `ai-features.*` preference id. */
19
+ protected aiConfiguration(target?: string): string;
20
+ protected createWalkthrough(): WalkthroughDefinition;
21
+ /**
22
+ * The opening slide, carrying what the welcome page used to announce in its AI banner: what the features
23
+ * are, that they are opt-in and may incur costs, and the invitation to the community behind them.
24
+ */
25
+ protected createAiSupportStep(): WalkthroughStepDefinition;
26
+ protected createEnableStep(): WalkthroughStepDefinition;
27
+ protected createModelStep(): WalkthroughStepDefinition;
28
+ protected createAgentStep(): WalkthroughStepDefinition;
29
+ /**
30
+ * One action per recommended agent, each setting it as the default right away.
31
+ *
32
+ * Every link stands alone in its paragraph, which is what the welcome page renders as a button, so this
33
+ * reads like the buttons the chat welcome used to offer. Products customize the list through
34
+ * {@link ChatAgentRecommendationService}.
35
+ */
36
+ protected renderAgentChoices(): string;
37
+ protected createFirstQuestionStep(): WalkthroughStepDefinition;
38
+ protected createToolConfirmationStep(): WalkthroughStepDefinition;
39
+ protected createGoFurtherStep(): WalkthroughStepDefinition;
40
+ }
41
+ //# sourceMappingURL=ai-getting-started-walkthrough.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-getting-started-walkthrough.d.ts","sourceRoot":"","sources":["../../src/browser/ai-getting-started-walkthrough.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAO3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,qDAAqD,CAAC;AAYvH;;;GAGG;AACH,eAAO,MAAM,iCAAiC,gCAAgC,CAAC;AAM/E;;;GAGG;AACH,qBACa,mCAAoC,YAAW,mBAAmB;IAG3E,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,8BAA8B,CAAC;IAEzE,SAAS,CAAC,WAAW,EAAE,qBAAqB,GAAG,SAAS,CAAC;IAEzD,eAAe,IAAI,qBAAqB,EAAE;IAM1C,SAAS,KAAK,eAAe,IAAI,MAAM,CAEtC;IAED,gHAAgH;IAChH,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM;IAIlD,SAAS,CAAC,iBAAiB,IAAI,qBAAqB;IAkBpD;;;OAGG;IACH,SAAS,CAAC,mBAAmB,IAAI,yBAAyB;IAsB1D,SAAS,CAAC,gBAAgB,IAAI,yBAAyB;IAavD,SAAS,CAAC,eAAe,IAAI,yBAAyB;IAsBtD,SAAS,CAAC,eAAe,IAAI,yBAAyB;IAkBtD;;;;;;OAMG;IACH,SAAS,CAAC,kBAAkB,IAAI,MAAM;IAWtC,SAAS,CAAC,uBAAuB,IAAI,yBAAyB;IAkB9D,SAAS,CAAC,0BAA0B,IAAI,yBAAyB;IAkBjE,SAAS,CAAC,mBAAmB,IAAI,yBAAyB;CAuB7D"}
@@ -0,0 +1,225 @@
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
+ exports.AiGettingStartedWalkthroughProvider = exports.AI_GETTING_STARTED_WALKTHROUGH_ID = void 0;
19
+ const tslib_1 = require("tslib");
20
+ const ai_chat_ui_contribution_1 = require("@theia/ai-chat-ui/lib/browser/ai-chat-ui-contribution");
21
+ const common_1 = require("@theia/ai-chat/lib/common");
22
+ const ai_chat_preferences_1 = require("@theia/ai-chat/lib/common/ai-chat-preferences");
23
+ const ai_activation_service_1 = require("@theia/ai-core/lib/browser/ai-activation-service");
24
+ const ai_configuration_category_1 = require("@theia/ai-core-ui/lib/browser/ai-configuration/ai-configuration-category");
25
+ const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
26
+ const perspective_service_1 = require("@theia/core/lib/browser/perspective-service");
27
+ const nls_1 = require("@theia/core/lib/common/nls");
28
+ const inversify_1 = require("@theia/core/shared/inversify");
29
+ const workspace_commands_1 = require("@theia/workspace/lib/browser/workspace-commands");
30
+ const ai_getting_started_commands_1 = require("./ai-getting-started-commands");
31
+ const ai_configuration_view_contribution_1 = require("./ai-configuration/ai-configuration-view-contribution");
32
+ const ai_walkthrough_context_keys_1 = require("./ai-walkthrough-context-keys");
33
+ /**
34
+ * Id of the walkthrough that guides a new user through setting up and using the AI features.
35
+ * Also the argument of the `walkthrough.open` command.
36
+ */
37
+ exports.AI_GETTING_STARTED_WALKTHROUGH_ID = 'ai-features.getting-started';
38
+ const AI_DOC_URL = 'https://theia-ide.org/docs/user_ai/';
39
+ const THEIA_AI_DOC_URL = 'https://theia-ide.org/docs/theia_ai/';
40
+ const FEEDBACK_URL = 'https://github.com/eclipse-theia/theia/issues/new/choose';
41
+ /**
42
+ * Contributes the "Get started with AI" walkthrough to the welcome page: the single, progress-tracked path
43
+ * from disabled AI features to a first answer in the chat.
44
+ */
45
+ let AiGettingStartedWalkthroughProvider = class AiGettingStartedWalkthroughProvider {
46
+ getWalkthroughs() {
47
+ // Built on demand rather than in the field initializer, so that the localization is in place.
48
+ this.walkthrough ??= this.createWalkthrough();
49
+ return [this.walkthrough];
50
+ }
51
+ get applicationName() {
52
+ return frontend_application_config_provider_1.FrontendApplicationConfigProvider.get().applicationName;
53
+ }
54
+ /** Deep-links into the AI Configuration view, which takes a category id or an `ai-features.*` preference id. */
55
+ aiConfiguration(target) {
56
+ return `command:${ai_configuration_view_contribution_1.OPEN_AI_CONFIG_VIEW.id}${target ? `?${target}` : ''}`;
57
+ }
58
+ createWalkthrough() {
59
+ return {
60
+ id: exports.AI_GETTING_STARTED_WALKTHROUGH_ID,
61
+ icon: 'sparkle',
62
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/title', 'Get started with AI'),
63
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/description', 'Set up the AI features of {0} and learn how to work with them.', this.applicationName),
64
+ steps: [
65
+ this.createAiSupportStep(),
66
+ this.createEnableStep(),
67
+ this.createModelStep(),
68
+ this.createAgentStep(),
69
+ this.createFirstQuestionStep(),
70
+ this.createToolConfirmationStep(),
71
+ this.createGoFurtherStep()
72
+ ]
73
+ };
74
+ }
75
+ /**
76
+ * The opening slide, carrying what the welcome page used to announce in its AI banner: what the features
77
+ * are, that they are opt-in and may incur costs, and the invitation to the community behind them.
78
+ */
79
+ createAiSupportStep() {
80
+ return {
81
+ id: 'ai-support',
82
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/aiSupport/title', 'AI support in {0}', this.applicationName),
83
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/aiSupport/description', `
84
+ {0} comes with AI support: chat with specialized agents about your project, let them change code and run tasks, complete code as you type and get help in the terminal.
85
+
86
+ These features are disabled by default, so that you can opt in at your own discretion.
87
+
88
+ Once enabled, they may generate continuous requests to the language models you provide access to. This might incur costs that you need to monitor closely.
89
+
90
+ [Read the documentation]({1}).
91
+
92
+ We welcome your feedback, contributions and sponsorship! Visit the [GitHub project]({2}) to support the ongoing development. Thank you for being part of our community!
93
+
94
+ All of this is built on Theia AI, the framework for AI-powered tools and IDEs, published as a stable release. [Read the framework documentation]({3}).
95
+ `, this.applicationName, AI_DOC_URL, FEEDBACK_URL, THEIA_AI_DOC_URL).trim(),
96
+ // Reading it is done once the user acts on it, either by following a link or by turning the features on.
97
+ completionEvents: [`onContext:${ai_activation_service_1.ENABLE_AI_CONTEXT_KEY}`, `onLink:${AI_DOC_URL}`]
98
+ };
99
+ }
100
+ createEnableStep() {
101
+ return {
102
+ id: 'enable-ai',
103
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/enableAi/title', 'Turn on the AI features'),
104
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/enableAi/description', `
105
+ Nothing is sent anywhere until you switch the AI features on, and you can switch them off again at any time.
106
+
107
+ [Open the AI Configuration]({0}) and enable them there.
108
+ `, this.aiConfiguration(ai_activation_service_1.ENABLE_AI_CONTEXT_KEY)).trim(),
109
+ completionEvents: [`onContext:${ai_activation_service_1.ENABLE_AI_CONTEXT_KEY}`]
110
+ };
111
+ }
112
+ createModelStep() {
113
+ return {
114
+ id: 'connect-model',
115
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/connectModel/title', 'Connect a language model'),
116
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/connectModel/description', `
117
+ Add an API key for a hosted provider:
118
+
119
+ - [OpenAI]({0})
120
+ - [Anthropic]({1})
121
+ - [Google]({2})
122
+
123
+ Prefer to stay local or use another service? Ollama, llamafile and any OpenAI-compatible endpoint can be set up in the [Models]({3}) page.
124
+
125
+ Some agents bring their own model, for example Claude Code, and work without a provider.
126
+ `, this.aiConfiguration('ai-features.openAiOfficial.openAiApiKey'), this.aiConfiguration('ai-features.anthropic.AnthropicApiKey'), this.aiConfiguration('ai-features.google.apiKey'), this.aiConfiguration(ai_configuration_category_1.AiConfigurationCategoryId.MODELS)).trim(),
127
+ completionEvents: [`onContext:${ai_walkthrough_context_keys_1.AI_MODEL_READY_CONTEXT_KEY}`]
128
+ };
129
+ }
130
+ createAgentStep() {
131
+ const intro = nls_1.nls.localize('theia/ai/ide/walkthrough/chooseAgent/intro', `
132
+ Every chat request goes to an agent, and one of them answers whenever you do not name one yourself.
133
+
134
+ **Set your default agent:**
135
+ `).trim();
136
+ const outro = nls_1.nls.localize('theia/ai/ide/walkthrough/chooseAgent/outro', `
137
+ You can also [choose the default agent]({0}) in the settings, and address another one for a single message by starting it with *@AgentName*.
138
+ The [Agents]({1}) page lists them all.
139
+ `, this.aiConfiguration(ai_chat_preferences_1.DEFAULT_CHAT_AGENT_PREF), this.aiConfiguration(ai_configuration_category_1.AiConfigurationCategoryId.AGENTS)).trim();
140
+ return {
141
+ id: 'choose-agent',
142
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/chooseAgent/title', 'Choose your default agent'),
143
+ description: [intro, this.renderAgentChoices(), outro].filter(part => !!part).join('\n\n'),
144
+ completionEvents: [`onContext:${ai_walkthrough_context_keys_1.AI_DEFAULT_AGENT_CONTEXT_KEY}`]
145
+ };
146
+ }
147
+ /**
148
+ * One action per recommended agent, each setting it as the default right away.
149
+ *
150
+ * Every link stands alone in its paragraph, which is what the welcome page renders as a button, so this
151
+ * reads like the buttons the chat welcome used to offer. Products customize the list through
152
+ * {@link ChatAgentRecommendationService}.
153
+ */
154
+ renderAgentChoices() {
155
+ return this.recommendationService.getRecommendedAgents()
156
+ .map(agent => {
157
+ const command = `command:${ai_getting_started_commands_1.AI_SET_DEFAULT_CHAT_AGENT.id}?${encodeURIComponent(JSON.stringify(agent.id))}`;
158
+ // Carried as the link title, so what the agent is good at stays available as a tooltip.
159
+ const title = agent.description ? ` "${agent.description.replace(/"/g, '')}"` : '';
160
+ return `[@${agent.label}](${command}${title})`;
161
+ })
162
+ .join('\n\n');
163
+ }
164
+ createFirstQuestionStep() {
165
+ return {
166
+ id: 'first-question',
167
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/firstQuestion/title', 'Ask your first question'),
168
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/firstQuestion/description', `
169
+ [Open the AI Chat]({0}) and ask something about your project.
170
+
171
+ Two things make the answers a lot better:
172
+
173
+ - *@AgentName* picks the agent for this message, for example *@Coder*.
174
+ - *#* attaches context, for example *#file* or *#selectedText*. The paperclip button next to the input does the same.
175
+
176
+ The chat remembers your sessions, so you can pick a conversation up later.
177
+ `, `command:${ai_chat_ui_contribution_1.AI_CHAT_TOGGLE_COMMAND_ID}`).trim(),
178
+ completionEvents: [`onContext:${ai_walkthrough_context_keys_1.AI_CHAT_USED_CONTEXT_KEY}`]
179
+ };
180
+ }
181
+ createToolConfirmationStep() {
182
+ return {
183
+ id: 'tool-confirmation',
184
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/toolConfirmation/title', 'Stay in control of what agents do'),
185
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/toolConfirmation/description', `
186
+ Agents act on your workspace through tools: they read files, run terminal commands or edit code.
187
+
188
+ Every tool call asks for your confirmation first. In the [Tools]({0}) page you can change that default or pre-approve the tools you trust.
189
+
190
+ AI features stay off entirely while a workspace is not trusted. [Manage workspace trust]({1}) to decide per project.
191
+ `, `command:${ai_configuration_view_contribution_1.OPEN_AI_CONFIG_VIEW_TOOLS.id}`, `command:${workspace_commands_1.WorkspaceCommands.MANAGE_WORKSPACE_TRUST.id}`).trim(),
192
+ completionEvents: [
193
+ `onContext:${ai_walkthrough_context_keys_1.AI_TOOL_CONFIRMATION_CONFIGURED_CONTEXT_KEY}`,
194
+ `onLink:command:${ai_configuration_view_contribution_1.OPEN_AI_CONFIG_VIEW_TOOLS.id}`
195
+ ]
196
+ };
197
+ }
198
+ createGoFurtherStep() {
199
+ return {
200
+ id: 'go-further',
201
+ title: nls_1.nls.localize('theia/ai/ide/walkthrough/goFurther/title', 'Go further'),
202
+ description: nls_1.nls.localize('theia/ai/ide/walkthrough/goFurther/description', `
203
+ The chat is only the beginning. AI also completes code as you type and assists in the terminal with *Ctrl+I*.
204
+
205
+ - [Prompts and skills]({0}): read and adapt the instructions the agents work with.
206
+ - [MCP servers]({1}): add tools beyond the ones {3} ships with.
207
+ - [Token usage]({2}): see what your requests consume.
208
+ - [Switch Perspective]({5}) (experimental): the *AI First* layout moves the chat into the main area, with the explorer and source control on the right.
209
+
210
+ The AI History view, where available, shows what was actually sent to the model.
211
+
212
+ There is more in [the documentation]({4}) - and your feedback is always welcome.
213
+ `, this.aiConfiguration(ai_configuration_category_1.AiConfigurationCategoryId.PROMPTS_AND_SKILLS), this.aiConfiguration(ai_configuration_category_1.AiConfigurationCategoryId.MCP_SERVERS), this.aiConfiguration(ai_configuration_category_1.AiConfigurationCategoryId.TOKEN_USAGE), this.applicationName, AI_DOC_URL, `command:${perspective_service_1.PerspectiveServiceImpl.SWITCH_PERSPECTIVE_COMMAND.id}`).trim()
214
+ };
215
+ }
216
+ };
217
+ exports.AiGettingStartedWalkthroughProvider = AiGettingStartedWalkthroughProvider;
218
+ tslib_1.__decorate([
219
+ (0, inversify_1.inject)(common_1.ChatAgentRecommendationService),
220
+ tslib_1.__metadata("design:type", Object)
221
+ ], AiGettingStartedWalkthroughProvider.prototype, "recommendationService", void 0);
222
+ exports.AiGettingStartedWalkthroughProvider = AiGettingStartedWalkthroughProvider = tslib_1.__decorate([
223
+ (0, inversify_1.injectable)()
224
+ ], AiGettingStartedWalkthroughProvider);
225
+ //# sourceMappingURL=ai-getting-started-walkthrough.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-getting-started-walkthrough.js","sourceRoot":"","sources":["../../src/browser/ai-getting-started-walkthrough.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,mGAAkG;AAClG,sDAA2E;AAC3E,uFAAwF;AACxF,4FAAyF;AACzF,wHAAqH;AACrH,uHAAiH;AACjH,qFAAqF;AACrF,oDAAiD;AAGjD,4DAAkE;AAClE,wFAAoF;AACpF,+EAA0E;AAC1E,8GAAuH;AACvH,+EAKuC;AAEvC;;;GAGG;AACU,QAAA,iCAAiC,GAAG,6BAA6B,CAAC;AAE/E,MAAM,UAAU,GAAG,qCAAqC,CAAC;AACzD,MAAM,gBAAgB,GAAG,sCAAsC,CAAC;AAChE,MAAM,YAAY,GAAG,0DAA0D,CAAC;AAEhF;;;GAGG;AAEI,IAAM,mCAAmC,GAAzC,MAAM,mCAAmC;IAO5C,eAAe;QACX,8FAA8F;QAC9F,IAAI,CAAC,WAAW,KAAK,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IAC9B,CAAC;IAED,IAAc,eAAe;QACzB,OAAO,wEAAiC,CAAC,GAAG,EAAE,CAAC,eAAe,CAAC;IACnE,CAAC;IAED,gHAAgH;IACtG,eAAe,CAAC,MAAe;QACrC,OAAO,WAAW,wDAAmB,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC,IAAI,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC5E,CAAC;IAES,iBAAiB;QACvB,OAAO;YACH,EAAE,EAAE,yCAAiC;YACrC,IAAI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AAE;aACnD;SACJ,CAAC;IACN,CAAC;IAES,mBAAmB;QACzB,OAAO;YACH,EAAE,EAAE,YAAY;YAChB,KAAK,EAAE,SAAG,CAAC,QAAQ,CAAC,0CAA0C,EAAE,YAAY,CAAC;YAC7E,WAAW,EAAE,SAAG,CAAC,QAAQ,CAAC,gDAAgD,EAAE;;;;;;;;;;;CAWvF,EAAE,IAAI,CAAC,eAAe,CAAC,qDAAyB,CAAC,kBAAkB,CAAC,EACrD,IAAI,CAAC,eAAe,CAAC,qDAAyB,CAAC,WAAW,CAAC,EAC3D,IAAI,CAAC,eAAe,CAAC,qDAAyB,CAAC,WAAW,CAAC,EAC3D,IAAI,CAAC,eAAe,EACpB,UAAU,EACV,WAAW,4CAAsB,CAAC,0BAA0B,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE;SAChF,CAAC;IACN,CAAC;CACJ,CAAA;AApMY,kFAAmC;AAGzB;IADlB,IAAA,kBAAM,EAAC,uCAA8B,CAAC;;kFACkC;8CAHhE,mCAAmC;IAD/C,IAAA,sBAAU,GAAE;GACA,mCAAmC,CAoM/C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=ai-getting-started-walkthrough.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-getting-started-walkthrough.spec.d.ts","sourceRoot":"","sources":["../../src/browser/ai-getting-started-walkthrough.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,124 @@
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 jsdom_1 = require("@theia/core/lib/browser/test/jsdom");
19
+ let disableJSDOM = (0, jsdom_1.enableJSDOM)();
20
+ const frontend_application_config_provider_1 = require("@theia/core/lib/browser/frontend-application-config-provider");
21
+ frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
22
+ const chai_1 = require("chai");
23
+ const ai_activation_service_1 = require("@theia/ai-core/lib/browser/ai-activation-service");
24
+ const ai_getting_started_walkthrough_1 = require("./ai-getting-started-walkthrough");
25
+ const ai_walkthrough_context_keys_1 = require("./ai-walkthrough-context-keys");
26
+ disableJSDOM();
27
+ /** The commands the walkthrough is allowed to link to; each one is registered by one of the AI packages. */
28
+ const KNOWN_COMMANDS = new Set([
29
+ 'aiConfiguration:open',
30
+ 'aiConfiguration:openTools',
31
+ 'aiChat:toggle',
32
+ 'workspace:manageTrust',
33
+ 'perspective.switch',
34
+ 'ai.setDefaultChatAgent'
35
+ ]);
36
+ const KNOWN_CONTEXT_KEYS = new Set([
37
+ ai_activation_service_1.ENABLE_AI_CONTEXT_KEY,
38
+ ai_walkthrough_context_keys_1.AI_MODEL_READY_CONTEXT_KEY,
39
+ ai_walkthrough_context_keys_1.AI_CHAT_USED_CONTEXT_KEY,
40
+ ai_walkthrough_context_keys_1.AI_DEFAULT_AGENT_CONTEXT_KEY,
41
+ ai_walkthrough_context_keys_1.AI_TOOL_CONFIRMATION_CONFIGURED_CONTEXT_KEY
42
+ ]);
43
+ describe('AiGettingStartedWalkthroughProvider', () => {
44
+ let walkthrough;
45
+ /** The recommended agents a product contributes, which the agent step turns into one link each. */
46
+ const recommendedAgents = [
47
+ { id: 'Coder', label: 'Coder', description: 'Code generation and modification' },
48
+ { id: 'Architect', label: 'Architect', description: 'High-level design and architecture' }
49
+ ];
50
+ function createProvider() {
51
+ const provider = new ai_getting_started_walkthrough_1.AiGettingStartedWalkthroughProvider();
52
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
+ provider.recommendationService = { getRecommendedAgents: () => recommendedAgents };
54
+ return provider;
55
+ }
56
+ function agentStepOf(provider) {
57
+ return provider.getWalkthroughs()[0].steps.find(step => step.id === 'choose-agent').description;
58
+ }
59
+ before(() => {
60
+ disableJSDOM = (0, jsdom_1.enableJSDOM)();
61
+ frontend_application_config_provider_1.FrontendApplicationConfigProvider.set({});
62
+ walkthrough = createProvider().getWalkthroughs()[0];
63
+ });
64
+ after(() => disableJSDOM());
65
+ it('should contribute the getting started walkthrough', () => {
66
+ const walkthroughs = createProvider().getWalkthroughs();
67
+ (0, chai_1.expect)(walkthroughs).to.have.lengthOf(1);
68
+ (0, chai_1.expect)(walkthroughs[0].id).to.equal(ai_getting_started_walkthrough_1.AI_GETTING_STARTED_WALKTHROUGH_ID);
69
+ (0, chai_1.expect)(walkthroughs[0].steps.map(step => step.id)).to.deep.equal(['ai-support', 'enable-ai', 'connect-model', 'choose-agent', 'first-question', 'tool-confirmation', 'go-further']);
70
+ });
71
+ it('should offer every recommended agent as an action that sets it as the default', () => {
72
+ const description = agentStepOf(createProvider());
73
+ for (const agent of recommendedAgents) {
74
+ // Alone in its paragraph, which is what the welcome page renders as a button, and carrying the
75
+ // agent's description as the link title so it stays available as a tooltip.
76
+ (0, chai_1.expect)(description, `action for ${agent.id}`).to.include(`\n\n[@${agent.label}](command:ai.setDefaultChatAgent?${encodeURIComponent(JSON.stringify(agent.id))} "${agent.description}")`);
77
+ }
78
+ });
79
+ it('should keep the preference row reachable', () => {
80
+ (0, chai_1.expect)(agentStepOf(createProvider())).to.include('command:aiConfiguration:open?ai-features.chat.defaultChatAgent');
81
+ });
82
+ it('should give every step an id, a title and a description', () => {
83
+ const ids = walkthrough.steps.map(step => step.id);
84
+ (0, chai_1.expect)(new Set(ids).size).to.equal(ids.length);
85
+ for (const step of walkthrough.steps) {
86
+ (0, chai_1.expect)(step.title, `title of ${step.id}`).to.not.be.empty;
87
+ (0, chai_1.expect)(step.description, `description of ${step.id}`).to.not.be.empty;
88
+ }
89
+ });
90
+ it('should substitute every placeholder', () => {
91
+ for (const step of walkthrough.steps) {
92
+ (0, chai_1.expect)(step.title, `title of ${step.id}`).to.not.match(/\{\d+\}/);
93
+ (0, chai_1.expect)(step.description, `description of ${step.id}`).to.not.match(/\{\d+\}/);
94
+ }
95
+ (0, chai_1.expect)(walkthrough.description).to.not.match(/\{\d+\}/);
96
+ });
97
+ it('should only link to commands that exist', () => {
98
+ for (const step of walkthrough.steps) {
99
+ for (const match of step.description.matchAll(/\(command:([^?)]+)/g)) {
100
+ (0, chai_1.expect)(KNOWN_COMMANDS, `command of ${step.id}`).to.include(match[1]);
101
+ }
102
+ }
103
+ });
104
+ it('should only complete on context keys that are published, so that steps also tick for an already configured user', () => {
105
+ for (const step of walkthrough.steps) {
106
+ for (const event of step.completionEvents ?? []) {
107
+ if (event.startsWith('onContext:')) {
108
+ (0, chai_1.expect)(KNOWN_CONTEXT_KEYS, `context key of ${step.id}`).to.include(event.substring('onContext:'.length));
109
+ }
110
+ else {
111
+ // An `onLink:` event only ever fires for a link the step actually offers.
112
+ (0, chai_1.expect)(event, `completion event of ${step.id}`).to.match(/^onLink:/);
113
+ (0, chai_1.expect)(step.description, `link of ${step.id}`).to.include(`(${event.substring('onLink:'.length)})`);
114
+ }
115
+ }
116
+ }
117
+ });
118
+ it('should have a completion event for every step that can be verified', () => {
119
+ const withoutCompletion = walkthrough.steps.filter(step => !step.completionEvents?.length).map(step => step.id);
120
+ // The closing step only points at further reading, so there is nothing to observe; it is marked done by hand.
121
+ (0, chai_1.expect)(withoutCompletion).to.deep.equal(['go-further']);
122
+ });
123
+ });
124
+ //# sourceMappingURL=ai-getting-started-walkthrough.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-getting-started-walkthrough.spec.js","sourceRoot":"","sources":["../../src/browser/ai-getting-started-walkthrough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C,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;gBAC7G,CAAC;qBAAM,CAAC;oBACJ,0EAA0E;oBAC1E,IAAA,aAAM,EAAC,KAAK,EAAE,uBAAuB,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;oBACrE,IAAA,aAAM,EAAC,IAAI,CAAC,WAAW,EAAE,WAAW,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBACxG,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC1E,MAAM,iBAAiB,GAAG,WAAW,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAChH,8GAA8G;QAC9G,IAAA,aAAM,EAAC,iBAAiB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import { ChatService } from '@theia/ai-chat/lib/common';
2
+ import { FrontendLanguageModelRegistry } from '@theia/ai-core/lib/common';
3
+ import { ContextKey, ContextKeyService } from '@theia/core/lib/browser/context-key-service';
4
+ import { FrontendApplicationContribution } from '@theia/core/lib/browser/frontend-application-contribution';
5
+ import { DisposableCollection } from '@theia/core/lib/common/disposable';
6
+ import { PreferenceService } from '@theia/core/lib/common/preferences';
7
+ /** True as soon as at least one language model is ready to be used. */
8
+ export declare const AI_MODEL_READY_CONTEXT_KEY = "ai.hasReadyLanguageModel";
9
+ /** True as soon as the user has held at least one conversation with an agent. */
10
+ export declare const AI_CHAT_USED_CONTEXT_KEY = "ai.chat.hasRequest";
11
+ /** True while a default chat agent is configured. */
12
+ export declare const AI_DEFAULT_AGENT_CONTEXT_KEY = "ai.chat.hasDefaultAgent";
13
+ /** True once the user has decided how tool calls are confirmed, instead of staying on the default. */
14
+ export declare const AI_TOOL_CONFIRMATION_CONFIGURED_CONTEXT_KEY = "ai.chat.toolConfirmationConfigured";
15
+ /**
16
+ * Publishes the state that the getting started walkthrough observes to tick off its steps.
17
+ *
18
+ * The keys describe what the user achieved rather than what they clicked. A step is therefore only completed
19
+ * once the setup actually works, and a user who configured everything before ever opening the walkthrough
20
+ * finds it completed rather than waiting for changes that already happened.
21
+ */
22
+ export declare class AiWalkthroughContextKeys implements FrontendApplicationContribution {
23
+ protected readonly contextKeyService: ContextKeyService;
24
+ protected readonly languageModelRegistry: FrontendLanguageModelRegistry;
25
+ protected readonly chatService: ChatService;
26
+ protected readonly preferenceService: PreferenceService;
27
+ protected readonly toDispose: DisposableCollection;
28
+ protected hasReadyLanguageModel: ContextKey<boolean>;
29
+ protected hasChatRequest: ContextKey<boolean>;
30
+ protected hasDefaultAgent: ContextKey<boolean>;
31
+ protected toolConfirmationConfigured: ContextKey<boolean>;
32
+ protected init(): void;
33
+ protected updateModelState(): Promise<void>;
34
+ /**
35
+ * A session gets its title from its first exchange, so a titled or persisted session means the user has
36
+ * asked something. Once true, the key stays true: the achievement does not go away when a chat is deleted.
37
+ */
38
+ protected updateChatState(): Promise<void>;
39
+ protected updateDefaultAgentState(): void;
40
+ /**
41
+ * The user has taken a stance on tool confirmation as soon as they changed the default mode or
42
+ * pre-approved individual tools.
43
+ */
44
+ protected updateToolConfirmationState(): void;
45
+ /**
46
+ * Whether a preference carries a value the user set, rather than the one the product ships.
47
+ *
48
+ * The effective value cannot answer this: a product is free to ship its own confirmation defaults, and
49
+ * reading those back as a decision would tick the step for a user who never saw it. An empty object does
50
+ * not count either, since that is what resetting the per-tool settings leaves behind.
51
+ */
52
+ protected isSetByUser(preferenceName: string): boolean;
53
+ onStop(): void;
54
+ }
55
+ //# sourceMappingURL=ai-walkthrough-context-keys.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-walkthrough-context-keys.d.ts","sourceRoot":"","sources":["../../src/browser/ai-walkthrough-context-keys.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAC5F,OAAO,EAAE,+BAA+B,EAAE,MAAM,2DAA2D,CAAC;AAC5G,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAGvE,uEAAuE;AACvE,eAAO,MAAM,0BAA0B,6BAA6B,CAAC;AACrE,iFAAiF;AACjF,eAAO,MAAM,wBAAwB,uBAAuB,CAAC;AAC7D,qDAAqD;AACrD,eAAO,MAAM,4BAA4B,4BAA4B,CAAC;AACtE,sGAAsG;AACtG,eAAO,MAAM,2CAA2C,uCAAuC,CAAC;AAEhG;;;;;;GAMG;AACH,qBACa,wBAAyB,YAAW,+BAA+B;IAG5E,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,qBAAqB,EAAE,6BAA6B,CAAC;IAGxE,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC;IAG5C,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,SAAS,CAAC,QAAQ,CAAC,SAAS,uBAA8B;IAE1D,SAAS,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