Skip to content

Commit 9cec0d7

Browse files
authored
revert: subscription details protocols #620 (#623)
This reverts commit ebc2dbb.
1 parent f214ae4 commit 9cec0d7

File tree

6 files changed

+0
-66
lines changed

6 files changed

+0
-66
lines changed

runtimes/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ The runtime supports chat by default
208208
| Send tab bar action request (e.g., export). | `aws/chat/tabBarAction` | `TabBarActionParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `TabBarActionResult` |
209209
| Send request to get serialized chat content in specified format. | `aws/chat/getSerializedChat` | `GetSerializedChatParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `GetSerializedChatResult` |
210210
| Send request to open file dialog for file selection. | `aws/chat/openFileDialog` | `OpenFileDialogParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) Client to Server | `OpenFileDialogResult` |
211-
| Sent to display subscription information in the chat UI | `aws/chat/subscription/details` | SubscriptionDetailsParams | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Server to Client | n/a |
212-
| Sent to begin a subscription upgrade | `aws/chat/subscription/upgrade` | SubscriptionUpgradeParams | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) Client to Server | n/a |
213211
214212
215213
```ts

runtimes/protocol/chat.ts

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,6 @@ import {
9191
LIST_AVAILABLE_MODELS_REQUEST_METHOD,
9292
ListAvailableModelsResult,
9393
ListAvailableModelsParams,
94-
SUBSCRIPTION_DETAILS_NOTIFICATION_METHOD,
95-
SubscriptionDetailsParams,
96-
SUBSCRIPTION_UPGRADE_NOTIFICATION_METHOD,
97-
SubscriptionUpgradeParams,
9894
} from './lsp'
9995

10096
export const chatRequestType = new AutoParameterStructuresProtocolRequestType<
@@ -283,21 +279,3 @@ export const listAvailableModelsRequestType = new ProtocolRequestType<
283279
void,
284280
void
285281
>(LIST_AVAILABLE_MODELS_REQUEST_METHOD)
286-
287-
// Subscription Tiers
288-
289-
/**
290-
* Subscription Details Notification is sent from server to client, with the expectation that
291-
* the client will display the subscription details in the Chat UI.
292-
*/
293-
export const subscriptionDetailsNotificationType = new ProtocolNotificationType<SubscriptionDetailsParams, void>(
294-
SUBSCRIPTION_DETAILS_NOTIFICATION_METHOD
295-
)
296-
297-
/**
298-
* Subscription Details Notification is sent from Chat UI through client over to server.
299-
* Flare will then ask the client to open a URL in the browser.
300-
*/
301-
export const subscriptionUpgradeNotificationType = new ProtocolNotificationType<SubscriptionUpgradeParams, void>(
302-
SUBSCRIPTION_UPGRADE_NOTIFICATION_METHOD
303-
)

runtimes/runtimes/base-runtime.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,6 @@ import {
6060
onPinnedContextRemoveNotificationType,
6161
openFileDialogRequestType,
6262
listAvailableModelsRequestType,
63-
subscriptionDetailsNotificationType,
64-
subscriptionUpgradeNotificationType,
6563
} from '../protocol'
6664
import { createConnection } from 'vscode-languageserver/browser'
6765
import {
@@ -202,10 +200,6 @@ export const baseRuntime = (connections: { reader: MessageReader; writer: Messag
202200
onOpenFileDialog: handler => lspConnection.onRequest(openFileDialogRequestType.method, handler),
203201
onRuleClick: handler => lspConnection.onRequest(ruleClickRequestType.method, handler),
204202
onListAvailableModels: handler => lspConnection.onRequest(listAvailableModelsRequestType.method, handler),
205-
sendSubscriptionDetails: params =>
206-
lspConnection.sendNotification(subscriptionDetailsNotificationType.method, params),
207-
onSubscriptionUpgrade: handler =>
208-
lspConnection.onNotification(subscriptionUpgradeNotificationType.method, handler),
209203
}
210204

211205
const identityManagement: IdentityManagement = {

runtimes/runtimes/chat/baseChat.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,6 @@ import {
8888
ListAvailableModelsParams,
8989
ListAvailableModelsResult,
9090
listAvailableModelsRequestType,
91-
SubscriptionDetailsParams,
92-
subscriptionDetailsNotificationType,
93-
subscriptionUpgradeNotificationType,
94-
SubscriptionUpgradeParams,
9591
} from '../../protocol'
9692
import { Chat } from '../../server-interface'
9793

@@ -247,12 +243,4 @@ export class BaseChat implements Chat {
247243
public onListAvailableModels(handler: RequestHandler<ListAvailableModelsParams, ListAvailableModelsResult, void>) {
248244
this.connection.onRequest(listAvailableModelsRequestType.method, handler)
249245
}
250-
251-
public sendSubscriptionDetails(params: SubscriptionDetailsParams) {
252-
this.connection.sendNotification(subscriptionDetailsNotificationType.method, params)
253-
}
254-
255-
public onSubscriptionUpgrade(handler: NotificationHandler<SubscriptionUpgradeParams>) {
256-
this.connection.onNotification(subscriptionUpgradeNotificationType.method, handler)
257-
}
258246
}

runtimes/server-interface/chat.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ import {
5151
ActiveEditorChangedParams,
5252
ListAvailableModelsParams,
5353
ListAvailableModelsResult,
54-
SubscriptionDetailsParams,
55-
SubscriptionUpgradeParams,
5654
} from '../protocol'
5755

5856
/**
@@ -102,6 +100,4 @@ export type Chat = {
102100
onCreatePrompt: (handler: NotificationHandler<CreatePromptParams>) => void
103101
onInlineChatResult: (handler: NotificationHandler<InlineChatResultParams>) => void
104102
onPromptInputOptionChange: (handler: NotificationHandler<PromptInputOptionChangeParams>) => void
105-
sendSubscriptionDetails: (params: SubscriptionDetailsParams) => void
106-
onSubscriptionUpgrade: (handler: NotificationHandler<SubscriptionUpgradeParams>) => void
107103
}

types/chat.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ export const LIST_AVAILABLE_MODELS_REQUEST_METHOD = 'aws/chat/listAvailableModel
5656
// button ids
5757
export const OPEN_WORKSPACE_INDEX_SETTINGS_BUTTON_ID = 'open-settings-for-ws-index'
5858

59-
// Subscription Tiers
60-
export const SUBSCRIPTION_DETAILS_NOTIFICATION_METHOD = 'aws/chat/subscription/details'
61-
export const SUBSCRIPTION_UPGRADE_NOTIFICATION_METHOD = 'aws/chat/subscription/upgrade'
62-
export const SUBSCRIPTION_SHOW_COMMAND_METHOD = 'aws/chat/subscription/show'
63-
6459
export interface ChatItemAction {
6560
pillText: string
6661
prompt?: string
@@ -282,11 +277,6 @@ export interface ChatOptions {
282277
*/
283278
export?: boolean
284279

285-
/**
286-
* Server signals to Client and Chat Client that it supports subscription tier operations
287-
*/
288-
subscriptionDetails?: boolean
289-
290280
/*
291281
Server signals to Chat Client support of Chat notifications.
292282
Currently used for sending chat notifications for developer profile updates.
@@ -705,13 +695,3 @@ export interface ListAvailableModelsResult {
705695
export interface ExecuteShellCommandParams {
706696
id: string
707697
}
708-
709-
export interface SubscriptionDetailsParams {
710-
subscriptionTier: string
711-
queryUsage: number
712-
queryLimit: number
713-
queryOverage: number
714-
daysRemaining: number
715-
}
716-
717-
export interface SubscriptionUpgradeParams {}

0 commit comments

Comments
 (0)