Skip to content

Commit 62c9bc5

Browse files
Copilotalexr00
andcommitted
Revert yarn.lock changes as requested
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 08ef6ba commit 62c9bc5

File tree

4 files changed

+1481
-1375
lines changed

4 files changed

+1481
-1375
lines changed

src/@types/vscode.proposed.chatParticipantAdditions.d.ts

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,30 @@ declare module 'vscode' {
8484
constructor(toolName: string);
8585
}
8686

87-
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatPrepareToolInvocationPart;
87+
export interface ChatTerminalToolInvocationData {
88+
commandLine: {
89+
original: string;
90+
userEdited?: string;
91+
toolEdited?: string;
92+
};
93+
language: string;
94+
}
95+
96+
export class ChatToolInvocationPart {
97+
toolName: string;
98+
toolCallId: string;
99+
isError?: boolean;
100+
invocationMessage?: string | MarkdownString;
101+
originMessage?: string | MarkdownString;
102+
pastTenseMessage?: string | MarkdownString;
103+
isConfirmed?: boolean;
104+
isComplete?: boolean;
105+
toolSpecificData?: ChatTerminalToolInvocationData;
88106

107+
constructor(toolName: string, toolCallId: string, isError?: boolean);
108+
}
109+
110+
export type ExtendedChatResponsePart = ChatResponsePart | ChatResponseTextEditPart | ChatResponseNotebookEditPart | ChatResponseConfirmationPart | ChatResponseCodeCitationPart | ChatResponseReferencePart2 | ChatResponseMovePart | ChatResponseExtensionsPart | ChatPrepareToolInvocationPart | ChatToolInvocationPart;
89111
export class ChatResponseWarningPart {
90112
value: MarkdownString;
91113
constructor(value: string | MarkdownString);
@@ -351,6 +373,10 @@ declare module 'vscode' {
351373
participant?: string;
352374
command?: string;
353375
};
376+
/**
377+
* An optional detail string that will be rendered at the end of the response in certain UI contexts.
378+
*/
379+
details?: string;
354380
}
355381

356382
export namespace chat {
@@ -445,6 +471,15 @@ declare module 'vscode' {
445471
outcome: ChatEditingSessionActionOutcome;
446472
}
447473

474+
export interface ChatEditingHunkAction {
475+
// eslint-disable-next-line local/vscode-dts-string-type-literals
476+
kind: 'chatEditingHunkAction';
477+
uri: Uri;
478+
lineCount: number;
479+
outcome: ChatEditingSessionActionOutcome;
480+
hasRemainingEdits: boolean;
481+
}
482+
448483
export enum ChatEditingSessionActionOutcome {
449484
Accepted = 1,
450485
Rejected = 2,
@@ -453,7 +488,7 @@ declare module 'vscode' {
453488

454489
export interface ChatUserActionEvent {
455490
readonly result: ChatResult;
456-
readonly action: ChatCopyAction | ChatInsertAction | ChatApplyAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction | ChatEditingSessionAction;
491+
readonly action: ChatCopyAction | ChatInsertAction | ChatApplyAction | ChatTerminalAction | ChatCommandAction | ChatFollowupAction | ChatBugReportAction | ChatEditorAction | ChatEditingSessionAction | ChatEditingHunkAction;
457492
}
458493

459494
export interface ChatPromptReference {

src/@types/vscode.proposed.chatParticipantPrivate.d.ts

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,31 @@ declare module 'vscode' {
137137
/**
138138
* @hidden
139139
*/
140-
private constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined);
140+
constructor(prompt: string, command: string | undefined, references: ChatPromptReference[], participant: string, toolReferences: ChatLanguageModelToolReference[], editedFileEvents: ChatRequestEditedFileEvent[] | undefined);
141+
}
142+
143+
export class ChatResponseTurn2 {
144+
/**
145+
* The content that was received from the chat participant. Only the stream parts that represent actual content (not metadata) are represented.
146+
*/
147+
readonly response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart | ExtendedChatResponsePart | ChatToolInvocationPart>;
148+
149+
/**
150+
* The result that was received from the chat participant.
151+
*/
152+
readonly result: ChatResult;
153+
154+
/**
155+
* The id of the chat participant that this response came from.
156+
*/
157+
readonly participant: string;
158+
159+
/**
160+
* The name of the command that this response came from.
161+
*/
162+
readonly command?: string;
163+
164+
constructor(response: ReadonlyArray<ChatResponseMarkdownPart | ChatResponseFileTreePart | ChatResponseAnchorPart | ChatResponseCommandButtonPart | ExtendedChatResponsePart>, result: ChatResult, participant: string);
141165
}
142166

143167
export interface ChatParticipant {

src/@types/vscode.proposed.chatSessionsProvider.d.ts

Lines changed: 74 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,28 @@ declare module 'vscode' {
1111
/**
1212
* Label of the extension that registers the provider.
1313
*/
14-
readonly label: string;
14+
readonly label: string; // TODO: move to contribution or registration
1515

1616
/**
1717
* Event that the provider can fire to signal that chat sessions have changed.
1818
*/
1919
readonly onDidChangeChatSessionItems: Event<void>;
2020

21+
// /**
22+
// * Create a new chat session item
23+
// */
24+
// provideNewChatSessionItem(context: {
25+
// // This interface should be extracted
26+
// readonly triggerChat?: {
27+
// readonly prompt: string;
28+
// readonly history: ReadonlyArray<ChatRequestTurn | ChatResponseTurn>;
29+
// };
30+
// }, token: CancellationToken): Thenable<ChatSessionItem> | ChatSessionItem;
31+
2132
/**
2233
* Provides a list of chat sessions.
34+
*
35+
* TODO: Do we need a flag to try auth if needed?
2336
*/
2437
provideChatSessionItems(token: CancellationToken): ProviderResult<ChatSessionItem[]>;
2538
}
@@ -41,7 +54,67 @@ declare module 'vscode' {
4154
iconPath?: IconPath;
4255
}
4356

57+
export interface ChatSession {
58+
59+
/**
60+
* The full history of the session
61+
*
62+
* This should not include any currently active responses
63+
*
64+
* TODO: Are these the right types to use?
65+
* TODO: link request + response to encourage correct usage?
66+
*/
67+
readonly history: ReadonlyArray<ChatRequestTurn | ChatResponseTurn2>;
68+
69+
/**
70+
* Callback invoked by the editor for a currently running response. This allows the session to push items for the
71+
* current response and stream these in as them come in. The current response will be considered complete once the
72+
* callback resolved.
73+
*
74+
* If not provided, the chat session is assumed to not currently be running.
75+
*/
76+
readonly activeResponseCallback?: (stream: ChatResponseStream, token: CancellationToken) => Thenable<void>;
77+
78+
/**
79+
* Handles new request for the session.
80+
*
81+
* If not set, then the session will be considered read-only and no requests can be made.
82+
*
83+
* TODO: Should we introduce our own type for `ChatRequestHandler` since not all field apply to chat sessions?
84+
*/
85+
readonly requestHandler: ChatRequestHandler | undefined;
86+
}
87+
88+
export interface ChatSessionContentProvider {
89+
/**
90+
* Resolves a chat session into a full `ChatSession` object.
91+
*
92+
* @param uri The URI of the chat session to open. Uris as structured as `vscode-chat-session:<chatSessionType>/id`
93+
* @param token A cancellation token that can be used to cancel the operation.
94+
*/
95+
provideChatSessionContent(id: string, token: CancellationToken): Thenable<ChatSession>;
96+
}
97+
4498
export namespace chat {
4599
export function registerChatSessionItemProvider(chatSessionType: string, provider: ChatSessionItemProvider): Disposable;
100+
101+
/**
102+
* @param chatSessionType A unique identifier for the chat session type. This is used to differentiate between different chat session providers.
103+
*/
104+
export function registerChatSessionContentProvider(chatSessionType: string, provider: ChatSessionContentProvider): Disposable;
105+
}
106+
107+
export interface ChatSessionShowOptions {
108+
/**
109+
* The editor view column to show the chat session in.
110+
*
111+
* If not provided, the chat session will be shown in the chat panel instead.
112+
*/
113+
readonly viewColumn?: ViewColumn;
114+
}
115+
116+
export namespace window {
117+
118+
export function showChatSession(chatSessionType: string, id: string, options: ChatSessionShowOptions): Thenable<void>;
46119
}
47120
}

0 commit comments

Comments
 (0)