Skip to content

Commit ce49c30

Browse files
authored
revert: add support for pinned context and rules (#548)" (#558)
This reverts commit 6606dcc.
1 parent 6606dcc commit ce49c30

File tree

6 files changed

+2
-179
lines changed

6 files changed

+2
-179
lines changed

runtimes/README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,11 @@ The runtime supports chat by default
191191
| Send chat messages and tab state update to specific tab. Depending on new vs existing`messageId` within `ChatMessage` message, the massgage will be added or updated. | `aws/chat/sendChatUpdate` | `ChatUpdateParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Server to Client | n/a |
192192
| Send file or file action click event. | `aws/chat/fileClick` | `FileClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
193193
| Send or update context commands that customer can attach to their prompt request (available via `@` in chat UI). | `aws/chat/sendContextCommands` | `ContextCommandParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Server to Client | n/a |
194-
| Send create prompt event that triggers new prompt or rule creation flow on server. | `aws/chat/createPrompt` | `CreatePromptParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
194+
| Send create prompt event that triggers new prompt creation flow on server. | `aws/chat/createPrompt` | `CreatePromptParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
195195
| Send request to list the conversations available in history: all or based on filter if provided. As there can be several filter options used, the filter in the request is a map of filter option ids to corresponding values. Possible filter options are expected to be provided in the previous `listConversations` result before filter can be used. | `aws/chat/listConversations` | `ListConversationsParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `ListConversationsResult` |
196196
| Send conversation or conversation action click event. If no action is provided, the default action is "open". | `aws/chat/conversationClick` | `ConversationClickParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `ConversationClickResult` |
197197
| Send request to list the MCP servers available: all or based on filter if provided. Similar to conversations, the filter in the request is a map of filter option ids to corresponding values. | `aws/chat/listMcpServers` | `ListMcpServersParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `ListMcpServersResult` |
198198
| Send MCP server or MCP server action click event. If no action is provided, the default action is "select". | `aws/chat/mcpServerClick` | `McpServerClickParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `McpServerClickResult` |
199-
| Send pinned context to client. Pinned context contains context commands that are pinned to the current tab. | `aws/chat/sendPinnedContext` | `PinnedContextParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Server to Client | n/a |
200-
| Notify server that pinned context has been added by the client. | `aws/chat/pinnedContextAdd` | `PinnedContextParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
201-
| Notify server that pinned context has been removed by the client. | `aws/chat/pinnedContextRemove` | `PinnedContextParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
202-
| Notify server that active editor has changed. | `aws/chat/activeEditorChanged` | `ActiveEditorChangedParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
203-
| Send request to list the rules available for a specific tab. | `aws/chat/listRules` | `ListRulesParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `ListRulesResult` |
204-
| Send rule or rule folder click event. | `aws/chat/ruleClick` | `RuleClickParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `RuleClickResult` |
205199
| Send server-initiated chat metadata updates. The interface is designed to be extensible for future chat options, currently focused on notification for developer profile changes. | `aws/chat/chatOptionsUpdate` | `ChatOptionsUpdateParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Server to Client | n/a |
206200
| Send prompt input option event changes | `aws/chat/promptInputOptionChange` | `PromptInputOptionChangeParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
207201

runtimes/protocol/chat.ts

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import {
4747
CREATE_PROMPT_NOTIFICATION_METHOD,
4848
CreatePromptParams,
4949
INLINE_CHAT_RESULT_NOTIFICATION_METHOD,
50-
PINNED_CONTEXT_NOTIFICATION_METHOD,
5150
InlineChatResultParams,
5251
ListConversationsParams,
5352
ListConversationsResult,
@@ -74,17 +73,6 @@ import {
7473
McpServerClickParams,
7574
McpServerClickResult,
7675
MCP_SERVER_CLICK_REQUEST_METHOD,
77-
ListRulesParams,
78-
RuleClickParams,
79-
RULE_CLICK_REQUEST_METHOD,
80-
LIST_RULES_REQUEST_METHOD,
81-
ListRulesResult,
82-
RuleClickResult,
83-
PinnedContextParams,
84-
PINNED_CONTEXT_ADD_NOTIFICATION_METHOD,
85-
PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD,
86-
ActiveEditorChangedParams,
87-
ACTIVE_EDITOR_CHANGED_NOTIFICATION_METHOD,
8876
} from './lsp'
8977

9078
export const chatRequestType = new AutoParameterStructuresProtocolRequestType<
@@ -166,36 +154,6 @@ export const inlineChatResultNotificationType = new ProtocolNotificationType<Inl
166154
INLINE_CHAT_RESULT_NOTIFICATION_METHOD
167155
)
168156

169-
// pinned context
170-
export const pinnedContextNotificationType = new ProtocolNotificationType<PinnedContextParams, void>(
171-
PINNED_CONTEXT_NOTIFICATION_METHOD
172-
)
173-
export const onPinnedContextAddNotificationType = new ProtocolNotificationType<PinnedContextParams, void>(
174-
PINNED_CONTEXT_ADD_NOTIFICATION_METHOD
175-
)
176-
export const onPinnedContextRemoveNotificationType = new ProtocolNotificationType<PinnedContextParams, void>(
177-
PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD
178-
)
179-
export const activeEditorChangedNotificationType = new ProtocolNotificationType<ActiveEditorChangedParams, void>(
180-
ACTIVE_EDITOR_CHANGED_NOTIFICATION_METHOD
181-
)
182-
183-
// rules
184-
export const listRulesRequestType = new AutoParameterStructuresProtocolRequestType<
185-
ListRulesParams,
186-
ListRulesResult,
187-
never,
188-
void,
189-
void
190-
>(LIST_RULES_REQUEST_METHOD)
191-
192-
export const ruleClickRequestType = new AutoParameterStructuresProtocolRequestType<
193-
RuleClickParams,
194-
RuleClickResult,
195-
never,
196-
void,
197-
void
198-
>(RULE_CLICK_REQUEST_METHOD)
199157
// history
200158
export const listConversationsRequestType = new AutoParameterStructuresProtocolRequestType<
201159
ListConversationsParams,

runtimes/runtimes/base-runtime.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,6 @@ import {
5151
buttonClickRequestType,
5252
listMcpServersRequestType,
5353
mcpServerClickRequestType,
54-
ruleClickRequestType,
55-
listRulesRequestType,
56-
pinnedContextNotificationType,
57-
activeEditorChangedNotificationType,
58-
onPinnedContextAddNotificationType,
59-
onPinnedContextRemoveNotificationType,
6054
} from '../protocol'
6155
import { createConnection } from 'vscode-languageserver/browser'
6256
import {
@@ -173,24 +167,16 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
173167
sendChatUpdate: params => lspConnection.sendNotification(chatUpdateNotificationType.method, params),
174168
onFileClicked: handler => lspConnection.onNotification(fileClickNotificationType.method, handler),
175169
sendContextCommands: params => lspConnection.sendNotification(contextCommandsNotificationType.method, params),
176-
sendPinnedContext: params => lspConnection.sendNotification(pinnedContextNotificationType.method, params),
177-
onPinnedContextAdd: params => lspConnection.sendNotification(onPinnedContextAddNotificationType.method, params),
178-
onPinnedContextRemove: params =>
179-
lspConnection.sendNotification(onPinnedContextRemoveNotificationType.method, params),
180-
onActiveEditorChanged: handler =>
181-
lspConnection.onNotification(activeEditorChangedNotificationType.method, handler),
182170
onCreatePrompt: handler => lspConnection.onNotification(createPromptNotificationType.method, handler),
183171
onInlineChatResult: handler => lspConnection.onNotification(inlineChatResultNotificationType.method, handler),
184172
onListConversations: handler => lspConnection.onRequest(listConversationsRequestType.method, handler),
185-
onListRules: handler => lspConnection.onRequest(listRulesRequestType.method, handler),
186173
onConversationClick: handler => lspConnection.onRequest(conversationClickRequestType.method, handler),
187174
onListMcpServers: handler => lspConnection.onRequest(listMcpServersRequestType.method, handler),
188175
onMcpServerClick: handler => lspConnection.onRequest(mcpServerClickRequestType.method, handler),
189176
getSerializedChat: params => lspConnection.sendRequest(getSerializedChatRequestType.method, params),
190177
onTabBarAction: handler => lspConnection.onRequest(tabBarActionRequestType.method, handler),
191178
onPromptInputOptionChange: handler =>
192179
lspConnection.onNotification(promptInputOptionChangeNotificationType.method, handler),
193-
onRuleClick: handler => lspConnection.onRequest(ruleClickRequestType.method, handler),
194180
}
195181

196182
const identityManagement: IdentityManagement = {

runtimes/runtimes/chat/baseChat.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@ import {
7070
McpServerClickParams,
7171
McpServerClickResult,
7272
mcpServerClickRequestType,
73-
RuleClickParams,
74-
ruleClickRequestType,
75-
ListRulesParams,
76-
ListRulesResult,
77-
listRulesRequestType,
78-
RuleClickResult,
79-
PinnedContextParams,
80-
pinnedContextNotificationType,
81-
ActiveEditorChangedParams,
82-
activeEditorChangedNotificationType,
83-
onPinnedContextAddNotificationType,
84-
onPinnedContextRemoveNotificationType,
8573
} from '../../protocol'
8674
import { Chat } from '../../server-interface'
8775

@@ -170,22 +158,6 @@ export class BaseChat implements Chat {
170158
this.connection.sendNotification(contextCommandsNotificationType.method, params)
171159
}
172160

173-
public sendPinnedContext(params: PinnedContextParams) {
174-
this.connection.sendNotification(pinnedContextNotificationType.method, params)
175-
}
176-
177-
public onPinnedContextAdd(handler: NotificationHandler<PinnedContextParams>) {
178-
this.connection.onNotification(onPinnedContextAddNotificationType.method, handler)
179-
}
180-
181-
public onPinnedContextRemove(handler: NotificationHandler<PinnedContextParams>) {
182-
this.connection.onNotification(onPinnedContextRemoveNotificationType.method, handler)
183-
}
184-
185-
public onActiveEditorChanged(handler: NotificationHandler<ActiveEditorChangedParams>) {
186-
this.connection.onNotification(activeEditorChangedNotificationType.method, handler)
187-
}
188-
189161
public onCreatePrompt(handler: NotificationHandler<CreatePromptParams>) {
190162
this.connection.onNotification(createPromptNotificationType.method, handler)
191163
}
@@ -198,10 +170,6 @@ export class BaseChat implements Chat {
198170
this.connection.onRequest(listConversationsRequestType.method, handler)
199171
}
200172

201-
public onListRules(handler: RequestHandler<ListRulesParams, ListRulesResult, void>) {
202-
this.connection.onRequest(listRulesRequestType.method, handler)
203-
}
204-
205173
public onConversationClick(handler: RequestHandler<ConversationClickParams, ConversationClickResult, void>) {
206174
this.connection.onRequest(conversationClickRequestType.method, handler)
207175
}
@@ -225,8 +193,4 @@ export class BaseChat implements Chat {
225193
public onPromptInputOptionChange(handler: NotificationHandler<PromptInputOptionChangeParams>) {
226194
this.connection.onNotification(promptInputOptionChangeNotificationType.method, handler)
227195
}
228-
229-
public onRuleClick(handler: RequestHandler<RuleClickParams, RuleClickResult, void>) {
230-
this.connection.onRequest(ruleClickRequestType.method, handler)
231-
}
232196
}

runtimes/server-interface/chat.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ import {
4141
ListMcpServersResult,
4242
McpServerClickResult,
4343
McpServerClickParams,
44-
RuleClickParams,
45-
ListRulesParams,
46-
ListRulesResult,
47-
RuleClickResult,
48-
PinnedContextParams,
49-
ActiveEditorChangedParams,
5044
} from '../protocol'
5145

5246
/**
@@ -68,9 +62,6 @@ export type Chat = {
6862
onConversationClick: (handler: RequestHandler<ConversationClickParams, ConversationClickResult, void>) => void
6963
onTabBarAction: (handler: RequestHandler<TabBarActionParams, TabBarActionResult, void>) => void
7064
getSerializedChat: (params: GetSerializedChatParams) => Promise<GetSerializedChatResult>
71-
onListRules: (handler: RequestHandler<ListRulesParams, ListRulesResult, void>) => void
72-
onRuleClick: (handler: RequestHandler<RuleClickParams, RuleClickResult, void>) => void
73-
7465
// Notifications
7566
onSendFeedback: (handler: NotificationHandler<FeedbackParams>) => void
7667
onReady: (handler: NotificationHandler<void>) => void
@@ -86,10 +77,6 @@ export type Chat = {
8677
onFileClicked: (handler: NotificationHandler<FileClickParams>) => void
8778
chatOptionsUpdate: (params: ChatOptionsUpdateParams) => void
8879
sendContextCommands: (params: ContextCommandParams) => void
89-
sendPinnedContext: (params: PinnedContextParams) => void
90-
onPinnedContextAdd: (handler: NotificationHandler<PinnedContextParams>) => void
91-
onPinnedContextRemove: (handler: NotificationHandler<PinnedContextParams>) => void
92-
onActiveEditorChanged: (handler: NotificationHandler<ActiveEditorChangedParams>) => void
9380
onCreatePrompt: (handler: NotificationHandler<CreatePromptParams>) => void
9481
onInlineChatResult: (handler: NotificationHandler<InlineChatResultParams>) => void
9582
onPromptInputOptionChange: (handler: NotificationHandler<PromptInputOptionChangeParams>) => void

types/chat.ts

Lines changed: 1 addition & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,6 @@ export const PROMPT_INPUT_OPTION_CHANGE_METHOD = 'aws/chat/promptInputOptionChan
2626
export const CONTEXT_COMMAND_NOTIFICATION_METHOD = 'aws/chat/sendContextCommands'
2727
export const CREATE_PROMPT_NOTIFICATION_METHOD = 'aws/chat/createPrompt'
2828
export const INLINE_CHAT_RESULT_NOTIFICATION_METHOD = 'aws/chat/inlineChatResult'
29-
30-
// pinned context
31-
export const PINNED_CONTEXT_ADD_NOTIFICATION_METHOD = 'aws/chat/pinnedContextAdd'
32-
export const PINNED_CONTEXT_REMOVE_NOTIFICATION_METHOD = 'aws/chat/pinnedContextRemove'
33-
export const RULE_CLICK_REQUEST_METHOD = 'aws/chat/ruleClick'
34-
35-
export const PINNED_CONTEXT_NOTIFICATION_METHOD = 'aws/chat/sendPinnedContext'
36-
export const LIST_RULES_REQUEST_METHOD = 'aws/chat/listRules'
37-
38-
//active tab
39-
export const ACTIVE_EDITOR_CHANGED_NOTIFICATION_METHOD = 'aws/chat/activeEditorChanged'
40-
4129
// history
4230
export const LIST_CONVERSATIONS_REQUEST_METHOD = 'aws/chat/listConversations'
4331
export const CONVERSATION_CLICK_REQUEST_METHOD = 'aws/chat/conversationClick'
@@ -301,9 +289,7 @@ export interface TabEventParams {
301289
tabId: string
302290
}
303291

304-
export interface TabAddParams extends TabEventParams {
305-
restoredTab?: boolean
306-
}
292+
export interface TabAddParams extends TabEventParams {}
307293

308294
export interface TabChangeParams extends TabEventParams {}
309295

@@ -420,15 +406,8 @@ export interface ContextCommandParams {
420406
contextCommandGroups: ContextCommandGroup[]
421407
}
422408

423-
export interface PinnedContextParams extends ContextCommandParams {
424-
tabId: string
425-
textDocument?: TextDocumentIdentifier
426-
showRules?: boolean
427-
}
428-
429409
export interface CreatePromptParams {
430410
promptName: string
431-
isRule?: boolean
432411
}
433412

434413
export interface ProgrammingLanguage {
@@ -502,51 +481,6 @@ export interface ListMcpServersParams {
502481
filter?: Record<string, FilterValue>
503482
}
504483

505-
export interface ListRulesParams {
506-
tabId: string
507-
}
508-
509-
export interface ListRulesResult {
510-
tabId: string
511-
header?: { title: string }
512-
filterOptions?: FilterOption[]
513-
rules: RulesFolder[]
514-
}
515-
516-
export interface RulesFolder {
517-
folderName?: string
518-
/**
519-
* Represents the active state of the folder:
520-
* - true: all rules in the folder are active
521-
* - false: all rules in the folder are inactive
522-
* - 'indeterminate': rules inside the folder have mixed active states (some active, some inactive),
523-
* similar to a parent checkbox in a nested checkbox list having an indeterminate state
524-
*/
525-
active: boolean | 'indeterminate'
526-
rules: Rule[]
527-
}
528-
529-
export interface Rule {
530-
active: boolean
531-
name: string
532-
id: string
533-
}
534-
535-
export interface RuleClickParams {
536-
tabId: string
537-
type: 'folder' | 'rule'
538-
id: string
539-
}
540-
541-
export interface RuleClickResult extends RuleClickParams {
542-
success: boolean
543-
}
544-
545-
export interface ActiveEditorChangedParams {
546-
cursorState?: CursorState[]
547-
textDocument?: TextDocumentIdentifier
548-
}
549-
550484
export interface ConversationsList {
551485
header?: { title: string }
552486
filterOptions?: FilterOption[]

0 commit comments

Comments
 (0)