@theia/plugin 1.57.0 → 1.58.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.
|
|
3
|
+
"version": "1.58.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.
|
|
30
|
+
"@theia/ext-scripts": "1.58.0"
|
|
31
31
|
},
|
|
32
32
|
"nyc": {
|
|
33
33
|
"extends": "../../configs/nyc.json"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "6594f32b9727aea20d88934bf386dee06d08fa5e"
|
|
36
36
|
}
|
package/src/theia.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ import './theia.proposed.profileContentHandlers';
|
|
|
43
43
|
import './theia.proposed.resolvers';
|
|
44
44
|
import './theia.proposed.scmValidation';
|
|
45
45
|
import './theia.proposed.shareProvider';
|
|
46
|
+
import './theia.proposed.terminalCompletionProvider';
|
|
46
47
|
import './theia.proposed.terminalQuickFixProvider';
|
|
47
48
|
import './theia.proposed.textSearchProvider';
|
|
48
49
|
import './theia.proposed.timeline';
|
|
@@ -17325,31 +17326,37 @@ export module '@theia/plugin' {
|
|
|
17325
17326
|
*
|
|
17326
17327
|
* *Note* that the {@link ChatParticipant.name name} of the participant and the {@link ChatCommand.name command}
|
|
17327
17328
|
* are not part of the prompt.
|
|
17329
|
+
* @stubbed
|
|
17328
17330
|
*/
|
|
17329
17331
|
readonly prompt: string;
|
|
17330
17332
|
|
|
17331
17333
|
/**
|
|
17332
17334
|
* The id of the chat participant to which this request was directed.
|
|
17335
|
+
* @stubbed
|
|
17333
17336
|
*/
|
|
17334
17337
|
readonly participant: string;
|
|
17335
17338
|
|
|
17336
17339
|
/**
|
|
17337
17340
|
* The name of the {@link ChatCommand command} that was selected for this request.
|
|
17341
|
+
* @stubbed
|
|
17338
17342
|
*/
|
|
17339
17343
|
readonly command?: string;
|
|
17340
17344
|
|
|
17341
17345
|
/**
|
|
17342
17346
|
* The references that were used in this message.
|
|
17347
|
+
* @stubbed
|
|
17343
17348
|
*/
|
|
17344
17349
|
readonly references: ChatPromptReference[];
|
|
17345
17350
|
|
|
17346
17351
|
/**
|
|
17347
17352
|
* The list of tools were attached to this request.
|
|
17353
|
+
* @stubbed
|
|
17348
17354
|
*/
|
|
17349
17355
|
readonly toolReferences: readonly ChatLanguageModelToolReference[];
|
|
17350
17356
|
|
|
17351
17357
|
/**
|
|
17352
17358
|
* @hidden
|
|
17359
|
+
* @stubbed
|
|
17353
17360
|
*/
|
|
17354
17361
|
private constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[]);
|
|
17355
17362
|
}
|
|
@@ -17361,21 +17368,25 @@ export module '@theia/plugin' {
|
|
|
17361
17368
|
export class ChatResponseTurn {
|
|
17362
17369
|
/**
|
|
17363
17370
|
* The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented.
|
|
17371
|
+
* @stubbed
|
|
17364
17372
|
*/
|
|
17365
17373
|
readonly response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart>;
|
|
17366
17374
|
|
|
17367
17375
|
/**
|
|
17368
17376
|
* The result that was received from the chat participant.
|
|
17377
|
+
* @stubbed
|
|
17369
17378
|
*/
|
|
17370
17379
|
readonly result: ChatResult;
|
|
17371
17380
|
|
|
17372
17381
|
/**
|
|
17373
17382
|
* The id of the chat participant that this response came from.
|
|
17383
|
+
* @stubbed
|
|
17374
17384
|
*/
|
|
17375
17385
|
readonly participant: string;
|
|
17376
17386
|
|
|
17377
17387
|
/**
|
|
17378
17388
|
* The name of the command that this response came from.
|
|
17389
|
+
* @stubbed
|
|
17379
17390
|
*/
|
|
17380
17391
|
readonly command?: string;
|
|
17381
17392
|
|
|
@@ -17392,6 +17403,7 @@ export module '@theia/plugin' {
|
|
|
17392
17403
|
export interface ChatContext {
|
|
17393
17404
|
/**
|
|
17394
17405
|
* All of the chat messages so far in the current chat session. Currently, only chat messages for the current participant are included.
|
|
17406
|
+
* @stubbed
|
|
17395
17407
|
*/
|
|
17396
17408
|
readonly history: ReadonlyArray<ChatRequestTurn | ChatResponseTurn>;
|
|
17397
17409
|
}
|
|
@@ -17403,11 +17415,13 @@ export module '@theia/plugin' {
|
|
|
17403
17415
|
export interface ChatErrorDetails {
|
|
17404
17416
|
/**
|
|
17405
17417
|
* An error message that is shown to the user.
|
|
17418
|
+
* @stubbed
|
|
17406
17419
|
*/
|
|
17407
17420
|
message: string;
|
|
17408
17421
|
|
|
17409
17422
|
/**
|
|
17410
17423
|
* If set to true, the response will be partly blurred out.
|
|
17424
|
+
* @stubbed
|
|
17411
17425
|
*/
|
|
17412
17426
|
responseIsFiltered?: boolean;
|
|
17413
17427
|
}
|
|
@@ -17419,11 +17433,13 @@ export module '@theia/plugin' {
|
|
|
17419
17433
|
export interface ChatResult {
|
|
17420
17434
|
/**
|
|
17421
17435
|
* If the request resulted in an error, this property defines the error details.
|
|
17436
|
+
* @stubbed
|
|
17422
17437
|
*/
|
|
17423
17438
|
errorDetails?: ChatErrorDetails;
|
|
17424
17439
|
|
|
17425
17440
|
/**
|
|
17426
17441
|
* Arbitrary metadata for this result. Can be anything, but must be JSON-stringifyable.
|
|
17442
|
+
* @stubbed
|
|
17427
17443
|
*/
|
|
17428
17444
|
readonly metadata?: { readonly [key: string]: any };
|
|
17429
17445
|
}
|
|
@@ -17451,11 +17467,13 @@ export module '@theia/plugin' {
|
|
|
17451
17467
|
/**
|
|
17452
17468
|
* The ChatResult for which the user is providing feedback.
|
|
17453
17469
|
* This object has the same properties as the result returned from the participant callback, including `metadata`, but is not the same instance.
|
|
17470
|
+
* @stubbed
|
|
17454
17471
|
*/
|
|
17455
17472
|
readonly result: ChatResult;
|
|
17456
17473
|
|
|
17457
17474
|
/**
|
|
17458
17475
|
* The kind of feedback that was received.
|
|
17476
|
+
* @stubbed
|
|
17459
17477
|
*/
|
|
17460
17478
|
readonly kind: ChatResultFeedbackKind;
|
|
17461
17479
|
}
|
|
@@ -17467,22 +17485,26 @@ export module '@theia/plugin' {
|
|
|
17467
17485
|
export interface ChatFollowup {
|
|
17468
17486
|
/**
|
|
17469
17487
|
* The message to send to the chat.
|
|
17488
|
+
* @stubbed
|
|
17470
17489
|
*/
|
|
17471
17490
|
prompt: string;
|
|
17472
17491
|
|
|
17473
17492
|
/**
|
|
17474
17493
|
* A title to show the user. The prompt will be shown by default, when this is unspecified.
|
|
17494
|
+
* @stubbed
|
|
17475
17495
|
*/
|
|
17476
17496
|
label?: string;
|
|
17477
17497
|
|
|
17478
17498
|
/**
|
|
17479
17499
|
* By default, the followup goes to the same participant/command. But this property can be set to invoke a different participant by ID.
|
|
17480
17500
|
* Followups can only invoke a participant that was contributed by the same extension.
|
|
17501
|
+
* @stubbed
|
|
17481
17502
|
*/
|
|
17482
17503
|
participant?: string;
|
|
17483
17504
|
|
|
17484
17505
|
/**
|
|
17485
17506
|
* By default, the followup goes to the same participant/command. But this property can be set to invoke a different command.
|
|
17507
|
+
* @stubbed
|
|
17486
17508
|
*/
|
|
17487
17509
|
command?: string;
|
|
17488
17510
|
}
|
|
@@ -17515,21 +17537,25 @@ export module '@theia/plugin' {
|
|
|
17515
17537
|
export interface ChatParticipant {
|
|
17516
17538
|
/**
|
|
17517
17539
|
* A unique ID for this participant.
|
|
17540
|
+
* @stubbed
|
|
17518
17541
|
*/
|
|
17519
17542
|
readonly id: string;
|
|
17520
17543
|
|
|
17521
17544
|
/**
|
|
17522
17545
|
* An icon for the participant shown in UI.
|
|
17546
|
+
* @stubbed
|
|
17523
17547
|
*/
|
|
17524
17548
|
iconPath?: IconPath;
|
|
17525
17549
|
|
|
17526
17550
|
/**
|
|
17527
17551
|
* The handler for requests to this participant.
|
|
17552
|
+
* @stubbed
|
|
17528
17553
|
*/
|
|
17529
17554
|
requestHandler: ChatRequestHandler;
|
|
17530
17555
|
|
|
17531
17556
|
/**
|
|
17532
17557
|
* This provider will be called once after each request to retrieve suggested followup questions.
|
|
17558
|
+
* @stubbed
|
|
17533
17559
|
*/
|
|
17534
17560
|
followupProvider?: ChatFollowupProvider;
|
|
17535
17561
|
|
|
@@ -17539,11 +17565,13 @@ export module '@theia/plugin' {
|
|
|
17539
17565
|
*
|
|
17540
17566
|
* The passed {@link ChatResultFeedback.result result} is guaranteed to be the same instance that was
|
|
17541
17567
|
* previously returned from this chat participant.
|
|
17568
|
+
* @stubbed
|
|
17542
17569
|
*/
|
|
17543
17570
|
onDidReceiveFeedback: Event<ChatResultFeedback>;
|
|
17544
17571
|
|
|
17545
17572
|
/**
|
|
17546
17573
|
* Dispose this participant and free resources.
|
|
17574
|
+
* @stubbed
|
|
17547
17575
|
*/
|
|
17548
17576
|
dispose(): void;
|
|
17549
17577
|
}
|
|
@@ -17555,6 +17583,7 @@ export module '@theia/plugin' {
|
|
|
17555
17583
|
export interface ChatPromptReference {
|
|
17556
17584
|
/**
|
|
17557
17585
|
* A unique identifier for this kind of reference.
|
|
17586
|
+
* @stubbed
|
|
17558
17587
|
*/
|
|
17559
17588
|
readonly id: string;
|
|
17560
17589
|
|
|
@@ -17563,16 +17592,19 @@ export module '@theia/plugin' {
|
|
|
17563
17592
|
*
|
|
17564
17593
|
* *Note* that the indices take the leading `#`-character into account which means they can
|
|
17565
17594
|
* used to modify the prompt as-is.
|
|
17595
|
+
* @stubbed
|
|
17566
17596
|
*/
|
|
17567
17597
|
readonly range?: [start: number, end: number];
|
|
17568
17598
|
|
|
17569
17599
|
/**
|
|
17570
17600
|
* A description of this value that could be used in an LLM prompt.
|
|
17601
|
+
* @stubbed
|
|
17571
17602
|
*/
|
|
17572
17603
|
readonly modelDescription?: string;
|
|
17573
17604
|
|
|
17574
17605
|
/**
|
|
17575
17606
|
* The value of this reference. The `string | Uri | Location` types are used today, but this could expand in the future.
|
|
17607
|
+
* @stubbed
|
|
17576
17608
|
*/
|
|
17577
17609
|
readonly value: string | Uri | Location | unknown;
|
|
17578
17610
|
}
|
|
@@ -17589,11 +17621,13 @@ export module '@theia/plugin' {
|
|
|
17589
17621
|
*
|
|
17590
17622
|
* *Note* that the {@link ChatParticipant.name name} of the participant and the {@link ChatCommand.name command}
|
|
17591
17623
|
* are not part of the prompt.
|
|
17624
|
+
* @stubbed
|
|
17592
17625
|
*/
|
|
17593
17626
|
readonly prompt: string;
|
|
17594
17627
|
|
|
17595
17628
|
/**
|
|
17596
17629
|
* The name of the {@link ChatCommand command} that was selected for this request.
|
|
17630
|
+
* @stubbed
|
|
17597
17631
|
*/
|
|
17598
17632
|
readonly command: string | undefined;
|
|
17599
17633
|
|
|
@@ -17605,6 +17639,7 @@ export module '@theia/plugin' {
|
|
|
17605
17639
|
* headings which contain the resolved values. References are sorted in reverse by their range
|
|
17606
17640
|
* in the prompt. That means the last reference in the prompt is the first in this list. This simplifies
|
|
17607
17641
|
* string-manipulation of the prompt.
|
|
17642
|
+
* @stubbed
|
|
17608
17643
|
*/
|
|
17609
17644
|
readonly references: readonly ChatPromptReference[];
|
|
17610
17645
|
|
|
@@ -17615,18 +17650,21 @@ export module '@theia/plugin' {
|
|
|
17615
17650
|
* {@link LanguageModelChatToolMode.Required} to force the language model to generate input for the tool. Then, the
|
|
17616
17651
|
* participant can use {@link lm.invokeTool} to use the tool attach the result to its request for the user's prompt. The
|
|
17617
17652
|
* tool may contribute useful extra context for the user's request.
|
|
17653
|
+
* @stubbed
|
|
17618
17654
|
*/
|
|
17619
17655
|
readonly toolReferences: readonly ChatLanguageModelToolReference[];
|
|
17620
17656
|
|
|
17621
17657
|
/**
|
|
17622
17658
|
* A token that can be passed to {@link lm.invokeTool} when invoking a tool inside the context of handling a chat request.
|
|
17623
17659
|
* This associates the tool invocation to a chat session.
|
|
17660
|
+
* @stubbed
|
|
17624
17661
|
*/
|
|
17625
17662
|
readonly toolInvocationToken: ChatParticipantToolToken;
|
|
17626
17663
|
|
|
17627
17664
|
/**
|
|
17628
17665
|
* This is the model that is currently selected in the UI. Extensions can use this or use {@link chat.selectChatModels} to
|
|
17629
17666
|
* pick another model. Don't hold onto this past the lifetime of the request.
|
|
17667
|
+
* @stubbed
|
|
17630
17668
|
*/
|
|
17631
17669
|
readonly model: LanguageModelChat;
|
|
17632
17670
|
}
|
|
@@ -17644,6 +17682,7 @@ export module '@theia/plugin' {
|
|
|
17644
17682
|
*
|
|
17645
17683
|
* @see {@link ChatResponseStream.push}
|
|
17646
17684
|
* @param value A markdown string or a string that should be interpreted as markdown. The boolean form of {@link MarkdownString.isTrusted} is NOT supported.
|
|
17685
|
+
* @stubbed
|
|
17647
17686
|
*/
|
|
17648
17687
|
markdown(value: string | MarkdownString): void;
|
|
17649
17688
|
|
|
@@ -17654,6 +17693,7 @@ export module '@theia/plugin' {
|
|
|
17654
17693
|
*
|
|
17655
17694
|
* @param value A uri or location.
|
|
17656
17695
|
* @param title An optional title that is rendered with value.
|
|
17696
|
+
* @stubbed
|
|
17657
17697
|
*/
|
|
17658
17698
|
anchor(value: Uri | Location, title?: string): void;
|
|
17659
17699
|
|
|
@@ -17662,6 +17702,7 @@ export module '@theia/plugin' {
|
|
|
17662
17702
|
* `push(new ChatResponseCommandButtonPart(value, title))`.
|
|
17663
17703
|
*
|
|
17664
17704
|
* @param command A Command that will be executed when the button is clicked.
|
|
17705
|
+
* @stubbed
|
|
17665
17706
|
*/
|
|
17666
17707
|
button(command: Command): void;
|
|
17667
17708
|
|
|
@@ -17671,6 +17712,7 @@ export module '@theia/plugin' {
|
|
|
17671
17712
|
*
|
|
17672
17713
|
* @param value File tree data.
|
|
17673
17714
|
* @param baseUri The base uri to which this file tree is relative.
|
|
17715
|
+
* @stubbed
|
|
17674
17716
|
*/
|
|
17675
17717
|
filetree(value: ChatResponseFileTree[], baseUri: Uri): void;
|
|
17676
17718
|
|
|
@@ -17679,6 +17721,7 @@ export module '@theia/plugin' {
|
|
|
17679
17721
|
* `push(new ChatResponseProgressPart(value))`.
|
|
17680
17722
|
*
|
|
17681
17723
|
* @param value A progress message
|
|
17724
|
+
* @stubbed
|
|
17682
17725
|
*/
|
|
17683
17726
|
progress(value: string): void;
|
|
17684
17727
|
|
|
@@ -17690,6 +17733,7 @@ export module '@theia/plugin' {
|
|
|
17690
17733
|
*
|
|
17691
17734
|
* @param value A uri or location
|
|
17692
17735
|
* @param iconPath Icon for the reference shown in UI
|
|
17736
|
+
* @stubbed
|
|
17693
17737
|
*/
|
|
17694
17738
|
reference(value: Uri | Location, iconPath?: IconPath): void;
|
|
17695
17739
|
|
|
@@ -17697,6 +17741,7 @@ export module '@theia/plugin' {
|
|
|
17697
17741
|
* Pushes a part to this stream.
|
|
17698
17742
|
*
|
|
17699
17743
|
* @param part A response part, rendered or metadata
|
|
17744
|
+
* @stubbed
|
|
17700
17745
|
*/
|
|
17701
17746
|
push(part: ChatResponsePart): void;
|
|
17702
17747
|
}
|
|
@@ -17708,6 +17753,7 @@ export module '@theia/plugin' {
|
|
|
17708
17753
|
export class ChatResponseMarkdownPart {
|
|
17709
17754
|
/**
|
|
17710
17755
|
* A markdown string or a string that should be interpreted as markdown.
|
|
17756
|
+
* @stubbed
|
|
17711
17757
|
*/
|
|
17712
17758
|
value: MarkdownString;
|
|
17713
17759
|
|
|
@@ -17715,6 +17761,7 @@ export module '@theia/plugin' {
|
|
|
17715
17761
|
* Create a new ChatResponseMarkdownPart.
|
|
17716
17762
|
*
|
|
17717
17763
|
* @param value A markdown string or a string that should be interpreted as markdown. The boolean form of {@link MarkdownString.isTrusted} is NOT supported.
|
|
17764
|
+
* @stubbed
|
|
17718
17765
|
*/
|
|
17719
17766
|
constructor(value: string | MarkdownString);
|
|
17720
17767
|
}
|
|
@@ -17726,11 +17773,13 @@ export module '@theia/plugin' {
|
|
|
17726
17773
|
export interface ChatResponseFileTree {
|
|
17727
17774
|
/**
|
|
17728
17775
|
* The name of the file or directory.
|
|
17776
|
+
* @stubbed
|
|
17729
17777
|
*/
|
|
17730
17778
|
name: string;
|
|
17731
17779
|
|
|
17732
17780
|
/**
|
|
17733
17781
|
* An array of child file trees, if the current file tree is a directory.
|
|
17782
|
+
* @stubbed
|
|
17734
17783
|
*/
|
|
17735
17784
|
children?: ChatResponseFileTree[];
|
|
17736
17785
|
}
|
|
@@ -17742,11 +17791,13 @@ export module '@theia/plugin' {
|
|
|
17742
17791
|
export class ChatResponseFileTreePart {
|
|
17743
17792
|
/**
|
|
17744
17793
|
* File tree data.
|
|
17794
|
+
* @stubbed
|
|
17745
17795
|
*/
|
|
17746
17796
|
value: ChatResponseFileTree[];
|
|
17747
17797
|
|
|
17748
17798
|
/**
|
|
17749
17799
|
* The base uri to which this file tree is relative
|
|
17800
|
+
* @stubbed
|
|
17750
17801
|
*/
|
|
17751
17802
|
baseUri: Uri;
|
|
17752
17803
|
|
|
@@ -17754,6 +17805,7 @@ export module '@theia/plugin' {
|
|
|
17754
17805
|
* Create a new ChatResponseFileTreePart.
|
|
17755
17806
|
* @param value File tree data.
|
|
17756
17807
|
* @param baseUri The base uri to which this file tree is relative.
|
|
17808
|
+
* @stubbed
|
|
17757
17809
|
*/
|
|
17758
17810
|
constructor(value: ChatResponseFileTree[], baseUri: Uri);
|
|
17759
17811
|
}
|
|
@@ -17765,11 +17817,13 @@ export module '@theia/plugin' {
|
|
|
17765
17817
|
export class ChatResponseAnchorPart {
|
|
17766
17818
|
/**
|
|
17767
17819
|
* The target of this anchor.
|
|
17820
|
+
* @stubbed
|
|
17768
17821
|
*/
|
|
17769
17822
|
value: Uri | Location;
|
|
17770
17823
|
|
|
17771
17824
|
/**
|
|
17772
17825
|
* An optional title that is rendered with value.
|
|
17826
|
+
* @stubbed
|
|
17773
17827
|
*/
|
|
17774
17828
|
title?: string;
|
|
17775
17829
|
|
|
@@ -17777,6 +17831,7 @@ export module '@theia/plugin' {
|
|
|
17777
17831
|
* Create a new ChatResponseAnchorPart.
|
|
17778
17832
|
* @param value A uri or location.
|
|
17779
17833
|
* @param title An optional title that is rendered with value.
|
|
17834
|
+
* @stubbed
|
|
17780
17835
|
*/
|
|
17781
17836
|
constructor(value: Uri | Location, title?: string);
|
|
17782
17837
|
}
|
|
@@ -17788,12 +17843,14 @@ export module '@theia/plugin' {
|
|
|
17788
17843
|
export class ChatResponseProgressPart {
|
|
17789
17844
|
/**
|
|
17790
17845
|
* The progress message
|
|
17846
|
+
* @stubbed
|
|
17791
17847
|
*/
|
|
17792
17848
|
value: string;
|
|
17793
17849
|
|
|
17794
17850
|
/**
|
|
17795
17851
|
* Create a new ChatResponseProgressPart.
|
|
17796
17852
|
* @param value A progress message
|
|
17853
|
+
* @stubbed
|
|
17797
17854
|
*/
|
|
17798
17855
|
constructor(value: string);
|
|
17799
17856
|
}
|
|
@@ -17805,11 +17862,13 @@ export module '@theia/plugin' {
|
|
|
17805
17862
|
export class ChatResponseReferencePart {
|
|
17806
17863
|
/**
|
|
17807
17864
|
* The reference target.
|
|
17865
|
+
* @stubbed
|
|
17808
17866
|
*/
|
|
17809
17867
|
value: Uri | Location;
|
|
17810
17868
|
|
|
17811
17869
|
/**
|
|
17812
17870
|
* The icon for the reference.
|
|
17871
|
+
* @stubbed
|
|
17813
17872
|
*/
|
|
17814
17873
|
iconPath?: IconPath;
|
|
17815
17874
|
|
|
@@ -17817,6 +17876,7 @@ export module '@theia/plugin' {
|
|
|
17817
17876
|
* Create a new ChatResponseReferencePart.
|
|
17818
17877
|
* @param value A uri or location
|
|
17819
17878
|
* @param iconPath Icon for the reference shown in UI
|
|
17879
|
+
* @stubbed
|
|
17820
17880
|
*/
|
|
17821
17881
|
constructor(value: Uri | Location, iconPath?: IconPath);
|
|
17822
17882
|
}
|
|
@@ -17828,12 +17888,14 @@ export module '@theia/plugin' {
|
|
|
17828
17888
|
export class ChatResponseCommandButtonPart {
|
|
17829
17889
|
/**
|
|
17830
17890
|
* The command that will be executed when the button is clicked.
|
|
17891
|
+
* @stubbed
|
|
17831
17892
|
*/
|
|
17832
17893
|
value: Command;
|
|
17833
17894
|
|
|
17834
17895
|
/**
|
|
17835
17896
|
* Create a new ChatResponseCommandButtonPart.
|
|
17836
17897
|
* @param value A Command that will be executed when the button is clicked.
|
|
17898
|
+
* @stubbed
|
|
17837
17899
|
*/
|
|
17838
17900
|
constructor(value: Command);
|
|
17839
17901
|
}
|
|
@@ -17887,6 +17949,7 @@ export module '@theia/plugin' {
|
|
|
17887
17949
|
*
|
|
17888
17950
|
* @param content The content of the message.
|
|
17889
17951
|
* @param name The optional name of a user for the message.
|
|
17952
|
+
* @stubbed
|
|
17890
17953
|
*/
|
|
17891
17954
|
static User(content: string | Array<LanguageModelTextPart | LanguageModelToolResultPart>, name?: string): LanguageModelChatMessage;
|
|
17892
17955
|
|
|
@@ -17895,27 +17958,32 @@ export module '@theia/plugin' {
|
|
|
17895
17958
|
*
|
|
17896
17959
|
* @param content The content of the message.
|
|
17897
17960
|
* @param name The optional name of a user for the message.
|
|
17961
|
+
* @stubbed
|
|
17898
17962
|
*/
|
|
17899
17963
|
static Assistant(content: string | Array<(LanguageModelTextPart | LanguageModelToolCallPart)>, name?: string): LanguageModelChatMessage;
|
|
17900
17964
|
|
|
17901
17965
|
/**
|
|
17902
17966
|
* The role of this message.
|
|
17967
|
+
* @stubbed
|
|
17903
17968
|
*/
|
|
17904
17969
|
role: LanguageModelChatMessageRole;
|
|
17905
17970
|
|
|
17906
17971
|
/**
|
|
17907
17972
|
* A string or heterogeneous array of things that a message can contain as content. Some parts may be message-type
|
|
17908
17973
|
* specific for some models.
|
|
17974
|
+
* @stubbed
|
|
17909
17975
|
*/
|
|
17910
17976
|
content: Array<(LanguageModelTextPart | LanguageModelToolResultPart | LanguageModelToolCallPart)>;
|
|
17911
17977
|
|
|
17912
17978
|
/**
|
|
17913
17979
|
* The optional name of a user for this message.
|
|
17980
|
+
* @stubbed
|
|
17914
17981
|
*/
|
|
17915
17982
|
name: string | undefined;
|
|
17916
17983
|
|
|
17917
17984
|
/**
|
|
17918
17985
|
* Create a new user message.
|
|
17986
|
+
* @stubbed
|
|
17919
17987
|
*
|
|
17920
17988
|
* @param role The role of the message.
|
|
17921
17989
|
* @param content The content of the message.
|
|
@@ -17962,6 +18030,7 @@ export module '@theia/plugin' {
|
|
|
17962
18030
|
* console.error(e);
|
|
17963
18031
|
* }
|
|
17964
18032
|
* ```
|
|
18033
|
+
* @stubbed
|
|
17965
18034
|
*/
|
|
17966
18035
|
stream: AsyncIterable<LanguageModelTextPart | LanguageModelToolCallPart | unknown>;
|
|
17967
18036
|
|
|
@@ -17969,6 +18038,7 @@ export module '@theia/plugin' {
|
|
|
17969
18038
|
* This is equivalent to filtering everything except for text parts from a {@link LanguageModelChatResponse.stream}.
|
|
17970
18039
|
*
|
|
17971
18040
|
* @see {@link LanguageModelChatResponse.stream}
|
|
18041
|
+
* @stubbed
|
|
17972
18042
|
*/
|
|
17973
18043
|
text: AsyncIterable<string>;
|
|
17974
18044
|
}
|
|
@@ -17983,34 +18053,40 @@ export module '@theia/plugin' {
|
|
|
17983
18053
|
|
|
17984
18054
|
/**
|
|
17985
18055
|
* Human-readable name of the language model.
|
|
18056
|
+
* @stubbed
|
|
17986
18057
|
*/
|
|
17987
18058
|
readonly name: string;
|
|
17988
18059
|
|
|
17989
18060
|
/**
|
|
17990
18061
|
* Opaque identifier of the language model.
|
|
18062
|
+
* @stubbed
|
|
17991
18063
|
*/
|
|
17992
18064
|
readonly id: string;
|
|
17993
18065
|
|
|
17994
18066
|
/**
|
|
17995
18067
|
* A well-known identifier of the vendor of the language model. An example is `copilot`, but
|
|
17996
18068
|
* values are defined by extensions contributing chat models and need to be looked up with them.
|
|
18069
|
+
* @stubbed
|
|
17997
18070
|
*/
|
|
17998
18071
|
readonly vendor: string;
|
|
17999
18072
|
|
|
18000
18073
|
/**
|
|
18001
18074
|
* Opaque family-name of the language model. Values might be `gpt-3.5-turbo`, `gpt4`, `phi2`, or `llama`
|
|
18002
18075
|
* but they are defined by extensions contributing languages and subject to change.
|
|
18076
|
+
* @stubbed
|
|
18003
18077
|
*/
|
|
18004
18078
|
readonly family: string;
|
|
18005
18079
|
|
|
18006
18080
|
/**
|
|
18007
18081
|
* Opaque version string of the model. This is defined by the extension contributing the language model
|
|
18008
18082
|
* and subject to change.
|
|
18083
|
+
* @stubbed
|
|
18009
18084
|
*/
|
|
18010
18085
|
readonly version: string;
|
|
18011
18086
|
|
|
18012
18087
|
/**
|
|
18013
18088
|
* The maximum number of tokens that can be sent to the model in a single request.
|
|
18089
|
+
* @stubbed
|
|
18014
18090
|
*/
|
|
18015
18091
|
readonly maxInputTokens: number;
|
|
18016
18092
|
|
|
@@ -18038,6 +18114,7 @@ export module '@theia/plugin' {
|
|
|
18038
18114
|
* @param options Options that control the request.
|
|
18039
18115
|
* @param token A cancellation token which controls the request. See {@link CancellationTokenSource} for how to create one.
|
|
18040
18116
|
* @returns A thenable that resolves to a {@link LanguageModelChatResponse}. The promise will reject when the request couldn't be made.
|
|
18117
|
+
* @stubbed
|
|
18041
18118
|
*/
|
|
18042
18119
|
sendRequest(messages: LanguageModelChatMessage[], options?: LanguageModelChatRequestOptions, token?: CancellationToken): Thenable<LanguageModelChatResponse>;
|
|
18043
18120
|
|
|
@@ -18046,6 +18123,7 @@ export module '@theia/plugin' {
|
|
|
18046
18123
|
* @param text A string or a message instance.
|
|
18047
18124
|
* @param token Optional cancellation token. See {@link CancellationTokenSource} for how to create one.
|
|
18048
18125
|
* @returns A thenable that resolves to the number of tokens.
|
|
18126
|
+
* @stubbed
|
|
18049
18127
|
*/
|
|
18050
18128
|
countTokens(text: string | LanguageModelChatMessage, token?: CancellationToken): Thenable<number>;
|
|
18051
18129
|
}
|
|
@@ -18061,24 +18139,28 @@ export module '@theia/plugin' {
|
|
|
18061
18139
|
/**
|
|
18062
18140
|
* A vendor of language models.
|
|
18063
18141
|
* @see {@link LanguageModelChat.vendor}
|
|
18142
|
+
* @stubbed
|
|
18064
18143
|
*/
|
|
18065
18144
|
vendor?: string;
|
|
18066
18145
|
|
|
18067
18146
|
/**
|
|
18068
18147
|
* A family of language models.
|
|
18069
18148
|
* @see {@link LanguageModelChat.family}
|
|
18149
|
+
* @stubbed
|
|
18070
18150
|
*/
|
|
18071
18151
|
family?: string;
|
|
18072
18152
|
|
|
18073
18153
|
/**
|
|
18074
18154
|
* The version of a language model.
|
|
18075
18155
|
* @see {@link LanguageModelChat.version}
|
|
18156
|
+
* @stubbed
|
|
18076
18157
|
*/
|
|
18077
18158
|
version?: string;
|
|
18078
18159
|
|
|
18079
18160
|
/**
|
|
18080
18161
|
* The identifier of a language model.
|
|
18081
18162
|
* @see {@link LanguageModelChat.id}
|
|
18163
|
+
* @stubbed
|
|
18082
18164
|
*/
|
|
18083
18165
|
id?: string;
|
|
18084
18166
|
}
|
|
@@ -18097,16 +18179,19 @@ export module '@theia/plugin' {
|
|
|
18097
18179
|
/**
|
|
18098
18180
|
* The requestor does not have permissions to use this
|
|
18099
18181
|
* language model
|
|
18182
|
+
* @stubbed
|
|
18100
18183
|
*/
|
|
18101
18184
|
static NoPermissions(message?: string): LanguageModelError;
|
|
18102
18185
|
|
|
18103
18186
|
/**
|
|
18104
18187
|
* The requestor is blocked from using this language model.
|
|
18188
|
+
* @stubbed
|
|
18105
18189
|
*/
|
|
18106
18190
|
static Blocked(message?: string): LanguageModelError;
|
|
18107
18191
|
|
|
18108
18192
|
/**
|
|
18109
18193
|
* The language model does not exist.
|
|
18194
|
+
* @stubbed
|
|
18110
18195
|
*/
|
|
18111
18196
|
static NotFound(message?: string): LanguageModelError;
|
|
18112
18197
|
|
|
@@ -18116,6 +18201,7 @@ export module '@theia/plugin' {
|
|
|
18116
18201
|
* Possible values are names of errors, like {@linkcode LanguageModelError.NotFound NotFound},
|
|
18117
18202
|
* or `Unknown` for unspecified errors from the language model itself. In the latter case the
|
|
18118
18203
|
* `cause`-property will contain the actual error.
|
|
18204
|
+
* @stubbed
|
|
18119
18205
|
*/
|
|
18120
18206
|
readonly code: string;
|
|
18121
18207
|
}
|
|
@@ -18130,12 +18216,14 @@ export module '@theia/plugin' {
|
|
|
18130
18216
|
|
|
18131
18217
|
/**
|
|
18132
18218
|
* A human-readable message that explains why access to a language model is needed and what feature is enabled by it.
|
|
18219
|
+
* @stubbed
|
|
18133
18220
|
*/
|
|
18134
18221
|
justification?: string;
|
|
18135
18222
|
|
|
18136
18223
|
/**
|
|
18137
18224
|
* A set of options that control the behavior of the language model. These options are specific to the language model
|
|
18138
18225
|
* and need to be lookup in the respective documentation.
|
|
18226
|
+
* @stubbed
|
|
18139
18227
|
*/
|
|
18140
18228
|
modelOptions?: { [name: string]: any };
|
|
18141
18229
|
|
|
@@ -18149,11 +18237,13 @@ export module '@theia/plugin' {
|
|
|
18149
18237
|
*
|
|
18150
18238
|
* Then, the tool result can be provided to the LLM by creating an Assistant-type {@link LanguageModelChatMessage} with a
|
|
18151
18239
|
* {@link LanguageModelToolCallPart}, followed by a User-type message with a {@link LanguageModelToolResultPart}.
|
|
18240
|
+
* @stubbed
|
|
18152
18241
|
*/
|
|
18153
18242
|
tools?: LanguageModelChatTool[];
|
|
18154
18243
|
|
|
18155
18244
|
/**
|
|
18156
18245
|
* The tool-selecting mode to use. {@link LanguageModelChatToolMode.Auto} by default.
|
|
18246
|
+
* @stubbed
|
|
18157
18247
|
*/
|
|
18158
18248
|
toolMode?: LanguageModelChatToolMode;
|
|
18159
18249
|
}
|
|
@@ -18251,6 +18341,7 @@ export module '@theia/plugin' {
|
|
|
18251
18341
|
|
|
18252
18342
|
/**
|
|
18253
18343
|
* An event that fires when access information changes.
|
|
18344
|
+
* @stubbed
|
|
18254
18345
|
*/
|
|
18255
18346
|
onDidChange: Event<void>;
|
|
18256
18347
|
|
|
@@ -18262,6 +18353,7 @@ export module '@theia/plugin' {
|
|
|
18262
18353
|
* @param chat A language model chat object.
|
|
18263
18354
|
* @return `true` if a request can be made, `false` if not, `undefined` if the language
|
|
18264
18355
|
* model does not exist or consent hasn't been asked for.
|
|
18356
|
+
* @stubbed
|
|
18265
18357
|
*/
|
|
18266
18358
|
canSendRequest(chat: LanguageModelChat): boolean | undefined;
|
|
18267
18359
|
|
|
@@ -18275,16 +18367,19 @@ export module '@theia/plugin' {
|
|
|
18275
18367
|
export interface LanguageModelChatTool {
|
|
18276
18368
|
/**
|
|
18277
18369
|
* The name of the tool.
|
|
18370
|
+
* @stubbed
|
|
18278
18371
|
*/
|
|
18279
18372
|
name: string;
|
|
18280
18373
|
|
|
18281
18374
|
/**
|
|
18282
18375
|
* The description of the tool.
|
|
18376
|
+
* @stubbed
|
|
18283
18377
|
*/
|
|
18284
18378
|
description: string;
|
|
18285
18379
|
|
|
18286
18380
|
/**
|
|
18287
18381
|
* A JSON schema for the input this tool accepts.
|
|
18382
|
+
* @stubbed
|
|
18288
18383
|
*/
|
|
18289
18384
|
inputSchema?: object;
|
|
18290
18385
|
}
|
|
@@ -18313,16 +18408,19 @@ export module '@theia/plugin' {
|
|
|
18313
18408
|
export class LanguageModelToolCallPart {
|
|
18314
18409
|
/**
|
|
18315
18410
|
* The ID of the tool call. This is a unique identifier for the tool call within the chat request.
|
|
18411
|
+
* @stubbed
|
|
18316
18412
|
*/
|
|
18317
18413
|
callId: string;
|
|
18318
18414
|
|
|
18319
18415
|
/**
|
|
18320
18416
|
* The name of the tool to call.
|
|
18417
|
+
* @stubbed
|
|
18321
18418
|
*/
|
|
18322
18419
|
name: string;
|
|
18323
18420
|
|
|
18324
18421
|
/**
|
|
18325
18422
|
* The input with which to call the tool.
|
|
18423
|
+
* @stubbed
|
|
18326
18424
|
*/
|
|
18327
18425
|
input: object;
|
|
18328
18426
|
|
|
@@ -18332,6 +18430,7 @@ export module '@theia/plugin' {
|
|
|
18332
18430
|
* @param callId The ID of the tool call.
|
|
18333
18431
|
* @param name The name of the tool to call.
|
|
18334
18432
|
* @param input The input with which to call the tool.
|
|
18433
|
+
* @stubbed
|
|
18335
18434
|
*/
|
|
18336
18435
|
constructor(callId: string, name: string, input: object);
|
|
18337
18436
|
}
|
|
@@ -18346,17 +18445,20 @@ export module '@theia/plugin' {
|
|
|
18346
18445
|
* The ID of the tool call.
|
|
18347
18446
|
*
|
|
18348
18447
|
* *Note* that this should match the {@link LanguageModelToolCallPart.callId callId} of a tool call part.
|
|
18448
|
+
* @stubbed
|
|
18349
18449
|
*/
|
|
18350
18450
|
callId: string;
|
|
18351
18451
|
|
|
18352
18452
|
/**
|
|
18353
18453
|
* The value of the tool result.
|
|
18454
|
+
* @stubbed
|
|
18354
18455
|
*/
|
|
18355
18456
|
content: Array<LanguageModelTextPart | LanguageModelPromptTsxPart | unknown>;
|
|
18356
18457
|
|
|
18357
18458
|
/**
|
|
18358
18459
|
* @param callId The ID of the tool call.
|
|
18359
18460
|
* @param content The content of the tool result.
|
|
18461
|
+
* @stubbed
|
|
18360
18462
|
*/
|
|
18361
18463
|
constructor(callId: string, content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart | unknown)>);
|
|
18362
18464
|
}
|
|
@@ -18368,12 +18470,14 @@ export module '@theia/plugin' {
|
|
|
18368
18470
|
export class LanguageModelTextPart {
|
|
18369
18471
|
/**
|
|
18370
18472
|
* The text content of the part.
|
|
18473
|
+
* @stubbed
|
|
18371
18474
|
*/
|
|
18372
18475
|
value: string;
|
|
18373
18476
|
|
|
18374
18477
|
/**
|
|
18375
18478
|
* Construct a text part with the given content.
|
|
18376
18479
|
* @param value The text content of the part.
|
|
18480
|
+
* @stubbed
|
|
18377
18481
|
*/
|
|
18378
18482
|
constructor(value: string);
|
|
18379
18483
|
}
|
|
@@ -18386,12 +18490,14 @@ export module '@theia/plugin' {
|
|
|
18386
18490
|
export class LanguageModelPromptTsxPart {
|
|
18387
18491
|
/**
|
|
18388
18492
|
* The value of the part.
|
|
18493
|
+
* @stubbed
|
|
18389
18494
|
*/
|
|
18390
18495
|
value: unknown;
|
|
18391
18496
|
|
|
18392
18497
|
/**
|
|
18393
18498
|
* Construct a prompt-tsx part with the given content.
|
|
18394
18499
|
* @param value The value of the part, the result of `renderPromptElementJSON` from `@vscode/prompt-tsx`.
|
|
18500
|
+
* @stubbed
|
|
18395
18501
|
*/
|
|
18396
18502
|
constructor(value: unknown);
|
|
18397
18503
|
}
|
|
@@ -18405,12 +18511,14 @@ export module '@theia/plugin' {
|
|
|
18405
18511
|
* A list of tool result content parts. Includes `unknown` becauses this list may be extended with new content types in
|
|
18406
18512
|
* the future.
|
|
18407
18513
|
* @see {@link lm.invokeTool}.
|
|
18514
|
+
* @stubbed
|
|
18408
18515
|
*/
|
|
18409
18516
|
content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart | unknown)>;
|
|
18410
18517
|
|
|
18411
18518
|
/**
|
|
18412
18519
|
* Create a LanguageModelToolResult
|
|
18413
18520
|
* @param content A list of tool result content parts
|
|
18521
|
+
* @stubbed
|
|
18414
18522
|
*/
|
|
18415
18523
|
constructor(content: Array<(LanguageModelTextPart | LanguageModelPromptTsxPart)>);
|
|
18416
18524
|
}
|
|
@@ -18436,18 +18544,21 @@ export module '@theia/plugin' {
|
|
|
18436
18544
|
* confirmations will be shown.
|
|
18437
18545
|
*
|
|
18438
18546
|
* *Note* that a tool that invokes another tool during its invocation, can pass along the `toolInvocationToken` that it received.
|
|
18547
|
+
* @stubbed
|
|
18439
18548
|
*/
|
|
18440
18549
|
toolInvocationToken: ChatParticipantToolToken | undefined;
|
|
18441
18550
|
|
|
18442
18551
|
/**
|
|
18443
18552
|
* The input with which to invoke the tool. The input must match the schema defined in
|
|
18444
18553
|
* {@link LanguageModelToolInformation.inputSchema}
|
|
18554
|
+
* @stubbed
|
|
18445
18555
|
*/
|
|
18446
18556
|
input: T;
|
|
18447
18557
|
|
|
18448
18558
|
/**
|
|
18449
18559
|
* Options to hint at how many tokens the tool should return in its response, and enable the tool to count tokens
|
|
18450
18560
|
* accurately.
|
|
18561
|
+
* @stubbed
|
|
18451
18562
|
*/
|
|
18452
18563
|
tokenizationOptions?: LanguageModelToolTokenizationOptions;
|
|
18453
18564
|
}
|
|
@@ -18459,6 +18570,7 @@ export module '@theia/plugin' {
|
|
|
18459
18570
|
export interface LanguageModelToolTokenizationOptions {
|
|
18460
18571
|
/**
|
|
18461
18572
|
* If known, the maximum number of tokens the tool should emit in its result.
|
|
18573
|
+
* @stubbed
|
|
18462
18574
|
*/
|
|
18463
18575
|
tokenBudget: number;
|
|
18464
18576
|
|
|
@@ -18467,6 +18579,7 @@ export module '@theia/plugin' {
|
|
|
18467
18579
|
* @param text A string.
|
|
18468
18580
|
* @param token Optional cancellation token. See {@link CancellationTokenSource} for how to create one.
|
|
18469
18581
|
* @returns A thenable that resolves to the number of tokens.
|
|
18582
|
+
* @stubbed
|
|
18470
18583
|
*/
|
|
18471
18584
|
countTokens(text: string, token?: CancellationToken): Thenable<number>;
|
|
18472
18585
|
}
|
|
@@ -18478,22 +18591,26 @@ export module '@theia/plugin' {
|
|
|
18478
18591
|
export interface LanguageModelToolInformation {
|
|
18479
18592
|
/**
|
|
18480
18593
|
* A unique name for the tool.
|
|
18594
|
+
* @stubbed
|
|
18481
18595
|
*/
|
|
18482
18596
|
readonly name: string;
|
|
18483
18597
|
|
|
18484
18598
|
/**
|
|
18485
18599
|
* A description of this tool that may be passed to a language model.
|
|
18600
|
+
* @stubbed
|
|
18486
18601
|
*/
|
|
18487
18602
|
readonly description: string;
|
|
18488
18603
|
|
|
18489
18604
|
/**
|
|
18490
18605
|
* A JSON schema for the input this tool accepts.
|
|
18606
|
+
* @stubbed
|
|
18491
18607
|
*/
|
|
18492
18608
|
readonly inputSchema: object | undefined;
|
|
18493
18609
|
|
|
18494
18610
|
/**
|
|
18495
18611
|
* A set of tags, declared by the tool, that roughly describe the tool's capabilities. A tool user may use these to filter
|
|
18496
18612
|
* the set of tools to just ones that are relevant for the task at hand.
|
|
18613
|
+
* @stubbed
|
|
18497
18614
|
*/
|
|
18498
18615
|
readonly tags: readonly string[];
|
|
18499
18616
|
}
|
|
@@ -18505,6 +18622,7 @@ export module '@theia/plugin' {
|
|
|
18505
18622
|
export interface LanguageModelToolInvocationPrepareOptions<T> {
|
|
18506
18623
|
/**
|
|
18507
18624
|
* The input that the tool is being invoked with.
|
|
18625
|
+
* @stubbed
|
|
18508
18626
|
*/
|
|
18509
18627
|
input: T;
|
|
18510
18628
|
}
|
|
@@ -18518,6 +18636,7 @@ export module '@theia/plugin' {
|
|
|
18518
18636
|
* Invoke the tool with the given input and return a result.
|
|
18519
18637
|
*
|
|
18520
18638
|
* The provided {@link LanguageModelToolInvocationOptions.input} has been validated against the declared schema.
|
|
18639
|
+
* @stubbed
|
|
18521
18640
|
*/
|
|
18522
18641
|
invoke(options: LanguageModelToolInvocationOptions<T>, token: CancellationToken): ProviderResult<LanguageModelToolResult>;
|
|
18523
18642
|
|
|
@@ -18528,6 +18647,7 @@ export module '@theia/plugin' {
|
|
|
18528
18647
|
*
|
|
18529
18648
|
* * *Note 1:* Must be free of side-effects.
|
|
18530
18649
|
* * *Note 2:* A call to `prepareInvocation` is not necessarily followed by a call to `invoke`.
|
|
18650
|
+
* @stubbed
|
|
18531
18651
|
*/
|
|
18532
18652
|
prepareInvocation?(options: LanguageModelToolInvocationPrepareOptions<T>, token: CancellationToken): ProviderResult<PreparedToolInvocation>;
|
|
18533
18653
|
}
|
|
@@ -18540,11 +18660,13 @@ export module '@theia/plugin' {
|
|
|
18540
18660
|
export interface LanguageModelToolConfirmationMessages {
|
|
18541
18661
|
/**
|
|
18542
18662
|
* The title of the confirmation message.
|
|
18663
|
+
* @stubbed
|
|
18543
18664
|
*/
|
|
18544
18665
|
title: string;
|
|
18545
18666
|
|
|
18546
18667
|
/**
|
|
18547
18668
|
* The body of the confirmation message.
|
|
18669
|
+
* @stubbed
|
|
18548
18670
|
*/
|
|
18549
18671
|
message: string | MarkdownString;
|
|
18550
18672
|
}
|
|
@@ -18556,12 +18678,14 @@ export module '@theia/plugin' {
|
|
|
18556
18678
|
export interface PreparedToolInvocation {
|
|
18557
18679
|
/**
|
|
18558
18680
|
* A customized progress message to show while the tool runs.
|
|
18681
|
+
* @stubbed
|
|
18559
18682
|
*/
|
|
18560
18683
|
invocationMessage?: string | MarkdownString;
|
|
18561
18684
|
|
|
18562
18685
|
/**
|
|
18563
18686
|
* The presence of this property indicates that the user should be asked to confirm before running the tool. The user
|
|
18564
18687
|
* should be asked for confirmation for any tool that has a side-effect or may potentially be dangerous.
|
|
18688
|
+
* @stubbed
|
|
18565
18689
|
*/
|
|
18566
18690
|
confirmationMessages?: LanguageModelToolConfirmationMessages;
|
|
18567
18691
|
}
|
|
@@ -18574,6 +18698,7 @@ export module '@theia/plugin' {
|
|
|
18574
18698
|
export interface ChatLanguageModelToolReference {
|
|
18575
18699
|
/**
|
|
18576
18700
|
* The tool name. Refers to a tool listed in {@link lm.tools}.
|
|
18701
|
+
* @stubbed
|
|
18577
18702
|
*/
|
|
18578
18703
|
readonly name: string;
|
|
18579
18704
|
|
|
@@ -18583,6 +18708,7 @@ export module '@theia/plugin' {
|
|
|
18583
18708
|
*
|
|
18584
18709
|
* *Note* that the indices take the leading `#`-character into account which means they can be used to modify the prompt
|
|
18585
18710
|
* as-is.
|
|
18711
|
+
* @stubbed
|
|
18586
18712
|
*/
|
|
18587
18713
|
readonly range?: [start: number, end: number];
|
|
18588
18714
|
}
|
|
@@ -28,6 +28,20 @@ export module '@theia/plugin' {
|
|
|
28
28
|
class DocumentDropOrPasteEditKind {
|
|
29
29
|
static readonly Empty: DocumentDropOrPasteEditKind;
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* The root kind for basic text edits.
|
|
33
|
+
*
|
|
34
|
+
* This kind should be used for edits that insert basic text into the document. A good example of this is
|
|
35
|
+
* an edit that pastes the clipboard text while also updating imports in the file based on the pasted text.
|
|
36
|
+
* For this we could use a kind such as `text.updateImports.someLanguageId`.
|
|
37
|
+
*
|
|
38
|
+
* Even though most drop/paste edits ultimately insert text, you should not use {@linkcode Text} as the base kind
|
|
39
|
+
* for every edit as this is redundant. Instead a more specific kind that describes the type of content being
|
|
40
|
+
* inserted should be used instead For example, if the edit adds a Markdown link, use `markdown.link` since even
|
|
41
|
+
* though the content being inserted is text, it's more important to know that the edit inserts Markdown syntax.
|
|
42
|
+
*/
|
|
43
|
+
static readonly Text: DocumentDropOrPasteEditKind;
|
|
44
|
+
|
|
31
45
|
private constructor(value: string);
|
|
32
46
|
|
|
33
47
|
/**
|
|
@@ -0,0 +1,143 @@
|
|
|
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.96.2/src/vscode-dts/vscode.proposed.terminalCompletionProvider.d.ts
|
|
22
|
+
|
|
23
|
+
declare module '@theia/plugin' {
|
|
24
|
+
|
|
25
|
+
// https://github.com/microsoft/vscode/issues/226562
|
|
26
|
+
|
|
27
|
+
export interface TerminalCompletionProvider<T extends TerminalCompletionItem> {
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* Provide completions for the given position and document.
|
|
31
|
+
* @param terminal The terminal for which completions are being provided.
|
|
32
|
+
* @param context Information about the terminal's current state.
|
|
33
|
+
* @param token A cancellation token.
|
|
34
|
+
* @return A list of completions.
|
|
35
|
+
*/
|
|
36
|
+
provideTerminalCompletions(terminal: Terminal, context: TerminalCompletionContext, token: CancellationToken): ProviderResult<T[] | TerminalCompletionList<T>>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface TerminalCompletionItem {
|
|
40
|
+
/**
|
|
41
|
+
* The label of the completion.
|
|
42
|
+
*/
|
|
43
|
+
label: string;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* The index of the start of the range to replace.
|
|
47
|
+
*/
|
|
48
|
+
replacementIndex: number;
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* The length of the range to replace.
|
|
52
|
+
*/
|
|
53
|
+
replacementLength: number;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The completion's detail which appears on the right of the list.
|
|
57
|
+
*/
|
|
58
|
+
detail?: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The completion's kind. Note that this will map to an icon.
|
|
62
|
+
*/
|
|
63
|
+
kind?: TerminalCompletionItemKind;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Terminal item kinds.
|
|
68
|
+
*/
|
|
69
|
+
export enum TerminalCompletionItemKind {
|
|
70
|
+
File = 0,
|
|
71
|
+
Folder = 1,
|
|
72
|
+
Flag = 2,
|
|
73
|
+
Method = 3,
|
|
74
|
+
Argument = 4
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface TerminalCompletionContext {
|
|
78
|
+
/**
|
|
79
|
+
* The complete terminal command line.
|
|
80
|
+
*/
|
|
81
|
+
commandLine: string;
|
|
82
|
+
/**
|
|
83
|
+
* The index of the
|
|
84
|
+
* cursor in the command line.
|
|
85
|
+
*/
|
|
86
|
+
cursorPosition: number;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export namespace window {
|
|
90
|
+
/**
|
|
91
|
+
* Register a completion provider for a certain type of terminal.
|
|
92
|
+
*
|
|
93
|
+
* @param provider The completion provider.
|
|
94
|
+
* @returns A {@link Disposable} that unregisters this provider when being disposed.
|
|
95
|
+
* @stubbed
|
|
96
|
+
*/
|
|
97
|
+
export function registerTerminalCompletionProvider<T extends TerminalCompletionItem>(provider: TerminalCompletionProvider<T>, ...triggerCharacters: string[]): Disposable;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Represents a collection of {@link TerminalCompletionItem completion items} to be presented
|
|
102
|
+
* in the terminal.
|
|
103
|
+
*/
|
|
104
|
+
export class TerminalCompletionList<T extends TerminalCompletionItem = TerminalCompletionItem> {
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Resources that should be shown in the completions list for the cwd of the terminal.
|
|
108
|
+
*/
|
|
109
|
+
resourceRequestConfig?: TerminalResourceRequestConfig;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The completion items.
|
|
113
|
+
*/
|
|
114
|
+
items: T[];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Creates a new completion list.
|
|
118
|
+
*
|
|
119
|
+
* @param items The completion items.
|
|
120
|
+
* @param resourceRequestConfig Indicates which resources should be shown as completions for the cwd of the terminal.
|
|
121
|
+
*/
|
|
122
|
+
constructor(items?: T[], resourceRequestConfig?: TerminalResourceRequestConfig);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export interface TerminalResourceRequestConfig {
|
|
126
|
+
/**
|
|
127
|
+
* Show files as completion items.
|
|
128
|
+
*/
|
|
129
|
+
filesRequested?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Show folders as completion items.
|
|
132
|
+
*/
|
|
133
|
+
foldersRequested?: boolean;
|
|
134
|
+
/**
|
|
135
|
+
* If no cwd is provided, no resources will be shown as completions.
|
|
136
|
+
*/
|
|
137
|
+
cwd?: Uri;
|
|
138
|
+
/**
|
|
139
|
+
* The path separator to use when constructing paths.
|
|
140
|
+
*/
|
|
141
|
+
pathSeparator: string;
|
|
142
|
+
}
|
|
143
|
+
}
|