@theia/plugin 1.65.0-next.55 → 1.65.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theia/plugin",
3
- "version": "1.65.0-next.55+d141c3601",
3
+ "version": "1.65.0",
4
4
  "description": "Theia - Plugin API",
5
5
  "types": "./src/theia.d.ts",
6
6
  "publishConfig": {
@@ -27,10 +27,10 @@
27
27
  "watch": "theiaext watch"
28
28
  },
29
29
  "devDependencies": {
30
- "@theia/ext-scripts": "1.64.0"
30
+ "@theia/ext-scripts": "1.65.0"
31
31
  },
32
32
  "nyc": {
33
33
  "extends": "../../configs/nyc.json"
34
34
  },
35
- "gitHead": "d141c3601e8c3d9cd254468790fed3566aa23305"
35
+ "gitHead": "500dfc80cee94fd2a623b5fb59b22d5a575247c2"
36
36
  }
package/src/theia.d.ts CHANGED
@@ -40,10 +40,12 @@ import './theia.proposed.notebookMessaging';
40
40
  import './theia.proposed.portsAttributes';
41
41
  import './theia.proposed.profileContentHandlers';
42
42
  import './theia.proposed.resolvers';
43
+ import './theia.proposed.scmProviderOptions';
43
44
  import './theia.proposed.scmValidation';
44
45
  import './theia.proposed.shareProvider';
45
46
  import './theia.proposed.terminalCompletionProvider';
46
47
  import './theia.proposed.terminalQuickFixProvider';
48
+ import './theia.proposed.textEditorDiffInformation';
47
49
  import './theia.proposed.textSearchProvider';
48
50
  import './theia.proposed.timeline';
49
51
 
@@ -3597,6 +3599,20 @@ export module '@theia/plugin' {
3597
3599
  * recommended for the best contrast and consistency across themes.
3598
3600
  */
3599
3601
  color?: ThemeColor;
3602
+
3603
+ /**
3604
+ * The nonce to use to verify shell integration sequences are coming from a trusted source.
3605
+ * An example impact of UX of this is if the command line is reported with a nonce, it will
3606
+ * not need to verify with the user that the command line is correct before rerunning it
3607
+ * via the [shell integration command decoration](https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler).
3608
+ *
3609
+ * This should be used if the terminal includes [custom shell integration support](https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences).
3610
+ * It should be set to a random GUID which will then set the `VSCODE_NONCE` environment
3611
+ * variable. Inside the shell, this should then be removed from the environment so as to
3612
+ * protect it from general access. Once that is done it can be passed through in the
3613
+ * relevant sequences to make them trusted.
3614
+ */
3615
+ shellIntegrationNonce?: string;
3600
3616
  }
3601
3617
 
3602
3618
  /**
@@ -3718,6 +3734,18 @@ export module '@theia/plugin' {
3718
3734
  * @stubbed
3719
3735
  */
3720
3736
  color?: ThemeColor;
3737
+
3738
+ /**
3739
+ * The nonce to use to verify shell integration sequences are coming from a trusted source.
3740
+ * An example impact of UX of this is if the command line is reported with a nonce, it will
3741
+ * not need to verify with the user that the command line is correct before rerunning it
3742
+ * via the [shell integration command decoration](https://code.visualstudio.com/docs/terminal/shell-integration#_command-decorations-and-the-overview-ruler).
3743
+ *
3744
+ * This should be used if the terminal includes [custom shell integration support](https://code.visualstudio.com/docs/terminal/shell-integration#_supported-escape-sequences).
3745
+ * It should be set to a random GUID. Inside the {@link Pseudoterminal} implementation, this value
3746
+ * can be passed through in the relevant sequences to make them trusted.
3747
+ */
3748
+ shellIntegrationNonce?: string;
3721
3749
  }
3722
3750
 
3723
3751
  /**
@@ -12093,12 +12121,12 @@ export module '@theia/plugin' {
12093
12121
  */
12094
12122
  export class EvaluatableExpression {
12095
12123
 
12096
- /*
12124
+ /**
12097
12125
  * The range is used to extract the evaluatable expression from the underlying document and to highlight it.
12098
12126
  */
12099
12127
  readonly range: Range;
12100
12128
 
12101
- /*
12129
+ /**
12102
12130
  * If specified the expression overrides the extracted expression.
12103
12131
  */
12104
12132
  readonly expression?: string | undefined;
@@ -17812,7 +17840,7 @@ export module '@theia/plugin' {
17812
17840
  * Creates a {@link FileCoverage} instance with counts filled in from
17813
17841
  * the coverage details.
17814
17842
  * @param uri Covered file URI
17815
- * @param detailed Detailed coverage information
17843
+ * @param details Detailed coverage information
17816
17844
  */
17817
17845
  static fromDetails(uri: Uri, details: readonly FileCoverageDetail[]): FileCoverage;
17818
17846
 
@@ -18593,7 +18621,7 @@ export module '@theia/plugin' {
18593
18621
  * specific for some models.
18594
18622
  * @stubbed
18595
18623
  */
18596
- content: Array<(LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart)>;
18624
+ content: Array<LanguageModelInputPart>;
18597
18625
 
18598
18626
  /**
18599
18627
  * The optional name of a user for this message.
@@ -18609,9 +18637,21 @@ export module '@theia/plugin' {
18609
18637
  * @param content The content of the message.
18610
18638
  * @param name The optional name of a user for the message.
18611
18639
  */
18612
- constructor(role: LanguageModelChatMessageRole, content: string | Array<LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart>, name?: string);
18640
+ constructor(role: LanguageModelChatMessageRole, content: string | Array<LanguageModelInputPart>, name?: string);
18613
18641
  }
18614
18642
 
18643
+ /**
18644
+ * The various message types which a {@linkcode LanguageModelChatProvider} can emit in the chat response stream
18645
+ * @stubbed
18646
+ */
18647
+ export type LanguageModelResponsePart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart;
18648
+
18649
+ /**
18650
+ * The various message types which can be sent via {@linkcode LanguageModelChat.sendRequest } and processed by a {@linkcode LanguageModelChatProvider}
18651
+ * @stubbed
18652
+ */
18653
+ export type LanguageModelInputPart = LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart;
18654
+
18615
18655
  /**
18616
18656
  * Represents a language model response.
18617
18657
  *
@@ -19000,6 +19040,202 @@ export module '@theia/plugin' {
19000
19040
  */
19001
19041
  resolveMcpServerDefinition?(server: T, token: CancellationToken): ProviderResult<T>;
19002
19042
  }
19043
+
19044
+ /**
19045
+ * The provider version of {@linkcode LanguageModelChatRequestOptions}
19046
+ * @stubbed
19047
+ */
19048
+ export interface ProvideLanguageModelChatResponseOptions {
19049
+ /**
19050
+ * A set of options that control the behavior of the language model. These options are specific to the language model.
19051
+ * @stubbed
19052
+ */
19053
+ readonly modelOptions?: { readonly [name: string]: any };
19054
+
19055
+ /**
19056
+ * An optional list of tools that are available to the language model. These could be registered tools available via
19057
+ * {@link lm.tools}, or private tools that are just implemented within the calling extension.
19058
+ *
19059
+ * If the LLM requests to call one of these tools, it will return a {@link LanguageModelToolCallPart} in
19060
+ * {@link LanguageModelChatResponse.stream}. It's the caller's responsibility to invoke the tool. If it's a tool
19061
+ * registered in {@link lm.tools}, that means calling {@link lm.invokeTool}.
19062
+ *
19063
+ * Then, the tool result can be provided to the LLM by creating an Assistant-type {@link LanguageModelChatMessage} with a
19064
+ * {@link LanguageModelToolCallPart}, followed by a User-type message with a {@link LanguageModelToolResultPart}.
19065
+ * @stubbed
19066
+ */
19067
+ readonly tools?: readonly LanguageModelChatTool[];
19068
+
19069
+ /**
19070
+ * The tool-selecting mode to use. The provider must implement respecting this.
19071
+ * @stubbed
19072
+ */
19073
+ readonly toolMode: LanguageModelChatToolMode;
19074
+ }
19075
+
19076
+ /**
19077
+ * Represents a language model provided by a {@linkcode LanguageModelChatProvider}.
19078
+ * @stubbed
19079
+ */
19080
+ export interface LanguageModelChatInformation {
19081
+
19082
+ /**
19083
+ * Unique identifier for the language model. Must be unique per provider, but not required to be globally unique.
19084
+ * @stubbed
19085
+ */
19086
+ readonly id: string;
19087
+
19088
+ /**
19089
+ * Human-readable name of the language model.
19090
+ * @stubbed
19091
+ */
19092
+ readonly name: string;
19093
+
19094
+ /**
19095
+ * Opaque family-name of the language model. Values might be `gpt-3.5-turbo`, `gpt4`, `phi2`, or `llama`
19096
+ * @stubbed
19097
+ */
19098
+ readonly family: string;
19099
+
19100
+ /**
19101
+ * The tooltip to render when hovering the model. Used to provide more information about the model.
19102
+ * @stubbed
19103
+ */
19104
+ readonly tooltip?: string;
19105
+
19106
+ /**
19107
+ * An optional, human-readable string which will be rendered alongside the model.
19108
+ * Useful for distinguishing models of the same name in the UI.
19109
+ * @stubbed
19110
+ */
19111
+ readonly detail?: string;
19112
+
19113
+ /**
19114
+ * Opaque version string of the model.
19115
+ * This is used as a lookup value in {@linkcode LanguageModelChatSelector.version}
19116
+ * An example is how GPT 4o has multiple versions like 2024-11-20 and 2024-08-06
19117
+ * @stubbed
19118
+ */
19119
+ readonly version: string;
19120
+
19121
+ /**
19122
+ * The maximum number of tokens the model can accept as input.
19123
+ * @stubbed
19124
+ */
19125
+ readonly maxInputTokens: number;
19126
+
19127
+ /**
19128
+ * The maximum number of tokens the model is capable of producing.
19129
+ * @stubbed
19130
+ */
19131
+ readonly maxOutputTokens: number;
19132
+
19133
+ /**
19134
+ * Various features that the model supports such as tool calling or image input.
19135
+ * @stubbed
19136
+ */
19137
+ readonly capabilities: {
19138
+
19139
+ /**
19140
+ * Whether image input is supported by the model.
19141
+ * Common supported images are jpg and png, but each model will vary in supported mimetypes.
19142
+ * @stubbed
19143
+ */
19144
+ readonly imageInput?: boolean;
19145
+
19146
+ /**
19147
+ * Whether tool calling is supported by the model.
19148
+ * If a number is provided, that is the maximum number of tools that can be provided in a request to the model.
19149
+ * @stubbed
19150
+ */
19151
+ readonly toolCalling?: boolean | number;
19152
+ };
19153
+ }
19154
+
19155
+ /**
19156
+ * The provider version of {@linkcode LanguageModelChatMessage}.
19157
+ * @stubbed
19158
+ */
19159
+ export interface LanguageModelChatRequestMessage {
19160
+ /**
19161
+ * The role of this message.
19162
+ * @stubbed
19163
+ */
19164
+ readonly role: LanguageModelChatMessageRole;
19165
+
19166
+ /**
19167
+ * A heterogeneous array of things that a message can contain as content. Some parts may be message-type
19168
+ * specific for some models.
19169
+ * @stubbed
19170
+ */
19171
+ readonly content: ReadonlyArray<LanguageModelInputPart | unknown>;
19172
+
19173
+ /**
19174
+ * The optional name of a user for this message.
19175
+ * @stubbed
19176
+ */
19177
+ readonly name: string | undefined;
19178
+ }
19179
+
19180
+ /**
19181
+ * A LanguageModelChatProvider implements access to language models, which users can then use through the chat view, or through extension API by acquiring a LanguageModelChat.
19182
+ * An example of this would be an OpenAI provider that provides models like gpt-5, o3, etc.
19183
+ * @stubbed
19184
+ */
19185
+ export interface LanguageModelChatProvider<T extends LanguageModelChatInformation = LanguageModelChatInformation> {
19186
+
19187
+ /**
19188
+ * An optional event fired when the available set of language models changes.
19189
+ * @stubbed
19190
+ */
19191
+ readonly onDidChangeLanguageModelChatInformation?: Event<void>;
19192
+
19193
+ /**
19194
+ * Get the list of available language models provided by this provider
19195
+ * @param options Options which specify the calling context of this function
19196
+ * @param token A cancellation token
19197
+ * @returns The list of available language models
19198
+ * @stubbed
19199
+ */
19200
+ provideLanguageModelChatInformation(options: PrepareLanguageModelChatModelOptions, token: CancellationToken): ProviderResult<T[]>;
19201
+
19202
+ /**
19203
+ * Returns the response for a chat request, passing the results to the progress callback.
19204
+ * The {@linkcode LanguageModelChatProvider} must emit the response parts to the progress callback as they are received from the language model.
19205
+ * @param model The language model to use
19206
+ * @param messages The messages to include in the request
19207
+ * @param options Options for the request
19208
+ * @param progress The progress to emit the streamed response chunks to
19209
+ * @param token A cancellation token
19210
+ * @returns A promise that resolves when the response is complete. Results are actually passed to the progress callback.
19211
+ * @stubbed
19212
+ */
19213
+ provideLanguageModelChatResponse(model: T, messages: readonly LanguageModelChatRequestMessage[], options: ProvideLanguageModelChatResponseOptions, progress: Progress<LanguageModelResponsePart>, token: CancellationToken): Thenable<void>;
19214
+
19215
+ /**
19216
+ * Returns the number of tokens for a given text using the model-specific tokenizer logic
19217
+ * @param model The language model to use
19218
+ * @param text The text to count tokens for
19219
+ * @param token A cancellation token
19220
+ * @returns The number of tokens
19221
+ * @stubbed
19222
+ */
19223
+ provideTokenCount(model: T, text: string | LanguageModelChatRequestMessage, token: CancellationToken): Thenable<number>;
19224
+ }
19225
+
19226
+ /**
19227
+ * The list of options passed into {@linkcode LanguageModelChatProvider.provideLanguageModelChatInformation}
19228
+ * @stubbed
19229
+ */
19230
+ export interface PrepareLanguageModelChatModelOptions {
19231
+ /**
19232
+ * Whether or not the user should be prompted via some UI flow, or if models should be attempted to be resolved silently.
19233
+ * If silent is true, all models may not be resolved due to lack of info such as API keys.
19234
+ * @stubbed
19235
+ */
19236
+ readonly silent: boolean;
19237
+ }
19238
+
19003
19239
  /**
19004
19240
  * Namespace for language model related functionality.
19005
19241
  */
@@ -19063,7 +19299,7 @@ export module '@theia/plugin' {
19063
19299
  * any custom flow.
19064
19300
  *
19065
19301
  * In the former case, the caller shall pass the
19066
- * {@link LanguageModelToolInvocationOptions.toolInvocationToken toolInvocationToken}, which comes with the a
19302
+ * {@link LanguageModelToolInvocationOptions.toolInvocationToken toolInvocationToken}, which comes from a
19067
19303
  * {@link ChatRequest.toolInvocationToken chat request}. This makes sure the chat UI shows the tool invocation for the
19068
19304
  * correct conversation.
19069
19305
  *
@@ -19111,6 +19347,16 @@ export module '@theia/plugin' {
19111
19347
  * @returns A disposable that unregisters the provider when disposed.
19112
19348
  */
19113
19349
  export function registerMcpServerDefinitionProvider(id: string, provider: McpServerDefinitionProvider): Disposable;
19350
+
19351
+ /**
19352
+ * Registers a {@linkcode LanguageModelChatProvider}
19353
+ * Note: You must also define the language model chat provider via the `languageModelChatProviders` contribution point in package.json
19354
+ * @param vendor The vendor for this provider. Must be globally unique. An example is `copilot` or `openai`.
19355
+ * @param provider The provider to register
19356
+ * @returns A disposable that unregisters the provider when disposed
19357
+ * @stubbed
19358
+ */
19359
+ export function registerLanguageModelChatProvider(vendor: string, provider: LanguageModelChatProvider): Disposable;
19114
19360
  }
19115
19361
 
19116
19362
  /**
@@ -19276,7 +19522,7 @@ export module '@theia/plugin' {
19276
19522
 
19277
19523
  /**
19278
19524
  * Construct a prompt-tsx part with the given content.
19279
- * @param value The value of the part, the result of `renderPromptElementJSON` from `@vscode/prompt-tsx`.
19525
+ * @param value The value of the part, the result of `renderElementJSON` from `@vscode/prompt-tsx`.
19280
19526
  * @stubbed
19281
19527
  */
19282
19528
  constructor(value: unknown);
@@ -0,0 +1,56 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 STMicroelectronics and others.
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
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ // code copied and modified from https://github.com/microsoft/vscode/blob/1.103.2/src/vscode-dts/vscode.proposed.scmProviderOptions.d.ts
22
+
23
+ declare module '@theia/plugin' {
24
+ // https://github.com/microsoft/vscode/issues/254910
25
+
26
+ export interface SourceControl {
27
+ /**
28
+ * Context value of the source control. This can be used to contribute source control specific actions.
29
+ * For example, if a source control is given a context value of `repository`, when contributing actions to `scm/sourceControl/context`
30
+ * using `menus` extension point, you can specify context value for key `scmProviderContext` in `when` expressions, like `scmProviderContext == repository`.
31
+ * ```json
32
+ * "contributes": {
33
+ * "menus": {
34
+ * "scm/sourceControl/context": [
35
+ * {
36
+ * "command": "extension.gitAction",
37
+ * "when": "scmProviderContext == repository"
38
+ * }
39
+ * ]
40
+ * }
41
+ * }
42
+ * ```
43
+ * This will show action `extension.gitAction` only for source controls with `contextValue` equal to `repository`.
44
+ */
45
+ contextValue?: string;
46
+
47
+ /**
48
+ * Fired when the parent source control is disposed.
49
+ */
50
+ readonly onDidDisposeParent: Event<void>;
51
+ }
52
+
53
+ export namespace scm {
54
+ export function createSourceControl(id: string, label: string, rootUri?: Uri, iconPath?: IconPath, parent?: SourceControl): SourceControl;
55
+ }
56
+ }
@@ -69,9 +69,21 @@ declare module '@theia/plugin' {
69
69
  export enum TerminalCompletionItemKind {
70
70
  File = 0,
71
71
  Folder = 1,
72
- Flag = 2,
73
- Method = 3,
74
- Argument = 4
72
+ Method = 2,
73
+ Alias = 3,
74
+ Argument = 4,
75
+ Option = 5,
76
+ OptionValue = 6,
77
+ Flag = 7,
78
+ SymbolicLinkFile = 8,
79
+ SymbolicLinkFolder = 9,
80
+ Commit = 10,
81
+ Branch = 11,
82
+ Tag = 12,
83
+ Stash = 13,
84
+ Remote = 14,
85
+ PullRequest = 15,
86
+ PullRequestDone = 16,
75
87
  }
76
88
 
77
89
  export interface TerminalCompletionContext {
@@ -0,0 +1,64 @@
1
+ // *****************************************************************************
2
+ // Copyright (C) 2025 STMicroelectronics and others.
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
+ /*---------------------------------------------------------------------------------------------
18
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19
+ * Licensed under the MIT License. See License.txt in the project root for license information.
20
+ *--------------------------------------------------------------------------------------------*/
21
+ // code copied and modified from https://github.com/microsoft/vscode/blob/1.103.2/src/vscode-dts/vscode.proposed.textEditorDiffInformation.d.ts
22
+
23
+ declare module '@theia/plugin' {
24
+ // https://github.com/microsoft/vscode/issues/84899
25
+
26
+ export enum TextEditorChangeKind {
27
+ Addition = 1,
28
+ Deletion = 2,
29
+ Modification = 3
30
+ }
31
+
32
+ export interface TextEditorLineRange {
33
+ readonly startLineNumber: number;
34
+ readonly endLineNumberExclusive: number;
35
+ }
36
+
37
+ export interface TextEditorChange {
38
+ readonly original: TextEditorLineRange;
39
+ readonly modified: TextEditorLineRange;
40
+ readonly kind: TextEditorChangeKind;
41
+ }
42
+
43
+ export interface TextEditorDiffInformation {
44
+ readonly documentVersion: number;
45
+ readonly original: Uri | undefined;
46
+ readonly modified: Uri;
47
+ readonly changes: readonly TextEditorChange[];
48
+ readonly isStale: boolean;
49
+ }
50
+
51
+ export interface TextEditorDiffInformationChangeEvent {
52
+ readonly textEditor: TextEditor;
53
+ readonly diffInformation: TextEditorDiffInformation[] | undefined;
54
+ }
55
+
56
+ export interface TextEditor {
57
+ readonly diffInformation: TextEditorDiffInformation[] | undefined;
58
+ }
59
+
60
+ export namespace window {
61
+ export const onDidChangeTextEditorDiffInformation: Event<TextEditorDiffInformationChangeEvent>;
62
+ }
63
+
64
+ }