@theia/ai-core 1.67.0-next.13 → 1.67.0-next.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/data/prompttemplate.tmLanguage.json +3 -0
- package/package.json +9 -9
- package/src/browser/frontend-language-model-alias-registry.ts +11 -11
- package/src/common/agent-service.ts +6 -6
- package/src/common/prompt-service.ts +6 -2
- package/lib/browser/agent-completion-notification-service.d.ts +0 -69
- package/lib/browser/agent-completion-notification-service.d.ts.map +0 -1
- package/lib/browser/agent-completion-notification-service.js +0 -187
- package/lib/browser/agent-completion-notification-service.js.map +0 -1
- package/lib/browser/ai-activation-service.d.ts +0 -31
- package/lib/browser/ai-activation-service.d.ts.map +0 -1
- package/lib/browser/ai-activation-service.js +0 -56
- package/lib/browser/ai-activation-service.js.map +0 -1
- package/lib/browser/ai-command-handler-factory.d.ts +0 -4
- package/lib/browser/ai-command-handler-factory.d.ts.map +0 -1
- package/lib/browser/ai-command-handler-factory.js +0 -20
- package/lib/browser/ai-command-handler-factory.js.map +0 -1
- package/lib/browser/ai-core-command-contribution.d.ts +0 -8
- package/lib/browser/ai-core-command-contribution.d.ts.map +0 -1
- package/lib/browser/ai-core-command-contribution.js +0 -44
- package/lib/browser/ai-core-command-contribution.js.map +0 -1
- package/lib/browser/ai-core-frontend-application-contribution.d.ts +0 -10
- package/lib/browser/ai-core-frontend-application-contribution.d.ts.map +0 -1
- package/lib/browser/ai-core-frontend-application-contribution.js +0 -46
- package/lib/browser/ai-core-frontend-application-contribution.js.map +0 -1
- package/lib/browser/ai-core-frontend-module.d.ts +0 -4
- package/lib/browser/ai-core-frontend-module.d.ts.map +0 -1
- package/lib/browser/ai-core-frontend-module.js +0 -137
- package/lib/browser/ai-core-frontend-module.js.map +0 -1
- package/lib/browser/ai-settings-service.d.ts +0 -16
- package/lib/browser/ai-settings-service.d.ts.map +0 -1
- package/lib/browser/ai-settings-service.js +0 -78
- package/lib/browser/ai-settings-service.js.map +0 -1
- package/lib/browser/ai-variable-uri-label-provider.d.ts +0 -17
- package/lib/browser/ai-variable-uri-label-provider.d.ts.map +0 -1
- package/lib/browser/ai-variable-uri-label-provider.js +0 -85
- package/lib/browser/ai-variable-uri-label-provider.js.map +0 -1
- package/lib/browser/ai-view-contribution.d.ts +0 -14
- package/lib/browser/ai-view-contribution.d.ts.map +0 -1
- package/lib/browser/ai-view-contribution.js +0 -87
- package/lib/browser/ai-view-contribution.js.map +0 -1
- package/lib/browser/file-variable-contribution.d.ts +0 -23
- package/lib/browser/file-variable-contribution.d.ts.map +0 -1
- package/lib/browser/file-variable-contribution.js +0 -114
- package/lib/browser/file-variable-contribution.js.map +0 -1
- package/lib/browser/frontend-language-model-alias-registry.d.ts +0 -31
- package/lib/browser/frontend-language-model-alias-registry.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-alias-registry.js +0 -170
- package/lib/browser/frontend-language-model-alias-registry.js.map +0 -1
- package/lib/browser/frontend-language-model-registry.d.ts +0 -49
- package/lib/browser/frontend-language-model-registry.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-registry.js +0 -387
- package/lib/browser/frontend-language-model-registry.js.map +0 -1
- package/lib/browser/frontend-language-model-registry.spec.d.ts +0 -2
- package/lib/browser/frontend-language-model-registry.spec.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-registry.spec.js +0 -248
- package/lib/browser/frontend-language-model-registry.spec.js.map +0 -1
- package/lib/browser/frontend-language-model-service.d.ts +0 -10
- package/lib/browser/frontend-language-model-service.d.ts.map +0 -1
- package/lib/browser/frontend-language-model-service.js +0 -66
- package/lib/browser/frontend-language-model-service.js.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.d.ts +0 -271
- package/lib/browser/frontend-prompt-customization-service.d.ts.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.js +0 -869
- package/lib/browser/frontend-prompt-customization-service.js.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts +0 -2
- package/lib/browser/frontend-prompt-customization-service.spec.d.ts.map +0 -1
- package/lib/browser/frontend-prompt-customization-service.spec.js +0 -127
- package/lib/browser/frontend-prompt-customization-service.spec.js.map +0 -1
- package/lib/browser/frontend-variable-service.d.ts +0 -61
- package/lib/browser/frontend-variable-service.d.ts.map +0 -1
- package/lib/browser/frontend-variable-service.js +0 -165
- package/lib/browser/frontend-variable-service.js.map +0 -1
- package/lib/browser/index.d.ts +0 -20
- package/lib/browser/index.d.ts.map +0 -1
- package/lib/browser/index.js +0 -38
- package/lib/browser/index.js.map +0 -1
- package/lib/browser/open-editors-variable-contribution.d.ts +0 -17
- package/lib/browser/open-editors-variable-contribution.d.ts.map +0 -1
- package/lib/browser/open-editors-variable-contribution.js +0 -84
- package/lib/browser/open-editors-variable-contribution.js.map +0 -1
- package/lib/browser/os-notification-service.d.ts +0 -96
- package/lib/browser/os-notification-service.d.ts.map +0 -1
- package/lib/browser/os-notification-service.js +0 -222
- package/lib/browser/os-notification-service.js.map +0 -1
- package/lib/browser/prompttemplate-contribution.d.ts +0 -29
- package/lib/browser/prompttemplate-contribution.d.ts.map +0 -1
- package/lib/browser/prompttemplate-contribution.js +0 -243
- package/lib/browser/prompttemplate-contribution.js.map +0 -1
- package/lib/browser/prompttemplate-parser.d.ts +0 -36
- package/lib/browser/prompttemplate-parser.d.ts.map +0 -1
- package/lib/browser/prompttemplate-parser.js +0 -94
- package/lib/browser/prompttemplate-parser.js.map +0 -1
- package/lib/browser/theia-variable-contribution.d.ts +0 -26
- package/lib/browser/theia-variable-contribution.d.ts.map +0 -1
- package/lib/browser/theia-variable-contribution.js +0 -146
- package/lib/browser/theia-variable-contribution.js.map +0 -1
- package/lib/browser/token-usage-frontend-service-impl.d.ts +0 -25
- package/lib/browser/token-usage-frontend-service-impl.d.ts.map +0 -1
- package/lib/browser/token-usage-frontend-service-impl.js +0 -138
- package/lib/browser/token-usage-frontend-service-impl.js.map +0 -1
- package/lib/browser/token-usage-frontend-service.d.ts +0 -33
- package/lib/browser/token-usage-frontend-service.d.ts.map +0 -1
- package/lib/browser/token-usage-frontend-service.js +0 -23
- package/lib/browser/token-usage-frontend-service.js.map +0 -1
- package/lib/browser/window-blink-service.d.ts +0 -41
- package/lib/browser/window-blink-service.d.ts.map +0 -1
- package/lib/browser/window-blink-service.js +0 -174
- package/lib/browser/window-blink-service.js.map +0 -1
- package/lib/common/agent-preferences.d.ts +0 -4
- package/lib/common/agent-preferences.d.ts.map +0 -1
- package/lib/common/agent-preferences.js +0 -84
- package/lib/common/agent-preferences.js.map +0 -1
- package/lib/common/agent-service.d.ts +0 -66
- package/lib/common/agent-service.d.ts.map +0 -1
- package/lib/common/agent-service.js +0 -104
- package/lib/common/agent-service.js.map +0 -1
- package/lib/common/agent.d.ts +0 -72
- package/lib/common/agent.d.ts.map +0 -1
- package/lib/common/agent.js +0 -20
- package/lib/common/agent.js.map +0 -1
- package/lib/common/agents-variable-contribution.d.ts +0 -19
- package/lib/common/agents-variable-contribution.d.ts.map +0 -1
- package/lib/common/agents-variable-contribution.js +0 -57
- package/lib/common/agents-variable-contribution.js.map +0 -1
- package/lib/common/ai-core-preferences.d.ts +0 -48
- package/lib/common/ai-core-preferences.d.ts.map +0 -1
- package/lib/common/ai-core-preferences.js +0 -204
- package/lib/common/ai-core-preferences.js.map +0 -1
- package/lib/common/ai-variable-resource.d.ts +0 -18
- package/lib/common/ai-variable-resource.d.ts.map +0 -1
- package/lib/common/ai-variable-resource.js +0 -103
- package/lib/common/ai-variable-resource.js.map +0 -1
- package/lib/common/configurable-in-memory-resources.d.ts +0 -47
- package/lib/common/configurable-in-memory-resources.d.ts.map +0 -1
- package/lib/common/configurable-in-memory-resources.js +0 -154
- package/lib/common/configurable-in-memory-resources.js.map +0 -1
- package/lib/common/index.d.ts +0 -22
- package/lib/common/index.d.ts.map +0 -1
- package/lib/common/index.js +0 -40
- package/lib/common/index.js.map +0 -1
- package/lib/common/language-model-alias.d.ts +0 -58
- package/lib/common/language-model-alias.d.ts.map +0 -1
- package/lib/common/language-model-alias.js +0 -20
- package/lib/common/language-model-alias.js.map +0 -1
- package/lib/common/language-model-delegate.d.ts +0 -25
- package/lib/common/language-model-delegate.d.ts.map +0 -1
- package/lib/common/language-model-delegate.js +0 -26
- package/lib/common/language-model-delegate.js.map +0 -1
- package/lib/common/language-model-interaction-model.d.ts +0 -74
- package/lib/common/language-model-interaction-model.d.ts.map +0 -1
- package/lib/common/language-model-interaction-model.js +0 -3
- package/lib/common/language-model-interaction-model.js.map +0 -1
- package/lib/common/language-model-service.d.ts +0 -38
- package/lib/common/language-model-service.d.ts.map +0 -1
- package/lib/common/language-model-service.js +0 -128
- package/lib/common/language-model-service.js.map +0 -1
- package/lib/common/language-model-util.d.ts +0 -17
- package/lib/common/language-model-util.d.ts.map +0 -1
- package/lib/common/language-model-util.js +0 -82
- package/lib/common/language-model-util.js.map +0 -1
- package/lib/common/language-model.d.ts +0 -285
- package/lib/common/language-model.d.ts.map +0 -1
- package/lib/common/language-model.js +0 -248
- package/lib/common/language-model.js.map +0 -1
- package/lib/common/language-model.spec.d.ts +0 -2
- package/lib/common/language-model.spec.d.ts.map +0 -1
- package/lib/common/language-model.spec.js +0 -62
- package/lib/common/language-model.spec.js.map +0 -1
- package/lib/common/notification-types.d.ts +0 -7
- package/lib/common/notification-types.d.ts.map +0 -1
- package/lib/common/notification-types.js +0 -29
- package/lib/common/notification-types.js.map +0 -1
- package/lib/common/prompt-service-util.d.ts +0 -8
- package/lib/common/prompt-service-util.d.ts.map +0 -1
- package/lib/common/prompt-service-util.js +0 -34
- package/lib/common/prompt-service-util.js.map +0 -1
- package/lib/common/prompt-service.d.ts +0 -466
- package/lib/common/prompt-service.d.ts.map +0 -1
- package/lib/common/prompt-service.js +0 -653
- package/lib/common/prompt-service.js.map +0 -1
- package/lib/common/prompt-service.spec.d.ts +0 -2
- package/lib/common/prompt-service.spec.d.ts.map +0 -1
- package/lib/common/prompt-service.spec.js +0 -431
- package/lib/common/prompt-service.spec.js.map +0 -1
- package/lib/common/prompt-text.d.ts +0 -8
- package/lib/common/prompt-text.d.ts.map +0 -1
- package/lib/common/prompt-text.js +0 -27
- package/lib/common/prompt-text.js.map +0 -1
- package/lib/common/prompt-variable-contribution.d.ts +0 -18
- package/lib/common/prompt-variable-contribution.d.ts.map +0 -1
- package/lib/common/prompt-variable-contribution.js +0 -207
- package/lib/common/prompt-variable-contribution.js.map +0 -1
- package/lib/common/prompt-variable-contribution.spec.d.ts +0 -2
- package/lib/common/prompt-variable-contribution.spec.d.ts.map +0 -1
- package/lib/common/prompt-variable-contribution.spec.js +0 -163
- package/lib/common/prompt-variable-contribution.spec.js.map +0 -1
- package/lib/common/protocol.d.ts +0 -25
- package/lib/common/protocol.d.ts.map +0 -1
- package/lib/common/protocol.js +0 -22
- package/lib/common/protocol.js.map +0 -1
- package/lib/common/settings-service.d.ts +0 -29
- package/lib/common/settings-service.d.ts.map +0 -1
- package/lib/common/settings-service.js +0 -5
- package/lib/common/settings-service.js.map +0 -1
- package/lib/common/today-variable-contribution.d.ts +0 -17
- package/lib/common/today-variable-contribution.d.ts.map +0 -1
- package/lib/common/today-variable-contribution.js +0 -68
- package/lib/common/today-variable-contribution.js.map +0 -1
- package/lib/common/token-usage-service.d.ts +0 -43
- package/lib/common/token-usage-service.d.ts.map +0 -1
- package/lib/common/token-usage-service.js +0 -20
- package/lib/common/token-usage-service.js.map +0 -1
- package/lib/common/tool-invocation-registry.d.ts +0 -66
- package/lib/common/tool-invocation-registry.d.ts.map +0 -1
- package/lib/common/tool-invocation-registry.js +0 -101
- package/lib/common/tool-invocation-registry.js.map +0 -1
- package/lib/common/variable-service.d.ts +0 -172
- package/lib/common/variable-service.d.ts.map +0 -1
- package/lib/common/variable-service.js +0 -287
- package/lib/common/variable-service.js.map +0 -1
- package/lib/common/variable-service.spec.d.ts +0 -2
- package/lib/common/variable-service.spec.d.ts.map +0 -1
- package/lib/common/variable-service.spec.js +0 -237
- package/lib/common/variable-service.spec.js.map +0 -1
- package/lib/node/ai-core-backend-module.d.ts +0 -4
- package/lib/node/ai-core-backend-module.d.ts.map +0 -1
- package/lib/node/ai-core-backend-module.js +0 -65
- package/lib/node/ai-core-backend-module.js.map +0 -1
- package/lib/node/backend-language-model-registry.d.ts +0 -13
- package/lib/node/backend-language-model-registry.d.ts.map +0 -1
- package/lib/node/backend-language-model-registry.js +0 -68
- package/lib/node/backend-language-model-registry.js.map +0 -1
- package/lib/node/language-model-frontend-delegate.d.ts +0 -18
- package/lib/node/language-model-frontend-delegate.d.ts.map +0 -1
- package/lib/node/language-model-frontend-delegate.js +0 -109
- package/lib/node/language-model-frontend-delegate.js.map +0 -1
- package/lib/node/token-usage-service-impl.d.ts +0 -23
- package/lib/node/token-usage-service-impl.d.ts.map +0 -1
- package/lib/node/token-usage-service-impl.js +0 -78
- package/lib/node/token-usage-service-impl.js.map +0 -1
- package/lib/node/tool-request-parameters.spec.d.ts +0 -2
- package/lib/node/tool-request-parameters.spec.d.ts.map +0 -1
- package/lib/node/tool-request-parameters.spec.js +0 -116
- package/lib/node/tool-request-parameters.spec.js.map +0 -1
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.OpenEditorsVariableContribution = exports.OPEN_EDITORS_SHORT_VARIABLE = exports.OPEN_EDITORS_VARIABLE = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const core_1 = require("@theia/core");
|
|
21
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
22
|
-
const browser_1 = require("@theia/editor/lib/browser");
|
|
23
|
-
const browser_2 = require("@theia/workspace/lib/browser");
|
|
24
|
-
exports.OPEN_EDITORS_VARIABLE = {
|
|
25
|
-
id: 'openEditors',
|
|
26
|
-
description: core_1.nls.localize('theia/ai/core/openEditorsVariable/description', 'A comma-separated list of all currently open files, relative to the workspace root.'),
|
|
27
|
-
name: 'openEditors',
|
|
28
|
-
};
|
|
29
|
-
exports.OPEN_EDITORS_SHORT_VARIABLE = {
|
|
30
|
-
id: 'openEditorsShort',
|
|
31
|
-
description: core_1.nls.localize('theia/ai/core/openEditorsShortVariable/description', 'Short reference to all currently open files (relative paths, comma-separated)'),
|
|
32
|
-
name: '_ff',
|
|
33
|
-
};
|
|
34
|
-
let OpenEditorsVariableContribution = class OpenEditorsVariableContribution {
|
|
35
|
-
registerVariables(service) {
|
|
36
|
-
service.registerResolver(exports.OPEN_EDITORS_VARIABLE, this);
|
|
37
|
-
service.registerResolver(exports.OPEN_EDITORS_SHORT_VARIABLE, this);
|
|
38
|
-
}
|
|
39
|
-
canResolve(request, _context) {
|
|
40
|
-
return (request.variable.name === exports.OPEN_EDITORS_VARIABLE.name || request.variable.name === exports.OPEN_EDITORS_SHORT_VARIABLE.name) ? 50 : 0;
|
|
41
|
-
}
|
|
42
|
-
async resolve(request, _context) {
|
|
43
|
-
if (request.variable.name !== exports.OPEN_EDITORS_VARIABLE.name && request.variable.name !== exports.OPEN_EDITORS_SHORT_VARIABLE.name) {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
const openFiles = this.getAllOpenFilesRelative();
|
|
47
|
-
return {
|
|
48
|
-
variable: request.variable,
|
|
49
|
-
value: openFiles
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
getAllOpenFilesRelative() {
|
|
53
|
-
const openFiles = [];
|
|
54
|
-
// Get all open editors from the editor manager
|
|
55
|
-
for (const editor of this.editorManager.all) {
|
|
56
|
-
const uri = editor.getResourceUri();
|
|
57
|
-
if (uri) {
|
|
58
|
-
const relativePath = this.getWorkspaceRelativePath(uri);
|
|
59
|
-
if (relativePath) {
|
|
60
|
-
openFiles.push(`'${relativePath}'`);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return openFiles.join(', ');
|
|
65
|
-
}
|
|
66
|
-
getWorkspaceRelativePath(uri) {
|
|
67
|
-
const workspaceRootUri = this.workspaceService.getWorkspaceRootUri(uri);
|
|
68
|
-
const path = workspaceRootUri && workspaceRootUri.path.relative(uri.path);
|
|
69
|
-
return path && path.toString();
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
exports.OpenEditorsVariableContribution = OpenEditorsVariableContribution;
|
|
73
|
-
tslib_1.__decorate([
|
|
74
|
-
(0, inversify_1.inject)(browser_1.EditorManager),
|
|
75
|
-
tslib_1.__metadata("design:type", browser_1.EditorManager)
|
|
76
|
-
], OpenEditorsVariableContribution.prototype, "editorManager", void 0);
|
|
77
|
-
tslib_1.__decorate([
|
|
78
|
-
(0, inversify_1.inject)(browser_2.WorkspaceService),
|
|
79
|
-
tslib_1.__metadata("design:type", browser_2.WorkspaceService)
|
|
80
|
-
], OpenEditorsVariableContribution.prototype, "workspaceService", void 0);
|
|
81
|
-
exports.OpenEditorsVariableContribution = OpenEditorsVariableContribution = tslib_1.__decorate([
|
|
82
|
-
(0, inversify_1.injectable)()
|
|
83
|
-
], OpenEditorsVariableContribution);
|
|
84
|
-
//# sourceMappingURL=open-editors-variable-contribution.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-editors-variable-contribution.js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sBAAU,GAAE;GACA,+BAA+B,CAmD3C"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Configuration options for OS notifications
|
|
3
|
-
*/
|
|
4
|
-
export interface OSNotificationOptions {
|
|
5
|
-
/** The notification body text */
|
|
6
|
-
body?: string;
|
|
7
|
-
/** Icon to display with the notification */
|
|
8
|
-
icon?: string;
|
|
9
|
-
/** Whether the notification should be silent */
|
|
10
|
-
silent?: boolean;
|
|
11
|
-
/** Tag to group notifications */
|
|
12
|
-
tag?: string;
|
|
13
|
-
/** Whether the notification requires user interaction to dismiss */
|
|
14
|
-
requireInteraction?: boolean;
|
|
15
|
-
/** Custom data to associate with the notification */
|
|
16
|
-
data?: unknown;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Result of an OS notification attempt
|
|
20
|
-
*/
|
|
21
|
-
export interface OSNotificationResult {
|
|
22
|
-
/** Whether the notification was successfully shown */
|
|
23
|
-
success: boolean;
|
|
24
|
-
/** Error message if the notification failed */
|
|
25
|
-
error?: string;
|
|
26
|
-
/** The created notification instance (if successful) */
|
|
27
|
-
notification?: Notification;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Service to handle OS-level notifications across different platforms
|
|
31
|
-
* Provides fallback mechanisms for environments where notifications are unavailable
|
|
32
|
-
*/
|
|
33
|
-
export declare class OSNotificationService {
|
|
34
|
-
private isElectron;
|
|
35
|
-
constructor();
|
|
36
|
-
/**
|
|
37
|
-
* Show an OS-level notification with the given title and options
|
|
38
|
-
*
|
|
39
|
-
* @param title The notification title
|
|
40
|
-
* @param options Optional notification configuration
|
|
41
|
-
* @returns Promise resolving to the notification result
|
|
42
|
-
*/
|
|
43
|
-
showNotification(title: string, options?: OSNotificationOptions): Promise<OSNotificationResult>;
|
|
44
|
-
/**
|
|
45
|
-
* Check if notification permission is granted
|
|
46
|
-
*
|
|
47
|
-
* @returns The current notification permission state
|
|
48
|
-
*/
|
|
49
|
-
getPermissionStatus(): NotificationPermission;
|
|
50
|
-
/**
|
|
51
|
-
* Request notification permission from the user
|
|
52
|
-
*
|
|
53
|
-
* @returns Promise resolving to the permission state
|
|
54
|
-
*/
|
|
55
|
-
requestPermission(): Promise<NotificationPermission>;
|
|
56
|
-
/**
|
|
57
|
-
* Check if OS notifications are supported in the current environment
|
|
58
|
-
*
|
|
59
|
-
* @returns true if notifications are supported, false otherwise
|
|
60
|
-
*/
|
|
61
|
-
isNotificationSupported(): boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Show a notification specifically for agent completion
|
|
64
|
-
* This is a convenience method with pre-configured options for agent notifications
|
|
65
|
-
*
|
|
66
|
-
* @param agentName The name of the agent that completed
|
|
67
|
-
* @param taskDescription Optional description of the completed task
|
|
68
|
-
* @returns Promise resolving to the notification result
|
|
69
|
-
*/
|
|
70
|
-
showAgentCompletionNotification(agentName: string, taskDescription?: string): Promise<OSNotificationResult>;
|
|
71
|
-
/**
|
|
72
|
-
* Ensure notification permission is granted
|
|
73
|
-
*
|
|
74
|
-
* @returns Promise resolving to the permission state
|
|
75
|
-
*/
|
|
76
|
-
private ensurePermission;
|
|
77
|
-
/**
|
|
78
|
-
* Create a native notification with the given title and options
|
|
79
|
-
*
|
|
80
|
-
* @param title The notification title
|
|
81
|
-
* @param options The notification options
|
|
82
|
-
* @returns Promise resolving to the created notification
|
|
83
|
-
*/
|
|
84
|
-
private createNotification;
|
|
85
|
-
/**
|
|
86
|
-
* Attempt to focus the application window when notification is clicked
|
|
87
|
-
*/
|
|
88
|
-
private focusApplicationWindow;
|
|
89
|
-
/**
|
|
90
|
-
* Get the icon URL for agent completion notifications
|
|
91
|
-
*
|
|
92
|
-
* @returns The icon URL or undefined if not available
|
|
93
|
-
*/
|
|
94
|
-
private getAgentCompletionIcon;
|
|
95
|
-
}
|
|
96
|
-
//# sourceMappingURL=os-notification-service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"os-notification-service.d.ts","sourceRoot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strict";
|
|
2
|
-
// *****************************************************************************
|
|
3
|
-
// Copyright (C) 2025 EclipseSource GmbH.
|
|
4
|
-
//
|
|
5
|
-
// This program and the accompanying materials are made available under the
|
|
6
|
-
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
-
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
-
//
|
|
9
|
-
// This Source Code may also be made available under the following Secondary
|
|
10
|
-
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
-
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
-
// with the GNU Classpath Exception which is available at
|
|
13
|
-
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
-
//
|
|
15
|
-
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
-
// *****************************************************************************
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.OSNotificationService = void 0;
|
|
19
|
-
const tslib_1 = require("tslib");
|
|
20
|
-
const inversify_1 = require("@theia/core/shared/inversify");
|
|
21
|
-
const nls_1 = require("@theia/core/lib/common/nls");
|
|
22
|
-
const core_1 = require("@theia/core");
|
|
23
|
-
/**
|
|
24
|
-
* Service to handle OS-level notifications across different platforms
|
|
25
|
-
* Provides fallback mechanisms for environments where notifications are unavailable
|
|
26
|
-
*/
|
|
27
|
-
let OSNotificationService = class OSNotificationService {
|
|
28
|
-
constructor() {
|
|
29
|
-
this.isElectron = core_1.environment.electron.is();
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Show an OS-level notification with the given title and options
|
|
33
|
-
*
|
|
34
|
-
* @param title The notification title
|
|
35
|
-
* @param options Optional notification configuration
|
|
36
|
-
* @returns Promise resolving to the notification result
|
|
37
|
-
*/
|
|
38
|
-
async showNotification(title, options = {}) {
|
|
39
|
-
try {
|
|
40
|
-
if (!this.isNotificationSupported()) {
|
|
41
|
-
return {
|
|
42
|
-
success: false,
|
|
43
|
-
error: 'Notifications are not supported in this environment'
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
const permission = await this.ensurePermission();
|
|
47
|
-
if (permission !== 'granted') {
|
|
48
|
-
return {
|
|
49
|
-
success: false,
|
|
50
|
-
error: `Notification permission ${permission}`
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const notification = await this.createNotification(title, options);
|
|
54
|
-
return {
|
|
55
|
-
success: true,
|
|
56
|
-
notification
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
catch (error) {
|
|
60
|
-
console.error('Failed to show OS notification:', error);
|
|
61
|
-
return {
|
|
62
|
-
success: false,
|
|
63
|
-
error: error instanceof Error ? error.message : 'Unknown error occurred'
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Check if notification permission is granted
|
|
69
|
-
*
|
|
70
|
-
* @returns The current notification permission state
|
|
71
|
-
*/
|
|
72
|
-
getPermissionStatus() {
|
|
73
|
-
if (!this.isNotificationSupported()) {
|
|
74
|
-
return 'denied';
|
|
75
|
-
}
|
|
76
|
-
return Notification.permission;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Request notification permission from the user
|
|
80
|
-
*
|
|
81
|
-
* @returns Promise resolving to the permission state
|
|
82
|
-
*/
|
|
83
|
-
async requestPermission() {
|
|
84
|
-
if (!this.isNotificationSupported()) {
|
|
85
|
-
return 'denied';
|
|
86
|
-
}
|
|
87
|
-
if (Notification.permission !== 'default') {
|
|
88
|
-
return Notification.permission;
|
|
89
|
-
}
|
|
90
|
-
try {
|
|
91
|
-
const permission = await Notification.requestPermission();
|
|
92
|
-
return permission;
|
|
93
|
-
}
|
|
94
|
-
catch (error) {
|
|
95
|
-
console.error('Failed to request notification permission:', error);
|
|
96
|
-
return 'denied';
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Check if OS notifications are supported in the current environment
|
|
101
|
-
*
|
|
102
|
-
* @returns true if notifications are supported, false otherwise
|
|
103
|
-
*/
|
|
104
|
-
isNotificationSupported() {
|
|
105
|
-
return typeof window !== 'undefined' && 'Notification' in window;
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* Show a notification specifically for agent completion
|
|
109
|
-
* This is a convenience method with pre-configured options for agent notifications
|
|
110
|
-
*
|
|
111
|
-
* @param agentName The name of the agent that completed
|
|
112
|
-
* @param taskDescription Optional description of the completed task
|
|
113
|
-
* @returns Promise resolving to the notification result
|
|
114
|
-
*/
|
|
115
|
-
async showAgentCompletionNotification(agentName, taskDescription) {
|
|
116
|
-
const title = nls_1.nls.localize('theia/ai-core/agentCompletionTitle', 'Agent "{0}" Task Completed', agentName);
|
|
117
|
-
const body = taskDescription
|
|
118
|
-
? nls_1.nls.localize('theia/ai-core/agentCompletionWithTask', 'Agent "{0}" has completed the task: {1}', agentName, taskDescription)
|
|
119
|
-
: nls_1.nls.localize('theia/ai-core/agentCompletionMessage', 'Agent "{0}" has completed its task.', agentName);
|
|
120
|
-
return this.showNotification(title, {
|
|
121
|
-
body,
|
|
122
|
-
icon: this.getAgentCompletionIcon(),
|
|
123
|
-
tag: `agent-completion-${agentName}`,
|
|
124
|
-
requireInteraction: false,
|
|
125
|
-
data: {
|
|
126
|
-
type: 'agent-completion',
|
|
127
|
-
agentName,
|
|
128
|
-
taskDescription,
|
|
129
|
-
timestamp: Date.now()
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Ensure notification permission is granted
|
|
135
|
-
*
|
|
136
|
-
* @returns Promise resolving to the permission state
|
|
137
|
-
*/
|
|
138
|
-
async ensurePermission() {
|
|
139
|
-
const currentPermission = this.getPermissionStatus();
|
|
140
|
-
if (currentPermission === 'granted') {
|
|
141
|
-
return currentPermission;
|
|
142
|
-
}
|
|
143
|
-
if (currentPermission === 'denied') {
|
|
144
|
-
return currentPermission;
|
|
145
|
-
}
|
|
146
|
-
return this.requestPermission();
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* Create a native notification with the given title and options
|
|
150
|
-
*
|
|
151
|
-
* @param title The notification title
|
|
152
|
-
* @param options The notification options
|
|
153
|
-
* @returns Promise resolving to the created notification
|
|
154
|
-
*/
|
|
155
|
-
async createNotification(title, options) {
|
|
156
|
-
return new Promise((resolve, reject) => {
|
|
157
|
-
try {
|
|
158
|
-
const notificationOptions = {
|
|
159
|
-
body: options.body,
|
|
160
|
-
icon: options.icon,
|
|
161
|
-
silent: options.silent,
|
|
162
|
-
tag: options.tag,
|
|
163
|
-
requireInteraction: options.requireInteraction,
|
|
164
|
-
data: options.data
|
|
165
|
-
};
|
|
166
|
-
const notification = new Notification(title, notificationOptions);
|
|
167
|
-
notification.onshow = () => {
|
|
168
|
-
console.debug('OS notification shown:', title);
|
|
169
|
-
};
|
|
170
|
-
notification.onerror = error => {
|
|
171
|
-
console.error('OS notification error:', error);
|
|
172
|
-
reject(new Error('Failed to show notification'));
|
|
173
|
-
};
|
|
174
|
-
notification.onclick = () => {
|
|
175
|
-
console.debug('OS notification clicked:', title);
|
|
176
|
-
this.focusApplicationWindow();
|
|
177
|
-
notification.close();
|
|
178
|
-
};
|
|
179
|
-
notification.onclose = () => {
|
|
180
|
-
console.debug('OS notification closed:', title);
|
|
181
|
-
};
|
|
182
|
-
resolve(notification);
|
|
183
|
-
}
|
|
184
|
-
catch (error) {
|
|
185
|
-
reject(error);
|
|
186
|
-
}
|
|
187
|
-
});
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Attempt to focus the application window when notification is clicked
|
|
191
|
-
*/
|
|
192
|
-
focusApplicationWindow() {
|
|
193
|
-
var _a;
|
|
194
|
-
try {
|
|
195
|
-
if (typeof window !== 'undefined') {
|
|
196
|
-
window.focus();
|
|
197
|
-
if (this.isElectron && ((_a = window.electronTheiaCore) === null || _a === void 0 ? void 0 : _a.focusWindow)) {
|
|
198
|
-
window.electronTheiaCore.focusWindow();
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
catch (error) {
|
|
203
|
-
console.debug('Could not focus application window:', error);
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Get the icon URL for agent completion notifications
|
|
208
|
-
*
|
|
209
|
-
* @returns The icon URL or undefined if not available
|
|
210
|
-
*/
|
|
211
|
-
getAgentCompletionIcon() {
|
|
212
|
-
// This could return a path to an icon file
|
|
213
|
-
// For now, we'll return undefined to use the default system icon
|
|
214
|
-
return undefined;
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
exports.OSNotificationService = OSNotificationService;
|
|
218
|
-
exports.OSNotificationService = OSNotificationService = tslib_1.__decorate([
|
|
219
|
-
(0, inversify_1.injectable)(),
|
|
220
|
-
tslib_1.__metadata("design:paramtypes", [])
|
|
221
|
-
], OSNotificationService);
|
|
222
|
-
//# sourceMappingURL=os-notification-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"os-notification-service.js","sourceRoot":"","sources":["../../src/browser/os-notification-service.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,4DAA0D;AAC1D,oDAAiD;AACjD,sCAA0C;AAgC1C;;;GAGG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAI9B;QACI,IAAI,CAAC,UAAU,GAAG,kBAAW,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;IAChD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CAAC,KAAa,EAAE,UAAiC,EAAE;QACrE,IAAI,CAAC;YACD,IAAI,CAAC,IAAI,CAAC,uBAAu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AAC,YAAY,CAAC,CAAC;YAE1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,MAAM,CAAC,KAAK,CAAC,CAAC;YAClB,CAAC;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;OAEG;IACK,sBAAsB;;QAC1B,IAAI,CAAC;YACD,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE,CAAC;gBAChC,MAAM,CAAC,KAAK,EAAE,CAAC;gBAEf,IAAI,IAAI,CAAC,UAAU,KAAI,MAAC,MAA0E,CAAC,iBAAiB,0CAAE,WAAW,CAAA,EAAE,CAAC;oBAC/H,MAAwE,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;gBAC9G,CAAC;YACL,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;QAChE,CAAC;IACL,CAAC;IAED;;;;OAIG;IACK,sBAAsB;QAC1B,2CAA2C;QAC3C,iEAAiE;QACjE,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAA;AAvNY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,sBAAU,GAAE;;GACA,qBAAqB,CAuNjC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { LanguageGrammarDefinitionContribution, TextmateRegistry } from '@theia/monaco/lib/browser/textmate';
|
|
2
|
-
import * as monaco from '@theia/monaco-editor-core';
|
|
3
|
-
import { Command, CommandContribution, CommandRegistry } from '@theia/core';
|
|
4
|
-
import { TabBarToolbarContribution, TabBarToolbarRegistry } from '@theia/core/lib/browser/shell/tab-bar-toolbar';
|
|
5
|
-
import { Widget } from '@theia/core/lib/browser';
|
|
6
|
-
import { EditorWidget } from '@theia/editor/lib/browser';
|
|
7
|
-
import { ToolInvocationRegistry } from '../common';
|
|
8
|
-
import { ProviderResult } from '@theia/monaco-editor-core/esm/vs/editor/common/languages';
|
|
9
|
-
import { AIVariableService } from '../common/variable-service';
|
|
10
|
-
export declare const PROMPT_TEMPLATE_EXTENSION = ".prompttemplate";
|
|
11
|
-
export declare const DISCARD_PROMPT_TEMPLATE_CUSTOMIZATIONS: Command;
|
|
12
|
-
export declare class PromptTemplateContribution implements LanguageGrammarDefinitionContribution, CommandContribution, TabBarToolbarContribution {
|
|
13
|
-
private readonly promptService;
|
|
14
|
-
protected readonly toolInvocationRegistry: ToolInvocationRegistry;
|
|
15
|
-
protected readonly variableService: AIVariableService;
|
|
16
|
-
readonly config: monaco.languages.LanguageConfiguration;
|
|
17
|
-
registerTextmateLanguage(registry: TextmateRegistry): void;
|
|
18
|
-
provideFunctionCompletions(model: monaco.editor.ITextModel, position: monaco.Position): ProviderResult<monaco.languages.CompletionList>;
|
|
19
|
-
provideVariableCompletions(model: monaco.editor.ITextModel, position: monaco.Position): ProviderResult<monaco.languages.CompletionList>;
|
|
20
|
-
provideVariableWithArgCompletions(model: monaco.editor.ITextModel, position: monaco.Position): Promise<monaco.languages.CompletionList>;
|
|
21
|
-
getCompletionRange(model: monaco.editor.ITextModel, position: monaco.Position, triggerCharacters: string): monaco.Range | undefined;
|
|
22
|
-
private getSuggestions;
|
|
23
|
-
registerCommands(commands: CommandRegistry): void;
|
|
24
|
-
protected isPromptTemplateWidget(widget: Widget): boolean;
|
|
25
|
-
protected canDiscard(widget: EditorWidget): boolean;
|
|
26
|
-
protected discard(widget: EditorWidget): Promise<void>;
|
|
27
|
-
registerToolbarItems(registry: TabBarToolbarRegistry): void;
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=prompttemplate-contribution.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prompttemplate-contribution.d.ts","sourceRoot":"","sources":["../../src/browser/prompttemplate-contribution.ts"],"names":[],"mappings":"AAiBA,OAAO,EAAgD,qCAAqC,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAC3J,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AAC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