@theia/ai-core 1.61.0 → 1.62.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 (69) hide show
  1. package/lib/browser/ai-core-frontend-module.js +2 -2
  2. package/lib/browser/ai-core-frontend-module.js.map +1 -1
  3. package/lib/browser/frontend-language-model-service.d.ts +1 -1
  4. package/lib/browser/frontend-language-model-service.d.ts.map +1 -1
  5. package/lib/browser/frontend-language-model-service.js.map +1 -1
  6. package/lib/browser/frontend-prompt-customization-service.d.ts +142 -48
  7. package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -1
  8. package/lib/browser/frontend-prompt-customization-service.js +452 -153
  9. package/lib/browser/frontend-prompt-customization-service.js.map +1 -1
  10. package/lib/browser/prompttemplate-contribution.d.ts +1 -2
  11. package/lib/browser/prompttemplate-contribution.d.ts.map +1 -1
  12. package/lib/browser/prompttemplate-contribution.js +5 -9
  13. package/lib/browser/prompttemplate-contribution.js.map +1 -1
  14. package/lib/common/agent-service.d.ts.map +1 -1
  15. package/lib/common/agent-service.js +14 -2
  16. package/lib/common/agent-service.js.map +1 -1
  17. package/lib/common/agent.d.ts +8 -3
  18. package/lib/common/agent.d.ts.map +1 -1
  19. package/lib/common/agent.js.map +1 -1
  20. package/lib/common/index.d.ts +0 -1
  21. package/lib/common/index.d.ts.map +1 -1
  22. package/lib/common/index.js +0 -1
  23. package/lib/common/index.js.map +1 -1
  24. package/lib/common/language-model-interaction-model.d.ts +74 -0
  25. package/lib/common/language-model-interaction-model.d.ts.map +1 -0
  26. package/lib/common/language-model-interaction-model.js +3 -0
  27. package/lib/common/language-model-interaction-model.js.map +1 -0
  28. package/lib/common/language-model-service.d.ts +26 -3
  29. package/lib/common/language-model-service.d.ts.map +1 -1
  30. package/lib/common/language-model-service.js +83 -6
  31. package/lib/common/language-model-service.js.map +1 -1
  32. package/lib/common/language-model-util.d.ts +3 -2
  33. package/lib/common/language-model-util.d.ts.map +1 -1
  34. package/lib/common/language-model-util.js +8 -0
  35. package/lib/common/language-model-util.js.map +1 -1
  36. package/lib/common/language-model.d.ts +25 -2
  37. package/lib/common/language-model.d.ts.map +1 -1
  38. package/lib/common/language-model.js +3 -1
  39. package/lib/common/language-model.js.map +1 -1
  40. package/lib/common/prompt-service.d.ts +332 -126
  41. package/lib/common/prompt-service.d.ts.map +1 -1
  42. package/lib/common/prompt-service.js +363 -102
  43. package/lib/common/prompt-service.js.map +1 -1
  44. package/lib/common/prompt-service.spec.js +104 -114
  45. package/lib/common/prompt-service.spec.js.map +1 -1
  46. package/lib/common/prompt-variable-contribution.d.ts +1 -2
  47. package/lib/common/prompt-variable-contribution.d.ts.map +1 -1
  48. package/lib/common/prompt-variable-contribution.js +17 -26
  49. package/lib/common/prompt-variable-contribution.js.map +1 -1
  50. package/package.json +10 -10
  51. package/src/browser/ai-core-frontend-module.ts +4 -4
  52. package/src/browser/frontend-language-model-service.ts +1 -1
  53. package/src/browser/frontend-prompt-customization-service.ts +574 -183
  54. package/src/browser/prompttemplate-contribution.ts +6 -9
  55. package/src/common/agent-service.ts +14 -4
  56. package/src/common/agent.ts +9 -3
  57. package/src/common/index.ts +0 -1
  58. package/src/common/language-model-interaction-model.ts +98 -0
  59. package/src/common/language-model-service.ts +115 -6
  60. package/src/common/language-model-util.ts +10 -2
  61. package/src/common/language-model.ts +28 -2
  62. package/src/common/prompt-service.spec.ts +108 -114
  63. package/src/common/prompt-service.ts +694 -221
  64. package/src/common/prompt-variable-contribution.ts +22 -27
  65. package/lib/common/communication-recording-service.d.ts +0 -30
  66. package/lib/common/communication-recording-service.d.ts.map +0 -1
  67. package/lib/common/communication-recording-service.js +0 -20
  68. package/lib/common/communication-recording-service.js.map +0 -1
  69. package/src/common/communication-recording-service.ts +0 -55
@@ -1,165 +1,196 @@
1
- import { URI, Event } from '@theia/core';
1
+ import { Event, Emitter, URI } from '@theia/core';
2
2
  import { AIVariableArg, AIVariableContext, AIVariableService, ResolvedAIVariable } from './variable-service';
3
3
  import { ToolInvocationRegistry } from './tool-invocation-registry';
4
4
  import { ToolRequest } from './language-model';
5
5
  import { AISettingsService } from './settings-service';
6
- export interface PromptTemplate {
6
+ /**
7
+ * Represents a basic prompt fragment with an ID and template content.
8
+ */
9
+ export interface BasePromptFragment {
10
+ /** Unique identifier for this prompt fragment */
7
11
  id: string;
12
+ /** The template content, which may contain variables and function references */
8
13
  template: string;
14
+ }
15
+ /**
16
+ * Represents a customized prompt fragment with an assigned customization ID and priority.
17
+ */
18
+ export interface CustomizedPromptFragment extends BasePromptFragment {
19
+ /**
20
+ * Unique identifier for this customization
21
+ */
22
+ customizationId: string;
9
23
  /**
10
- * (Optional) The ID of the main template for which this template is a variant.
11
- * If present, this indicates that the current template represents an alternative version of the specified main template.
24
+ * The order/priority of this customization, higher values indicate higher priority
25
+ * when multiple customizations exist for the same fragment
12
26
  */
13
- variantOf?: string;
27
+ priority: number;
14
28
  }
29
+ /**
30
+ * Union type representing either a built-in or customized prompt fragment
31
+ */
32
+ export type PromptFragment = BasePromptFragment | CustomizedPromptFragment;
33
+ /**
34
+ * Type guard to check if a PromptFragment is a built-in fragment (not customized)
35
+ * @param fragment The fragment to check
36
+ * @returns True if the fragment is a basic BasePromptFragment (not customized)
37
+ */
38
+ export declare function isBasePromptFragment(fragment: PromptFragment): fragment is BasePromptFragment;
39
+ /**
40
+ * Type guard to check if a PromptFragment is a CustomizedPromptFragment
41
+ * @param fragment The fragment to check
42
+ * @returns True if the fragment is a CustomizedPromptFragment
43
+ */
44
+ export declare function isCustomizedPromptFragment(fragment: PromptFragment): fragment is CustomizedPromptFragment;
45
+ /**
46
+ * Map of prompt fragment IDs to prompt fragments
47
+ */
15
48
  export interface PromptMap {
16
- [id: string]: PromptTemplate;
49
+ [id: string]: PromptFragment;
17
50
  }
18
- export interface ResolvedPromptTemplate {
51
+ /**
52
+ * Represents a prompt fragment with all variables and function references resolved
53
+ */
54
+ export interface ResolvedPromptFragment {
55
+ /** The fragment ID */
19
56
  id: string;
20
- /** The resolved prompt text with variables and function requests being replaced. */
57
+ /** The resolved prompt text with variables and function requests being replaced */
21
58
  text: string;
22
- /** All functions referenced in the prompt template. */
59
+ /** All functions referenced in the prompt fragment */
23
60
  functionDescriptions?: Map<string, ToolRequest>;
24
- /** All variables resolved in the prompt template */
61
+ /** All variables resolved in the prompt fragment */
25
62
  variables?: ResolvedAIVariable[];
26
63
  }
27
- export declare const PromptService: unique symbol;
28
- export interface PromptService {
64
+ /**
65
+ * Describes a custom agent with its properties
66
+ */
67
+ export interface CustomAgentDescription {
68
+ /** Unique identifier for this agent */
69
+ id: string;
70
+ /** Display name for the agent */
71
+ name: string;
72
+ /** Description of the agent's purpose and capabilities */
73
+ description: string;
74
+ /** The prompt text for this agent */
75
+ prompt: string;
76
+ /** The default large language model to use with this agent */
77
+ defaultLLM: string;
78
+ }
79
+ export declare namespace CustomAgentDescription {
29
80
  /**
30
- * Retrieve the raw {@link PromptTemplate} object (unresolved variables, functions and including comments).
31
- * @param id the id of the {@link PromptTemplate}
81
+ * Type guard to check if an object is a CustomAgentDescription
32
82
  */
33
- getRawPrompt(id: string): PromptTemplate | undefined;
83
+ function is(entry: unknown): entry is CustomAgentDescription;
34
84
  /**
35
- * Retrieve the unresolved {@link PromptTemplate} object (unresolved variables, functions, excluding comments)
36
- * @param id the id of the {@link PromptTemplate}
85
+ * Compares two CustomAgentDescription objects for equality
37
86
  */
38
- getUnresolvedPrompt(id: string): PromptTemplate | undefined;
87
+ function equals(a: CustomAgentDescription, b: CustomAgentDescription): boolean;
88
+ }
89
+ /**
90
+ * Service responsible for customizing prompt fragments
91
+ */
92
+ export declare const PromptFragmentCustomizationService: unique symbol;
93
+ export interface PromptFragmentCustomizationService {
39
94
  /**
40
- * Retrieve the default raw {@link PromptTemplate} object.
41
- * @param id the id of the {@link PromptTemplate}
95
+ * Event fired when a prompt fragment is changed
42
96
  */
43
- getDefaultRawPrompt(id: string): PromptTemplate | undefined;
97
+ readonly onDidChangePromptFragmentCustomization: Event<string[]>;
44
98
  /**
45
- * Allows to directly replace placeholders in the prompt. The supported format is 'Hi {{name}}!'.
46
- * The placeholder is then searched inside the args object and replaced.
47
- * Function references are also supported via format '~{functionId}'.
48
- *
49
- * All placeholders are replaced before function references are resolved.
50
- * This allows to resolve function references contained in placeholders.
51
- *
52
- * @param id the id of the prompt
53
- * @param args the object with placeholders, mapping the placeholder key to the value
99
+ * Event fired when custom agents are modified
54
100
  */
55
- getPrompt(id: string, args?: {
56
- [key: string]: unknown;
57
- }, context?: AIVariableContext): Promise<ResolvedPromptTemplate | undefined>;
101
+ readonly onDidChangeCustomAgents: Event<void>;
58
102
  /**
59
- * Allows to directly replace placeholders in the prompt. The supported format is 'Hi {{name}}!'.
60
- * The placeholder is then searched inside the args object and replaced.
61
- *
62
- * In contrast to {@link getPrompt}, this method does not resolve function references but leaves them as is.
63
- * This allows resolving them later as part of the prompt or chat message containing the fragment.
64
- *
65
- * @param id the id of the prompt
66
- * @param args the object with placeholders, mapping the placeholder key to the value
67
- * @param context the {@link AIVariableContext} to use during variable resolution
68
- * @param resolveVariable the variable resolving method. Fall back to using the {@link AIVariableService} if not given.
103
+ * Checks if a prompt fragment has customizations
104
+ * @param fragmentId The prompt fragment ID
105
+ * @returns Whether the fragment has any customizations
69
106
  */
70
- getPromptFragment(id: string, args?: {
71
- [key: string]: unknown;
72
- }, context?: AIVariableContext, resolveVariable?: (variable: AIVariableArg) => Promise<ResolvedAIVariable | undefined>): Promise<Omit<ResolvedPromptTemplate, 'functionDescriptions'> | undefined>;
107
+ isPromptFragmentCustomized(fragmentId: string): boolean;
73
108
  /**
74
- * Adds a {@link PromptTemplate} to the list of prompts.
75
- * @param promptTemplate the prompt template to store
109
+ * Gets the active customized prompt fragment for a given ID
110
+ * @param fragmentId The prompt fragment ID
111
+ * @returns The active customized fragment or undefined if none exists
76
112
  */
77
- storePromptTemplate(promptTemplate: PromptTemplate): void;
113
+ getActivePromptFragmentCustomization(fragmentId: string): CustomizedPromptFragment | undefined;
78
114
  /**
79
- * Removes a prompt from the list of prompts.
80
- * @param id the id of the prompt
115
+ * Gets all customizations for a prompt fragment ordered by priority
116
+ * @param fragmentId The prompt fragment ID
117
+ * @returns Array of customized fragments ordered by priority (highest first)
81
118
  */
82
- removePrompt(id: string): void;
119
+ getAllCustomizations(fragmentId: string): CustomizedPromptFragment[];
83
120
  /**
84
- * Return all known prompts as a {@link PromptMap map}.
121
+ * Gets the IDs of all prompt fragments that have customizations
122
+ * @returns Array of prompt fragment IDs
85
123
  */
86
- getAllPrompts(): PromptMap;
124
+ getCustomizedPromptFragmentIds(): string[];
87
125
  /**
88
- * Retrieve all variant IDs of a given {@link PromptTemplate}.
89
- * @param id the id of the main {@link PromptTemplate}
90
- * @returns an array of string IDs representing the variants of the given template
126
+ * Creates a new customization for a prompt fragment
127
+ * @param fragmentId The fragment ID to customize
128
+ * @param defaultContent Optional default content for the customization
91
129
  */
92
- getVariantIds(id: string): string[];
130
+ createPromptFragmentCustomization(fragmentId: string, defaultContent?: string): Promise<void>;
93
131
  /**
94
- * Retrieve the currently selected variant ID for a given main prompt ID.
95
- * If a variant is selected for the main prompt, it will be returned.
96
- * Otherwise, the main prompt ID will be returned.
97
- * @param id the id of the main prompt
98
- * @returns the variant ID if one is selected, or the main prompt ID otherwise
132
+ * Creates a customization based on a built-in fragment
133
+ * @param fragmentId The ID of the built-in fragment to customize
134
+ * @param defaultContent Optional default content for the customization
99
135
  */
100
- getVariantId(id: string): Promise<string>;
101
- }
102
- export interface CustomAgentDescription {
103
- id: string;
104
- name: string;
105
- description: string;
106
- prompt: string;
107
- defaultLLM: string;
108
- }
109
- export declare namespace CustomAgentDescription {
110
- function is(entry: unknown): entry is CustomAgentDescription;
111
- function equals(a: CustomAgentDescription, b: CustomAgentDescription): boolean;
112
- }
113
- export declare const PromptCustomizationService: unique symbol;
114
- export interface PromptCustomizationService {
136
+ createBuiltInPromptFragmentCustomization(fragmentId: string, defaultContent?: string): Promise<void>;
115
137
  /**
116
- * Whether there is a customization for a {@link PromptTemplate} object
117
- * @param id the id of the {@link PromptTemplate} to check
138
+ * Edits a specific customization of a prompt fragment
139
+ * @param fragmentId The prompt fragment ID
140
+ * @param customizationId The customization ID to edit
118
141
  */
119
- isPromptTemplateCustomized(id: string): boolean;
142
+ editPromptFragmentCustomization(fragmentId: string, customizationId: string): Promise<void>;
120
143
  /**
121
- * Returns the customization of {@link PromptTemplate} object or undefined if there is none
122
- * @param id the id of the {@link PromptTemplate} to check
144
+ * Edits the built-in customization of a prompt fragment
145
+ * @param fragmentId The prompt fragment ID to edit
146
+ * @param defaultContent Optional default content for the customization
123
147
  */
124
- getCustomizedPromptTemplate(id: string): string | undefined;
125
- getCustomPromptTemplateIDs(): string[];
148
+ editBuiltInPromptFragmentCustomization(fragmentId: string, defaultContent?: string): Promise<void>;
126
149
  /**
127
- * Edit the template. If the content is specified, is will be
128
- * used to customize the template. Otherwise, the behavior depends
129
- * on the implementation. Implementation may for example decide to
130
- * open an editor, or request more information from the user, ...
131
- * @param id the template id.
132
- * @param content optional default content to initialize the template
150
+ * Removes a specific customization of a prompt fragment
151
+ * @param fragmentId The prompt fragment ID
152
+ * @param customizationId The customization ID to remove
133
153
  */
134
- editTemplate(id: string, defaultContent?: string): void;
154
+ removePromptFragmentCustomization(fragmentId: string, customizationId: string): Promise<void>;
135
155
  /**
136
- * Reset the template to its default value.
137
- * @param id the template id.
156
+ * Resets a fragment to its built-in version by removing all customizations
157
+ * @param fragmentId The fragment ID to reset
138
158
  */
139
- resetTemplate(id: string): void;
159
+ removeAllPromptFragmentCustomizations(fragmentId: string): Promise<void>;
140
160
  /**
141
- * Return the template id for a given template file.
142
- * @param uri the uri of the template file
161
+ * Resets to a specific customization by removing higher-priority customizations
162
+ * @param fragmentId The fragment ID
163
+ * @param customizationId The customization ID to reset to
143
164
  */
144
- getTemplateIDFromURI(uri: URI): string | undefined;
165
+ resetToCustomization(fragmentId: string, customizationId: string): Promise<void>;
145
166
  /**
146
- * Event which is fired when the prompt template is changed.
167
+ * Gets information about the description of a customization
168
+ * @param fragmentId The fragment ID
169
+ * @param customizationId The customization ID
170
+ * @returns Description of the customization
147
171
  */
148
- readonly onDidChangePrompt: Event<string>;
172
+ getPromptFragmentCustomizationDescription(fragmentId: string, customizationId: string): Promise<string | undefined>;
149
173
  /**
150
- * Return all custom agents.
151
- * @returns all custom agents
174
+ * Gets information about the source/type of a customization
175
+ * @param fragmentId The fragment ID
176
+ * @param customizationId The customization ID
177
+ * @returns Type of the customization source
152
178
  */
153
- getCustomAgents(): Promise<CustomAgentDescription[]>;
179
+ getPromptFragmentCustomizationType(fragmentId: string, customizationId: string): Promise<string | undefined>;
154
180
  /**
155
- * Event which is fired when custom agents are modified.
181
+ * Gets the fragment ID from a resource identifier
182
+ * @param resourceId Resource identifier (implementation specific)
183
+ * @returns Fragment ID or undefined if not found
156
184
  */
157
- readonly onDidChangeCustomAgents: Event<void>;
185
+ getPromptFragmentIDFromResource(resourceId: unknown): string | undefined;
158
186
  /**
159
- * Returns all locations of existing customAgents.yml files and potential locations where
160
- * new customAgents.yml files could be created.
161
- *
162
- * @returns An array of objects containing the URI and whether the file exists
187
+ * Gets all custom agent descriptions
188
+ * @returns Array of custom agent descriptions
189
+ */
190
+ getCustomAgents(): Promise<CustomAgentDescription[]>;
191
+ /**
192
+ * Gets the locations of custom agent configuration files
193
+ * @returns Array of URIs and existence status
163
194
  */
164
195
  getCustomAgentsLocations(): Promise<{
165
196
  uri: URI;
@@ -172,32 +203,179 @@ export interface PromptCustomizationService {
172
203
  */
173
204
  openCustomAgentYaml(uri: URI): Promise<void>;
174
205
  }
206
+ /**
207
+ * Service for managing and resolving prompt fragments
208
+ */
209
+ export declare const PromptService: unique symbol;
210
+ export interface PromptService {
211
+ /**
212
+ * Event fired when the prompts change
213
+ */
214
+ readonly onPromptsChange: Event<void>;
215
+ /**
216
+ * Event fired when the selected variant for a prompt variant set changes
217
+ */
218
+ readonly onSelectedVariantChange: Event<{
219
+ promptVariantSetId: string;
220
+ variantId: string;
221
+ }>;
222
+ /**
223
+ * Gets the raw prompt fragment with comments
224
+ * @param fragmentId The prompt fragment ID
225
+ * @returns The raw prompt fragment or undefined if not found
226
+ */
227
+ getRawPromptFragment(fragmentId: string): PromptFragment | undefined;
228
+ /**
229
+ * Gets the raw prompt fragment without comments
230
+ * @param fragmentId The prompt fragment ID
231
+ * @returns The raw prompt fragment or undefined if not found
232
+ */
233
+ getPromptFragment(fragmentId: string): PromptFragment | undefined;
234
+ /**
235
+ * Gets the built-in raw prompt fragment (before any customizations)
236
+ * @param fragmentId The prompt fragment ID
237
+ * @returns The built-in fragment or undefined if not found
238
+ */
239
+ getBuiltInRawPrompt(fragmentId: string): PromptFragment | undefined;
240
+ /**
241
+ * Resolves a prompt fragment by replacing variables and function references
242
+ * @param fragmentId The prompt fragment ID
243
+ * @param args Optional object with values for variable replacement
244
+ * @param context Optional context for variable resolution
245
+ * @returns The resolved prompt fragment or undefined if not found
246
+ */
247
+ getResolvedPromptFragment(fragmentId: string, args?: {
248
+ [key: string]: unknown;
249
+ }, context?: AIVariableContext): Promise<ResolvedPromptFragment | undefined>;
250
+ /**
251
+ * Resolves a prompt fragment by replacing variables but preserving function references
252
+ * @param fragmentId The prompt fragment ID
253
+ * @param args Optional object with values for variable replacement
254
+ * @param context Optional context for variable resolution
255
+ * @param resolveVariable Optional custom variable resolution function
256
+ * @returns The partially resolved prompt fragment or undefined if not found
257
+ */
258
+ getResolvedPromptFragmentWithoutFunctions(fragmentId: string, args?: {
259
+ [key: string]: unknown;
260
+ }, context?: AIVariableContext, resolveVariable?: (variable: AIVariableArg) => Promise<ResolvedAIVariable | undefined>): Promise<Omit<ResolvedPromptFragment, 'functionDescriptions'> | undefined>;
261
+ /**
262
+ * Adds a prompt fragment to the service
263
+ * @param promptFragment The fragment to store
264
+ * @param promptVariantSetId Optional ID of the prompt variant set this is a variant of
265
+ */
266
+ addBuiltInPromptFragment(promptFragment: BasePromptFragment, promptVariantSetId?: string, isDefault?: boolean): void;
267
+ /**
268
+ * Removes a prompt fragment from the service
269
+ * @param fragmentId The fragment ID to remove
270
+ */
271
+ removePromptFragment(fragmentId: string): void;
272
+ /**
273
+ * Gets all known prompts, including variants and customizations
274
+ * @returns Map of fragment IDs to arrays of fragments
275
+ */
276
+ getAllPromptFragments(): Map<string, PromptFragment[]>;
277
+ /**
278
+ * Gets all active prompts (highest priority version of each fragment)
279
+ * @returns Array of active prompt fragments
280
+ */
281
+ getActivePromptFragments(): PromptFragment[];
282
+ /**
283
+ * Returns all IDs of all prompt fragments of the given set
284
+ * @param promptVariantSetId The prompt variant set id
285
+ * @returns Array of variant IDs
286
+ */
287
+ getVariantIds(promptVariantSetId: string): string[];
288
+ /**
289
+ * Gets the currently selected variant ID of the given set
290
+ * @param promptVariantSetId The prompt variant set id
291
+ * @returns The selected variant ID or the main ID if no variant is selected
292
+ */
293
+ getSelectedVariantId(promptVariantSetId: string): Promise<string | undefined>;
294
+ /**
295
+ * Gets the default variant ID of the given set
296
+ * @param promptVariantSetId The prompt variant set id
297
+ * @returns The default variant ID or undefined if no default is set
298
+ */
299
+ getDefaultVariantId(promptVariantSetId: string): string | undefined;
300
+ /**
301
+ * Updates the selected variant for a prompt variant set
302
+ * @param agentId The ID of the agent to update
303
+ * @param promptVariantSetId The prompt variant set ID
304
+ * @param newVariant The new variant ID to set as selected
305
+ */
306
+ updateSelectedVariantId(agentId: string, promptVariantSetId: string, newVariant: string): Promise<void>;
307
+ /**
308
+ * Gets all prompt variant sets and their variants
309
+ * @returns Map of prompt variant set IDs to arrays of variant IDs
310
+ */
311
+ getPromptVariantSets(): Map<string, string[]>;
312
+ /**
313
+ * The following methods delegate to the PromptFragmentCustomizationService
314
+ */
315
+ createCustomization(fragmentId: string): Promise<void>;
316
+ createBuiltInCustomization(fragmentId: string): Promise<void>;
317
+ editBuiltInCustomization(fragmentId: string): Promise<void>;
318
+ editCustomization(fragmentId: string, customizationId: string): Promise<void>;
319
+ removeCustomization(fragmentId: string, customizationId: string): Promise<void>;
320
+ resetAllToBuiltIn(): Promise<void>;
321
+ resetToBuiltIn(fragmentId: string): Promise<void>;
322
+ resetToCustomization(fragmentId: string, customizationId: string): Promise<void>;
323
+ getCustomizationDescription(fragmentId: string, customizationId: string): Promise<string | undefined>;
324
+ getCustomizationType(fragmentId: string, customizationId: string): Promise<string | undefined>;
325
+ getTemplateIDFromResource(resourceId: unknown): string | undefined;
326
+ }
175
327
  export declare class PromptServiceImpl implements PromptService {
176
328
  protected readonly settingsService: AISettingsService | undefined;
177
- protected readonly customizationService: PromptCustomizationService | undefined;
329
+ protected readonly customizationService: PromptFragmentCustomizationService | undefined;
178
330
  protected readonly variableService: AIVariableService | undefined;
179
331
  protected readonly toolInvocationRegistry: ToolInvocationRegistry | undefined;
180
- protected _prompts: PromptMap;
181
- getRawPrompt(id: string): PromptTemplate | undefined;
182
- getDefaultRawPrompt(id: string): PromptTemplate | undefined;
183
- getUnresolvedPrompt(id: string): PromptTemplate | undefined;
184
- protected stripComments(template: string): string;
185
- getVariantId(id: string): Promise<string>;
186
- getPrompt(id: string, args?: {
332
+ protected _builtInFragments: BasePromptFragment[];
333
+ protected _promptVariantSetsMap: Map<string, string[]>;
334
+ protected _defaultVariantsMap: Map<string, string>;
335
+ protected _onPromptsChangeEmitter: Emitter<void>;
336
+ readonly onPromptsChange: Event<void>;
337
+ protected _onSelectedVariantChangeEmitter: Emitter<{
338
+ promptVariantSetId: string;
339
+ variantId: string;
340
+ }>;
341
+ readonly onSelectedVariantChange: Event<{
342
+ promptVariantSetId: string;
343
+ variantId: string;
344
+ }>;
345
+ protected init(): void;
346
+ /**
347
+ * Finds a built-in fragment by its ID
348
+ * @param fragmentId The ID of the fragment to find
349
+ * @returns The built-in fragment or undefined if not found
350
+ */
351
+ protected findBuiltInFragmentById(fragmentId: string): BasePromptFragment | undefined;
352
+ getRawPromptFragment(fragmentId: string): PromptFragment | undefined;
353
+ getBuiltInRawPrompt(fragmentId: string): PromptFragment | undefined;
354
+ getPromptFragment(fragmentId: string): PromptFragment | undefined;
355
+ /**
356
+ * Strips comments from a template string
357
+ * @param templateText The template text to process
358
+ * @returns Template text with comments removed
359
+ */
360
+ protected stripComments(templateText: string): string;
361
+ getSelectedVariantId(fragmentId: string): Promise<string | undefined>;
362
+ protected resolvePotentialSystemPrompt(promptFragmentId: string): Promise<PromptFragment | undefined>;
363
+ getResolvedPromptFragment(systemOrFragmentId: string, args?: {
187
364
  [key: string]: unknown;
188
- }, context?: AIVariableContext): Promise<ResolvedPromptTemplate | undefined>;
189
- getPromptFragment(id: string, args?: {
365
+ }, context?: AIVariableContext): Promise<ResolvedPromptFragment | undefined>;
366
+ getResolvedPromptFragmentWithoutFunctions(systemOrFragmentId: string, args?: {
190
367
  [key: string]: unknown;
191
- }, context?: AIVariableContext, resolveVariable?: (variable: AIVariableArg) => Promise<ResolvedAIVariable | undefined>): Promise<Omit<ResolvedPromptTemplate, 'functionDescriptions'> | undefined>;
368
+ }, context?: AIVariableContext, resolveVariable?: (variable: AIVariableArg) => Promise<ResolvedAIVariable | undefined>): Promise<Omit<ResolvedPromptFragment, 'functionDescriptions'> | undefined>;
192
369
  /**
193
370
  * Calculates all variable and argument replacements for an unresolved template.
194
371
  *
195
- * @param template the unresolved template text
372
+ * @param templateText the unresolved template text
196
373
  * @param args the object with placeholders, mapping the placeholder key to the value
197
374
  * @param context the {@link AIVariableContext} to use during variable resolution
198
375
  * @param resolveVariable the variable resolving method. Fall back to using the {@link AIVariableService} if not given.
376
+ * @returns Object containing replacements and resolved variables
199
377
  */
200
- protected getVariableAndArgReplacements(template: string, args?: {
378
+ protected resolveVariablesAndArgs(templateText: string, args?: {
201
379
  [key: string]: unknown;
202
380
  }, context?: AIVariableContext, resolveVariable?: (variable: AIVariableArg) => Promise<ResolvedAIVariable | undefined>): Promise<{
203
381
  replacements: {
@@ -206,9 +384,37 @@ export declare class PromptServiceImpl implements PromptService {
206
384
  }[];
207
385
  resolvedVariables: ResolvedAIVariable[];
208
386
  }>;
209
- getAllPrompts(): PromptMap;
210
- removePrompt(id: string): void;
211
- getVariantIds(id: string): string[];
212
- storePromptTemplate(promptTemplate: PromptTemplate): void;
387
+ getAllPromptFragments(): Map<string, PromptFragment[]>;
388
+ getActivePromptFragments(): PromptFragment[];
389
+ removePromptFragment(fragmentId: string): void;
390
+ getVariantIds(fragmentId: string): string[];
391
+ getDefaultVariantId(promptVariantSetId: string): string | undefined;
392
+ getPromptVariantSets(): Map<string, string[]>;
393
+ addBuiltInPromptFragment(promptFragment: BasePromptFragment, promptVariantSetId?: string, isDefault?: boolean): void;
394
+ /**
395
+ * Adds a variant ID to the fragment variants map
396
+ * @param promptVariantSetId The prompt variant set id
397
+ * @param variantId The variant ID to add
398
+ * @param isDefault Whether this variant should be the default for the prompt variant set (defaults to false)
399
+ */
400
+ protected addFragmentVariant(promptVariantSetId: string, variantId: string, isDefault?: boolean): void;
401
+ /**
402
+ * Removes a variant ID from the fragment variants map
403
+ * @param promptVariantSetId The prompt variant set id
404
+ * @param variantId The variant ID to remove
405
+ */
406
+ protected removeFragmentVariant(promptVariantSetId: string, variantId: string): void;
407
+ updateSelectedVariantId(agentId: string, promptVariantSetId: string, newVariant: string): Promise<void>;
408
+ createCustomization(fragmentId: string): Promise<void>;
409
+ createBuiltInCustomization(fragmentId: string): Promise<void>;
410
+ editCustomization(fragmentId: string, customizationId: string): Promise<void>;
411
+ removeCustomization(fragmentId: string, customizationId: string): Promise<void>;
412
+ resetAllToBuiltIn(): Promise<void>;
413
+ resetToBuiltIn(fragmentId: string): Promise<void>;
414
+ resetToCustomization(fragmentId: string, customizationId: string): Promise<void>;
415
+ getCustomizationDescription(fragmentId: string, customizationId: string): Promise<string | undefined>;
416
+ getCustomizationType(fragmentId: string, customizationId: string): Promise<string | undefined>;
417
+ getTemplateIDFromResource(resourceId: unknown): string | undefined;
418
+ editBuiltInCustomization(fragmentId: string): Promise<void>;
213
419
  }
214
420
  //# sourceMappingURL=prompt-service.d.ts.map
@@ -1 +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