@theia/plugin-ext 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/lib/common/lm-tool-protocol.d.ts +58 -0
- package/lib/common/lm-tool-protocol.d.ts.map +1 -0
- package/lib/common/lm-tool-protocol.js +38 -0
- package/lib/common/lm-tool-protocol.js.map +1 -0
- package/lib/common/lm-tool-protocol.spec.d.ts +2 -0
- package/lib/common/lm-tool-protocol.spec.d.ts.map +1 -0
- package/lib/common/lm-tool-protocol.spec.js +80 -0
- package/lib/common/lm-tool-protocol.spec.js.map +1 -0
- package/lib/common/plugin-api-rpc-model.d.ts +4 -0
- package/lib/common/plugin-api-rpc-model.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc-model.js.map +1 -1
- package/lib/common/plugin-api-rpc.d.ts +6 -1
- package/lib/common/plugin-api-rpc.d.ts.map +1 -1
- package/lib/common/plugin-api-rpc.js +4 -2
- package/lib/common/plugin-api-rpc.js.map +1 -1
- package/lib/common/plugin-protocol.d.ts +8 -0
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts +2 -1
- package/lib/hosted/node/hosted-plugin-localization-service.d.ts.map +1 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js +6 -1
- package/lib/hosted/node/hosted-plugin-localization-service.js.map +1 -1
- package/lib/hosted/node/plugin-deployer-handler-impl.js +4 -3
- package/lib/hosted/node/plugin-deployer-handler-impl.js.map +1 -1
- package/lib/hosted/node/plugin-host-module.d.ts.map +1 -1
- package/lib/hosted/node/plugin-host-module.js +2 -0
- package/lib/hosted/node/plugin-host-module.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts +2 -0
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +55 -49
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.d.ts +3 -3
- package/lib/main/browser/comments/comment-thread-widget.d.ts.map +1 -1
- package/lib/main/browser/comments/comment-thread-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-opener.js +1 -0
- package/lib/main/browser/custom-editors/custom-editor-opener.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts +1 -0
- package/lib/main/browser/custom-editors/custom-editor-widget.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editor-widget.js +3 -0
- package/lib/main/browser/custom-editors/custom-editor-widget.js.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.d.ts.map +1 -1
- package/lib/main/browser/custom-editors/custom-editors-main.js +2 -0
- package/lib/main/browser/custom-editors/custom-editors-main.js.map +1 -1
- package/lib/main/browser/debug/debug-main.d.ts +1 -11
- package/lib/main/browser/debug/debug-main.d.ts.map +1 -1
- package/lib/main/browser/debug/debug-main.js +3 -24
- package/lib/main/browser/debug/debug-main.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts +2 -1
- package/lib/main/browser/debug/plugin-debug-service.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-service.js +8 -3
- package/lib/main/browser/debug/plugin-debug-service.js.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts +7 -44
- package/lib/main/browser/debug/plugin-debug-session-factory.d.ts.map +1 -1
- package/lib/main/browser/debug/plugin-debug-session-factory.js +29 -35
- package/lib/main/browser/debug/plugin-debug-session-factory.js.map +1 -1
- package/lib/main/browser/languages-main.d.ts +6 -1
- package/lib/main/browser/languages-main.d.ts.map +1 -1
- package/lib/main/browser/languages-main.js +39 -2
- package/lib/main/browser/languages-main.js.map +1 -1
- package/lib/main/browser/lm-main.js +2 -2
- package/lib/main/browser/lm-main.js.map +1 -1
- package/lib/main/browser/lm-tool-main.d.ts +14 -0
- package/lib/main/browser/lm-tool-main.d.ts.map +1 -0
- package/lib/main/browser/lm-tool-main.js +101 -0
- package/lib/main/browser/lm-tool-main.js.map +1 -0
- package/lib/main/browser/lm-tool-main.spec.d.ts +2 -0
- package/lib/main/browser/lm-tool-main.spec.d.ts.map +1 -0
- package/lib/main/browser/lm-tool-main.spec.js +100 -0
- package/lib/main/browser/lm-tool-main.spec.js.map +1 -0
- package/lib/main/browser/main-context.d.ts.map +1 -1
- package/lib/main/browser/main-context.js +3 -0
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/main-file-system-event-service.d.ts +21 -4
- package/lib/main/browser/main-file-system-event-service.d.ts.map +1 -1
- package/lib/main/browser/main-file-system-event-service.js +47 -17
- package/lib/main/browser/main-file-system-event-service.js.map +1 -1
- package/lib/main/browser/main-file-system-event-service.spec.js +61 -26
- package/lib/main/browser/main-file-system-event-service.spec.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts +2 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js +11 -5
- package/lib/main/browser/notebooks/renderers/cell-output-webview.js.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.d.ts +2 -0
- package/lib/main/browser/plugin-contribution-handler.d.ts.map +1 -1
- package/lib/main/browser/plugin-contribution-handler.js +10 -4
- package/lib/main/browser/plugin-contribution-handler.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.d.ts +1 -0
- package/lib/main/browser/view/plugin-view-registry.d.ts.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.js +28 -3
- package/lib/main/browser/view/plugin-view-registry.js.map +1 -1
- package/lib/main/browser/view/plugin-view-registry.spec.js +40 -0
- package/lib/main/browser/view/plugin-view-registry.spec.js.map +1 -1
- package/lib/main/browser/webview/webview-resource-cache.d.ts +2 -0
- package/lib/main/browser/webview/webview-resource-cache.d.ts.map +1 -1
- package/lib/main/browser/webview/webview-resource-cache.js +7 -1
- package/lib/main/browser/webview/webview-resource-cache.js.map +1 -1
- package/lib/main/browser/webview/webview.d.ts +2 -1
- package/lib/main/browser/webview/webview.d.ts.map +1 -1
- package/lib/main/browser/webview/webview.js +7 -1
- package/lib/main/browser/webview/webview.js.map +1 -1
- package/lib/main/node/plugin-deployer-impl.js +2 -1
- package/lib/main/node/plugin-deployer-impl.js.map +1 -1
- package/lib/plugin/languages/diagnostics.d.ts +4 -1
- package/lib/plugin/languages/diagnostics.d.ts.map +1 -1
- package/lib/plugin/languages/diagnostics.js +22 -9
- package/lib/plugin/languages/diagnostics.js.map +1 -1
- package/lib/plugin/languages/multi-document-highlight.d.ts +14 -0
- package/lib/plugin/languages/multi-document-highlight.d.ts.map +1 -0
- package/lib/plugin/languages/multi-document-highlight.js +60 -0
- package/lib/plugin/languages/multi-document-highlight.js.map +1 -0
- package/lib/plugin/languages.d.ts +3 -1
- package/lib/plugin/languages.d.ts.map +1 -1
- package/lib/plugin/languages.js +11 -0
- package/lib/plugin/languages.js.map +1 -1
- package/lib/plugin/lm-tool-ext.d.ts +28 -0
- package/lib/plugin/lm-tool-ext.d.ts.map +1 -0
- package/lib/plugin/lm-tool-ext.js +171 -0
- package/lib/plugin/lm-tool-ext.js.map +1 -0
- package/lib/plugin/lm-tool-ext.spec.d.ts +2 -0
- package/lib/plugin/lm-tool-ext.spec.d.ts.map +1 -0
- package/lib/plugin/lm-tool-ext.spec.js +124 -0
- package/lib/plugin/lm-tool-ext.spec.js.map +1 -0
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +10 -11
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +0 -9
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +22 -15
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +32 -31
- package/src/common/lm-tool-protocol.spec.ts +89 -0
- package/src/common/lm-tool-protocol.ts +102 -0
- package/src/common/plugin-api-rpc-model.ts +5 -0
- package/src/common/plugin-api-rpc.ts +9 -2
- package/src/common/plugin-protocol.ts +9 -0
- package/src/hosted/node/hosted-plugin-localization-service.ts +6 -3
- package/src/hosted/node/plugin-deployer-handler-impl.ts +5 -5
- package/src/hosted/node/plugin-host-module.ts +2 -0
- package/src/hosted/node/scanners/scanner-theia.ts +54 -50
- package/src/main/browser/comments/comment-thread-widget.tsx +5 -5
- package/src/main/browser/custom-editors/custom-editor-opener.tsx +1 -0
- package/src/main/browser/custom-editors/custom-editor-widget.ts +4 -0
- package/src/main/browser/custom-editors/custom-editors-main.ts +2 -0
- package/src/main/browser/debug/debug-main.ts +3 -45
- package/src/main/browser/debug/plugin-debug-service.ts +7 -5
- package/src/main/browser/debug/plugin-debug-session-factory.ts +25 -71
- package/src/main/browser/languages-main.ts +49 -4
- package/src/main/browser/lm-main.ts +2 -2
- package/src/main/browser/lm-tool-main.spec.ts +126 -0
- package/src/main/browser/lm-tool-main.ts +116 -0
- package/src/main/browser/main-context.ts +4 -0
- package/src/main/browser/main-file-system-event-service.spec.ts +76 -29
- package/src/main/browser/main-file-system-event-service.ts +46 -16
- package/src/main/browser/notebooks/renderers/cell-output-webview.tsx +11 -7
- package/src/main/browser/plugin-contribution-handler.ts +8 -4
- package/src/main/browser/plugin-ext-widget.tsx +1 -1
- package/src/main/browser/view/plugin-view-registry.spec.ts +69 -1
- package/src/main/browser/view/plugin-view-registry.ts +30 -3
- package/src/main/browser/webview/webview-resource-cache.ts +6 -2
- package/src/main/browser/webview/webview.ts +6 -3
- package/src/main/node/plugin-deployer-impl.ts +2 -2
- package/src/plugin/languages/diagnostics.ts +28 -10
- package/src/plugin/languages/multi-document-highlight.ts +75 -0
- package/src/plugin/languages.ts +20 -0
- package/src/plugin/lm-tool-ext.spec.ts +152 -0
- package/src/plugin/lm-tool-ext.ts +197 -0
- package/src/plugin/plugin-context.ts +11 -11
- package/src/plugin/types-impl.ts +22 -15
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 EclipseSource.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { CancellationToken } from '@theia/core/lib/common/cancellation';
|
|
18
|
+
|
|
19
|
+
export interface LanguageModelToolDto {
|
|
20
|
+
name: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
inputSchema?: object;
|
|
23
|
+
tags?: string[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface ToolResultTextPartDto {
|
|
27
|
+
type: 'text';
|
|
28
|
+
value: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ToolResultDataPartDto {
|
|
32
|
+
type: 'data';
|
|
33
|
+
base64: string;
|
|
34
|
+
mimeType: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface ToolResultPromptTsxPartDto {
|
|
38
|
+
type: 'prompt-tsx';
|
|
39
|
+
value: unknown;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface ToolResultUnknownPartDto {
|
|
43
|
+
type: 'unknown';
|
|
44
|
+
json: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export type ToolResultPartDto = ToolResultTextPartDto | ToolResultDataPartDto | ToolResultPromptTsxPartDto | ToolResultUnknownPartDto;
|
|
48
|
+
|
|
49
|
+
export interface LanguageModelToolResultDto {
|
|
50
|
+
content: ToolResultPartDto[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface LanguageModelToolInvocationErrorDto {
|
|
54
|
+
error: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export type ToolInvocationResult = LanguageModelToolResultDto | LanguageModelToolInvocationErrorDto;
|
|
58
|
+
|
|
59
|
+
export const isToolInvocationError = (result: ToolInvocationResult): result is LanguageModelToolInvocationErrorDto =>
|
|
60
|
+
typeof result === 'object' && 'error' in result && !('content' in result);
|
|
61
|
+
|
|
62
|
+
export function uint8ArrayToBase64(data: Uint8Array): string {
|
|
63
|
+
let binary = '';
|
|
64
|
+
for (let i = 0; i < data.byteLength; i++) {
|
|
65
|
+
binary += String.fromCharCode(data[i]);
|
|
66
|
+
}
|
|
67
|
+
return btoa(binary);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function base64ToUint8Array(base64: string): Uint8Array {
|
|
71
|
+
const binary = atob(base64);
|
|
72
|
+
const bytes = new Uint8Array(binary.length);
|
|
73
|
+
for (let i = 0; i < binary.length; i++) {
|
|
74
|
+
bytes[i] = binary.charCodeAt(i);
|
|
75
|
+
}
|
|
76
|
+
return bytes;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Main side of the language model tools registry.
|
|
81
|
+
*/
|
|
82
|
+
export interface LanguageModelToolsMain {
|
|
83
|
+
/**
|
|
84
|
+
* Register a language model tool.
|
|
85
|
+
*/
|
|
86
|
+
$registerTool(handle: number, name: string, metadata: LanguageModelToolDto, pluginId: string): Promise<void>;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Unregister a language model tool.
|
|
90
|
+
*/
|
|
91
|
+
$unregisterTool(handle: number): void;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Extension side of the language model tools registry.
|
|
96
|
+
*/
|
|
97
|
+
export interface LanguageModelToolsExt {
|
|
98
|
+
/**
|
|
99
|
+
* Invoke a language model tool.
|
|
100
|
+
*/
|
|
101
|
+
$invokeTool(handle: number, argsString: string, token?: CancellationToken): Promise<ToolInvocationResult>;
|
|
102
|
+
}
|
|
@@ -343,6 +343,11 @@ export interface DocumentHighlightProvider {
|
|
|
343
343
|
provideDocumentHighlights(model: monaco.editor.ITextModel, position: monaco.Position, token: monaco.CancellationToken): DocumentHighlight[] | undefined;
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
+
export interface MultiDocumentHighlightDto {
|
|
347
|
+
uri: UriComponents;
|
|
348
|
+
highlights: DocumentHighlight[];
|
|
349
|
+
}
|
|
350
|
+
|
|
346
351
|
export interface FormattingOptions {
|
|
347
352
|
tabSize: number;
|
|
348
353
|
insertSpaces: boolean;
|
|
@@ -46,6 +46,7 @@ import {
|
|
|
46
46
|
InlineValue,
|
|
47
47
|
InlineValueContext,
|
|
48
48
|
DocumentHighlight,
|
|
49
|
+
MultiDocumentHighlightDto,
|
|
49
50
|
FormattingOptions,
|
|
50
51
|
ChainedCacheId,
|
|
51
52
|
Definition,
|
|
@@ -129,6 +130,7 @@ import { TreeDelta } from '@theia/test/lib/common/tree-delta';
|
|
|
129
130
|
import { TestItemDTO, TestOutputDTO, TestRunDTO, TestRunProfileDTO, TestRunRequestDTO, TestStateChangeDTO } from './test-types';
|
|
130
131
|
import { ArgumentProcessor } from './commands';
|
|
131
132
|
import { McpServerDefinitionRegistryMain, McpServerDefinitionRegistryExt } from './lm-protocol';
|
|
133
|
+
import { LanguageModelToolsMain, LanguageModelToolsExt } from './lm-tool-protocol';
|
|
132
134
|
|
|
133
135
|
export interface PreferenceData {
|
|
134
136
|
[scope: number]: any;
|
|
@@ -1824,6 +1826,8 @@ export interface LanguagesExt {
|
|
|
1824
1826
|
$provideEvaluatableExpression(handle: number, resource: UriComponents, position: Position, token: CancellationToken): Promise<EvaluatableExpression | undefined>;
|
|
1825
1827
|
$provideInlineValues(handle: number, resource: UriComponents, range: Range, context: InlineValueContext, token: CancellationToken): Promise<InlineValue[] | undefined>;
|
|
1826
1828
|
$provideDocumentHighlights(handle: number, resource: UriComponents, position: Position, token: CancellationToken): Promise<DocumentHighlight[] | undefined>;
|
|
1829
|
+
$provideMultiDocumentHighlights(handle: number, resource: UriComponents, position: Position, otherResources: UriComponents[], token: CancellationToken):
|
|
1830
|
+
Promise<MultiDocumentHighlightDto[] | undefined>;
|
|
1827
1831
|
$provideDocumentFormattingEdits(handle: number, resource: UriComponents,
|
|
1828
1832
|
options: FormattingOptions, token: CancellationToken): Promise<TextEdit[] | undefined>;
|
|
1829
1833
|
$provideDocumentRangeFormattingEdits(handle: number, resource: UriComponents, range: Range,
|
|
@@ -1919,6 +1923,7 @@ export interface LanguagesMain {
|
|
|
1919
1923
|
$registerInlineValuesProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1920
1924
|
$emitInlineValuesEvent(eventHandle: number, event?: any): void;
|
|
1921
1925
|
$registerDocumentHighlightProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1926
|
+
$registerMultiDocumentHighlightProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[]): void;
|
|
1922
1927
|
$registerQuickFixProvider(handle: number, pluginInfo: PluginInfo, selector: SerializedDocumentFilter[], codeActionKinds?: string[], documentation?: CodeActionProviderDocumentation): void;
|
|
1923
1928
|
$clearDiagnostics(id: string): void;
|
|
1924
1929
|
$changeDiagnostics(id: string, delta: [string, MarkerData[]][]): void;
|
|
@@ -2476,7 +2481,8 @@ export const PLUGIN_RPC_CONTEXT = {
|
|
|
2476
2481
|
LOCALIZATION_MAIN: createProxyIdentifier<LocalizationMain>('LocalizationMain'),
|
|
2477
2482
|
TESTING_MAIN: createProxyIdentifier<TestingMain>('TestingMain'),
|
|
2478
2483
|
URI_MAIN: createProxyIdentifier<UriMain>('UriMain'),
|
|
2479
|
-
MCP_SERVER_DEFINITION_REGISTRY_MAIN: createProxyIdentifier<McpServerDefinitionRegistryMain>('McpServerDefinitionRegistryMain')
|
|
2484
|
+
MCP_SERVER_DEFINITION_REGISTRY_MAIN: createProxyIdentifier<McpServerDefinitionRegistryMain>('McpServerDefinitionRegistryMain'),
|
|
2485
|
+
LM_TOOLS_MAIN: createProxyIdentifier<LanguageModelToolsMain>('LanguageModelToolsMain')
|
|
2480
2486
|
};
|
|
2481
2487
|
|
|
2482
2488
|
export const MAIN_RPC_CONTEXT = {
|
|
@@ -2521,7 +2527,8 @@ export const MAIN_RPC_CONTEXT = {
|
|
|
2521
2527
|
TELEMETRY_EXT: createProxyIdentifier<TelemetryExt>('TelemetryExt)'),
|
|
2522
2528
|
TESTING_EXT: createProxyIdentifier<TestingExt>('TestingExt'),
|
|
2523
2529
|
URI_EXT: createProxyIdentifier<UriExt>('UriExt'),
|
|
2524
|
-
MCP_SERVER_DEFINITION_REGISTRY_EXT: createProxyIdentifier<McpServerDefinitionRegistryExt>('McpServerDefinitionRegistryExt')
|
|
2530
|
+
MCP_SERVER_DEFINITION_REGISTRY_EXT: createProxyIdentifier<McpServerDefinitionRegistryExt>('McpServerDefinitionRegistryExt'),
|
|
2531
|
+
LM_TOOLS_EXT: createProxyIdentifier<LanguageModelToolsExt>('LanguageModelToolsExt')
|
|
2525
2532
|
};
|
|
2526
2533
|
|
|
2527
2534
|
export interface TasksExt {
|
|
@@ -113,6 +113,7 @@ export interface PluginPackageContribution {
|
|
|
113
113
|
notebookRenderer?: PluginNotebookRendererContribution[];
|
|
114
114
|
notebookPreload?: PluginPackageNotebookPreload[];
|
|
115
115
|
mcpServerDefinitionProviders?: PluginPackageMcpServerDefinitionProviderContribution[];
|
|
116
|
+
languageModelTools?: PluginPackageLanguageModelToolContribution[];
|
|
116
117
|
}
|
|
117
118
|
|
|
118
119
|
export interface PluginPackageNotebook {
|
|
@@ -141,6 +142,14 @@ export interface PluginPackageMcpServerDefinitionProviderContribution {
|
|
|
141
142
|
description?: string;
|
|
142
143
|
}
|
|
143
144
|
|
|
145
|
+
export interface PluginPackageLanguageModelToolContribution {
|
|
146
|
+
name: string;
|
|
147
|
+
modelDescription?: string;
|
|
148
|
+
userDescription?: string;
|
|
149
|
+
inputSchema?: object;
|
|
150
|
+
tags?: string[];
|
|
151
|
+
}
|
|
152
|
+
|
|
144
153
|
export interface PluginPackageAuthenticationProvider {
|
|
145
154
|
id: string;
|
|
146
155
|
label: string;
|
|
@@ -18,11 +18,11 @@ import * as path from 'path';
|
|
|
18
18
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
19
19
|
import { LazyLocalization, LocalizationProvider } from '@theia/core/lib/node/i18n/localization-provider';
|
|
20
20
|
import { Localization } from '@theia/core/lib/common/i18n/localization';
|
|
21
|
-
import { inject, injectable } from '@theia/core/shared/inversify';
|
|
21
|
+
import { inject, injectable, named } from '@theia/core/shared/inversify';
|
|
22
22
|
import { DeployedPlugin, Localization as PluginLocalization, PluginIdentifiers, Translation } from '../../common';
|
|
23
23
|
import { EnvVariablesServer } from '@theia/core/lib/common/env-variables';
|
|
24
24
|
import { BackendApplicationContribution } from '@theia/core/lib/node';
|
|
25
|
-
import { Disposable, DisposableCollection, isObject, MaybePromise, nls, Path, URI } from '@theia/core';
|
|
25
|
+
import { Disposable, DisposableCollection, isObject, MaybePromise, nls, Path, URI, ILogger } from '@theia/core';
|
|
26
26
|
import { Deferred } from '@theia/core/lib/common/promise-util';
|
|
27
27
|
import { LanguagePackBundle, LanguagePackService } from '../../common/language-pack-service';
|
|
28
28
|
|
|
@@ -48,6 +48,9 @@ export class HostedPluginLocalizationService implements BackendApplicationContri
|
|
|
48
48
|
@inject(EnvVariablesServer)
|
|
49
49
|
protected readonly envVariables: EnvVariablesServer;
|
|
50
50
|
|
|
51
|
+
@inject(ILogger) @named('plugin-ext:HostedPluginLocalizationService')
|
|
52
|
+
protected readonly logger: ILogger;
|
|
53
|
+
|
|
51
54
|
protected localizationDisposeMap = new Map<string, Disposable>();
|
|
52
55
|
protected translationConfigFiles: Map<string, string> = new Map();
|
|
53
56
|
|
|
@@ -162,7 +165,7 @@ export class HostedPluginLocalizationService implements BackendApplicationContri
|
|
|
162
165
|
return Localization.localize(localization, fullKey, original);
|
|
163
166
|
}) as DeployedPlugin;
|
|
164
167
|
} catch (err) {
|
|
165
|
-
|
|
168
|
+
this.logger.error(`Failed to localize plugin '${pluginId}'.`, err);
|
|
166
169
|
}
|
|
167
170
|
return plugin;
|
|
168
171
|
}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// *****************************************************************************
|
|
16
16
|
|
|
17
17
|
import * as fs from '@theia/core/shared/fs-extra';
|
|
18
|
-
import { injectable, inject } from '@theia/core/shared/inversify';
|
|
18
|
+
import { injectable, inject, named } from '@theia/core/shared/inversify';
|
|
19
19
|
import { ILogger } from '@theia/core';
|
|
20
20
|
import {
|
|
21
21
|
PluginDeployerHandler, PluginDeployerEntry, PluginEntryPoint, DeployedPlugin,
|
|
@@ -29,7 +29,7 @@ import { PluginUninstallationManager } from '../../main/node/plugin-uninstallati
|
|
|
29
29
|
|
|
30
30
|
@injectable()
|
|
31
31
|
export class PluginDeployerHandlerImpl implements PluginDeployerHandler {
|
|
32
|
-
@inject(ILogger)
|
|
32
|
+
@inject(ILogger) @named('plugin-ext:PluginDeployerHandlerImpl')
|
|
33
33
|
protected readonly logger: ILogger;
|
|
34
34
|
|
|
35
35
|
@inject(HostedPluginReader)
|
|
@@ -128,7 +128,7 @@ export class PluginDeployerHandlerImpl implements PluginDeployerHandler {
|
|
|
128
128
|
}
|
|
129
129
|
return dependencies;
|
|
130
130
|
} catch (e) {
|
|
131
|
-
|
|
131
|
+
this.logger.error(`Failed to load plugin dependencies from '${pluginPath}' path`, e);
|
|
132
132
|
return undefined;
|
|
133
133
|
}
|
|
134
134
|
}
|
|
@@ -211,13 +211,13 @@ export class PluginDeployerHandlerImpl implements PluginDeployerHandler {
|
|
|
211
211
|
return false;
|
|
212
212
|
}
|
|
213
213
|
await Promise.all(Array.from(sourceLocations,
|
|
214
|
-
location => fs.remove(location).catch(err =>
|
|
214
|
+
location => fs.remove(location).catch(err => this.logger.error(`Failed to remove source for ${pluginId} at ${location}`, err))));
|
|
215
215
|
this.sourceLocations.delete(pluginId);
|
|
216
216
|
this.localizationService.undeployLocalizations(pluginId);
|
|
217
217
|
this.uninstallationManager.markAsUninstalled(pluginId);
|
|
218
218
|
return true;
|
|
219
219
|
} catch (e) {
|
|
220
|
-
|
|
220
|
+
this.logger.error('Error uninstalling plugin', e);
|
|
221
221
|
return false;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -37,6 +37,7 @@ import { TerminalServiceExtImpl } from '../../plugin/terminal-ext';
|
|
|
37
37
|
import { InternalSecretsExt, SecretsExtImpl } from '../../plugin/secrets-ext';
|
|
38
38
|
import { setupPluginHostLogger } from './plugin-host-logger';
|
|
39
39
|
import { LmExtImpl } from '../../plugin/lm-ext';
|
|
40
|
+
import { LanguageModelToolsExtImpl } from '../../plugin/lm-tool-ext';
|
|
40
41
|
import { EncodingService } from '@theia/core/lib/common/encoding-service';
|
|
41
42
|
|
|
42
43
|
export default new ContainerModule(bind => {
|
|
@@ -66,6 +67,7 @@ export default new ContainerModule(bind => {
|
|
|
66
67
|
bind(PreferenceRegistryExtImpl).toSelf().inSingletonScope();
|
|
67
68
|
bind(DebugExtImpl).toSelf().inSingletonScope();
|
|
68
69
|
bind(LmExtImpl).toSelf().inSingletonScope();
|
|
70
|
+
bind(LanguageModelToolsExtImpl).toSelf().inSingletonScope();
|
|
69
71
|
bind(EncodingService).toSelf().inSingletonScope();
|
|
70
72
|
bind(EditorsAndDocumentsExtImpl).toSelf().inSingletonScope();
|
|
71
73
|
bind(WorkspaceExtImpl).toSelf().inSingletonScope();
|