@theia/plugin-ext 1.55.0 → 1.56.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/common/plugin-protocol.d.ts +2 -0
- package/lib/common/plugin-protocol.d.ts.map +1 -1
- package/lib/common/plugin-protocol.js.map +1 -1
- package/lib/hosted/common/hosted-plugin.d.ts.map +1 -1
- package/lib/hosted/common/hosted-plugin.js +1 -0
- package/lib/hosted/common/hosted-plugin.js.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.d.ts.map +1 -1
- package/lib/hosted/node/scanners/scanner-theia.js +3 -0
- package/lib/hosted/node/scanners/scanner-theia.js.map +1 -1
- package/lib/main/browser/editors-and-documents-main.js +6 -3
- package/lib/main/browser/editors-and-documents-main.js.map +1 -1
- package/lib/main/browser/main-context.js +1 -1
- package/lib/main/browser/main-context.js.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts +2 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.d.ts.map +1 -1
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js +7 -2
- package/lib/main/browser/notebooks/notebook-documents-and-editors-main.js.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.d.ts.map +1 -1
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js +18 -15
- package/lib/main/browser/notebooks/renderers/output-webview-internal.js.map +1 -1
- package/lib/main/browser/text-editor-main.d.ts.map +1 -1
- package/lib/main/browser/text-editor-main.js +6 -1
- package/lib/main/browser/text-editor-main.js.map +1 -1
- package/lib/main/browser/view/tree-view-widget.d.ts +0 -2
- package/lib/main/browser/view/tree-view-widget.d.ts.map +1 -1
- package/lib/main/browser/view/tree-view-widget.js +0 -5
- package/lib/main/browser/view/tree-view-widget.js.map +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.d.ts.map +1 -1
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js +2 -0
- package/lib/main/node/plugin-deployer-proxy-entry-impl.js.map +1 -1
- package/lib/plugin/notebook/notebooks.d.ts +1 -1
- package/lib/plugin/notebook/notebooks.d.ts.map +1 -1
- package/lib/plugin/notebook/notebooks.js +8 -7
- package/lib/plugin/notebook/notebooks.js.map +1 -1
- package/lib/plugin/plugin-context.d.ts.map +1 -1
- package/lib/plugin/plugin-context.js +17 -1
- package/lib/plugin/plugin-context.js.map +1 -1
- package/lib/plugin/types-impl.d.ts +75 -5
- package/lib/plugin/types-impl.d.ts.map +1 -1
- package/lib/plugin/types-impl.js +71 -2
- package/lib/plugin/types-impl.js.map +1 -1
- package/package.json +29 -29
- package/src/common/plugin-protocol.ts +2 -0
- package/src/hosted/common/hosted-plugin.ts +2 -2
- package/src/hosted/node/scanners/scanner-theia.ts +6 -2
- package/src/main/browser/editors-and-documents-main.ts +4 -1
- package/src/main/browser/main-context.ts +1 -1
- package/src/main/browser/notebooks/notebook-documents-and-editors-main.ts +8 -1
- package/src/main/browser/notebooks/renderers/output-webview-internal.ts +19 -16
- package/src/main/browser/text-editor-main.ts +10 -5
- package/src/main/browser/view/tree-view-widget.tsx +0 -4
- package/src/main/node/plugin-deployer-proxy-entry-impl.ts +5 -2
- package/src/plugin/notebook/notebooks.ts +8 -6
- package/src/plugin/plugin-context.ts +23 -1
- package/src/plugin/types-impl.ts +90 -6
|
@@ -159,7 +159,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
159
159
|
theia.postMessage({ type: 'cellFocusChanged', cellHandle: cellHandle });
|
|
160
160
|
});
|
|
161
161
|
|
|
162
|
-
if (cellIndex && cellIndex < container.children.length) {
|
|
162
|
+
if (cellIndex !== undefined && cellIndex < container.children.length) {
|
|
163
163
|
container.insertBefore(this.element, container.children[cellIndex]);
|
|
164
164
|
} else {
|
|
165
165
|
container.appendChild(this.element);
|
|
@@ -174,7 +174,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
calcTotalOutputHeight(): number {
|
|
177
|
-
return this.outputElements.reduce((acc, output) => acc + output.element.
|
|
177
|
+
return this.outputElements.reduce((acc, output) => acc + output.element.getBoundingClientRect().height, 0) + 5;
|
|
178
178
|
}
|
|
179
179
|
|
|
180
180
|
createOutputElement(index: number, output: webviewCommunication.Output, items: rendererApi.OutputItem[]): OutputContainer {
|
|
@@ -216,9 +216,11 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
216
216
|
public outputVisibilityChanged(visible: boolean): void {
|
|
217
217
|
this.outputElements.forEach(output => {
|
|
218
218
|
output.element.style.display = visible ? 'initial' : 'none';
|
|
219
|
+
output.containerElement.style.minHeight = visible ? '20px' : '0px';
|
|
219
220
|
});
|
|
220
221
|
if (visible) {
|
|
221
222
|
this.element.getElementsByClassName('output-hidden')?.[0].remove();
|
|
223
|
+
window.requestAnimationFrame(() => this.outputElements.forEach(output => sendDidRenderMessage(this, output)));
|
|
222
224
|
} else {
|
|
223
225
|
const outputHiddenElement = document.createElement('div');
|
|
224
226
|
outputHiddenElement.classList.add('output-hidden');
|
|
@@ -290,6 +292,7 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
290
292
|
private createHtmlElement(): void {
|
|
291
293
|
this.containerElement = document.createElement('div');
|
|
292
294
|
this.containerElement.classList.add('output-container');
|
|
295
|
+
this.containerElement.style.minHeight = '20px';
|
|
293
296
|
this.element = document.createElement('div');
|
|
294
297
|
this.element.id = this.outputId;
|
|
295
298
|
this.element.classList.add('output');
|
|
@@ -489,26 +492,16 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
489
492
|
img.dataset.waiting = 'true'; // mark to avoid overriding onload a second time
|
|
490
493
|
return new Promise(resolve => { img.onload = img.onerror = resolve; });
|
|
491
494
|
})).then(() => {
|
|
492
|
-
|
|
493
|
-
new ResizeObserver(() =>
|
|
495
|
+
sendDidRenderMessage(cell, output);
|
|
496
|
+
new ResizeObserver(() => sendDidRenderMessage(cell, output)).observe(cell.element);
|
|
494
497
|
});
|
|
495
498
|
} else {
|
|
496
|
-
|
|
497
|
-
new ResizeObserver(() =>
|
|
499
|
+
sendDidRenderMessage(cell, output);
|
|
500
|
+
new ResizeObserver(() => sendDidRenderMessage(cell, output)).observe(cell.element);
|
|
498
501
|
}
|
|
499
502
|
|
|
500
503
|
}
|
|
501
504
|
|
|
502
|
-
private sendDidRenderMessage(cell: OutputCell, output: OutputContainer): void {
|
|
503
|
-
theia.postMessage(<webviewCommunication.OnDidRenderOutput>{
|
|
504
|
-
type: 'didRenderOutput',
|
|
505
|
-
cellHandle: cell.cellHandle,
|
|
506
|
-
outputId: output.outputId,
|
|
507
|
-
outputHeight: cell.calcTotalOutputHeight(),
|
|
508
|
-
bodyHeight: document.body.clientHeight
|
|
509
|
-
});
|
|
510
|
-
}
|
|
511
|
-
|
|
512
505
|
private async doRender(item: rendererApi.OutputItem, element: HTMLElement, renderer: Renderer, signal: AbortSignal): Promise<{ continue: boolean }> {
|
|
513
506
|
try {
|
|
514
507
|
await (await renderer.getOrLoad())?.renderOutputItem(item, element, signal);
|
|
@@ -565,6 +558,16 @@ export async function outputWebviewPreload(ctx: PreloadContext): Promise<void> {
|
|
|
565
558
|
}
|
|
566
559
|
}();
|
|
567
560
|
|
|
561
|
+
function sendDidRenderMessage(cell: OutputCell, output: OutputContainer): void {
|
|
562
|
+
theia.postMessage(<webviewCommunication.OnDidRenderOutput>{
|
|
563
|
+
type: 'didRenderOutput',
|
|
564
|
+
cellHandle: cell.cellHandle,
|
|
565
|
+
outputId: output.outputId,
|
|
566
|
+
outputHeight: cell.calcTotalOutputHeight(),
|
|
567
|
+
bodyHeight: document.body.clientHeight
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
|
|
568
571
|
const kernelPreloads = new class {
|
|
569
572
|
private readonly preloads = new Map<string /* uri */, Promise<unknown>>();
|
|
570
573
|
|
|
@@ -388,11 +388,16 @@ export class TextEditorPropertiesMain {
|
|
|
388
388
|
if (editor && editor instanceof MonacoEditor) {
|
|
389
389
|
result = editor.getControl().getSelections() || undefined;
|
|
390
390
|
} else if (editor && editor instanceof SimpleMonacoEditor) {
|
|
391
|
-
result = editor.getControl().getSelections()?.map(selection =>
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
391
|
+
result = editor.getControl().getSelections()?.map(selection => {
|
|
392
|
+
const monacoSelection = new monaco.Selection(
|
|
393
|
+
selection.selectionStartLineNumber,
|
|
394
|
+
selection.selectionStartColumn,
|
|
395
|
+
selection.positionLineNumber,
|
|
396
|
+
selection.positionColumn);
|
|
397
|
+
monacoSelection.setStartPosition(selection.startLineNumber, selection.startColumn);
|
|
398
|
+
monacoSelection.setEndPosition(selection.endLineNumber, selection.endColumn);
|
|
399
|
+
return monacoSelection;
|
|
400
|
+
});
|
|
396
401
|
}
|
|
397
402
|
|
|
398
403
|
if (!result && prevProperties) {
|
|
@@ -45,7 +45,6 @@ import { View } from '../../../common/plugin-protocol';
|
|
|
45
45
|
import { URI } from '@theia/core/lib/common/uri';
|
|
46
46
|
import { ContextKeyService } from '@theia/core/lib/browser/context-key-service';
|
|
47
47
|
import { MarkdownString } from '@theia/core/lib/common/markdown-rendering';
|
|
48
|
-
import { LabelParser } from '@theia/core/lib/browser/label-parser';
|
|
49
48
|
import { AccessibilityInformation } from '@theia/plugin';
|
|
50
49
|
import { ColorRegistry } from '@theia/core/lib/browser/color-registry';
|
|
51
50
|
import { DecoratedTreeNode } from '@theia/core/lib/browser/tree/tree-decorator';
|
|
@@ -456,9 +455,6 @@ export class TreeViewWidget extends TreeViewWelcomeWidget {
|
|
|
456
455
|
@inject(HoverService)
|
|
457
456
|
protected readonly hoverService: HoverService;
|
|
458
457
|
|
|
459
|
-
@inject(LabelParser)
|
|
460
|
-
protected readonly labelParser: LabelParser;
|
|
461
|
-
|
|
462
458
|
@inject(ColorRegistry)
|
|
463
459
|
protected readonly colorRegistry: ColorRegistry;
|
|
464
460
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
//
|
|
14
14
|
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
15
|
// *****************************************************************************
|
|
16
|
-
import { injectable } from '@theia/core/shared/inversify';
|
|
16
|
+
import { injectable, unmanaged } from '@theia/core/shared/inversify';
|
|
17
17
|
import { PluginDeployerEntry, PluginDeployerEntryType, PluginType } from '../../common/plugin-protocol';
|
|
18
18
|
import { PluginDeployerEntryImpl } from './plugin-deployer-entry-impl';
|
|
19
19
|
|
|
@@ -25,7 +25,10 @@ export class ProxyPluginDeployerEntry<T> implements PluginDeployerEntry {
|
|
|
25
25
|
|
|
26
26
|
private readonly deployerName: string;
|
|
27
27
|
|
|
28
|
-
constructor(
|
|
28
|
+
constructor(
|
|
29
|
+
@unmanaged() readonly deployer: T,
|
|
30
|
+
@unmanaged() readonly delegate: PluginDeployerEntryImpl
|
|
31
|
+
) {
|
|
29
32
|
this.deployerName = (this.deployer as {}).constructor.name;
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
|
|
21
21
|
import { CancellationToken, Disposable, DisposableCollection, Emitter, Event, URI } from '@theia/core';
|
|
22
22
|
import { URI as TheiaURI } from '../types-impl';
|
|
23
|
-
import * as theia from '@theia/plugin';
|
|
23
|
+
import type * as theia from '@theia/plugin';
|
|
24
24
|
import {
|
|
25
25
|
NotebookCellStatusBarListDto, NotebookDataDto,
|
|
26
26
|
NotebookDocumentsAndEditorsDelta, NotebookDocumentShowOptions, NotebookDocumentsMain, NotebookEditorAddData, NotebookEditorsMain, NotebooksExt, NotebooksMain, Plugin,
|
|
@@ -337,12 +337,14 @@ export class NotebooksExtImpl implements NotebooksExt {
|
|
|
337
337
|
console.error(`FAILED to find active notebook editor ${delta.newActiveEditor}`);
|
|
338
338
|
}
|
|
339
339
|
this.activeNotebookEditor = this.editors.get(delta.newActiveEditor);
|
|
340
|
-
if (this.textDocumentsAndEditors.activeEditor()?.document.uri.path !== this.activeNotebookEditor?.notebookData.uri.path) {
|
|
341
|
-
this.textDocumentsAndEditors.acceptEditorsAndDocumentsDelta({
|
|
342
|
-
newActiveEditor: null
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
340
|
this.onDidChangeActiveNotebookEditorEmitter.fire(this.activeNotebookEditor?.apiEditor);
|
|
341
|
+
|
|
342
|
+
const newActiveCell = this.activeApiNotebookEditor?.notebook.cellAt(this.activeApiNotebookEditor.selection.start);
|
|
343
|
+
this.textDocumentsAndEditors.acceptEditorsAndDocumentsDelta({
|
|
344
|
+
newActiveEditor: newActiveCell?.kind === 2 /* code cell */ ?
|
|
345
|
+
this.textDocumentsAndEditors.allEditors().find(editor => editor.document.uri.toString() === newActiveCell.document.uri.toString())?.id ?? null :
|
|
346
|
+
null
|
|
347
|
+
});
|
|
346
348
|
}
|
|
347
349
|
}
|
|
348
350
|
|
|
@@ -226,7 +226,13 @@ import {
|
|
|
226
226
|
ChatResultFeedbackKind,
|
|
227
227
|
LanguageModelChatMessage,
|
|
228
228
|
LanguageModelChatMessageRole,
|
|
229
|
+
LanguageModelChatToolMode,
|
|
229
230
|
LanguageModelError,
|
|
231
|
+
LanguageModelPromptTsxPart,
|
|
232
|
+
LanguageModelTextPart,
|
|
233
|
+
LanguageModelToolCallPart,
|
|
234
|
+
LanguageModelToolResult,
|
|
235
|
+
LanguageModelToolResultPart,
|
|
230
236
|
PortAutoForwardAction,
|
|
231
237
|
PortAttributes,
|
|
232
238
|
DebugVisualization,
|
|
@@ -1325,7 +1331,17 @@ export function createAPIFactory(
|
|
|
1325
1331
|
return Promise.resolve([]);
|
|
1326
1332
|
},
|
|
1327
1333
|
/** @stubbed LanguageModelChat */
|
|
1328
|
-
onDidChangeChatModels: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables)
|
|
1334
|
+
onDidChangeChatModels: (listener, thisArgs?, disposables?) => Event.None(listener, thisArgs, disposables),
|
|
1335
|
+
/** @stubbed LanguageModelTool */
|
|
1336
|
+
invokeTool(name: string, options: theia.LanguageModelToolInvocationOptions<object>, token?: CancellationToken): Thenable<theia.LanguageModelToolResult> {
|
|
1337
|
+
return Promise.resolve({ content: [] });
|
|
1338
|
+
},
|
|
1339
|
+
/** @stubbed LanguageModelTool */
|
|
1340
|
+
registerTool<T>(name: string, tool: theia.LanguageModelTool<T>): Disposable {
|
|
1341
|
+
return Disposable.NULL;
|
|
1342
|
+
},
|
|
1343
|
+
/** @stubbed LanguageModelTool */
|
|
1344
|
+
tools: []
|
|
1329
1345
|
};
|
|
1330
1346
|
|
|
1331
1347
|
return <typeof theia>{
|
|
@@ -1545,6 +1561,12 @@ export function createAPIFactory(
|
|
|
1545
1561
|
LanguageModelChatMessage,
|
|
1546
1562
|
LanguageModelChatMessageRole,
|
|
1547
1563
|
LanguageModelError,
|
|
1564
|
+
LanguageModelChatToolMode,
|
|
1565
|
+
LanguageModelPromptTsxPart,
|
|
1566
|
+
LanguageModelTextPart,
|
|
1567
|
+
LanguageModelToolCallPart,
|
|
1568
|
+
LanguageModelToolResult,
|
|
1569
|
+
LanguageModelToolResultPart,
|
|
1548
1570
|
PortAutoForwardAction,
|
|
1549
1571
|
PortAttributes,
|
|
1550
1572
|
DebugVisualization,
|
package/src/plugin/types-impl.ts
CHANGED
|
@@ -725,7 +725,7 @@ export class SnippetString {
|
|
|
725
725
|
|
|
726
726
|
@es5ClassCompat
|
|
727
727
|
export class ThemeColor {
|
|
728
|
-
constructor(public id: string) { }
|
|
728
|
+
constructor(public readonly id: string) { }
|
|
729
729
|
}
|
|
730
730
|
|
|
731
731
|
@es5ClassCompat
|
|
@@ -3868,19 +3868,29 @@ export class TerminalQuickFixOpener {
|
|
|
3868
3868
|
}
|
|
3869
3869
|
|
|
3870
3870
|
// #region Chat
|
|
3871
|
+
|
|
3872
|
+
/**
|
|
3873
|
+
* @stubbed
|
|
3874
|
+
*/
|
|
3871
3875
|
export class ChatRequestTurn {
|
|
3872
3876
|
readonly prompt: string;
|
|
3873
3877
|
readonly participant: string;
|
|
3874
3878
|
readonly command?: string;
|
|
3875
3879
|
readonly references: theia.ChatPromptReference[];
|
|
3876
|
-
|
|
3880
|
+
readonly toolReferences: readonly theia.ChatLanguageModelToolReference[];
|
|
3881
|
+
private constructor(prompt: string, command: string | undefined, references: theia.ChatPromptReference[], participant: string,
|
|
3882
|
+
toolReferences: theia.ChatLanguageModelToolReference[]) {
|
|
3877
3883
|
this.prompt = prompt;
|
|
3878
3884
|
this.command = command;
|
|
3879
3885
|
this.participant = participant;
|
|
3880
3886
|
this.references = references;
|
|
3887
|
+
this.toolReferences = toolReferences;
|
|
3881
3888
|
};
|
|
3882
3889
|
}
|
|
3883
3890
|
|
|
3891
|
+
/**
|
|
3892
|
+
* @stubbed
|
|
3893
|
+
*/
|
|
3884
3894
|
export class ChatResponseTurn {
|
|
3885
3895
|
readonly command?: string;
|
|
3886
3896
|
|
|
@@ -3888,6 +3898,9 @@ export class ChatResponseTurn {
|
|
|
3888
3898
|
| theia.ChatResponseCommandButtonPart>, readonly result: theia.ChatResult, readonly participant: string) { }
|
|
3889
3899
|
}
|
|
3890
3900
|
|
|
3901
|
+
/**
|
|
3902
|
+
* @stubbed
|
|
3903
|
+
*/
|
|
3891
3904
|
export class ChatResponseAnchorPart {
|
|
3892
3905
|
value: URI | Location;
|
|
3893
3906
|
title?: string;
|
|
@@ -3895,12 +3908,18 @@ export class ChatResponseAnchorPart {
|
|
|
3895
3908
|
constructor(value: URI | Location, title?: string) { }
|
|
3896
3909
|
}
|
|
3897
3910
|
|
|
3911
|
+
/**
|
|
3912
|
+
* @stubbed
|
|
3913
|
+
*/
|
|
3898
3914
|
export class ChatResponseProgressPart {
|
|
3899
3915
|
value: string;
|
|
3900
3916
|
|
|
3901
3917
|
constructor(value: string) { }
|
|
3902
3918
|
}
|
|
3903
3919
|
|
|
3920
|
+
/**
|
|
3921
|
+
* @stubbed
|
|
3922
|
+
*/
|
|
3904
3923
|
export class ChatResponseReferencePart {
|
|
3905
3924
|
value: URI | Location;
|
|
3906
3925
|
iconPath?: URI | ThemeIcon | { light: URI; dark: URI; };
|
|
@@ -3910,12 +3929,19 @@ export class ChatResponseReferencePart {
|
|
|
3910
3929
|
dark: URI;
|
|
3911
3930
|
}) { }
|
|
3912
3931
|
}
|
|
3932
|
+
|
|
3933
|
+
/**
|
|
3934
|
+
* @stubbed
|
|
3935
|
+
*/
|
|
3913
3936
|
export class ChatResponseCommandButtonPart {
|
|
3914
3937
|
value: theia.Command;
|
|
3915
3938
|
|
|
3916
3939
|
constructor(value: theia.Command) { }
|
|
3917
3940
|
}
|
|
3918
3941
|
|
|
3942
|
+
/**
|
|
3943
|
+
* @stubbed
|
|
3944
|
+
*/
|
|
3919
3945
|
export class ChatResponseMarkdownPart {
|
|
3920
3946
|
value: theia.MarkdownString;
|
|
3921
3947
|
|
|
@@ -3923,6 +3949,9 @@ export class ChatResponseMarkdownPart {
|
|
|
3923
3949
|
}
|
|
3924
3950
|
}
|
|
3925
3951
|
|
|
3952
|
+
/**
|
|
3953
|
+
* @stubbed
|
|
3954
|
+
*/
|
|
3926
3955
|
export class ChatResponseFileTreePart {
|
|
3927
3956
|
value: theia.ChatResponseFileTree[];
|
|
3928
3957
|
baseUri: URI;
|
|
@@ -3943,17 +3972,20 @@ export enum LanguageModelChatMessageRole {
|
|
|
3943
3972
|
Assistant = 2
|
|
3944
3973
|
}
|
|
3945
3974
|
|
|
3975
|
+
/**
|
|
3976
|
+
* @stubbed
|
|
3977
|
+
*/
|
|
3946
3978
|
export class LanguageModelChatMessage {
|
|
3947
|
-
|
|
3948
|
-
static User(content: string, name?: string): LanguageModelChatMessage {
|
|
3979
|
+
static User(content: string | (LanguageModelTextPart | LanguageModelToolResultPart)[], name?: string): LanguageModelChatMessage {
|
|
3949
3980
|
return new LanguageModelChatMessage(LanguageModelChatMessageRole.User, content, name);
|
|
3950
3981
|
}
|
|
3951
3982
|
|
|
3952
|
-
static Assistant(content: string, name?: string): LanguageModelChatMessage {
|
|
3983
|
+
static Assistant(content: string | (LanguageModelTextPart | LanguageModelToolResultPart)[], name?: string): LanguageModelChatMessage {
|
|
3953
3984
|
return new LanguageModelChatMessage(LanguageModelChatMessageRole.Assistant, content, name);
|
|
3954
3985
|
}
|
|
3955
3986
|
|
|
3956
|
-
constructor(public role: LanguageModelChatMessageRole, public content: string
|
|
3987
|
+
constructor(public role: LanguageModelChatMessageRole, public content: string | (LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart)[],
|
|
3988
|
+
public name?: string) { }
|
|
3957
3989
|
}
|
|
3958
3990
|
|
|
3959
3991
|
export class LanguageModelError extends Error {
|
|
@@ -3978,6 +4010,58 @@ export class LanguageModelError extends Error {
|
|
|
3978
4010
|
this.code = code ?? '';
|
|
3979
4011
|
}
|
|
3980
4012
|
}
|
|
4013
|
+
|
|
4014
|
+
export enum LanguageModelChatToolMode {
|
|
4015
|
+
Auto = 1,
|
|
4016
|
+
Required = 2
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
/**
|
|
4020
|
+
* @stubbed
|
|
4021
|
+
*/
|
|
4022
|
+
export class LanguageModelToolCallPart {
|
|
4023
|
+
callId: string;
|
|
4024
|
+
name: string;
|
|
4025
|
+
input: object;
|
|
4026
|
+
|
|
4027
|
+
constructor(callId: string, name: string, input: object) { }
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
/**
|
|
4031
|
+
* @stubbed
|
|
4032
|
+
*/
|
|
4033
|
+
export class LanguageModelToolResultPart {
|
|
4034
|
+
callId: string;
|
|
4035
|
+
content: (theia.LanguageModelTextPart | theia.LanguageModelPromptTsxPart | unknown)[];
|
|
4036
|
+
|
|
4037
|
+
constructor(callId: string, content: (theia.LanguageModelTextPart | theia.LanguageModelPromptTsxPart | unknown)[]) { }
|
|
4038
|
+
}
|
|
4039
|
+
|
|
4040
|
+
/**
|
|
4041
|
+
* @stubbed
|
|
4042
|
+
*/
|
|
4043
|
+
export class LanguageModelTextPart {
|
|
4044
|
+
value: string;
|
|
4045
|
+
constructor(value: string) { }
|
|
4046
|
+
}
|
|
4047
|
+
|
|
4048
|
+
/**
|
|
4049
|
+
* @stubbed
|
|
4050
|
+
*/
|
|
4051
|
+
export class LanguageModelToolResult {
|
|
4052
|
+
content: (theia.LanguageModelTextPart | theia.LanguageModelPromptTsxPart | unknown)[];
|
|
4053
|
+
|
|
4054
|
+
constructor(content: (theia.LanguageModelTextPart | theia.LanguageModelPromptTsxPart)[]) { }
|
|
4055
|
+
}
|
|
4056
|
+
|
|
4057
|
+
/**
|
|
4058
|
+
* @stubbed
|
|
4059
|
+
*/
|
|
4060
|
+
export class LanguageModelPromptTsxPart {
|
|
4061
|
+
value: unknown;
|
|
4062
|
+
|
|
4063
|
+
constructor(value: unknown) { }
|
|
4064
|
+
}
|
|
3981
4065
|
// #endregion
|
|
3982
4066
|
|
|
3983
4067
|
// #region Port Attributes
|