New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@aws/language-server-runtimes

Package Overview
Dependencies
Maintainers
7
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aws/language-server-runtimes - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

protocol/auth.js.map

20

package.json
{
"name": "@aws/language-server-runtimes",
"version": "0.2.2",
"version": "0.2.3",
"description": "Runtimes to host Language Servers for AWS",

@@ -14,3 +14,4 @@ "files": [

"type": "git",
"url": "https://github.com/aws/language-server-runtimes"
"url": "https://github.com/aws/language-server-runtimes",
"directory": "runtimes"
},

@@ -23,11 +24,11 @@ "author": "Amazon Web Services",

"scripts": {
"clean": "rm -rf out",
"clean": "rm -rf out/",
"compile": "tsc --build",
"fix:prettier": "prettier . --write",
"prepare": "husky install",
"prepub:copyFiles": "cp .npmignore CHANGELOG.md LICENSE NOTICE README.md SECURITY.md package.json out/",
"prepub:copyFiles": "cp ../.npmignore CHANGELOG.md ../LICENSE ../NOTICE README.md ../SECURITY.md package.json out/",
"prepub": "npm run clean && npm run test && npm run compile && npm run prepub:copyFiles",
"pub": "cd out && npm publish",
"test:prettier": "prettier . --check",
"test:unit": "ts-mocha -b 'src/**/*.test.ts'",
"test:unit": "ts-mocha -b './**/*.test.ts'",
"test": "npm run test:prettier && npm run test:unit",

@@ -38,12 +39,11 @@ "preversion": "npm run test",

"dependencies": {
"@aws/language-server-runtimes-types": "0.0.1",
"jose": "^5.2.3",
"rxjs": "^7.8.1",
"vscode-languageserver": "^9.0.1",
"vscode-languageserver-protocol": "^3.17.5",
"vscode-languageserver-textdocument": "^1.0.11",
"vscode-languageserver-types": "^3.17.5"
"vscode-languageserver-protocol": "^3.17.5"
},
"devDependencies": {
"@types/mocha": "^10.0.1",
"@types/node": "^20.5.9",
"@types/node": "^20.12.7",
"assert": "^2.0.0",

@@ -55,3 +55,3 @@ "husky": "^9.0.11",

"ts-sinon": "^2.0.2",
"typescript": "^5.2.2"
"typescript": "^5.4.5"
},

@@ -58,0 +58,0 @@ "typesVersions": {

@@ -1,20 +0,2 @@

import { ProtocolNotificationType0, ProtocolRequestType0, AutoParameterStructuresProtocolRequestType } from './lsp';
export type IamCredentials = {
readonly accessKeyId: string;
readonly secretAccessKey: string;
readonly sessionToken?: string;
};
export type BearerCredentials = {
readonly token: string;
};
export interface SsoProfileData {
startUrl?: string;
}
export interface ConnectionMetadata {
sso?: SsoProfileData;
}
export interface UpdateCredentialsParams {
data: IamCredentials | BearerCredentials | string;
encrypted?: boolean;
}
import { UpdateCredentialsParams, ConnectionMetadata, ProtocolNotificationType0, ProtocolRequestType0, AutoParameterStructuresProtocolRequestType } from './lsp';
export declare const iamCredentialsUpdateRequestType: AutoParameterStructuresProtocolRequestType<UpdateCredentialsParams, null, void, void, void>;

@@ -21,0 +3,0 @@ export declare const iamCredentialsDeleteNotificationType: ProtocolNotificationType0<void>;

@@ -10,1 +10,2 @@ "use strict";

exports.getConnectionMetadataRequestType = new lsp_1.ProtocolRequestType0('aws/credentials/getConnectionMetadata');
//# sourceMappingURL=auth.js.map

@@ -1,126 +0,19 @@

import { ProgressToken, ProtocolNotificationType, ProtocolRequestType } from './lsp';
export interface ChatItemAction {
pillText: string;
prompt?: string;
disabled?: boolean;
description?: string;
}
export interface SourceLink {
title: string;
url: string;
body?: string;
}
export interface ReferenceTrackerInformation {
licenseName?: string;
repository?: string;
url?: string;
recommendationContentSpan?: {
start?: number;
end?: number;
};
information: string;
}
export interface ChatPrompt {
prompt?: string;
escapedPrompt?: string;
command?: string;
}
export declare enum VoteType {
UP = "upvote",
DOWN = "downvote"
}
export interface FeedbackPayload {
messageId: string;
tabId: string;
selectedOption: string;
comment?: string;
}
export type CodeSelectionType = 'selection' | 'block';
export interface ChatParams {
tabId: string;
prompt: ChatPrompt;
import { ChatParams, ChatResult, CopyCodeToClipboardParams, EndChatParams, FeedbackParams, FollowUpClickParams, InfoLinkClickParams, InsertToCursorPositionParams, LinkClickParams, QuickActionParams, SourceLinkClickParams, TabAddParams, TabChangeParams, TabRemoveParams, VoteParams, ProtocolNotificationType, ProtocolRequestType, ProgressToken } from './lsp';
export interface ChatRequest extends ChatParams {
partialResultToken?: ProgressToken;
}
export interface ChatResult {
body?: string;
messageId?: string;
canBeVoted?: boolean;
relatedContent?: {
title?: string;
content: SourceLink[];
};
followUp?: {
text?: string;
options?: ChatItemAction[];
};
codeReference?: ReferenceTrackerInformation[];
}
export declare const chatRequestType: ProtocolRequestType<ChatParams, ChatResult, ChatResult, void, void>;
export type EndChatParams = {
tabId: string;
};
export type EndChatResult = boolean;
export declare const chatRequestType: ProtocolRequestType<ChatRequest, ChatResult, ChatResult, void, void>;
export declare const endChatRequestType: ProtocolRequestType<EndChatParams, boolean, never, void, void>;
export interface QuickActionParams {
tabId: string;
quickAction: string;
prompt?: string;
}
export declare const quickActionRequestType: ProtocolRequestType<QuickActionParams, ChatResult, ChatResult, void, void>;
export declare const readyNotificationType: ProtocolNotificationType<void, void>;
export interface QuickActionResult extends ChatResult {
}
export interface VoteParams {
tabId: string;
messageId: string;
vote: VoteType;
}
export declare const voteNotificationType: ProtocolNotificationType<VoteParams, void>;
export interface FeedbackParams {
tabId: string;
messageId: string;
feedbackPayload: FeedbackPayload;
}
export declare const feedbackNotificationType: ProtocolNotificationType<FeedbackParams, void>;
export interface TabEventParams {
tabId: string;
}
export interface TabAddParams extends TabEventParams {
}
export declare const tabAddNotificationType: ProtocolNotificationType<TabAddParams, void>;
export interface TabChangeParams extends TabEventParams {
}
export declare const tabChangeNotificationType: ProtocolNotificationType<TabChangeParams, void>;
export interface TabRemoveParams extends TabEventParams {
}
export declare const tabRemoveNotificationType: ProtocolNotificationType<TabRemoveParams, void>;
export interface InsertToCursorPositionParams {
tabId: string;
messageId: string;
code?: string;
type?: CodeSelectionType;
referenceTrackerInformation?: ReferenceTrackerInformation[];
}
export declare const insertToCursorPositionNotificationType: ProtocolNotificationType<InsertToCursorPositionParams, void>;
export interface CopyCodeToClipboardParams extends InsertToCursorPositionParams {
}
export declare const copyCodeToClipboardNotificationType: ProtocolNotificationType<CopyCodeToClipboardParams, void>;
export interface LinkClickParams {
tabId: string;
messageId: string;
link: string;
mouseEvent?: MouseEvent;
}
export declare const linkClickNotificationType: ProtocolNotificationType<LinkClickParams, void>;
export interface InfoLinkClickParams extends LinkClickParams {
}
export declare const infoLinkClickNotificationType: ProtocolNotificationType<InfoLinkClickParams, void>;
export interface SourceLinkClickParams extends LinkClickParams {
}
export declare const sourceLinkClickNotificationType: ProtocolNotificationType<SourceLinkClickParams, void>;
export interface FollowUpClickParams {
tabId: string;
messageId: string;
followUp: ChatItemAction;
}
export declare const followUpClickNotificationType: ProtocolNotificationType<FollowUpClickParams, void>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.followUpClickNotificationType = exports.sourceLinkClickNotificationType = exports.infoLinkClickNotificationType = exports.linkClickNotificationType = exports.copyCodeToClipboardNotificationType = exports.insertToCursorPositionNotificationType = exports.tabRemoveNotificationType = exports.tabChangeNotificationType = exports.tabAddNotificationType = exports.feedbackNotificationType = exports.voteNotificationType = exports.readyNotificationType = exports.quickActionRequestType = exports.endChatRequestType = exports.chatRequestType = exports.VoteType = void 0;
exports.followUpClickNotificationType = exports.sourceLinkClickNotificationType = exports.infoLinkClickNotificationType = exports.linkClickNotificationType = exports.copyCodeToClipboardNotificationType = exports.insertToCursorPositionNotificationType = exports.tabRemoveNotificationType = exports.tabChangeNotificationType = exports.tabAddNotificationType = exports.feedbackNotificationType = exports.voteNotificationType = exports.readyNotificationType = exports.quickActionRequestType = exports.endChatRequestType = exports.chatRequestType = void 0;
const lsp_1 = require("./lsp");
var VoteType;
(function (VoteType) {
VoteType["UP"] = "upvote";
VoteType["DOWN"] = "downvote";
})(VoteType || (exports.VoteType = VoteType = {}));
exports.chatRequestType = new lsp_1.ProtocolRequestType('aws/chat/sendChatPrompt');

@@ -25,1 +20,2 @@ exports.endChatRequestType = new lsp_1.ProtocolRequestType('aws/chat/endChat');

exports.followUpClickNotificationType = new lsp_1.ProtocolNotificationType('aws/chat/followUpClick');
//# sourceMappingURL=chat.js.map

@@ -20,1 +20,2 @@ "use strict";

__exportStar(require("./chat"), exports);
//# sourceMappingURL=index.js.map

@@ -10,1 +10,2 @@ "use strict";

exports.inlineCompletionRequestType = new lsp_1.ProtocolRequestType('aws/textDocument/inlineCompletion');
//# sourceMappingURL=inlineCompletions.js.map

@@ -1,78 +0,4 @@

import { InlineCompletionItem, InlineCompletionParams, InlineCompletionRegistrationOptions, ProtocolNotificationType, ProtocolRequestType } from './lsp';
import { InlineCompletionListWithReferences, InlineCompletionItemWithReferences, LogInlineCompletionSessionResultsParams, InlineCompletionRegistrationOptions, ProtocolNotificationType, ProtocolRequestType, InlineCompletionParams } from './lsp';
export type InlineCompletionWithReferencesParams = InlineCompletionParams & {};
/**
* Extend InlineCompletionItem to include optional references.
*/
export type InlineCompletionItemWithReferences = InlineCompletionItem & {
/**
* Identifier for the the recommendation returned by server.
*/
itemId: string;
references?: {
referenceName?: string;
referenceUrl?: string;
licenseName?: string;
position?: {
startCharacter?: number;
endCharacter?: number;
};
}[];
};
/**
* Extend InlineCompletionList to include optional references. This is not inheriting from `InlineCompletionList`
* since the `items` arrays are incompatible.
*/
export type InlineCompletionListWithReferences = {
/**
* Server returns a session ID for current recommendation session.
* Client need to attach this session ID in the request when sending
* a completion session results.
*/
sessionId: string;
/**
* The inline completion items with optional references
*/
items: InlineCompletionItemWithReferences[];
};
export declare const inlineCompletionWithReferencesRequestType: ProtocolRequestType<InlineCompletionWithReferencesParams, InlineCompletionItemWithReferences[] | InlineCompletionListWithReferences | null, InlineCompletionItemWithReferences[], void, InlineCompletionRegistrationOptions>;
export interface InlineCompletionStates {
/**
* Completion item was displayed in the client application UI.
*/
seen: boolean;
/**
* Completion item was accepted.
*/
accepted: boolean;
/**
* Recommendation was filtered out on the client-side and marked as discarded.
*/
discarded: boolean;
}
export interface LogInlineCompletionSessionResultsParams {
/**
* Session Id attached to get completion items response.
* This value must match to the one that server returned in InlineCompletionListWithReferences response.
*/
sessionId: string;
/**
* Map with results of interaction with completion items in the client UI.
* This list contain a state of each recommendation items from the recommendation session.
*/
completionSessionResult: {
[itemId: string]: InlineCompletionStates;
};
/**
* Time from completion request invocation start to rendering of the first recommendation in the UI.
*/
firstCompletionDisplayLatency?: number;
/**
* Total time when items from this completion session were visible in UI
*/
totalSessionDisplayTime?: number;
/**
* Length of additional characters inputed by user from when the trigger happens to when the user decision was made
*/
typeaheadLength?: number;
}
export declare const inlineCompletionWithReferencesRequestType: ProtocolRequestType<InlineCompletionWithReferencesParams, InlineCompletionListWithReferences | InlineCompletionItemWithReferences[] | null, InlineCompletionItemWithReferences[], void, InlineCompletionRegistrationOptions>;
export declare const logInlineCompletionSessionResultsNotificationType: ProtocolNotificationType<LogInlineCompletionSessionResultsParams, void>;

@@ -7,1 +7,2 @@ "use strict";

exports.logInlineCompletionSessionResultsNotificationType = new lsp_1.ProtocolNotificationType('aws/logInlineCompletionSessionResults');
//# sourceMappingURL=inlineCompletionWithReferences.js.map
import { ProgressType, RegistrationType, RequestType } from 'vscode-languageserver-protocol';
import { _EM } from 'vscode-jsonrpc';
export { TextDocument, Position } from 'vscode-languageserver-textdocument';
export * from '@aws/language-server-runtimes-types';
export { TextDocument } from 'vscode-languageserver-textdocument';
export * from 'vscode-languageserver-protocol';

@@ -5,0 +6,0 @@ export * from './inlineCompletions';

@@ -19,2 +19,3 @@ "use strict";

const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
__exportStar(require("@aws/language-server-runtimes-types"), exports);
var vscode_languageserver_textdocument_1 = require("vscode-languageserver-textdocument");

@@ -38,1 +39,2 @@ Object.defineProperty(exports, "TextDocument", { enumerable: true, get: function () { return vscode_languageserver_textdocument_1.TextDocument; } });

exports.AutoParameterStructuresProtocolRequestType = AutoParameterStructuresProtocolRequestType;
//# sourceMappingURL=lsp.js.map

@@ -12,9 +12,10 @@ # Language Server Runtimes

## Project structure
The project source code is split into next directories:
- `/src`: This directory contains all the source code of the project.
- `/protocol`: JSON-RPC-based Runtime protocol implementation in Typescript, which defines the communication between Runtime and Runtime Clients (e.g. AWS Toolkit extension).
- `/runtimes`: implementation of several runtimes (standalone, webworker) and features, that are exposed to Runtime Servers developed by Server implementors.
- `/server-interface`: defines interfaces of features, that Runtime provides to Runtime Servers implementors.
- `/testing`: testing helper for Server implementors.
- `/src`: This directory contains all the source code of the project.
- `/protocol`: JSON-RPC-based Runtime protocol implementation in Typescript, which defines the communication between Runtime and Runtime Clients (e.g. AWS Toolkit extension).
- `/runtimes`: implementation of several runtimes (standalone, webworker) and features, that are exposed to Runtime Servers developed by Server implementors.
- `/server-interface`: defines interfaces of features, that Runtime provides to Runtime Servers implementors.
- `/testing`: testing helper for Server implementors.

@@ -29,16 +30,17 @@ ## Features

| Method | Support | Notes |
| ------ | ------- | ----- |
| onInlineCompletion | Yes | Provide list of inline completion suggestions from the Server |
| onExecuteCommand | Yes | Executes a custom command provided by the Server. Servers are advised to document custom commands they support in the package README. |
| Method | Support | Notes |
| ------------------ | ------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| onInlineCompletion | Yes | Provide list of inline completion suggestions from the Server |
| onExecuteCommand | Yes | Executes a custom command provided by the Server. Servers are advised to document custom commands they support in the package README. |
##### LSP Extensions
| Method Name | Method | Params | Method Type | Response Type | Notes |
| ------------| ------ | ------ | ----------- | ------------- | ----- |
| onInlineCompletionWithReferences | `aws/textDocument/inlineCompletionWithReferences` | `InlineCompletionWithReferencesParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `InlineCompletionListWithReferences` | Provides list of inline completion suggestions from the Server with references for each of its suggestion |
| onLogInlineCompletionSessionResults | `aws/logInlineCompletionSessionResults` | `LogInlineCompletionSessionResultsParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a | Logs the results from inline completion suggestions from the Server |
| Method Name | Method | Params | Method Type | Response Type | Notes |
| ----------------------------------- | ------------------------------------------------- | ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------------------------------------------- |
| onInlineCompletionWithReferences | `aws/textDocument/inlineCompletionWithReferences` | `InlineCompletionWithReferencesParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `InlineCompletionListWithReferences` | Provides list of inline completion suggestions from the Server with references for each of its suggestion |
| onLogInlineCompletionSessionResults | `aws/logInlineCompletionSessionResults` | `LogInlineCompletionSessionResultsParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a | Logs the results from inline completion suggestions from the Server |
### Auth
The runtime supports two types of credentials: [IAM credentials](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html) and Bearer tokens (e.g. Builder ID). These credentials should be available to destinations in plaintext.
The runtime supports two types of credentials: [IAM credentials](https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/Credentials.html) and Bearer tokens (e.g. Builder ID). These credentials should be available to destinations in plaintext.

@@ -59,16 +61,18 @@ ```ts

Destinations are responsible for managing credentials state, refreshing and updating them on the runtime when their state changes.
Destinations are responsible for managing credentials state, refreshing and updating them on the runtime when their state changes.
#### Initialization
The runtimes by default support authentication with both types of credentials, without the need of a prior agreement or handshake with the client. If the client supports a specific type of credentials, the corresponding LSP `update` method can be called directly. For cases when passing plaintext credentials is not suitable (e.g. standalone runtimes), they can be encrypted before being sent to the server (see [Encryption](README.md#encryption)).
#### Feature Specification
The following table outlines custom LSP methods are supported by servers for authentication:
| Description | Method | Params | Method type | Response Type |
| ----------- | ------ | ------ | ----------- | ------------- |
| Send IAM Credentials | `aws/credentials/iam/update` | `UpdateCredentialsPayload` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | [ResponseMessage](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseMessage) |
| Send Bearer token | `aws/credentials/token/update` | `UpdateCredentialsPayload` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | [ResponseMessage](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseMessage) |
| Delete IAM credentials | `aws/credentials/iam/delete` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Delete bearer token | `aws/credentials/token/delete` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Description | Method | Params | Method type | Response Type |
| ---------------------- | ------------------------------ | -------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Send IAM Credentials | `aws/credentials/iam/update` | `UpdateCredentialsPayload` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | [ResponseMessage](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseMessage) |
| Send Bearer token | `aws/credentials/token/update` | `UpdateCredentialsPayload` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | [ResponseMessage](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseMessage) |
| Delete IAM credentials | `aws/credentials/iam/delete` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Delete bearer token | `aws/credentials/token/delete` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |

@@ -94,13 +98,13 @@ ```ts

| Description | Method | Params | Method type | Response Type |
| ----------- | ------ | ------ | ----------- | ------------- |
| Get Connection Metadata | `aws/credentials/getConnectionMetadata` | n/a | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ConnectionMetadata` |
| Description | Method | Params | Method type | Response Type |
| ----------------------- | --------------------------------------- | ------ | --------------------------------------------------------------------------------------------------------------------- | -------------------- |
| Get Connection Metadata | `aws/credentials/getConnectionMetadata` | n/a | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ConnectionMetadata` |
```ts
export interface ConnectionMetadata {
sso?: SsoProfileData;
sso?: SsoProfileData
}
export interface SsoProfileData {
startUrl?: string;
startUrl?: string
}

@@ -112,18 +116,20 @@ ```

#### Initialization
The runtimes by default supports the telemetry feature, allowing servers to send metrics to destinations. Additional option to disable this feature during initialization as well as during an ongoing session is currently in plan.
#### Feature Specification
The telemetry notification is sent from the server to the client to ask the client to log a telemetry event. AWS Runtimes using Telemetry feature will send metric events with default LSP telemetry notification with specified payload interface. Telemetry notifications are specified as follow:
| Description | Method | Params | Method type | Response Type |
| ----------- | ------ | ------ | ----------- | ------------- |
| Send telemetry event | `telemetry/event` | `MetricEvent` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Description | Method | Params | Method type | Response Type |
| -------------------- | ----------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------- |
| Send telemetry event | `telemetry/event` | `MetricEvent` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
```ts
export type MetricEvent = {
name: string;
data?: any;
result?: ResultType;
errorData?: ErrorData;
};
name: string
data?: any
result?: ResultType
errorData?: ErrorData
}
```

@@ -136,33 +142,36 @@

#### Initialization
TBD
#### Feature Specification
TBD
### Chat
### Chat
The runtime defines Chat interface that allow runtime server implementors to define handlers for chat events to enable conversational experiences. Chat data types are mostly modeled after [mynah-ui](https://github.com/aws/mynah-ui), an event driven UI library designed for chat experiences. `mynah-ui` is the suggested UI library to be used on the destination. However the Chat interface is generic enough to be compatible with other UI approaches
#### Initialization
The runtime supports chat by default
#### Feature Specification
| Description | Method | Params | Method type | Response Type |
| ----------- | ------ | ------ | ----------- | ------------- |
| Send chat prompt | `aws/chat/sendChatPrompt` | `ChatParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ChatResult` |
| End conversation | `aws/chat/endChat` | `EndChatParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `EndChatResult` |
| Send chat quick action | `aws/chat/sendChatQuickAction` | `QuickActionParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ChatResult` |
| Send chat UI ready event | `aws/chat/ready` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send chat vote event | `aws/chat/vote` | `VoteParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send chat feedback event | `aws/chat/feedback` | `FeedbackParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send tab add event | `aws/chat/tabAdd` | `TabAddParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send active tab change event | `aws/chat/tabChange` | `TabChangeParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send tab remove event | `aws/chat/tabRemove` | `TabRemoveParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send insert to cursor position event | `aws/chat/insertToCursorPosition` | `InsertToCursorPositionParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send copy code to clipboard event | `aws/chat/copyCodeToClipboard` | `CopyCodeToClipboardParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send link click event | `aws/chat/linkClick` | `LinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send info link click event | `aws/chat/infoLinkClick` | `InfoLinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send source link click event | `aws/chat/sourceLinkClick` | `SourceLinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send followup chat item click event | `aws/chat/followUpClick` | `FollowUpClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Description | Method | Params | Method type | Response Type |
| ------------------------------------ | --------------------------------- | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------- | --------------- |
| Send chat prompt | `aws/chat/sendChatPrompt` | `ChatParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ChatResult` |
| End conversation | `aws/chat/endChat` | `EndChatParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `EndChatResult` |
| Send chat quick action | `aws/chat/sendChatQuickAction` | `QuickActionParams` | [Request](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#requestMessage) | `ChatResult` |
| Send chat UI ready event | `aws/chat/ready` | n/a | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send chat vote event | `aws/chat/vote` | `VoteParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send chat feedback event | `aws/chat/feedback` | `FeedbackParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send tab add event | `aws/chat/tabAdd` | `TabAddParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send active tab change event | `aws/chat/tabChange` | `TabChangeParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send tab remove event | `aws/chat/tabRemove` | `TabRemoveParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send insert to cursor position event | `aws/chat/insertToCursorPosition` | `InsertToCursorPositionParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send copy code to clipboard event | `aws/chat/copyCodeToClipboard` | `CopyCodeToClipboardParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send link click event | `aws/chat/linkClick` | `LinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send info link click event | `aws/chat/infoLinkClick` | `InfoLinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send source link click event | `aws/chat/sourceLinkClick` | `SourceLinkClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |
| Send followup chat item click event | `aws/chat/followUpClick` | `FollowUpClickParams` | [Notification](https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#notificationMessage) | n/a |

@@ -197,2 +206,3 @@ ```ts

```
Complete Chat parameter and result interfaces can be found in [chat.ts](src/protocol/chat.ts)

@@ -237,26 +247,27 @@

#### Encryption
Runtimes support the passing of encrypted credentials over LSP with stdio as transport. Encryption options must be sent to the runtime over stdin before the LSP initalization starts. Currently, runtimes support AES symmetric encryption with 256 bit keys.
Runtimes support the passing of encrypted credentials over LSP with stdio as transport. Encryption options must be sent to the runtime over stdin before the LSP initalization starts. Currently, runtimes support AES symmetric encryption with 256 bit keys.
The following steps outline how to enable encrypted credentials:
1. Create a random 256 bit (32 byte) encryption key.
1. Create a random 256 bit (32 byte) encryption key.
2. Pass the `--set-credentials-encryption-key` command line argument to the server process at launch. This will signal to the server that the client wants to enable encryption and will wait for the encryption options during the next 5 seconds.
3. Immediately send a JSON blob over `stdin` with the information in the script below, followed by the new line `/n` character, which will signal the end of transmission to the runtime. If LSP initialization continues, encryption options have been validated and saved. If the client fails to send encryption options during the first 5 seconds or the JSON object is invalid, the process will exit with status code 10.
3. Immediately send a JSON blob over `stdin` with the information in the script below, followed by the new line `/n` character, which will signal the end of transmission to the runtime. If LSP initialization continues, encryption options have been validated and saved. If the client fails to send encryption options during the first 5 seconds or the JSON object is invalid, the process will exit with status code 10.
```json
{
"version" : "1.0",
"key" : "<base64 encoded encryption key>",
"mode" : "JWT"
"version": "1.0",
"key": "<base64 encoded encryption key>",
"mode": "JWT"
}
```
4. After LSP initialization is complete, destinations should send credentials over LSP and are responsible for keeping them updated.
4. After LSP initialization is complete, destinations should send credentials over LSP and are responsible for keeping them updated.
To send encrypted credentials, the `UpdateCredentialsPayload` parameters should be sent over the corresponding `aws/credentials/${type}/update` method.
`UpdateCredentialsPayload` specification:
`UpdateCredentialsPayload` specification:
1. **- encrypted**: set to `true` ;
2. **- data**: string value representing the encrypted [JWT](https://www.rfc-editor.org/rfc/rfc7519) token. Encryption must be done with `{ alg: 'dir', enc: 'A256GCM' }` parameters. The payload to be encrypted must contain data field with the credentials.
2. **- data**: string value representing the encrypted [JWT](https://www.rfc-editor.org/rfc/rfc7519) token. Encryption must be done with `{ alg: 'dir', enc: 'A256GCM' }` parameters. The payload to be encrypted must contain data field with the credentials.
3. Clients can set [nbf/exp](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4) claims on the JWT token, which will be validated on the runtime side. A `clockTolerance` of 60 seconds is allowed when verifying the claims.

@@ -267,3 +278,3 @@

{
"data": <credentials>
"data": <credentials>
}

@@ -283,2 +294,1 @@ ```

This project is licensed under the Apache-2.0 License.

@@ -159,1 +159,2 @@ "use strict";

exports.Auth = Auth;
//# sourceMappingURL=auth.js.map

@@ -345,1 +345,2 @@ "use strict";

});
//# sourceMappingURL=auth.test.js.map

@@ -18,1 +18,2 @@ "use strict";

__exportStar(require("./auth"), exports);
//# sourceMappingURL=index.js.map

@@ -63,1 +63,2 @@ "use strict";

exports.readEncryptionDetails = readEncryptionDetails;
//# sourceMappingURL=encryption.js.map

@@ -104,1 +104,2 @@ "use strict";

});
//# sourceMappingURL=encryption.test.js.map

@@ -6,1 +6,2 @@ "use strict";

Object.defineProperty(exports, "standalone", { enumerable: true, get: function () { return standalone_1.standalone; } });
//# sourceMappingURL=index.js.map

@@ -6,1 +6,2 @@ "use strict";

Object.defineProperty(exports, "observe", { enumerable: true, get: function () { return textDocumentConnection_1.observe; } });
//# sourceMappingURL=index.js.map

@@ -32,3 +32,2 @@ "use strict";

},
hoverProvider: true,
},

@@ -60,1 +59,2 @@ };

exports.LspRouter = LspRouter;
//# sourceMappingURL=lspRouter.js.map

@@ -57,3 +57,2 @@ "use strict";

},
hoverProvider: true,
},

@@ -76,3 +75,2 @@ };

},
hoverProvider: true,
},

@@ -92,5 +90,3 @@ };

return Promise.resolve({
capabilities: {
hoverProvider: true,
},
capabilities: {},
extraField: 'extraValue',

@@ -113,3 +109,2 @@ });

completionProvider: { resolveProvider: true },
hoverProvider: true,
},

@@ -149,3 +144,2 @@ extraField: 'extraValue',

completionProvider: { resolveProvider: true },
hoverProvider: true,
},

@@ -216,1 +210,2 @@ };

});
//# sourceMappingURL=lspRouter.test.js.map

@@ -45,1 +45,2 @@ "use strict";

exports.LspServer = LspServer;
//# sourceMappingURL=lspServer.js.map

@@ -47,1 +47,2 @@ "use strict";

exports.mergeObjects = mergeObjects;
//# sourceMappingURL=util.js.map

@@ -60,1 +60,2 @@ "use strict";

exports.observe = observe;
//# sourceMappingURL=textDocumentConnection.js.map

@@ -123,3 +123,3 @@ "use strict";

});
describe('onWillSaeTextDocumentWaitUntil', () => {
describe('onWillSaveTextDocumentWaitUntil', () => {
it('supports only last handler', () => {

@@ -141,1 +141,2 @@ const connection = (0, textDocumentConnection_1.observe)(testConnection);

});
//# sourceMappingURL=textDocumentConnection.test.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=runtime.js.map

@@ -206,2 +206,3 @@ "use strict";

getConfiguration: section => lspConnection.workspace.getConfiguration(section),
onDidChangeWorkspaceFolders: handler => lspConnection.onNotification(protocol_1.DidChangeWorkspaceFoldersNotification.method, handler),
},

@@ -232,1 +233,2 @@ publishDiagnostics: params => lspConnection.sendNotification(protocol_1.PublishDiagnosticsNotification.method, params),

exports.standalone = standalone;
//# sourceMappingURL=standalone.js.map

@@ -11,1 +11,2 @@ "use strict";

exports.handleVersionArgument = handleVersionArgument;
//# sourceMappingURL=versioning.js.map

@@ -40,1 +40,2 @@ "use strict";

});
//# sourceMappingURL=versioning.test.js.map

@@ -98,2 +98,3 @@ "use strict";

getConfiguration: section => lspConnection.workspace.getConfiguration(section),
onDidChangeWorkspaceFolders: handler => lspConnection.onNotification(protocol_1.DidChangeWorkspaceFoldersNotification.method, handler),
},

@@ -123,1 +124,2 @@ publishDiagnostics: params => lspConnection.sendNotification(protocol_1.PublishDiagnosticsNotification.method, params),

exports.webworker = webworker;
//# sourceMappingURL=webworker.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=auth.js.map

@@ -1,3 +0,2 @@

import { NotificationHandler, RequestHandler } from '../protocol';
import { ChatParams, ChatResult, CopyCodeToClipboardParams, EndChatParams, EndChatResult, FeedbackParams, FollowUpClickParams, InfoLinkClickParams, InsertToCursorPositionParams, LinkClickParams, QuickActionParams, QuickActionResult, SourceLinkClickParams, TabChangeParams, TabAddParams, TabRemoveParams, VoteParams } from '../protocol';
import { NotificationHandler, RequestHandler, ChatParams, ChatResult, CopyCodeToClipboardParams, EndChatParams, EndChatResult, FeedbackParams, FollowUpClickParams, InfoLinkClickParams, InsertToCursorPositionParams, LinkClickParams, QuickActionParams, QuickActionResult, SourceLinkClickParams, TabChangeParams, TabAddParams, TabRemoveParams, VoteParams } from '../protocol';
/**

@@ -4,0 +3,0 @@ * The Chat feature interface. Provides access to chat features

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=chat.js.map

@@ -20,1 +20,2 @@ "use strict";

__exportStar(require("./telemetry"), exports);
//# sourceMappingURL=index.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=logging.js.map

@@ -1,2 +0,2 @@

import { CompletionItem, CompletionList, InlineCompletionItem, CompletionParams, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, ExecuteCommandParams, Hover, HoverParams, InitializeError, InitializeParams, InitializedParams, InlineCompletionList, InlineCompletionParams, NotificationHandler, PublishDiagnosticsParams, ServerCapabilities, InlineCompletionItemWithReferences, InlineCompletionListWithReferences, LogInlineCompletionSessionResultsParams, RequestHandler, DidOpenTextDocumentParams, DocumentFormattingParams, TextEdit, ProgressType, ProgressToken } from '../protocol';
import { CompletionItem, CompletionList, InlineCompletionItem, CompletionParams, DidChangeConfigurationParams, DidChangeTextDocumentParams, DidCloseTextDocumentParams, ExecuteCommandParams, Hover, HoverParams, InitializeError, InitializeParams, InitializedParams, InlineCompletionList, InlineCompletionParams, NotificationHandler, PublishDiagnosticsParams, ServerCapabilities, InlineCompletionItemWithReferences, InlineCompletionListWithReferences, LogInlineCompletionSessionResultsParams, RequestHandler, DidOpenTextDocumentParams, DocumentFormattingParams, TextEdit, ProgressType, ProgressToken, DidChangeWorkspaceFoldersParams } from '../protocol';
export * from '../protocol/lsp';

@@ -30,2 +30,3 @@ export type PartialServerCapabilities<T = any> = Pick<ServerCapabilities<T>, 'completionProvider' | 'hoverProvider' | 'executeCommandProvider'>;

getConfiguration: (section: string) => Promise<any>;
onDidChangeWorkspaceFolders: (handler: NotificationHandler<DidChangeWorkspaceFoldersParams>) => void;
};

@@ -32,0 +33,0 @@ extensions: {

@@ -20,1 +20,2 @@ "use strict";

__exportStar(require("../protocol/lsp"), exports);
//# sourceMappingURL=lsp.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=server.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=telemetry.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=workspace.js.map

@@ -6,1 +6,2 @@ "use strict";

Object.defineProperty(exports, "TestFeatures", { enumerable: true, get: function () { return TestFeatures_1.TestFeatures; } });
//# sourceMappingURL=index.js.map

@@ -34,3 +34,3 @@ import { Server, CredentialsProvider, Logging, Lsp, Telemetry, Workspace, Chat } from '../server-interface';

doHover(params: HoverParams, token: CancellationToken): Promise<import("vscode-languageserver-types").Hover | import("vscode-jsonrpc/lib/common/messages").ResponseError<void> | null | undefined>;
doInlineCompletionWithReferences(...args: Parameters<Parameters<Lsp['extensions']['onInlineCompletionWithReferences']>[0]>): Promise<import("../server-interface").InlineCompletionItemWithReferences[] | import("../server-interface").InlineCompletionListWithReferences | import("vscode-jsonrpc/lib/common/messages").ResponseError<void> | null | undefined>;
doInlineCompletionWithReferences(...args: Parameters<Parameters<Lsp['extensions']['onInlineCompletionWithReferences']>[0]>): Promise<import("@aws/language-server-runtimes-types/out/inlineCompletionWithReferences").InlineCompletionListWithReferences | import("@aws/language-server-runtimes-types/out/inlineCompletionWithReferences").InlineCompletionItemWithReferences[] | import("vscode-jsonrpc/lib/common/messages").ResponseError<void> | null | undefined>;
doLogInlineCompletionSessionResults(...args: Parameters<Parameters<Lsp['extensions']['onLogInlineCompletionSessionResults']>[0]>): Promise<void>;

@@ -37,0 +37,0 @@ openDocument(document: TextDocument): this;

@@ -159,1 +159,2 @@ "use strict";

exports.TestFeatures = TestFeatures;
//# sourceMappingURL=TestFeatures.js.map
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc