@theia/ai-core 1.65.0-next.6 → 1.65.1

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 (72) hide show
  1. package/lib/browser/agent-completion-notification-service.d.ts +1 -1
  2. package/lib/browser/agent-completion-notification-service.d.ts.map +1 -1
  3. package/lib/browser/agent-completion-notification-service.js +3 -3
  4. package/lib/browser/agent-completion-notification-service.js.map +1 -1
  5. package/lib/browser/ai-activation-service.d.ts +2 -2
  6. package/lib/browser/ai-activation-service.d.ts.map +1 -1
  7. package/lib/browser/ai-activation-service.js +1 -1
  8. package/lib/browser/ai-activation-service.js.map +1 -1
  9. package/lib/browser/ai-core-frontend-module.js +1 -1
  10. package/lib/browser/ai-core-frontend-module.js.map +1 -1
  11. package/lib/browser/ai-settings-service.d.ts +1 -1
  12. package/lib/browser/ai-settings-service.d.ts.map +1 -1
  13. package/lib/browser/ai-settings-service.js +3 -3
  14. package/lib/browser/ai-settings-service.js.map +1 -1
  15. package/lib/browser/ai-view-contribution.d.ts +2 -2
  16. package/lib/browser/ai-view-contribution.d.ts.map +1 -1
  17. package/lib/browser/ai-view-contribution.js +17 -1
  18. package/lib/browser/ai-view-contribution.js.map +1 -1
  19. package/lib/browser/frontend-language-model-alias-registry.d.ts +1 -1
  20. package/lib/browser/frontend-language-model-alias-registry.d.ts.map +1 -1
  21. package/lib/browser/frontend-language-model-alias-registry.js +4 -4
  22. package/lib/browser/frontend-language-model-alias-registry.js.map +1 -1
  23. package/lib/browser/frontend-language-model-service.d.ts +2 -2
  24. package/lib/browser/frontend-language-model-service.d.ts.map +1 -1
  25. package/lib/browser/frontend-language-model-service.js +3 -3
  26. package/lib/browser/frontend-language-model-service.js.map +1 -1
  27. package/lib/browser/frontend-prompt-customization-service.d.ts +18 -1
  28. package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -1
  29. package/lib/browser/frontend-prompt-customization-service.js +37 -8
  30. package/lib/browser/frontend-prompt-customization-service.js.map +1 -1
  31. package/lib/browser/index.d.ts +1 -1
  32. package/lib/browser/index.d.ts.map +1 -1
  33. package/lib/browser/index.js +1 -1
  34. package/lib/browser/index.js.map +1 -1
  35. package/lib/common/agent-preferences.d.ts +4 -0
  36. package/lib/common/agent-preferences.d.ts.map +1 -0
  37. package/lib/{browser → common}/agent-preferences.js +1 -2
  38. package/lib/common/agent-preferences.js.map +1 -0
  39. package/lib/common/agent.d.ts +25 -3
  40. package/lib/common/agent.d.ts.map +1 -1
  41. package/lib/{browser → common}/ai-core-preferences.d.ts +3 -2
  42. package/lib/common/ai-core-preferences.d.ts.map +1 -0
  43. package/lib/{browser → common}/ai-core-preferences.js +2 -4
  44. package/lib/common/ai-core-preferences.js.map +1 -0
  45. package/lib/common/index.d.ts +1 -0
  46. package/lib/common/index.d.ts.map +1 -1
  47. package/lib/common/index.js +1 -0
  48. package/lib/common/index.js.map +1 -1
  49. package/lib/node/ai-core-backend-module.d.ts.map +1 -1
  50. package/lib/node/ai-core-backend-module.js +4 -0
  51. package/lib/node/ai-core-backend-module.js.map +1 -1
  52. package/package.json +10 -11
  53. package/src/browser/agent-completion-notification-service.ts +2 -2
  54. package/src/browser/ai-activation-service.ts +2 -2
  55. package/src/browser/ai-core-frontend-module.ts +1 -1
  56. package/src/browser/ai-settings-service.ts +1 -1
  57. package/src/browser/ai-view-contribution.ts +2 -2
  58. package/src/browser/frontend-language-model-alias-registry.ts +2 -2
  59. package/src/browser/frontend-language-model-service.ts +2 -2
  60. package/src/browser/frontend-prompt-customization-service.ts +86 -11
  61. package/src/browser/index.ts +1 -1
  62. package/src/common/agent-preferences.ts +88 -0
  63. package/src/common/agent.ts +25 -3
  64. package/src/{browser → common}/ai-core-preferences.ts +4 -5
  65. package/src/common/index.ts +1 -0
  66. package/src/node/ai-core-backend-module.ts +5 -0
  67. package/lib/browser/agent-preferences.d.ts +0 -4
  68. package/lib/browser/agent-preferences.d.ts.map +0 -1
  69. package/lib/browser/agent-preferences.js.map +0 -1
  70. package/lib/browser/ai-core-preferences.d.ts.map +0 -1
  71. package/lib/browser/ai-core-preferences.js.map +0 -1
  72. package/src/browser/agent-preferences.ts +0 -88
@@ -21,7 +21,7 @@ import { PromptFragmentCustomizationService, CustomAgentDescription, CustomizedP
21
21
  import { BinaryBuffer } from '@theia/core/lib/common/buffer';
22
22
  import { FileService } from '@theia/filesystem/lib/browser/file-service';
23
23
  import { FileChangesEvent } from '@theia/filesystem/lib/common/files';
24
- import { AICorePreferences, PREFERENCE_NAME_PROMPT_TEMPLATES } from './ai-core-preferences';
24
+ import { AICorePreferences, PREFERENCE_NAME_PROMPT_TEMPLATES } from '../common/ai-core-preferences';
25
25
  import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
26
26
  import { load, dump } from 'js-yaml';
27
27
  import { PROMPT_TEMPLATE_EXTENSION } from './prompttemplate-contribution';
@@ -463,13 +463,46 @@ export class DefaultPromptFragmentCustomizationService implements PromptFragment
463
463
  priority: number,
464
464
  customizationSource: CustomizationSource
465
465
  ): Promise<void> {
466
- if (!(await this.fileService.exists(dirURI))) {
467
- return;
466
+ const dirExists = await this.fileService.exists(dirURI);
467
+
468
+ // Process existing files if directory exists
469
+ if (dirExists) {
470
+ await this.processExistingTemplateDirectory(
471
+ activeCustomizationsCopy,
472
+ trackedTemplateURIsCopy,
473
+ allCustomizationsCopy,
474
+ dirURI,
475
+ priority,
476
+ customizationSource
477
+ );
468
478
  }
479
+
480
+ // Set up file watching for the directory (works for both existing and non-existing directories)
481
+ this.setupDirectoryWatcher(dirURI, priority, customizationSource);
482
+ }
483
+
484
+ /**
485
+ * Processes an existing directory for template files
486
+ * @param activeCustomizationsCopy Map to store active customizations
487
+ * @param trackedTemplateURIsCopy Set to track URIs being monitored
488
+ * @param allCustomizationsCopy Map to store all loaded customizations
489
+ * @param dirURI URI of the directory to process
490
+ * @param priority Priority level for customizations in this directory
491
+ * @param customizationSource Source type of the customization
492
+ */
493
+ protected async processExistingTemplateDirectory(
494
+ activeCustomizationsCopy: Map<string, PromptFragmentCustomization>,
495
+ trackedTemplateURIsCopy: Set<string>,
496
+ allCustomizationsCopy: Map<string, PromptFragmentCustomization>,
497
+ dirURI: URI,
498
+ priority: number,
499
+ customizationSource: CustomizationSource
500
+ ): Promise<void> {
469
501
  const stat = await this.fileService.resolve(dirURI);
470
502
  if (stat.children === undefined) {
471
503
  return;
472
504
  }
505
+
473
506
  const parsedPromptFragments = new Set<string>();
474
507
  for (const file of stat.children) {
475
508
  if (!file.isFile) {
@@ -486,13 +519,34 @@ export class DefaultPromptFragmentCustomizationService implements PromptFragment
486
519
  }
487
520
  this.onDidChangePromptFragmentCustomizationEmitter.fire(Array.from(parsedPromptFragments));
488
521
  this.onDidChangeCustomAgentsEmitter.fire();
522
+ }
489
523
 
524
+ /**
525
+ * Sets up file watching for a template directory (works for both existing and non-existing directories)
526
+ * @param dirURI URI of the directory to watch
527
+ * @param priority Priority level for customizations in this directory
528
+ * @param customizationSource Source type of the customization
529
+ */
530
+ protected setupDirectoryWatcher(
531
+ dirURI: URI,
532
+ priority: number,
533
+ customizationSource: CustomizationSource
534
+ ): void {
490
535
  this.toDispose.push(this.fileService.watch(dirURI, { recursive: true, excludes: [] }));
491
536
  this.toDispose.push(this.fileService.onDidFilesChange(async (event: FileChangesEvent) => {
492
- // Only watch for changes within provided dir
537
+ // Filter for changes within the watched directory
493
538
  if (!event.changes.some(change => change.resource.toString().startsWith(dirURI.toString()))) {
494
539
  return;
495
540
  }
541
+
542
+ // Handle directory creation or deletion (when watching a previously non-existent directory)
543
+ if (event.getAdded().some(addedFile => addedFile.resource.toString() === dirURI.toString()) ||
544
+ event.getDeleted().some(deletedFile => deletedFile.resource.toString() === dirURI.toString())) {
545
+ // Directory was created or deleted, restart the update process to handle the change
546
+ await this.update();
547
+ return;
548
+ }
549
+
496
550
  if (event.changes.some(change => change.resource.toString().endsWith('customAgents.yml'))) {
497
551
  this.onDidChangeCustomAgentsEmitter.fire();
498
552
  }
@@ -500,29 +554,42 @@ export class DefaultPromptFragmentCustomizationService implements PromptFragment
500
554
  // Track changes for batched notification
501
555
  const changedFragmentIds = new Set<string>();
502
556
 
503
- // check deleted templates
557
+ // Handle deleted templates
504
558
  for (const deletedFile of event.getDeleted()) {
505
559
  const uriString = deletedFile.resource.toString();
506
560
  if (this.trackedTemplateURIs.has(uriString)) {
507
- const removedFragmentId = this.removeCustomizationFromMaps(uriString, this.allCustomizations, this.activeCustomizations, this.trackedTemplateURIs);
561
+ const removedFragmentId = this.removeCustomizationFromMaps(
562
+ uriString,
563
+ this.allCustomizations,
564
+ this.activeCustomizations,
565
+ this.trackedTemplateURIs
566
+ );
508
567
  if (removedFragmentId) {
509
568
  changedFragmentIds.add(removedFragmentId);
510
569
  }
511
570
  }
512
571
  }
513
572
 
514
- // check updated templates
573
+ // Handle updated templates
515
574
  for (const updatedFile of event.getUpdated()) {
516
575
  const uriString = updatedFile.resource.toString();
517
576
  if (this.trackedTemplateURIs.has(uriString)) {
518
577
  const fileContent = await this.fileService.read(updatedFile.resource);
519
578
  const fragmentId = this.removePromptTemplateSuffix(updatedFile.resource.path.name);
520
- this.addTemplate(this.activeCustomizations, fragmentId, fileContent.value, uriString, this.allCustomizations, priority, customizationSource);
579
+ this.addTemplate(
580
+ this.activeCustomizations,
581
+ fragmentId,
582
+ fileContent.value,
583
+ uriString,
584
+ this.allCustomizations,
585
+ priority,
586
+ customizationSource
587
+ );
521
588
  changedFragmentIds.add(fragmentId);
522
589
  }
523
590
  }
524
591
 
525
- // check new templates
592
+ // Handle new templates
526
593
  for (const addedFile of event.getAdded()) {
527
594
  if (addedFile.resource.parent.toString() === dirURI.toString() &&
528
595
  this.isPromptTemplateExtension(addedFile.resource.path.ext)) {
@@ -530,7 +597,15 @@ export class DefaultPromptFragmentCustomizationService implements PromptFragment
530
597
  this.trackedTemplateURIs.add(uriString);
531
598
  const fileContent = await this.fileService.read(addedFile.resource);
532
599
  const fragmentId = this.removePromptTemplateSuffix(addedFile.resource.path.name);
533
- this.addTemplate(this.activeCustomizations, fragmentId, fileContent.value, uriString, this.allCustomizations, priority, customizationSource);
600
+ this.addTemplate(
601
+ this.activeCustomizations,
602
+ fragmentId,
603
+ fileContent.value,
604
+ uriString,
605
+ this.allCustomizations,
606
+ priority,
607
+ customizationSource
608
+ );
534
609
  changedFragmentIds.add(fragmentId);
535
610
  }
536
611
  }
@@ -538,7 +613,7 @@ export class DefaultPromptFragmentCustomizationService implements PromptFragment
538
613
  const changedFragmentIdsArray = Array.from(changedFragmentIds);
539
614
  if (changedFragmentIdsArray.length > 0) {
540
615
  this.onDidChangePromptFragmentCustomizationEmitter.fire(changedFragmentIdsArray);
541
- };
616
+ }
542
617
  }));
543
618
  }
544
619
 
@@ -21,7 +21,7 @@ export * from './ai-activation-service';
21
21
  export * from './ai-command-handler-factory';
22
22
  export * from './ai-core-frontend-application-contribution';
23
23
  export * from './ai-core-frontend-module';
24
- export * from './ai-core-preferences';
24
+ export * from '../common/ai-core-preferences';
25
25
  export * from './ai-settings-service';
26
26
  export * from './ai-view-contribution';
27
27
  export * from './frontend-language-model-registry';
@@ -0,0 +1,88 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 EclipseSource GmbH.
3
+ //
4
+ // This program and the accompanying materials are made available under the
5
+ // terms of the Eclipse Public License v. 2.0 which is available at
6
+ // http://www.eclipse.org/legal/epl-2.0.
7
+ //
8
+ // This Source Code may also be made available under the following Secondary
9
+ // Licenses when the conditions for such availability set forth in the Eclipse
10
+ // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
+ // with the GNU Classpath Exception which is available at
12
+ // https://www.gnu.org/software/classpath/license.html.
13
+ //
14
+ // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
+ // *****************************************************************************
16
+
17
+ import { nls, PreferenceSchema } from '@theia/core';
18
+ import {
19
+ NOTIFICATION_TYPES
20
+ } from './notification-types';
21
+
22
+ export const AGENT_SETTINGS_PREF = 'ai-features.agentSettings';
23
+
24
+ export const AgentSettingsPreferenceSchema: PreferenceSchema = {
25
+ properties: {
26
+ [AGENT_SETTINGS_PREF]: {
27
+ type: 'object',
28
+ title: nls.localize('theia/ai/agents/title', 'Agent Settings'),
29
+ hidden: true,
30
+ markdownDescription: nls.localize('theia/ai/agents/mdDescription', 'Configure agent settings such as enabling or disabling specific agents, configuring prompts and \
31
+ selecting LLMs.'),
32
+ additionalProperties: {
33
+ type: 'object',
34
+ properties: {
35
+ enable: {
36
+ type: 'boolean',
37
+ title: nls.localize('theia/ai/agents/enable/title', 'Enable Agent'),
38
+ markdownDescription: nls.localize('theia/ai/agents/enable/mdDescription', 'Specifies whether the agent should be enabled (true) or disabled (false).'),
39
+ default: true
40
+ },
41
+ languageModelRequirements: {
42
+ type: 'array',
43
+ title: nls.localize('theia/ai/agents/languageModelRequirements/title', 'Language Model Requirements'),
44
+ markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/mdDescription', 'Specifies the used language models for this agent.'),
45
+ items: {
46
+ type: 'object',
47
+ properties: {
48
+ purpose: {
49
+ type: 'string',
50
+ title: nls.localize('theia/ai/agents/languageModelRequirements/purpose/title', 'Purpose'),
51
+ markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/purpose/mdDescription',
52
+ 'The purpose for which this language model is used.')
53
+ },
54
+ identifier: {
55
+ type: 'string',
56
+ title: nls.localize('theia/ai/agents/languageModelRequirements/identifier/title', 'Identifier'),
57
+ markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/identifier/mdDescription',
58
+ 'The identifier of the language model to be used.')
59
+ }
60
+ },
61
+ required: ['purpose', 'identifier']
62
+ }
63
+ },
64
+ selectedVariants: {
65
+ type: 'object',
66
+ title: nls.localize('theia/ai/agents/selectedVariants/title', 'Selected Variants'),
67
+ markdownDescription: nls.localize('theia/ai/agents/selectedVariants/mdDescription', 'Specifies the currently selected prompt variants for this agent.'),
68
+ additionalProperties: {
69
+ type: 'string'
70
+ }
71
+ },
72
+ completionNotification: {
73
+ type: 'string',
74
+ enum: [...NOTIFICATION_TYPES],
75
+ title: nls.localize('theia/ai/agents/completionNotification/title', 'Completion Notification'),
76
+ markdownDescription: nls.localize('theia/ai/agents/completionNotification/mdDescription',
77
+ 'Notification behavior when this agent completes a task. If not set, the global default notification setting will be used.\n\
78
+ - `os-notification`: Show OS/system notifications\n\
79
+ - `message`: Show notifications in the status bar/message area\n\
80
+ - `blink`: Blink or highlight the UI\n\
81
+ - `off`: Disable notifications for this agent')
82
+ }
83
+ },
84
+ required: ['languageModelRequirements']
85
+ }
86
+ }
87
+ }
88
+ };
@@ -56,7 +56,14 @@ export interface Agent {
56
56
  /** A markdown description of its functionality and its privacy-relevant requirements, including function call handlers that access some data autonomously. */
57
57
  readonly description: string;
58
58
 
59
- /** The list of global variable identifiers this agent needs to clarify its context requirements. See #39. */
59
+ /**
60
+ * The list of global variable identifiers that are always available to this agent during execution,
61
+ * regardless of whether they are referenced in prompts.
62
+ *
63
+ * This array is primarily used for documentation purposes in the AI Configuration View
64
+ * to show which variables are guaranteed to be available to the agent. Referenced variables are NOT automatically handed over by the framework,
65
+ * this must be explicitly done in the agent implementation.
66
+ */
60
67
  readonly variables: string[];
61
68
 
62
69
  /** The prompts introduced and used by this agent. */
@@ -68,9 +75,24 @@ export interface Agent {
68
75
  /** A list of tags to filter agents and to display capabilities in the UI */
69
76
  readonly tags?: string[];
70
77
 
71
- /** The list of local variable identifiers this agent needs to clarify its context requirements. */
78
+ /**
79
+ * The list of local variable identifiers that can be made available to this agent during execution,
80
+ * these variables are context specific and do not exist for other agents.
81
+ *
82
+ * This array is primarily used for documentation purposes in the AI Configuration View
83
+ * to show which variables can be made available to the agent.
84
+ * Referenced variables are NOT automatically handed over by the framework,
85
+ * this must be explicitly done in the agent implementation or in prompts.
86
+ */
72
87
  readonly agentSpecificVariables: AgentSpecificVariables[];
73
88
 
74
- /** The list of global function identifiers this agent needs to clarify its context requirements. */
89
+ /**
90
+ * The list of global function identifiers that are always available to this agent during execution,
91
+ * regardless of whether they are referenced in prompts.
92
+ *
93
+ * This array is primarily used for documentation purposes in the AI Configuration View
94
+ * to show which functions are guaranteed to be available to the agent. Referenced functions are NOT automatically handed over by the framework,
95
+ * this must be explicitly done in the agent implementation.
96
+ */
75
97
  readonly functions: string[];
76
98
  }
@@ -14,15 +14,15 @@
14
14
  // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
15
  // *****************************************************************************
16
16
 
17
- import { nls } from '@theia/core';
18
- import { PreferenceProxy, PreferenceSchema } from '@theia/core/lib/browser';
19
- import { PreferenceProxyFactory } from '@theia/core/lib/browser/preferences/injectable-preference-proxy';
17
+ import { nls, PreferenceProxyFactory } from '@theia/core';
18
+ import { PreferenceProxy } from '@theia/core/lib/common';
20
19
  import { interfaces } from '@theia/core/shared/inversify';
21
20
  import {
22
21
  NOTIFICATION_TYPES,
23
22
  NOTIFICATION_TYPE_OFF,
24
23
  NotificationType
25
- } from '../common/notification-types';
24
+ } from './notification-types';
25
+ import { PreferenceSchema } from '@theia/core/lib/common/preferences/preference-schema';
26
26
 
27
27
  export const AI_CORE_PREFERENCES_TITLE = nls.localize('theia/ai/core/prefs/title', '✨ AI Features [Beta]');
28
28
  export const PREFERENCE_NAME_PROMPT_TEMPLATES = 'ai-features.promptTemplates.promptTemplatesFolder';
@@ -33,7 +33,6 @@ export const PREFERENCE_NAME_DEFAULT_NOTIFICATION_TYPE = 'ai-features.notificati
33
33
  export const LANGUAGE_MODEL_ALIASES_PREFERENCE = 'ai-features.languageModelAliases';
34
34
 
35
35
  export const aiCorePreferenceSchema: PreferenceSchema = {
36
- type: 'object',
37
36
  properties: {
38
37
  [PREFERENCE_NAME_PROMPT_TEMPLATES]: {
39
38
  title: AI_CORE_PREFERENCES_TITLE,
@@ -16,6 +16,7 @@
16
16
  export * from './agent-service';
17
17
  export * from './agent';
18
18
  export * from './agents-variable-contribution';
19
+ export * from './ai-core-preferences';
19
20
  export * from './tool-invocation-registry';
20
21
  export * from './language-model-delegate';
21
22
  export * from './language-model-util';
@@ -20,6 +20,7 @@ import {
20
20
  } from './language-model-frontend-delegate';
21
21
  import {
22
22
  ConnectionHandler,
23
+ PreferenceContribution,
23
24
  RpcConnectionHandler,
24
25
  bindContributionProvider,
25
26
  } from '@theia/core';
@@ -43,6 +44,8 @@ import {
43
44
  } from '../common';
44
45
  import { BackendLanguageModelRegistryImpl } from './backend-language-model-registry';
45
46
  import { TokenUsageServiceImpl } from './token-usage-service-impl';
47
+ import { AgentSettingsPreferenceSchema } from '../common/agent-preferences';
48
+ import { bindAICorePreferences } from '../common/ai-core-preferences';
46
49
 
47
50
  // We use a connection module to handle AI services separately for each frontend.
48
51
  const aiCoreConnectionModule = ConnectionContainerModule.create(({ bind, bindBackendService, bindFrontendService }) => {
@@ -107,5 +110,7 @@ const aiCoreConnectionModule = ConnectionContainerModule.create(({ bind, bindBac
107
110
  });
108
111
 
109
112
  export default new ContainerModule(bind => {
113
+ bind(PreferenceContribution).toConstantValue({ schema: AgentSettingsPreferenceSchema });
114
+ bindAICorePreferences(bind);
110
115
  bind(ConnectionContainerModule).toConstantValue(aiCoreConnectionModule);
111
116
  });
@@ -1,4 +0,0 @@
1
- import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
2
- export declare const AGENT_SETTINGS_PREF = "ai-features.agentSettings";
3
- export declare const AgentSettingsPreferenceSchema: PreferenceSchema;
4
- //# sourceMappingURL=agent-preferences.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-preferences.d.ts","sourceRoot":"","sources":["../../src/browser/agent-preferences.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,6DAA6D,CAAC;AAK/F,eAAO,MAAM,mBAAmB,8BAA8B,CAAC;AAE/D,eAAO,MAAM,6BAA6B,EAAE,gBA+D3C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-preferences.js","sourceRoot":"","sources":["../../src/browser/agent-preferences.ts"],"names":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AO,KAAI,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;QAC5D,WAAW,IAAI,EAAE,CAAC;IACtB,CAAC;IAED,iCAAiC;IACjC,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,OAAO,CAAC,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC;QAC5D,WAAW,IAAI,GAAG,CAAC;IACvB,CAAC;IAED,OAAO,WAAW,CAAC;AACvB,CAAC,CAAC;AA1CW,QAAA,4BAA4B,gCA0CvC"}
@@ -1,88 +0,0 @@
1
- // *****************************************************************************
2
- // Copyright (C) 2025 EclipseSource GmbH.
3
- //
4
- // This program and the accompanying materials are made available under the
5
- // terms of the Eclipse Public License v. 2.0 which is available at
6
- // http://www.eclipse.org/legal/epl-2.0.
7
- //
8
- // This Source Code may also be made available under the following Secondary
9
- // Licenses when the conditions for such availability set forth in the Eclipse
10
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
11
- // with the GNU Classpath Exception which is available at
12
- // https://www.gnu.org/software/classpath/license.html.
13
- //
14
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
15
- // *****************************************************************************
16
-
17
- import { nls } from '@theia/core';
18
- import { PreferenceSchema } from '@theia/core/lib/browser/preferences/preference-contribution';
19
- import {
20
- NOTIFICATION_TYPES
21
- } from '../common/notification-types';
22
-
23
- export const AGENT_SETTINGS_PREF = 'ai-features.agentSettings';
24
-
25
- export const AgentSettingsPreferenceSchema: PreferenceSchema = {
26
- type: 'object',
27
- properties: {
28
- [AGENT_SETTINGS_PREF]: {
29
- type: 'object',
30
- title: nls.localize('theia/ai/agents/title', 'Agent Settings'),
31
- hidden: true,
32
- markdownDescription: nls.localize('theia/ai/agents/mdDescription', 'Configure agent settings such as enabling or disabling specific agents, configuring prompts and \
33
- selecting LLMs.'),
34
- additionalProperties: {
35
- type: 'object',
36
- properties: {
37
- enable: {
38
- type: 'boolean',
39
- title: nls.localize('theia/ai/agents/enable/title', 'Enable Agent'),
40
- markdownDescription: nls.localize('theia/ai/agents/enable/mdDescription', 'Specifies whether the agent should be enabled (true) or disabled (false).'),
41
- default: true
42
- },
43
- languageModelRequirements: {
44
- type: 'array',
45
- title: nls.localize('theia/ai/agents/languageModelRequirements/title', 'Language Model Requirements'),
46
- markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/mdDescription', 'Specifies the used language models for this agent.'),
47
- items: {
48
- type: 'object',
49
- properties: {
50
- purpose: {
51
- type: 'string',
52
- title: nls.localize('theia/ai/agents/languageModelRequirements/purpose/title', 'Purpose'),
53
- markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/purpose/mdDescription', 'The purpose for which this language model is used.')
54
- },
55
- identifier: {
56
- type: 'string',
57
- title: nls.localize('theia/ai/agents/languageModelRequirements/identifier/title', 'Identifier'),
58
- markdownDescription: nls.localize('theia/ai/agents/languageModelRequirements/identifier/mdDescription', 'The identifier of the language model to be used.')
59
- }
60
- },
61
- required: ['purpose', 'identifier']
62
- }
63
- },
64
- selectedVariants: {
65
- type: 'object',
66
- title: nls.localize('theia/ai/agents/selectedVariants/title', 'Selected Variants'),
67
- markdownDescription: nls.localize('theia/ai/agents/selectedVariants/mdDescription', 'Specifies the currently selected prompt variants for this agent.'),
68
- additionalProperties: {
69
- type: 'string'
70
- }
71
- },
72
- completionNotification: {
73
- type: 'string',
74
- enum: [...NOTIFICATION_TYPES],
75
- title: nls.localize('theia/ai/agents/completionNotification/title', 'Completion Notification'),
76
- markdownDescription: nls.localize('theia/ai/agents/completionNotification/mdDescription',
77
- 'Notification behavior when this agent completes a task. If not set, the global default notification setting will be used.\n\
78
- - `os-notification`: Show OS/system notifications\n\
79
- - `message`: Show notifications in the status bar/message area\n\
80
- - `blink`: Blink or highlight the UI\n\
81
- - `off`: Disable notifications for this agent')
82
- }
83
- },
84
- required: ['languageModelRequirements']
85
- }
86
- }
87
- }
88
- };