@theia/ai-core 1.73.0-next.7 → 1.73.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.
- package/README.md +2 -2
- package/lib/browser/{agent-completion-notification-service.d.ts → agent-notification-service.d.ts} +12 -10
- package/lib/browser/agent-notification-service.d.ts.map +1 -0
- package/lib/browser/{agent-completion-notification-service.js → agent-notification-service.js} +37 -27
- package/lib/browser/agent-notification-service.js.map +1 -0
- package/lib/browser/ai-core-frontend-module.js +2 -2
- package/lib/browser/ai-core-frontend-module.js.map +1 -1
- package/lib/browser/frontend-language-model-alias-registry.js +3 -3
- package/lib/browser/frontend-prompt-customization-service.d.ts +193 -16
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +1 -1
- package/lib/browser/frontend-prompt-customization-service.js +686 -46
- package/lib/browser/frontend-prompt-customization-service.js.map +1 -1
- package/lib/browser/frontend-prompt-customization-service.spec.js +259 -0
- package/lib/browser/frontend-prompt-customization-service.spec.js.map +1 -1
- package/lib/browser/frontend-variable-service.d.ts +2 -1
- package/lib/browser/frontend-variable-service.d.ts.map +1 -1
- package/lib/browser/frontend-variable-service.js +6 -1
- package/lib/browser/frontend-variable-service.js.map +1 -1
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.d.ts.map +1 -1
- package/lib/browser/index.js +1 -1
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/os-notification-service.d.ts +10 -6
- package/lib/browser/os-notification-service.d.ts.map +1 -1
- package/lib/browser/os-notification-service.js +34 -20
- package/lib/browser/os-notification-service.js.map +1 -1
- package/lib/browser/prompt-variable-contribution.spec.js +2 -1
- package/lib/browser/prompt-variable-contribution.spec.js.map +1 -1
- package/lib/browser/skill-service.d.ts +6 -1
- package/lib/browser/skill-service.d.ts.map +1 -1
- package/lib/browser/skill-service.js +47 -18
- package/lib/browser/skill-service.js.map +1 -1
- package/lib/browser/skill-service.spec.js +153 -31
- package/lib/browser/skill-service.spec.js.map +1 -1
- package/lib/browser/token-usage-frontend-service-impl.d.ts +2 -0
- package/lib/browser/token-usage-frontend-service-impl.d.ts.map +1 -1
- package/lib/browser/token-usage-frontend-service-impl.js +6 -1
- package/lib/browser/token-usage-frontend-service-impl.js.map +1 -1
- package/lib/browser/window-blink-service.d.ts +2 -0
- package/lib/browser/window-blink-service.d.ts.map +1 -1
- package/lib/browser/window-blink-service.js +8 -3
- package/lib/browser/window-blink-service.js.map +1 -1
- package/lib/common/agent-preferences.d.ts.map +1 -1
- package/lib/common/agent-preferences.js +12 -2
- package/lib/common/agent-preferences.js.map +1 -1
- package/lib/common/ai-core-preferences.d.ts.map +1 -1
- package/lib/common/ai-core-preferences.js +4 -2
- package/lib/common/ai-core-preferences.js.map +1 -1
- package/lib/common/capability-variable-contribution.spec.js +2 -1
- package/lib/common/capability-variable-contribution.spec.js.map +1 -1
- package/lib/common/frontmatter.d.ts +33 -0
- package/lib/common/frontmatter.d.ts.map +1 -0
- package/lib/common/frontmatter.js +80 -0
- package/lib/common/frontmatter.js.map +1 -0
- package/lib/common/frontmatter.spec.d.ts +2 -0
- package/lib/common/frontmatter.spec.d.ts.map +1 -0
- package/lib/common/frontmatter.spec.js +73 -0
- package/lib/common/frontmatter.spec.js.map +1 -0
- package/lib/common/index.d.ts +1 -0
- package/lib/common/index.d.ts.map +1 -1
- package/lib/common/index.js +1 -0
- package/lib/common/index.js.map +1 -1
- package/lib/common/language-model-service.js +1 -1
- package/lib/common/language-model-service.js.map +1 -1
- package/lib/common/language-model-service.spec.d.ts +2 -0
- package/lib/common/language-model-service.spec.d.ts.map +1 -0
- package/lib/common/language-model-service.spec.js +62 -0
- package/lib/common/language-model-service.spec.js.map +1 -0
- package/lib/common/language-model.d.ts +64 -2
- package/lib/common/language-model.d.ts.map +1 -1
- package/lib/common/language-model.js +8 -2
- package/lib/common/language-model.js.map +1 -1
- package/lib/common/notification-types.d.ts +7 -0
- package/lib/common/notification-types.d.ts.map +1 -1
- package/lib/common/notification-types.js +7 -1
- package/lib/common/notification-types.js.map +1 -1
- package/lib/common/prompt-service-util.d.ts +22 -1
- package/lib/common/prompt-service-util.d.ts.map +1 -1
- package/lib/common/prompt-service-util.js +24 -2
- package/lib/common/prompt-service-util.js.map +1 -1
- package/lib/common/prompt-service-util.spec.d.ts +2 -0
- package/lib/common/prompt-service-util.spec.d.ts.map +1 -0
- package/lib/common/prompt-service-util.spec.js +54 -0
- package/lib/common/prompt-service-util.spec.js.map +1 -0
- package/lib/common/prompt-service.d.ts +72 -8
- package/lib/common/prompt-service.d.ts.map +1 -1
- package/lib/common/prompt-service.js +36 -4
- package/lib/common/prompt-service.js.map +1 -1
- package/lib/common/prompt-service.spec.js +49 -2
- package/lib/common/prompt-service.spec.js.map +1 -1
- package/lib/common/settings-service.d.ts +5 -0
- package/lib/common/settings-service.d.ts.map +1 -1
- package/lib/common/skill.d.ts +17 -4
- package/lib/common/skill.d.ts.map +1 -1
- package/lib/common/skill.js +22 -35
- package/lib/common/skill.js.map +1 -1
- package/lib/common/tool-invocation-registry.d.ts +7 -0
- package/lib/common/tool-invocation-registry.d.ts.map +1 -1
- package/lib/common/tool-invocation-registry.js +5 -0
- package/lib/common/tool-invocation-registry.js.map +1 -1
- package/lib/common/variable-service.d.ts +2 -2
- package/lib/common/variable-service.d.ts.map +1 -1
- package/lib/common/variable-service.js +7 -4
- package/lib/common/variable-service.js.map +1 -1
- package/lib/common/variable-service.spec.js +2 -1
- package/lib/common/variable-service.spec.js.map +1 -1
- package/lib/node/backend-language-model-registry.d.ts.map +1 -1
- package/lib/node/backend-language-model-registry.js +1 -0
- package/lib/node/backend-language-model-registry.js.map +1 -1
- package/lib/node/backend-language-model-registry.spec.d.ts +2 -0
- package/lib/node/backend-language-model-registry.spec.d.ts.map +1 -0
- package/lib/node/backend-language-model-registry.spec.js +48 -0
- package/lib/node/backend-language-model-registry.spec.js.map +1 -0
- package/lib/node/token-usage-service-impl.d.ts +2 -0
- package/lib/node/token-usage-service-impl.d.ts.map +1 -1
- package/lib/node/token-usage-service-impl.js +7 -1
- package/lib/node/token-usage-service-impl.js.map +1 -1
- package/package.json +12 -12
- package/src/browser/{agent-completion-notification-service.ts → agent-notification-service.ts} +52 -27
- package/src/browser/ai-core-frontend-module.ts +2 -2
- package/src/browser/frontend-language-model-alias-registry.ts +3 -3
- package/src/browser/frontend-prompt-customization-service.spec.ts +319 -1
- package/src/browser/frontend-prompt-customization-service.ts +810 -59
- package/src/browser/frontend-variable-service.ts +5 -3
- package/src/browser/index.ts +1 -1
- package/src/browser/os-notification-service.ts +39 -24
- package/src/browser/prompt-variable-contribution.spec.ts +2 -1
- package/src/browser/skill-service.spec.ts +191 -38
- package/src/browser/skill-service.ts +61 -33
- package/src/browser/token-usage-frontend-service-impl.ts +6 -3
- package/src/browser/window-blink-service.ts +7 -4
- package/src/common/agent-preferences.ts +13 -2
- package/src/common/ai-core-preferences.ts +4 -2
- package/src/common/capability-variable-contribution.spec.ts +2 -1
- package/src/common/frontmatter.spec.ts +82 -0
- package/src/common/frontmatter.ts +99 -0
- package/src/common/index.ts +1 -0
- package/src/common/language-model-service.spec.ts +70 -0
- package/src/common/language-model-service.ts +1 -1
- package/src/common/language-model.ts +72 -3
- package/src/common/notification-types.ts +10 -0
- package/src/common/prompt-service-util.spec.ts +60 -0
- package/src/common/prompt-service-util.ts +31 -1
- package/src/common/prompt-service.spec.ts +59 -2
- package/src/common/prompt-service.ts +104 -8
- package/src/common/settings-service.ts +5 -0
- package/src/common/skill.ts +37 -39
- package/src/common/tool-invocation-registry.ts +13 -0
- package/src/common/variable-service.spec.ts +2 -2
- package/src/common/variable-service.ts +3 -1
- package/src/node/backend-language-model-registry.spec.ts +52 -0
- package/src/node/backend-language-model-registry.ts +1 -0
- package/src/node/token-usage-service-impl.ts +7 -2
- package/lib/browser/agent-completion-notification-service.d.ts.map +0 -1
- package/lib/browser/agent-completion-notification-service.js.map +0 -1
package/README.md
CHANGED
|
@@ -23,9 +23,9 @@ Skills provide reusable instructions and domain knowledge for AI agents. A skill
|
|
|
23
23
|
|
|
24
24
|
Skills are discovered from multiple locations, processed in priority order (first wins on duplicates):
|
|
25
25
|
|
|
26
|
-
1. **Workspace:** `.prompts/skills/` in the workspace root (project-specific skills)
|
|
26
|
+
1. **Workspace:** `.prompts/skills/` and `.agents/skills/` in the workspace root (project-specific skills)
|
|
27
27
|
2. **User-configured:** Directories listed in `ai-features.skills.skillDirectories` preference
|
|
28
|
-
3. **Global:** `~/.theia/skills/` (
|
|
28
|
+
3. **Global:** `~/.theia/skills/` (product configuration folder) and `~/.agents/skills/` (home directory)
|
|
29
29
|
|
|
30
30
|
#### Skill Structure
|
|
31
31
|
|
package/lib/browser/{agent-completion-notification-service.d.ts → agent-notification-service.d.ts}
RENAMED
|
@@ -3,12 +3,12 @@ import { AgentService } from '../common/agent-service';
|
|
|
3
3
|
import { AISettingsService } from '../common/settings-service';
|
|
4
4
|
import { OSNotificationService } from './os-notification-service';
|
|
5
5
|
import { WindowBlinkService } from './window-blink-service';
|
|
6
|
-
import { NotificationType } from '../common/notification-types';
|
|
7
|
-
import { PreferenceService } from '@theia/core';
|
|
6
|
+
import { NotificationType, AgentNotificationKind } from '../common/notification-types';
|
|
7
|
+
import { PreferenceService, ILogger } from '@theia/core';
|
|
8
8
|
/**
|
|
9
|
-
* Options for showing
|
|
9
|
+
* Options for showing an agent notification.
|
|
10
10
|
*/
|
|
11
|
-
export interface
|
|
11
|
+
export interface AgentNotificationOptions {
|
|
12
12
|
/**
|
|
13
13
|
* Callback to check if the notification should be suppressed.
|
|
14
14
|
* If returns true, the notification will not be shown.
|
|
@@ -25,20 +25,22 @@ export interface CompletionNotificationOptions {
|
|
|
25
25
|
*/
|
|
26
26
|
sessionTitle?: string;
|
|
27
27
|
}
|
|
28
|
-
export declare class
|
|
28
|
+
export declare class AgentNotificationService {
|
|
29
29
|
protected readonly preferenceService: PreferenceService;
|
|
30
30
|
protected readonly agentService: AgentService;
|
|
31
31
|
protected readonly settingsService: AISettingsService;
|
|
32
32
|
protected readonly osNotificationService: OSNotificationService;
|
|
33
33
|
protected readonly messageService: MessageService;
|
|
34
34
|
protected readonly windowBlinkService: WindowBlinkService;
|
|
35
|
+
protected readonly logger: ILogger;
|
|
35
36
|
/**
|
|
36
|
-
* Show a
|
|
37
|
+
* Show a notification for the specified agent if enabled in preferences.
|
|
37
38
|
*
|
|
38
39
|
* @param agentId The unique identifier of the agent
|
|
40
|
+
* @param kind Whether the agent completed its task or needs user input
|
|
39
41
|
* @param options Optional configuration for the notification
|
|
40
42
|
*/
|
|
41
|
-
|
|
43
|
+
showNotification(agentId: string, kind: AgentNotificationKind, options?: AgentNotificationOptions): Promise<void>;
|
|
42
44
|
/**
|
|
43
45
|
* Resolve the display name for an agent by its ID.
|
|
44
46
|
*
|
|
@@ -58,11 +60,11 @@ export declare class AgentCompletionNotificationService {
|
|
|
58
60
|
/**
|
|
59
61
|
* Show OS notification directly.
|
|
60
62
|
*/
|
|
61
|
-
protected showOSNotification(agentName: string, onActivate?: () => void, sessionTitle?: string): Promise<void>;
|
|
63
|
+
protected showOSNotification(agentName: string, kind: AgentNotificationKind, onActivate?: () => void, sessionTitle?: string): Promise<void>;
|
|
62
64
|
/**
|
|
63
65
|
* Show MessageService notification.
|
|
64
66
|
*/
|
|
65
|
-
protected showMessageServiceNotification(agentName: string, onActivate?: () => void, sessionTitle?: string): Promise<void>;
|
|
67
|
+
protected showMessageServiceNotification(agentName: string, kind: AgentNotificationKind, onActivate?: () => void, sessionTitle?: string): Promise<void>;
|
|
66
68
|
/**
|
|
67
69
|
* Show window blink notification.
|
|
68
70
|
*/
|
|
@@ -80,4 +82,4 @@ export declare class AgentCompletionNotificationService {
|
|
|
80
82
|
*/
|
|
81
83
|
requestOSNotificationPermission(): Promise<NotificationPermission>;
|
|
82
84
|
}
|
|
83
|
-
//# sourceMappingURL=agent-
|
|
85
|
+
//# sourceMappingURL=agent-notification-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ag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,IAAI,CAAC;IA8BhB;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IAcnD;;;OAGG;cACa,2BAA2B,CACvC,OAAO,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC;IAgB5B;;OAEG;YACW,uBAAuB;IAsBrC;;OAEG;cACa,kBAAkB,CAC9B,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,qBAAqB,EAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,EACvB,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAahB;;OAEG;cACa,8BAA8B,CAC1C,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,qBAAqB,EAC3B,UAAU,CAAC,EAAE,MAAM,IAAI,EACvB,YAAY,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,IAAI,CAAC;IAiChB;;OAEG;cACa,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASvE;;OAEG;IACH,yBAAyB,IAAI,OAAO;IAIpC;;OAEG;IACH,2BAA2B,IAAI,sBAAsB;IAIrD;;OAEG;IACG,+BAA+B,IAAI,OAAO,CAAC,sBAAsB,CAAC;CAG3E"}
|
package/lib/browser/{agent-completion-notification-service.js → agent-notification-service.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
3
|
+
// Copyright (C) 2025 EclipseSource GmbH and others.
|
|
4
4
|
//
|
|
5
5
|
// This program and the accompanying materials are made available under the
|
|
6
6
|
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
16
|
// *****************************************************************************
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.
|
|
18
|
+
exports.AgentNotificationService = void 0;
|
|
19
19
|
const tslib_1 = require("tslib");
|
|
20
20
|
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
21
|
const message_service_1 = require("@theia/core/lib/common/message-service");
|
|
@@ -27,14 +27,15 @@ const os_notification_service_1 = require("./os-notification-service");
|
|
|
27
27
|
const window_blink_service_1 = require("./window-blink-service");
|
|
28
28
|
const notification_types_1 = require("../common/notification-types");
|
|
29
29
|
const core_1 = require("@theia/core");
|
|
30
|
-
let
|
|
30
|
+
let AgentNotificationService = class AgentNotificationService {
|
|
31
31
|
/**
|
|
32
|
-
* Show a
|
|
32
|
+
* Show a notification for the specified agent if enabled in preferences.
|
|
33
33
|
*
|
|
34
34
|
* @param agentId The unique identifier of the agent
|
|
35
|
+
* @param kind Whether the agent completed its task or needs user input
|
|
35
36
|
* @param options Optional configuration for the notification
|
|
36
37
|
*/
|
|
37
|
-
async
|
|
38
|
+
async showNotification(agentId, kind, options) {
|
|
38
39
|
const notificationType = await this.getNotificationTypeForAgent(agentId);
|
|
39
40
|
if (notificationType === notification_types_1.NOTIFICATION_TYPE_OFF) {
|
|
40
41
|
return;
|
|
@@ -45,10 +46,10 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
45
46
|
}
|
|
46
47
|
try {
|
|
47
48
|
const agentName = this.resolveAgentName(agentId);
|
|
48
|
-
await this.executeNotificationType(agentName, notificationType, options?.onActivate, options?.sessionTitle);
|
|
49
|
+
await this.executeNotificationType(agentName, kind, notificationType, options?.onActivate, options?.sessionTitle);
|
|
49
50
|
}
|
|
50
51
|
catch (error) {
|
|
51
|
-
|
|
52
|
+
this.logger.error('Failed to show agent notification:', error);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
@@ -64,7 +65,7 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
64
65
|
return agent?.name || agentId;
|
|
65
66
|
}
|
|
66
67
|
catch (error) {
|
|
67
|
-
|
|
68
|
+
this.logger.warn(`Failed to resolve agent name for ID '${agentId}':`, error);
|
|
68
69
|
return agentId;
|
|
69
70
|
}
|
|
70
71
|
}
|
|
@@ -84,13 +85,13 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
84
85
|
/**
|
|
85
86
|
* Execute the specified notification type.
|
|
86
87
|
*/
|
|
87
|
-
async executeNotificationType(agentName, type, onActivate, sessionTitle) {
|
|
88
|
+
async executeNotificationType(agentName, kind, type, onActivate, sessionTitle) {
|
|
88
89
|
switch (type) {
|
|
89
90
|
case notification_types_1.NOTIFICATION_TYPE_OS_NOTIFICATION:
|
|
90
|
-
await this.showOSNotification(agentName, onActivate, sessionTitle);
|
|
91
|
+
await this.showOSNotification(agentName, kind, onActivate, sessionTitle);
|
|
91
92
|
break;
|
|
92
93
|
case notification_types_1.NOTIFICATION_TYPE_MESSAGE:
|
|
93
|
-
await this.showMessageServiceNotification(agentName, onActivate, sessionTitle);
|
|
94
|
+
await this.showMessageServiceNotification(agentName, kind, onActivate, sessionTitle);
|
|
94
95
|
break;
|
|
95
96
|
case notification_types_1.NOTIFICATION_TYPE_BLINK:
|
|
96
97
|
await this.showBlinkNotification(agentName);
|
|
@@ -102,8 +103,8 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
102
103
|
/**
|
|
103
104
|
* Show OS notification directly.
|
|
104
105
|
*/
|
|
105
|
-
async showOSNotification(agentName, onActivate, sessionTitle) {
|
|
106
|
-
const result = await this.osNotificationService.
|
|
106
|
+
async showOSNotification(agentName, kind, onActivate, sessionTitle) {
|
|
107
|
+
const result = await this.osNotificationService.showAgentNotification(agentName, kind, sessionTitle, onActivate);
|
|
107
108
|
if (!result.success) {
|
|
108
109
|
throw new Error(`OS notification failed: ${result.error}`);
|
|
109
110
|
}
|
|
@@ -111,10 +112,14 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
111
112
|
/**
|
|
112
113
|
* Show MessageService notification.
|
|
113
114
|
*/
|
|
114
|
-
async showMessageServiceNotification(agentName, onActivate, sessionTitle) {
|
|
115
|
-
const message =
|
|
116
|
-
?
|
|
117
|
-
|
|
115
|
+
async showMessageServiceNotification(agentName, kind, onActivate, sessionTitle) {
|
|
116
|
+
const message = kind === notification_types_1.AGENT_NOTIFICATION_KIND_INPUT_NEEDED
|
|
117
|
+
? (sessionTitle
|
|
118
|
+
? nls_1.nls.localize('theia/ai-core/agentInputNeededMessageWithSession', 'Agent "{0}" needs your input in "{1}".', agentName, sessionTitle)
|
|
119
|
+
: nls_1.nls.localize('theia/ai-core/agentInputNeededMessage', 'Agent "{0}" needs your input.', agentName))
|
|
120
|
+
: (sessionTitle
|
|
121
|
+
? nls_1.nls.localize('theia/ai-core/agentCompletionMessageWithSession', 'Agent "{0}" has completed its task in "{1}".', agentName, sessionTitle)
|
|
122
|
+
: nls_1.nls.localize('theia/ai-core/agentCompletionMessage', 'Agent "{0}" has completed its task.', agentName));
|
|
118
123
|
const showChatAction = nls_1.nls.localize('theia/ai-core/showChat', 'Show Chat');
|
|
119
124
|
const action = await this.messageService.info(message, showChatAction);
|
|
120
125
|
if (action === showChatAction && onActivate) {
|
|
@@ -149,32 +154,37 @@ let AgentCompletionNotificationService = class AgentCompletionNotificationServic
|
|
|
149
154
|
return this.osNotificationService.requestPermission();
|
|
150
155
|
}
|
|
151
156
|
};
|
|
152
|
-
exports.
|
|
157
|
+
exports.AgentNotificationService = AgentNotificationService;
|
|
153
158
|
tslib_1.__decorate([
|
|
154
159
|
(0, inversify_1.inject)(core_1.PreferenceService),
|
|
155
160
|
tslib_1.__metadata("design:type", Object)
|
|
156
|
-
],
|
|
161
|
+
], AgentNotificationService.prototype, "preferenceService", void 0);
|
|
157
162
|
tslib_1.__decorate([
|
|
158
163
|
(0, inversify_1.inject)(agent_service_1.AgentService),
|
|
159
164
|
tslib_1.__metadata("design:type", Object)
|
|
160
|
-
],
|
|
165
|
+
], AgentNotificationService.prototype, "agentService", void 0);
|
|
161
166
|
tslib_1.__decorate([
|
|
162
167
|
(0, inversify_1.inject)(settings_service_1.AISettingsService),
|
|
163
168
|
tslib_1.__metadata("design:type", Object)
|
|
164
|
-
],
|
|
169
|
+
], AgentNotificationService.prototype, "settingsService", void 0);
|
|
165
170
|
tslib_1.__decorate([
|
|
166
171
|
(0, inversify_1.inject)(os_notification_service_1.OSNotificationService),
|
|
167
172
|
tslib_1.__metadata("design:type", os_notification_service_1.OSNotificationService)
|
|
168
|
-
],
|
|
173
|
+
], AgentNotificationService.prototype, "osNotificationService", void 0);
|
|
169
174
|
tslib_1.__decorate([
|
|
170
175
|
(0, inversify_1.inject)(message_service_1.MessageService),
|
|
171
176
|
tslib_1.__metadata("design:type", message_service_1.MessageService)
|
|
172
|
-
],
|
|
177
|
+
], AgentNotificationService.prototype, "messageService", void 0);
|
|
173
178
|
tslib_1.__decorate([
|
|
174
179
|
(0, inversify_1.inject)(window_blink_service_1.WindowBlinkService),
|
|
175
180
|
tslib_1.__metadata("design:type", window_blink_service_1.WindowBlinkService)
|
|
176
|
-
],
|
|
177
|
-
|
|
181
|
+
], AgentNotificationService.prototype, "windowBlinkService", void 0);
|
|
182
|
+
tslib_1.__decorate([
|
|
183
|
+
(0, inversify_1.inject)(core_1.ILogger),
|
|
184
|
+
(0, inversify_1.named)('ai-core:AgentNotificationService'),
|
|
185
|
+
tslib_1.__metadata("design:type", Object)
|
|
186
|
+
], AgentNotificationService.prototype, "logger", void 0);
|
|
187
|
+
exports.AgentNotificationService = AgentNotificationService = tslib_1.__decorate([
|
|
178
188
|
(0, inversify_1.injectable)()
|
|
179
|
-
],
|
|
180
|
-
//# sourceMappingURL=agent-
|
|
189
|
+
], AgentNotificationService);
|
|
190
|
+
//# sourceMappingURL=agent-notification-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-notification-service.js","sourceRoot":"","sources":["../../src/browser/agent-notification-service.ts"],"names":[],"mappings":";AAA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ED;;OAEG;IACO,KAAK,CAAC,qBAAqB,CAAC,SAAiB;QACnD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACX,qCAAqC,MAAM,CAAC,KAAK,EAAE,CACtD,CAAC;QACN,CAAC;IACL,CAAC;IAED;;OAEG;IACH,yBAAyB;QACrB,OAAO,IAAI,CAAC,qBAAqB,CAAC,uBAAuB,EAAE,CAAC;IAChE,CAAC;IAED;;OAEG;IACH,2BAA2B;QACvB,OAAO,IAAI,CAAC,qBAAqB,CAAC,mBAAmB,EAAE,CAAC;IAC5D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,+BAA+B;QACjC,OAAO,IAAI,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,CAAC;IAC1D,CAAC;CACJ,CAAA;AAhOY,4DAAwB;AAEd;IADlB,IAAA,kBAAM,EAAC,wBAAiB,CAAC;;mEAC8B;AAGrC;IADlB,IAAA,kBAAM,EAAC,4BAAY,CAAC;;8DACyB;AAG3B;IADlB,IAAA,kBAAM,EAAC,oCAAiB,CAAC;;iEAC4B;AAGnC;IADlB,IAAA,kBAAM,EAAC,+CAAqB,CAAC;sCACY,+CAAqB;uEAAC;AAG7C;IADlB,IAAA,kBAAM,EAAC,gCAAc,CAAC;sCACY,gCAAc;gEAAC;AAG/B;IADlB,IAAA,kBAAM,EAAC,yCAAkB,CAAC;sCACY,yCAAkB;oEAAC;AAGvC;IADlB,IAAA,kBAAM,EAAC,cAAO,CAAC;IAAE,IAAA,iBAAK,EAAC,kCAAkC,CAAC;;wDACxB;mCApB1B,wBAAwB;IADpC,IAAA,sBAAU,GAAE;GACA,wBAAwB,CAgOpC"}
|
|
@@ -55,7 +55,7 @@ const frontend_language_model_service_1 = require("./frontend-language-model-ser
|
|
|
55
55
|
const token_usage_frontend_service_1 = require("./token-usage-frontend-service");
|
|
56
56
|
const token_usage_frontend_service_impl_1 = require("./token-usage-frontend-service-impl");
|
|
57
57
|
const ai_variable_uri_label_provider_1 = require("./ai-variable-uri-label-provider");
|
|
58
|
-
const
|
|
58
|
+
const agent_notification_service_1 = require("./agent-notification-service");
|
|
59
59
|
const os_notification_service_1 = require("./os-notification-service");
|
|
60
60
|
const window_blink_service_1 = require("./window-blink-service");
|
|
61
61
|
exports.default = new inversify_1.ContainerModule(bind => {
|
|
@@ -151,7 +151,7 @@ exports.default = new inversify_1.ContainerModule(bind => {
|
|
|
151
151
|
bind(core_1.ResourceResolver).toService(common_1.AIVariableResourceResolver);
|
|
152
152
|
bind(ai_variable_uri_label_provider_1.AIVariableUriLabelProvider).toSelf().inSingletonScope();
|
|
153
153
|
bind(browser_1.LabelProviderContribution).toService(ai_variable_uri_label_provider_1.AIVariableUriLabelProvider);
|
|
154
|
-
bind(
|
|
154
|
+
bind(agent_notification_service_1.AgentNotificationService).toSelf().inSingletonScope();
|
|
155
155
|
bind(os_notification_service_1.OSNotificationService).toSelf().inSingletonScope();
|
|
156
156
|
bind(window_blink_service_1.WindowBlinkService).toSelf().inSingletonScope();
|
|
157
157
|
bind(common_1.ConfigurableInMemoryResources).toSelf().inSingletonScope();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-core-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-core-frontend-module.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,sCAAkH;AAClH,+GAGuE;AACvE,4DAA+D;AAC/D,qGAA6F;AAC7F,mFAA6E;AAC7E,yEAA4E;AAC5E,sCAwBmB;AACnB,yFAG4C;AAC5C,qDAAqG;AACrG,mFAA0F;AAC1F,iEAA2F;AAC3F,2GAAoG;AACpG,uEAAsE;AACtE,+DAA8D;AAC9D,mGAAoG;AACpG,2EAAsG;AACtG,+EAA2E;AAC3E,6EAAwE;AACxE,+EAA0E;AAC1E,uFAAkF;AAClF,yFAAoF;AACpF,6FAAuF;AACvF,iFAA4E;AAC5E,mEAAuF;AACvF,2DAAyE;AACzE,6EAAuE;AACvE,iEAA+D;AAC/D,mDAAoE;AACpE,yEAAoE;AACpE,iFAA2E;AAC3E,iFAA4E;AAC5E,6FAAuF;AACvF,iGAA4F;AAC5F,6GAAuG;AACvG,2HAAoH;AACpH,6EAAwE;AACxE,uFAAqF;AACrF,iFAA2E;AAC3E,2FAAiH;AACjH,qFAA8E;AAC9E,
|
|
1
|
+
{"version":3,"file":"ai-core-frontend-module.js","sourceRoot":"","sources":["../../src/browser/ai-core-frontend-module.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,sCAAkH;AAClH,+GAGuE;AACvE,4DAA+D;AAC/D,qGAA6F;AAC7F,mFAA6E;AAC7E,yEAA4E;AAC5E,sCAwBmB;AACnB,yFAG4C;AAC5C,qDAAqG;AACrG,mFAA0F;AAC1F,iEAA2F;AAC3F,2GAAoG;AACpG,uEAAsE;AACtE,+DAA8D;AAC9D,mGAAoG;AACpG,2EAAsG;AACtG,+EAA2E;AAC3E,6EAAwE;AACxE,+EAA0E;AAC1E,uFAAkF;AAClF,yFAAoF;AACpF,6FAAuF;AACvF,iFAA4E;AAC5E,mEAAuF;AACvF,2DAAyE;AACzE,6EAAuE;AACvE,iEAA+D;AAC/D,mDAAoE;AACpE,yEAAoE;AAC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guageModelAliasRegistry
|
|
|
29
29
|
{
|
|
30
30
|
id: 'default/code',
|
|
31
31
|
defaultModelIds: [
|
|
32
|
-
'anthropic/claude-opus-4-
|
|
32
|
+
'anthropic/claude-opus-4-8',
|
|
33
33
|
'openai/gpt-5.5',
|
|
34
34
|
'google/gemini-3.1-pro-preview'
|
|
35
35
|
],
|
|
@@ -38,7 +38,7 @@ let DefaultLanguageModelAliasRegistry = class DefaultLanguageModelAliasRegistry
|
|
|
38
38
|
{
|
|
39
39
|
id: 'default/universal',
|
|
40
40
|
defaultModelIds: [
|
|
41
|
-
'anthropic/claude-opus-4-
|
|
41
|
+
'anthropic/claude-opus-4-8',
|
|
42
42
|
'openai/gpt-5.5',
|
|
43
43
|
'google/gemini-3.1-pro-preview'
|
|
44
44
|
],
|
|
@@ -56,7 +56,7 @@ let DefaultLanguageModelAliasRegistry = class DefaultLanguageModelAliasRegistry
|
|
|
56
56
|
{
|
|
57
57
|
id: 'default/summarize',
|
|
58
58
|
defaultModelIds: [
|
|
59
|
-
'anthropic/claude-opus-4-
|
|
59
|
+
'anthropic/claude-opus-4-8',
|
|
60
60
|
'openai/gpt-5.5',
|
|
61
61
|
'google/gemini-3.1-pro-preview'
|
|
62
62
|
],
|
|
@@ -1,12 +1,37 @@
|
|
|
1
|
-
import { DisposableCollection, URI, Event, Emitter } from '@theia/core';
|
|
1
|
+
import { DisposableCollection, URI, Event, Emitter, ILogger } from '@theia/core';
|
|
2
2
|
import { OpenerService } from '@theia/core/lib/browser';
|
|
3
|
-
import { PromptFragmentCustomizationService, CustomAgentDescription, CustomizedPromptFragment, CommandPromptFragmentMetadata } from '../common';
|
|
3
|
+
import { PromptFragmentCustomizationService, CustomAgentDescription, CustomAgentPromptVariant, CustomizedPromptFragment, CommandPromptFragmentMetadata, CustomAgentsLocation } from '../common';
|
|
4
4
|
import { ConfigurableInMemoryResources } from '../common/configurable-in-memory-resources';
|
|
5
5
|
import { FileService } from '@theia/filesystem/lib/browser/file-service';
|
|
6
6
|
import { AICorePreferences } from '../common/ai-core-preferences';
|
|
7
7
|
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
8
8
|
import { ParsedTemplate } from './prompttemplate-parser';
|
|
9
9
|
import { WorkspaceService } from '@theia/workspace/lib/browser';
|
|
10
|
+
/**
|
|
11
|
+
* Subdirectory (relative to a prompt-templates scope) holding one folder per custom agent.
|
|
12
|
+
*/
|
|
13
|
+
export declare const CUSTOM_AGENTS_DIRECTORY = "agents";
|
|
14
|
+
/**
|
|
15
|
+
* Filename of the per-agent definition file (frontmatter + prompt body) inside `agents/<id>/`.
|
|
16
|
+
*/
|
|
17
|
+
export declare const CUSTOM_AGENT_FILE_NAME = "agent.md";
|
|
18
|
+
/**
|
|
19
|
+
* Filename stem (without extension) reserved for the customization of a custom agent's
|
|
20
|
+
* default prompt. Lives at `<scope>/agents/<id>/prompt.prompttemplate` and maps to
|
|
21
|
+
* fragment id `<agent-name>_prompt`. Excluded from the variant loader so it doesn't double
|
|
22
|
+
* as an extra variant.
|
|
23
|
+
*/
|
|
24
|
+
export declare const CUSTOM_AGENT_DEFAULT_PROMPT_STEM = "prompt";
|
|
25
|
+
/**
|
|
26
|
+
* Workspace-relative parent folders scanned for custom agents, independent of the configurable
|
|
27
|
+
* prompt-templates directories. Scanning both folders mirrors the skills convention introduced
|
|
28
|
+
* in #17553, but the duplicate-id precedence is intentionally inverted: here `.agents` is listed
|
|
29
|
+
* first, so it becomes the default location for newly created agents and wins over `.prompts`,
|
|
30
|
+
* whereas for skills `.prompts` wins over `.agents` (see `combineSkillDirectories` in
|
|
31
|
+
* `skill-service.ts`). `.prompts` is retained for backward compatibility with agents authored
|
|
32
|
+
* before the move to `.agents`.
|
|
33
|
+
*/
|
|
34
|
+
export declare const CUSTOM_AGENT_WORKSPACE_DIRECTORIES: string[];
|
|
10
35
|
export declare enum CustomizationSource {
|
|
11
36
|
CUSTOMIZED = 1,
|
|
12
37
|
FOLDER = 2,
|
|
@@ -23,6 +48,12 @@ export interface PromptFragmentCustomizationProperties {
|
|
|
23
48
|
filePaths?: string[];
|
|
24
49
|
/** Array of file extensions to consider as template files */
|
|
25
50
|
extensions?: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Absolute parent directories scanned for custom agents (their `agents/` and legacy
|
|
53
|
+
* `customAgents.yml`), independent of {@link directoryPaths}. Resolved from
|
|
54
|
+
* {@link CUSTOM_AGENT_WORKSPACE_DIRECTORIES} against the workspace roots.
|
|
55
|
+
*/
|
|
56
|
+
agentDirectoryPaths?: string[];
|
|
26
57
|
}
|
|
27
58
|
/**
|
|
28
59
|
* Internal representation of a fragment entry in the customization service
|
|
@@ -62,6 +93,7 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
62
93
|
protected readonly openerService: OpenerService;
|
|
63
94
|
protected readonly inMemoryResources: ConfigurableInMemoryResources;
|
|
64
95
|
protected readonly workspaceService: WorkspaceService;
|
|
96
|
+
protected readonly logger: ILogger;
|
|
65
97
|
/** Stores URI strings of template files from directories currently being monitored for changes. */
|
|
66
98
|
protected trackedTemplateURIs: Set<string>;
|
|
67
99
|
/** Contains the currently active customization, mapped by prompt fragment ID. */
|
|
@@ -70,17 +102,37 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
70
102
|
protected allCustomizations: Map<string, PromptFragmentCustomization>;
|
|
71
103
|
/** Stores additional directory paths for loading template files. */
|
|
72
104
|
protected additionalTemplateDirs: Set<string>;
|
|
105
|
+
/**
|
|
106
|
+
* Built-in parent directories scanned for custom agents (`.agents`, `.prompts`), independent of
|
|
107
|
+
* {@link additionalTemplateDirs}. Insertion order is preserved so the first entry (`.agents`)
|
|
108
|
+
* acts as the default location for newly created agents.
|
|
109
|
+
*/
|
|
110
|
+
protected customAgentDirs: Set<string>;
|
|
73
111
|
/** Contains file extensions that identify prompt template files. */
|
|
74
112
|
protected templateExtensions: Set<string>;
|
|
75
113
|
/** Stores specific file paths, provided by the settings, that should be treated as templates. */
|
|
76
114
|
protected workspaceTemplateFiles: Set<string>;
|
|
77
115
|
/** Maps URI strings to WatchedFileInfo objects for individually watched template files. */
|
|
78
116
|
protected watchedFiles: Map<string, WatchedFileInfo>;
|
|
117
|
+
/**
|
|
118
|
+
* For each known custom-agent prompt fragment id (i.e. `<name>_prompt`), the URI of the
|
|
119
|
+
* agent's folder (`<scope>/agents/<id>/`). Populated as agents are loaded and used to
|
|
120
|
+
* route customization writes/reads into the agent folder.
|
|
121
|
+
*/
|
|
122
|
+
protected customAgentFolderByFragmentId: Map<string, URI>;
|
|
79
123
|
/** Collection of disposable resources for cleanup when the service updates or is disposed. */
|
|
80
124
|
protected toDispose: DisposableCollection;
|
|
81
125
|
protected readonly onDidChangePromptFragmentCustomizationEmitter: Emitter<string[]>;
|
|
82
126
|
readonly onDidChangePromptFragmentCustomization: Event<string[]>;
|
|
83
127
|
protected readonly onDidChangeCustomAgentsEmitter: Emitter<void>;
|
|
128
|
+
/**
|
|
129
|
+
* In-flight migration promise used to serialize {@link migrateCustomAgentsYaml} calls.
|
|
130
|
+
* Multiple sources (initial onStart, onDidChangeCustomAgents events from async template-dir
|
|
131
|
+
* population) can request migration before the first run finishes; without serialization
|
|
132
|
+
* they race on the same `customAgents.yml`, causing one rename to succeed and the others
|
|
133
|
+
* to fail with ENOENT while concurrently moving fragment files clobber each other.
|
|
134
|
+
*/
|
|
135
|
+
protected migrationInFlight: Promise<MigrationReport[]> | undefined;
|
|
84
136
|
readonly onDidChangeCustomAgents: Event<void>;
|
|
85
137
|
protected init(): void;
|
|
86
138
|
/**
|
|
@@ -160,6 +212,39 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
160
212
|
* @param customizationSource Source type of the customization
|
|
161
213
|
*/
|
|
162
214
|
protected processTemplateDirectory(activeCustomizationsCopy: Map<string, PromptFragmentCustomization>, trackedTemplateURIsCopy: Set<string>, allCustomizationsCopy: Map<string, PromptFragmentCustomization>, dirURI: URI, priority: number, customizationSource: CustomizationSource): Promise<void>;
|
|
215
|
+
/**
|
|
216
|
+
* Processes a built-in custom-agent scope (`.agents`/`.prompts`): registers the prompt fragments
|
|
217
|
+
* inside its `agents/<id>/` folders and watches the scope for changes. Unlike
|
|
218
|
+
* {@link processTemplateDirectory} it does not scan loose `*.prompttemplate` files in the scope
|
|
219
|
+
* root, so `.agents` does not become a general prompt-template directory.
|
|
220
|
+
* @param dirURI URI of the agent scope directory
|
|
221
|
+
* @param priority Priority level for customizations in this scope
|
|
222
|
+
* @param customizationSource Source type of the customization
|
|
223
|
+
*/
|
|
224
|
+
protected processCustomAgentScope(activeCustomizationsCopy: Map<string, PromptFragmentCustomization>, trackedTemplateURIsCopy: Set<string>, allCustomizationsCopy: Map<string, PromptFragmentCustomization>, dirURI: URI, priority: number, customizationSource: CustomizationSource): Promise<void>;
|
|
225
|
+
/**
|
|
226
|
+
* Scan `<dirURI>/agents/<id>/*.prompttemplate` files and register each as a customized
|
|
227
|
+
* prompt fragment so they appear in the Prompt Fragments configuration view and so
|
|
228
|
+
* `editPromptFragmentCustomization` / `removePromptFragmentCustomization` can find their
|
|
229
|
+
* source URIs.
|
|
230
|
+
*
|
|
231
|
+
* The reserved filename `prompt.prompttemplate` maps to the agent's default-variant
|
|
232
|
+
* fragment id (`<agent-name>_prompt` read from the sibling `agent.md`'s frontmatter).
|
|
233
|
+
* Any other `.prompttemplate` file uses its filename stem as the fragment id (matching
|
|
234
|
+
* how variants are registered via {@link readCustomAgentPromptVariants}).
|
|
235
|
+
*/
|
|
236
|
+
protected processCustomAgentFolders(activeCustomizationsCopy: Map<string, PromptFragmentCustomization>, trackedTemplateURIsCopy: Set<string>, allCustomizationsCopy: Map<string, PromptFragmentCustomization>, scopeDir: URI, priority: number, customizationSource: CustomizationSource): Promise<void>;
|
|
237
|
+
/**
|
|
238
|
+
* Return the parent URI when `resource` lives in `<scopeDirURI>/agents/<id>/`; otherwise
|
|
239
|
+
* undefined. Used to decide whether a newly-added file should be processed as a
|
|
240
|
+
* custom-agent prompt customization.
|
|
241
|
+
*/
|
|
242
|
+
protected matchesCustomAgentFolder(resource: URI, scopeDirURI: URI): URI | undefined;
|
|
243
|
+
/**
|
|
244
|
+
* Read `<agentFolderURI>/agent.md`'s frontmatter and return the implied default
|
|
245
|
+
* fragment id (`<name>_prompt`). Returns undefined if the file is missing or invalid.
|
|
246
|
+
*/
|
|
247
|
+
protected readCustomAgentDefaultFragmentId(agentFolderURI: URI): Promise<string | undefined>;
|
|
163
248
|
/**
|
|
164
249
|
* Processes an existing directory for template files
|
|
165
250
|
* @param activeCustomizationsCopy Map to store active customizations
|
|
@@ -170,13 +255,23 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
170
255
|
* @param customizationSource Source type of the customization
|
|
171
256
|
*/
|
|
172
257
|
protected processExistingTemplateDirectory(activeCustomizationsCopy: Map<string, PromptFragmentCustomization>, trackedTemplateURIsCopy: Set<string>, allCustomizationsCopy: Map<string, PromptFragmentCustomization>, dirURI: URI, priority: number, customizationSource: CustomizationSource): Promise<void>;
|
|
258
|
+
/**
|
|
259
|
+
* Whether a changed resource path affects custom agents, i.e. it is (or is inside) an `agents/`
|
|
260
|
+
* directory, or a legacy `customAgents.yml`. Matches the `agents` directory itself (e.g. when the
|
|
261
|
+
* whole folder is deleted), not only files within it, so removing `agents/` triggers a reload.
|
|
262
|
+
* @param path The string form of the changed resource URI
|
|
263
|
+
*/
|
|
264
|
+
protected isCustomAgentChange(path: string): boolean;
|
|
173
265
|
/**
|
|
174
266
|
* Sets up file watching for a template directory (works for both existing and non-existing directories)
|
|
175
267
|
* @param dirURI URI of the directory to watch
|
|
176
268
|
* @param priority Priority level for customizations in this directory
|
|
177
269
|
* @param customizationSource Source type of the customization
|
|
270
|
+
* @param agentsOnly When true, only `agents/<id>/` prompt files are registered on add; loose
|
|
271
|
+
* `*.prompttemplate` files in the scope root are ignored. Used for built-in agent scopes
|
|
272
|
+
* (`.agents`) that must not become general prompt-template directories.
|
|
178
273
|
*/
|
|
179
|
-
protected setupDirectoryWatcher(dirURI: URI, priority: number, customizationSource: CustomizationSource): void;
|
|
274
|
+
protected setupDirectoryWatcher(dirURI: URI, priority: number, customizationSource: CustomizationSource, agentsOnly?: boolean): void;
|
|
180
275
|
/**
|
|
181
276
|
* Checks if the given file extension is registered as a prompt template extension
|
|
182
277
|
* @param extension The file extension including the leading dot (e.g., '.prompttemplate')
|
|
@@ -209,6 +304,22 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
209
304
|
* @returns URI of the templates directory
|
|
210
305
|
*/
|
|
211
306
|
protected getTemplatesDirectoryURI(): Promise<URI>;
|
|
307
|
+
/**
|
|
308
|
+
* The additional (workspace) template directories as URIs, excluding any that resolves to the
|
|
309
|
+
* same location as `excluding` (typically the global templates directory). A user can point
|
|
310
|
+
* both the `promptTemplates` preference and a workspace template directory at the same path;
|
|
311
|
+
* processing that scope twice would hide priority-1 customizations behind priority-2 copies
|
|
312
|
+
* (see {@link update}) or list the same scope twice in the agent-location picker.
|
|
313
|
+
*/
|
|
314
|
+
protected getDedupedAdditionalScopes(excluding: URI): URI[];
|
|
315
|
+
/**
|
|
316
|
+
* The deduplicated parent directories scanned for custom agents, in precedence order:
|
|
317
|
+
* the built-in {@link customAgentDirs} (`.agents` then `.prompts`) first, so `.agents` is both
|
|
318
|
+
* the discovery winner and the default creation target; then any configured
|
|
319
|
+
* {@link additionalTemplateDirs} that may also hold agents; then the global templates directory.
|
|
320
|
+
* Independent of the prompt-templates preference, mirroring how skills resolve their folders.
|
|
321
|
+
*/
|
|
322
|
+
protected getCustomAgentScopes(): Promise<URI[]>;
|
|
212
323
|
/**
|
|
213
324
|
* Gets the URI for a specific template file
|
|
214
325
|
* @param fragmentId The fragment ID
|
|
@@ -262,27 +373,93 @@ export declare class DefaultPromptFragmentCustomizationService implements Prompt
|
|
|
262
373
|
getPromptFragmentIDFromResource(resourceId: unknown): string | undefined;
|
|
263
374
|
getCustomAgents(): Promise<CustomAgentDescription[]>;
|
|
264
375
|
/**
|
|
265
|
-
* Load custom agents from
|
|
266
|
-
*
|
|
267
|
-
*
|
|
376
|
+
* Load custom agents from `<parentDirectory>/agents/<id>/agent.md`. Each immediate
|
|
377
|
+
* subdirectory under `agents/` defines one custom agent: the folder name is the
|
|
378
|
+
* agent id (single source of truth), the file's YAML frontmatter holds the metadata,
|
|
379
|
+
* and the body is the prompt text. Folders without a readable `agent.md` are skipped.
|
|
268
380
|
*/
|
|
269
|
-
protected
|
|
381
|
+
protected loadCustomAgentsFromAgentsDirectory(parentDirectory: URI, agentsById: Map<string, CustomAgentDescription>): Promise<void>;
|
|
382
|
+
protected readCustomAgentFile(agentFolderURI: URI): Promise<CustomAgentDescription | undefined>;
|
|
270
383
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
|
|
384
|
+
* Remove `<scopeDir>/agents/<id>/` directories that contain no `agent.md`. They are usually
|
|
385
|
+
* the leftover side effect of a previous migration whose `agent.md` write failed after the
|
|
386
|
+
* parent directory had already been created. Removing them lets the next run re-attempt.
|
|
387
|
+
*/
|
|
388
|
+
protected cleanupEmptyAgentFolders(scopeDir: URI): Promise<void>;
|
|
389
|
+
/**
|
|
390
|
+
* List `.prompttemplate` files directly inside the given scope directory (one level only).
|
|
391
|
+
* Returns each file's URI along with its filename stem to enable cheap prefix matching
|
|
392
|
+
* during migration.
|
|
275
393
|
*/
|
|
276
|
-
|
|
394
|
+
protected listScopeRootPromptTemplates(scopeDir: URI): Promise<Array<{
|
|
277
395
|
uri: URI;
|
|
278
|
-
|
|
279
|
-
}
|
|
396
|
+
stem: string;
|
|
397
|
+
}>>;
|
|
280
398
|
/**
|
|
281
|
-
*
|
|
399
|
+
* Scan an agent folder for sibling `.prompttemplate` files; each becomes a variant
|
|
400
|
+
* of the agent's prompt. Variant id = filename stem (e.g. `concise.prompttemplate`
|
|
401
|
+
* yields a variant with id `concise`). Files inside subdirectories are ignored.
|
|
282
402
|
*
|
|
283
|
-
*
|
|
403
|
+
* The reserved filename `prompt.prompttemplate` is excluded: it represents the
|
|
404
|
+
* default-variant customization (overrides `agent.md`'s body), not an extra variant,
|
|
405
|
+
* and is registered by the prompt-fragment customization scan instead.
|
|
406
|
+
*/
|
|
407
|
+
protected readCustomAgentPromptVariants(agentFolderURI: URI): Promise<CustomAgentPromptVariant[]>;
|
|
408
|
+
/**
|
|
409
|
+
* @deprecated Reads legacy `customAgents.yml` files. New agents should live under
|
|
410
|
+
* `<scope>/agents/<id>/agent.md`. Kept as a fallback until existing files have been
|
|
411
|
+
* auto-migrated; loader logs a one-time warning per scope when it finds one.
|
|
412
|
+
*/
|
|
413
|
+
protected loadCustomAgentsFromDirectory(directoryURI: URI, agentsById: Map<string, CustomAgentDescription>): Promise<void>;
|
|
414
|
+
private readonly warnedLegacyYamlUris;
|
|
415
|
+
protected warnOnceLegacyYaml(uri: URI): void;
|
|
416
|
+
/**
|
|
417
|
+
* Returns all locations of existing customAgents.yml files and `agents/` directories,
|
|
418
|
+
* plus the canonical locations where new agents would be created (one per scope). Scopes are
|
|
419
|
+
* returned in precedence order, so the first `agents-dir` entry is the default creation target.
|
|
420
|
+
*/
|
|
421
|
+
getCustomAgentsLocations(): Promise<CustomAgentsLocation[]>;
|
|
422
|
+
/**
|
|
423
|
+
* Creates `<parentDirectory>/agents/<id>/agent.md` from a `CustomAgentDescription` and opens it.
|
|
424
|
+
* The agent id determines the folder name; the prompt body is written verbatim under the YAML frontmatter.
|
|
425
|
+
*/
|
|
426
|
+
createCustomAgentFile(parentDirectory: URI, agent: CustomAgentDescription): Promise<URI>;
|
|
427
|
+
/**
|
|
428
|
+
* Auto-migrate every legacy `customAgents.yml` reachable from the configured scopes to the new
|
|
429
|
+
* `agents/<id>/agent.md` layout. The original content is never deleted:
|
|
430
|
+
* - on full success the YAML is renamed to `customAgents.yml.bak`, replacing any previous backup;
|
|
431
|
+
* - on partial failure the YAML is renamed to `customAgents.yml.bak` only if no backup exists yet;
|
|
432
|
+
* if one already exists the YAML is left in place, so the loader keeps serving it and the next
|
|
433
|
+
* startup retries the migration.
|
|
434
|
+
*
|
|
435
|
+
* Idempotent: rerunning never overwrites an already-migrated agent file.
|
|
436
|
+
*/
|
|
437
|
+
migrateCustomAgentsYaml(): Promise<MigrationReport[]>;
|
|
438
|
+
protected doMigrateCustomAgentsYaml(): Promise<MigrationReport[]>;
|
|
439
|
+
protected migrateSingleScope(scopeDir: URI): Promise<MigrationReport | undefined>;
|
|
440
|
+
/**
|
|
441
|
+
* @deprecated Use {@link createCustomAgentFile} to author agents in the new
|
|
442
|
+
* `<scope>/agents/<id>/agent.md` layout. Retained so existing UI affordances keep
|
|
443
|
+
* working until they are migrated.
|
|
284
444
|
*/
|
|
285
445
|
openCustomAgentYaml(uri: URI): Promise<void>;
|
|
286
446
|
}
|
|
447
|
+
/**
|
|
448
|
+
* Outcome of attempting to migrate one scope's `customAgents.yml`.
|
|
449
|
+
*/
|
|
450
|
+
export interface MigrationReport {
|
|
451
|
+
scope: URI;
|
|
452
|
+
yamlURI: URI;
|
|
453
|
+
/** Number of agents written to `agents/<id>/agent.md`. */
|
|
454
|
+
migrated: number;
|
|
455
|
+
/** Number of agents skipped because an `agent.md` already existed (idempotency). */
|
|
456
|
+
alreadyPresent: number;
|
|
457
|
+
/** Number of agents whose new file failed to write. */
|
|
458
|
+
failed: number;
|
|
459
|
+
/** Whether the original YAML was renamed to `customAgents.yml.bak` during this run. */
|
|
460
|
+
yamlBackedUp: boolean;
|
|
461
|
+
/** Number of scope-root prompt customization files (`<name>_prompt.prompttemplate`) folded into agent.md and deleted. */
|
|
462
|
+
promptOverridesMigrated: number;
|
|
463
|
+
}
|
|
287
464
|
export {};
|
|
288
465
|
//# sourceMappingURL=frontend-prompt-customization-service.d.ts.map
|