feat: Complete zCode CLI X with Telegram bot integration

- Add full Telegram bot functionality with Z.AI API integration
- Implement 4 tools: Bash, FileEdit, WebSearch, Git
- Add 3 agents: Code Reviewer, Architect, DevOps Engineer
- Add 6 skills for common coding tasks
- Add systemd service file for 24/7 operation
- Add nginx configuration for HTTPS webhook
- Add comprehensive documentation
- Implement WebSocket server for real-time updates
- Add logging system with Winston
- Add environment validation

🤖 zCode CLI X - Agentic coder with Z.AI + Telegram integration
This commit is contained in:
admin
2026-05-05 09:01:26 +00:00
Unverified
parent 4a7035dd92
commit 875c7f9b91
24688 changed files with 3224957 additions and 221 deletions

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "{}"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,19 @@
# @aws-sdk/middleware-websocket
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/middleware-websocket/latest.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-websocket)
[![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/middleware-websocket.svg)](https://www.npmjs.com/package/@aws-sdk/middleware-websocket)
### :warning: Internal API :warning:
> This is an internal package.
> That means this is used as a dependency for other, public packages, but
> should not be taken directly as a dependency in your application's `package.json`.
> If you are updating the version of this package, for example to bring in a
> bug-fix, you should do so by updating your application lockfile with
> e.g. `npm up @scope/package` or equivalent command in another
> package manager, rather than taking a direct dependency.
---
This package contains necessary dependency to support WebSocket connections for AWS services. These behaviors are subject to change.

View File

@@ -0,0 +1,395 @@
'use strict';
var utilFormatUrl = require('@aws-sdk/util-format-url');
var eventstreamSerdeBrowser = require('@smithy/eventstream-serde-browser');
var fetchHttpHandler = require('@smithy/fetch-http-handler');
var protocolHttp = require('@smithy/protocol-http');
var utilBase64 = require('@smithy/util-base64');
var eventstreamCodec = require('@smithy/eventstream-codec');
var utilHexEncoding = require('@smithy/util-hex-encoding');
const isWebSocketRequest = (request) => request.protocol === "ws:" || request.protocol === "wss:";
const DEFAULT_WS_CONNECTION_TIMEOUT_MS = 3000;
class WebSocketFetchHandler {
metadata = {
handlerProtocol: "websocket/h1.1",
};
config = {};
configPromise;
httpHandler;
sockets = {};
static create(instanceOrOptions, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {
if (typeof instanceOrOptions?.handle === "function") {
return instanceOrOptions;
}
return new WebSocketFetchHandler(instanceOrOptions, httpHandler);
}
constructor(options, httpHandler = new fetchHttpHandler.FetchHttpHandler()) {
this.httpHandler = httpHandler;
const setConfig = (opts) => {
this.config = {
...(opts ?? {}),
};
return this.config;
};
if (typeof options === "function") {
this.config = {};
this.configPromise = options().then((opts) => {
return setConfig(opts);
});
}
else {
this.configPromise = Promise.resolve(setConfig(options));
}
}
destroy() {
for (const [key, sockets] of Object.entries(this.sockets)) {
for (const socket of sockets) {
socket.close(1000, `Socket closed through destroy() call`);
}
delete this.sockets[key];
}
}
async handle(request) {
this.config = await this.configPromise;
const { logger } = this.config;
if (!isWebSocketRequest(request)) {
logger?.debug?.(`@aws-sdk - ws fetching ${request.protocol}${request.hostname}${request.path}`);
return this.httpHandler.handle(request);
}
const url = utilFormatUrl.formatUrl(request);
logger?.debug?.(`@aws-sdk - ws connecting ${url.split("?")[0]}`);
const socket = new WebSocket(url);
if (!this.sockets[url]) {
this.sockets[url] = [];
}
this.sockets[url].push(socket);
socket.binaryType = "arraybuffer";
const { connectionTimeout = DEFAULT_WS_CONNECTION_TIMEOUT_MS } = this.config;
await this.waitForReady(socket, connectionTimeout);
const { body } = request;
const bodyStream = getIterator(body);
const asyncIterable = this.connect(socket, bodyStream);
const outputPayload = toReadableStream(asyncIterable);
return {
response: new protocolHttp.HttpResponse({
statusCode: 200,
body: outputPayload,
}),
};
}
updateHttpClientConfig(key, value) {
this.configPromise = this.configPromise.then((config) => {
config[key] = value;
return config;
});
}
httpHandlerConfigs() {
return this.config ?? {};
}
removeNotUsableSockets(url) {
this.sockets[url] = (this.sockets[url] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState));
}
waitForReady(socket, connectionTimeout) {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
this.removeNotUsableSockets(socket.url);
reject({
$metadata: {
httpStatusCode: 500,
websocketSynthetic500Error: true,
},
});
}, connectionTimeout);
socket.onopen = () => {
clearTimeout(timeout);
resolve();
};
});
}
connect(socket, data) {
const messageQueue = [];
let pendingResolve = null;
let pendingReject = null;
const push = (item) => {
if (pendingResolve) {
if (item.error) {
pendingReject(item.error);
}
else {
pendingResolve({ done: item.done, value: item.value });
}
pendingResolve = null;
pendingReject = null;
}
else {
messageQueue.push(item);
}
};
socket.onmessage = (event) => {
const { data } = event;
if (typeof data === "string") {
push({
done: false,
value: utilBase64.fromBase64(data),
});
}
else {
push({
done: false,
value: new Uint8Array(data),
});
}
};
socket.onerror = (event) => {
socket.close();
push({ done: true, error: event });
};
socket.onclose = () => {
this.removeNotUsableSockets(socket.url);
push({ done: true });
};
const outputStream = {
[Symbol.asyncIterator]: () => ({
async next() {
if (messageQueue.length > 0) {
const item = messageQueue.shift();
if (item.error) {
throw item.error;
}
return { done: item.done, value: item.value };
}
return new Promise((resolve, reject) => {
pendingResolve = resolve;
pendingReject = reject;
});
},
}),
};
const send = async () => {
try {
for await (const chunk of data) {
if (socket.readyState >= WebSocket.CLOSING) {
break;
}
else {
socket.send(chunk);
}
}
}
catch (err) {
push({
done: true,
error: err,
});
}
finally {
socket.close(1000);
}
};
send();
return outputStream;
}
}
const getIterator = (stream) => {
if (stream[Symbol.asyncIterator]) {
return stream;
}
if (isReadableStream(stream)) {
return eventstreamSerdeBrowser.readableStreamtoIterable(stream);
}
return {
[Symbol.asyncIterator]: async function* () {
yield stream;
},
};
};
const toReadableStream = (asyncIterable) => typeof ReadableStream === "function" ? eventstreamSerdeBrowser.iterableToReadableStream(asyncIterable) : asyncIterable;
const isReadableStream = (payload) => typeof ReadableStream === "function" && payload instanceof ReadableStream;
const websocketEndpointMiddleware = (config, options) => (next) => (args) => {
const { request } = args;
if (protocolHttp.HttpRequest.isInstance(request) &&
config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) {
request.protocol = "wss:";
request.method = "GET";
request.path = `${request.path}-websocket`;
const { headers } = request;
delete headers["content-type"];
delete headers["x-amz-content-sha256"];
for (const name of Object.keys(headers)) {
if (name.indexOf(options.headerPrefix) === 0) {
const chunkedName = name.replace(options.headerPrefix, "");
request.query[chunkedName] = headers[name];
}
}
if (headers["x-amz-user-agent"]) {
request.query["user-agent"] = headers["x-amz-user-agent"];
}
request.headers = { host: headers.host ?? request.hostname };
}
return next(args);
};
const websocketEndpointMiddlewareOptions = {
name: "websocketEndpointMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
relation: "after",
toMiddleware: "eventStreamHeaderMiddleware",
override: true,
};
const injectSessionIdMiddleware = () => (next) => async (args) => {
const requestParams = {
...args.input,
};
const response = await next(args);
const output = response.output;
if (requestParams.SessionId && output.SessionId == null) {
output.SessionId = requestParams.SessionId;
}
return response;
};
const injectSessionIdMiddlewareOptions = {
step: "initialize",
name: "injectSessionIdMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
override: true,
};
const getWebSocketPlugin = (config, options) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions);
clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions);
},
});
class WebsocketSignatureV4 {
signer;
constructor(options) {
this.signer = options.signer;
}
presign(originalRequest, options = {}) {
return this.signer.presign(originalRequest, options);
}
async sign(toSign, options) {
if (protocolHttp.HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) {
const signedRequest = await this.signer.presign({ ...toSign, body: "" }, {
...options,
expiresIn: 60,
unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host")),
});
return {
...signedRequest,
body: toSign.body,
};
}
else {
return this.signer.sign(toSign, options);
}
}
signMessage(message, args) {
return this.signer.signMessage(message, args);
}
}
const resolveWebSocketConfig = (input) => {
const { signer } = input;
return Object.assign(input, {
signer: async (authScheme) => {
const signerObj = await signer(authScheme);
if (validateSigner(signerObj)) {
return new WebsocketSignatureV4({ signer: signerObj });
}
throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor.");
},
});
};
const validateSigner = (signer) => !!signer;
class EventSigningTransformStream extends TransformStream {
constructor(initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) {
let priorSignature = initialSignature;
super({
start() { },
async transform(chunk, controller) {
try {
const now = new Date(Date.now() + (await systemClockOffsetProvider()));
const dateHeader = {
":date": { type: "timestamp", value: now },
};
const signedMessage = await messageSigner.sign({
message: {
body: chunk,
headers: dateHeader,
},
priorSignature: priorSignature,
}, {
signingDate: now,
});
priorSignature = signedMessage.signature;
const serializedSigned = eventStreamCodec.encode({
headers: {
...dateHeader,
":chunk-signature": {
type: "binary",
value: utilHexEncoding.fromHex(signedMessage.signature),
},
},
body: chunk,
});
controller.enqueue(serializedSigned);
}
catch (error) {
controller.error(error);
}
},
});
}
}
class EventStreamPayloadHandler {
messageSigner;
eventStreamCodec;
systemClockOffsetProvider;
constructor(options) {
this.messageSigner = options.messageSigner;
this.eventStreamCodec = new eventstreamCodec.EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
}
async handle(next, args, context = {}) {
const request = args.request;
const { body: payload, headers, query } = request;
if (!(payload instanceof ReadableStream)) {
throw new Error("Eventstream payload must be a ReadableStream.");
}
const placeHolderStream = new TransformStream();
request.body = placeHolderStream.readable;
const match = (headers?.authorization ?? "").match(/Signature=(\w+)$/);
let priorSignature = (match ?? [])[1] ?? (query && query["X-Amz-Signature"]) ?? "";
if (context.__staticSignature) {
priorSignature = "";
}
const signingStream = new EventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);
payload.pipeThrough(signingStream).pipeThrough(placeHolderStream);
let result;
try {
result = await next(args);
}
catch (e) {
const p = payload.cancel?.();
if (p instanceof Promise) {
p.catch(() => { });
}
throw e;
}
return result;
}
}
const eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options);
exports.WebSocketFetchHandler = WebSocketFetchHandler;
exports.eventStreamPayloadHandlerProvider = eventStreamPayloadHandlerProvider;
exports.getWebSocketPlugin = getWebSocketPlugin;
exports.resolveWebSocketConfig = resolveWebSocketConfig;

View File

@@ -0,0 +1,203 @@
import { formatUrl } from "@aws-sdk/util-format-url";
import { iterableToReadableStream, readableStreamtoIterable } from "@smithy/eventstream-serde-browser";
import { FetchHttpHandler } from "@smithy/fetch-http-handler";
import { HttpResponse } from "@smithy/protocol-http";
import { fromBase64 } from "@smithy/util-base64";
import { isWebSocketRequest } from "./utils";
const DEFAULT_WS_CONNECTION_TIMEOUT_MS = 3000;
export class WebSocketFetchHandler {
metadata = {
handlerProtocol: "websocket/h1.1",
};
config = {};
configPromise;
httpHandler;
sockets = {};
static create(instanceOrOptions, httpHandler = new FetchHttpHandler()) {
if (typeof instanceOrOptions?.handle === "function") {
return instanceOrOptions;
}
return new WebSocketFetchHandler(instanceOrOptions, httpHandler);
}
constructor(options, httpHandler = new FetchHttpHandler()) {
this.httpHandler = httpHandler;
const setConfig = (opts) => {
this.config = {
...(opts ?? {}),
};
return this.config;
};
if (typeof options === "function") {
this.config = {};
this.configPromise = options().then((opts) => {
return setConfig(opts);
});
}
else {
this.configPromise = Promise.resolve(setConfig(options));
}
}
destroy() {
for (const [key, sockets] of Object.entries(this.sockets)) {
for (const socket of sockets) {
socket.close(1000, `Socket closed through destroy() call`);
}
delete this.sockets[key];
}
}
async handle(request) {
this.config = await this.configPromise;
const { logger } = this.config;
if (!isWebSocketRequest(request)) {
logger?.debug?.(`@aws-sdk - ws fetching ${request.protocol}${request.hostname}${request.path}`);
return this.httpHandler.handle(request);
}
const url = formatUrl(request);
logger?.debug?.(`@aws-sdk - ws connecting ${url.split("?")[0]}`);
const socket = new WebSocket(url);
if (!this.sockets[url]) {
this.sockets[url] = [];
}
this.sockets[url].push(socket);
socket.binaryType = "arraybuffer";
const { connectionTimeout = DEFAULT_WS_CONNECTION_TIMEOUT_MS } = this.config;
await this.waitForReady(socket, connectionTimeout);
const { body } = request;
const bodyStream = getIterator(body);
const asyncIterable = this.connect(socket, bodyStream);
const outputPayload = toReadableStream(asyncIterable);
return {
response: new HttpResponse({
statusCode: 200,
body: outputPayload,
}),
};
}
updateHttpClientConfig(key, value) {
this.configPromise = this.configPromise.then((config) => {
config[key] = value;
return config;
});
}
httpHandlerConfigs() {
return this.config ?? {};
}
removeNotUsableSockets(url) {
this.sockets[url] = (this.sockets[url] ?? []).filter((socket) => ![WebSocket.CLOSING, WebSocket.CLOSED].includes(socket.readyState));
}
waitForReady(socket, connectionTimeout) {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
this.removeNotUsableSockets(socket.url);
reject({
$metadata: {
httpStatusCode: 500,
websocketSynthetic500Error: true,
},
});
}, connectionTimeout);
socket.onopen = () => {
clearTimeout(timeout);
resolve();
};
});
}
connect(socket, data) {
const messageQueue = [];
let pendingResolve = null;
let pendingReject = null;
const push = (item) => {
if (pendingResolve) {
if (item.error) {
pendingReject(item.error);
}
else {
pendingResolve({ done: item.done, value: item.value });
}
pendingResolve = null;
pendingReject = null;
}
else {
messageQueue.push(item);
}
};
socket.onmessage = (event) => {
const { data } = event;
if (typeof data === "string") {
push({
done: false,
value: fromBase64(data),
});
}
else {
push({
done: false,
value: new Uint8Array(data),
});
}
};
socket.onerror = (event) => {
socket.close();
push({ done: true, error: event });
};
socket.onclose = () => {
this.removeNotUsableSockets(socket.url);
push({ done: true });
};
const outputStream = {
[Symbol.asyncIterator]: () => ({
async next() {
if (messageQueue.length > 0) {
const item = messageQueue.shift();
if (item.error) {
throw item.error;
}
return { done: item.done, value: item.value };
}
return new Promise((resolve, reject) => {
pendingResolve = resolve;
pendingReject = reject;
});
},
}),
};
const send = async () => {
try {
for await (const chunk of data) {
if (socket.readyState >= WebSocket.CLOSING) {
break;
}
else {
socket.send(chunk);
}
}
}
catch (err) {
push({
done: true,
error: err,
});
}
finally {
socket.close(1000);
}
};
send();
return outputStream;
}
}
const getIterator = (stream) => {
if (stream[Symbol.asyncIterator]) {
return stream;
}
if (isReadableStream(stream)) {
return readableStreamtoIterable(stream);
}
return {
[Symbol.asyncIterator]: async function* () {
yield stream;
},
};
};
const toReadableStream = (asyncIterable) => typeof ReadableStream === "function" ? iterableToReadableStream(asyncIterable) : asyncIterable;
const isReadableStream = (payload) => typeof ReadableStream === "function" && payload instanceof ReadableStream;

View File

@@ -0,0 +1,30 @@
import { HttpRequest } from "@smithy/protocol-http";
import { isWebSocketRequest } from "./utils";
export class WebsocketSignatureV4 {
signer;
constructor(options) {
this.signer = options.signer;
}
presign(originalRequest, options = {}) {
return this.signer.presign(originalRequest, options);
}
async sign(toSign, options) {
if (HttpRequest.isInstance(toSign) && isWebSocketRequest(toSign)) {
const signedRequest = await this.signer.presign({ ...toSign, body: "" }, {
...options,
expiresIn: 60,
unsignableHeaders: new Set(Object.keys(toSign.headers).filter((header) => header !== "host")),
});
return {
...signedRequest,
body: toSign.body,
};
}
else {
return this.signer.sign(toSign, options);
}
}
signMessage(message, args) {
return this.signer.signMessage(message, args);
}
}

View File

@@ -0,0 +1,8 @@
import { websocketEndpointMiddleware, websocketEndpointMiddlewareOptions, } from "./middlewares/websocketEndpointMiddleware";
import { injectSessionIdMiddleware, injectSessionIdMiddlewareOptions, } from "./middlewares/websocketInjectSessionIdMiddleware";
export const getWebSocketPlugin = (config, options) => ({
applyToStack: (clientStack) => {
clientStack.addRelativeTo(websocketEndpointMiddleware(config, options), websocketEndpointMiddlewareOptions);
clientStack.add(injectSessionIdMiddleware(), injectSessionIdMiddlewareOptions);
},
});

View File

@@ -0,0 +1,4 @@
export * from "./WebSocketFetchHandler";
export * from "./getWebSocketPlugin";
export * from "./resolveWebSocketConfig";
export * from "./ws-eventstream/eventStreamPayloadHandlerProvider";

View File

@@ -0,0 +1,31 @@
import { HttpRequest } from "@smithy/protocol-http";
export const websocketEndpointMiddleware = (config, options) => (next) => (args) => {
const { request } = args;
if (HttpRequest.isInstance(request) &&
config.requestHandler.metadata?.handlerProtocol?.toLowerCase().includes("websocket")) {
request.protocol = "wss:";
request.method = "GET";
request.path = `${request.path}-websocket`;
const { headers } = request;
delete headers["content-type"];
delete headers["x-amz-content-sha256"];
for (const name of Object.keys(headers)) {
if (name.indexOf(options.headerPrefix) === 0) {
const chunkedName = name.replace(options.headerPrefix, "");
request.query[chunkedName] = headers[name];
}
}
if (headers["x-amz-user-agent"]) {
request.query["user-agent"] = headers["x-amz-user-agent"];
}
request.headers = { host: headers.host ?? request.hostname };
}
return next(args);
};
export const websocketEndpointMiddlewareOptions = {
name: "websocketEndpointMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
relation: "after",
toMiddleware: "eventStreamHeaderMiddleware",
override: true,
};

View File

@@ -0,0 +1,17 @@
export const injectSessionIdMiddleware = () => (next) => async (args) => {
const requestParams = {
...args.input,
};
const response = await next(args);
const output = response.output;
if (requestParams.SessionId && output.SessionId == null) {
output.SessionId = requestParams.SessionId;
}
return response;
};
export const injectSessionIdMiddlewareOptions = {
step: "initialize",
name: "injectSessionIdMiddleware",
tags: ["WEBSOCKET", "EVENT_STREAM"],
override: true,
};

View File

@@ -0,0 +1,14 @@
import { WebsocketSignatureV4 } from "./WebsocketSignatureV4";
export const resolveWebSocketConfig = (input) => {
const { signer } = input;
return Object.assign(input, {
signer: async (authScheme) => {
const signerObj = await signer(authScheme);
if (validateSigner(signerObj)) {
return new WebsocketSignatureV4({ signer: signerObj });
}
throw new Error("Expected WebsocketSignatureV4 signer, please check the client constructor.");
},
});
};
const validateSigner = (signer) => !!signer;

View File

@@ -0,0 +1 @@
export const isWebSocketRequest = (request) => request.protocol === "ws:" || request.protocol === "wss:";

View File

@@ -0,0 +1,41 @@
import { fromHex } from "@smithy/util-hex-encoding";
export class EventSigningTransformStream extends TransformStream {
constructor(initialSignature, messageSigner, eventStreamCodec, systemClockOffsetProvider) {
let priorSignature = initialSignature;
super({
start() { },
async transform(chunk, controller) {
try {
const now = new Date(Date.now() + (await systemClockOffsetProvider()));
const dateHeader = {
":date": { type: "timestamp", value: now },
};
const signedMessage = await messageSigner.sign({
message: {
body: chunk,
headers: dateHeader,
},
priorSignature: priorSignature,
}, {
signingDate: now,
});
priorSignature = signedMessage.signature;
const serializedSigned = eventStreamCodec.encode({
headers: {
...dateHeader,
":chunk-signature": {
type: "binary",
value: fromHex(signedMessage.signature),
},
},
body: chunk,
});
controller.enqueue(serializedSigned);
}
catch (error) {
controller.error(error);
}
},
});
}
}

View File

@@ -0,0 +1,40 @@
import { EventStreamCodec } from "@smithy/eventstream-codec";
import { EventSigningTransformStream } from "./EventSigningTransformStream";
export class EventStreamPayloadHandler {
messageSigner;
eventStreamCodec;
systemClockOffsetProvider;
constructor(options) {
this.messageSigner = options.messageSigner;
this.eventStreamCodec = new EventStreamCodec(options.utf8Encoder, options.utf8Decoder);
this.systemClockOffsetProvider = async () => options.systemClockOffset ?? 0;
}
async handle(next, args, context = {}) {
const request = args.request;
const { body: payload, headers, query } = request;
if (!(payload instanceof ReadableStream)) {
throw new Error("Eventstream payload must be a ReadableStream.");
}
const placeHolderStream = new TransformStream();
request.body = placeHolderStream.readable;
const match = (headers?.authorization ?? "").match(/Signature=(\w+)$/);
let priorSignature = (match ?? [])[1] ?? (query && query["X-Amz-Signature"]) ?? "";
if (context.__staticSignature) {
priorSignature = "";
}
const signingStream = new EventSigningTransformStream(priorSignature, await this.messageSigner(), this.eventStreamCodec, this.systemClockOffsetProvider);
payload.pipeThrough(signingStream).pipeThrough(placeHolderStream);
let result;
try {
result = await next(args);
}
catch (e) {
const p = payload.cancel?.();
if (p instanceof Promise) {
p.catch(() => { });
}
throw e;
}
return result;
}
}

View File

@@ -0,0 +1,2 @@
import { EventStreamPayloadHandler } from "./EventStreamPayloadHandler";
export const eventStreamPayloadHandlerProvider = (options) => new EventStreamPayloadHandler(options);

View File

@@ -0,0 +1,49 @@
import type { HttpRequest } from "@smithy/protocol-http";
import { HttpResponse } from "@smithy/protocol-http";
import type { Logger, Provider, RequestHandler, RequestHandlerMetadata } from "@smithy/types";
export interface WebSocketFetchHandlerOptions {
/**
* The maximum time in milliseconds that the connection phase of a request
* may take before the connection attempt is abandoned.
*/
connectionTimeout?: number;
/**
* Optional logger.
*/
logger?: Logger;
}
/**
* Base handler for websocket requests and HTTP request. By default, the request input and output
* body will be in a ReadableStream, because of interface consistency among middleware.
* If ReadableStream is not available, like in React-Native, the response body
* will be an async iterable.
*/
export declare class WebSocketFetchHandler {
readonly metadata: RequestHandlerMetadata;
private config;
private configPromise;
private readonly httpHandler;
private readonly sockets;
/**
* @returns the input if it is an HttpHandler of any class,
* or instantiates a new instance of this handler.
*/
static create(instanceOrOptions?: WebSocketFetchHandler | WebSocketFetchHandlerOptions | Provider<WebSocketFetchHandlerOptions | void>, httpHandler?: RequestHandler<any, any>): WebSocketFetchHandler;
constructor(options?: WebSocketFetchHandlerOptions | Provider<WebSocketFetchHandlerOptions>, httpHandler?: RequestHandler<any, any>);
/**
* Destroys the WebSocketHandler.
* Closes all sockets from the socket pool.
*/
destroy(): void;
handle(request: HttpRequest): Promise<{
response: HttpResponse;
}>;
updateHttpClientConfig(key: keyof WebSocketFetchHandlerOptions, value: WebSocketFetchHandlerOptions[typeof key]): void;
httpHandlerConfigs(): WebSocketFetchHandlerOptions;
/**
* Removes all closing/closed sockets from the socket pool for URL.
*/
private removeNotUsableSockets;
private waitForReady;
private connect;
}

View File

@@ -0,0 +1,20 @@
import type { SignatureV4 as BaseSignatureV4 } from "@smithy/signature-v4";
import type { EventSigner, EventSigningArguments, FormattedEvent, HttpRequest as IHttpRequest, MessageSigner, RequestPresigner, RequestPresigningArguments, RequestSigner, RequestSigningArguments, SignableMessage, SignedMessage, SigningArguments, StringSigner } from "@smithy/types";
/**
* Because this signer defers to sigv4, it implements all signing interfaces that
* the sigv4 signer does, including message signing.
*
* @internal
*/
export declare class WebsocketSignatureV4 implements RequestPresigner, RequestSigner, StringSigner, EventSigner, MessageSigner {
private readonly signer;
constructor(options: {
signer: BaseSignatureV4;
});
presign(originalRequest: IHttpRequest, options?: RequestPresigningArguments): Promise<IHttpRequest>;
sign(stringToSign: string, options?: SigningArguments): Promise<string>;
sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
sign(event: SignableMessage, options: SigningArguments): Promise<SignedMessage>;
sign(requestToSign: IHttpRequest, options?: RequestSigningArguments): Promise<IHttpRequest>;
signMessage(message: SignableMessage, args: SigningArguments): Promise<SignedMessage>;
}

View File

@@ -0,0 +1,8 @@
import type { Pluggable, RequestHandler } from "@smithy/types";
interface WebSocketResolvedConfig {
requestHandler: RequestHandler<any, any>;
}
export declare const getWebSocketPlugin: (config: WebSocketResolvedConfig, options: {
headerPrefix: string;
}) => Pluggable<any, any>;
export {};

View File

@@ -0,0 +1,4 @@
export * from "./WebSocketFetchHandler";
export * from "./getWebSocketPlugin";
export * from "./resolveWebSocketConfig";
export * from "./ws-eventstream/eventStreamPayloadHandlerProvider";

View File

@@ -0,0 +1,13 @@
import type { BuildMiddleware, RelativeMiddlewareOptions, RequestHandler } from "@smithy/types";
/**
* Middleware that modify the request to from http to WebSocket
* This middleware can only be applied to commands that supports bi-directional event streaming via WebSocket.
* Example of headerPrefix is "x-amz-rekognition-streaming-liveness-*" prefix exists for all rekognition streaming
* websocket API's headers. The common prefix are to be removed when moving them from headers to querystring.
*/
export declare const websocketEndpointMiddleware: (config: {
requestHandler: RequestHandler<any, any>;
}, options: {
headerPrefix: string;
}) => BuildMiddleware<any, any>;
export declare const websocketEndpointMiddlewareOptions: RelativeMiddlewareOptions;

View File

@@ -0,0 +1,10 @@
import type { InitializeHandlerOptions, InitializeMiddleware } from "@smithy/types";
/**
* Most WebSocket operations contains `SessionId` parameter in both input and
* output, with the same value. This middleware populates the `SessionId`
* parameter from request to the response. This is necessary because in
* WebSocket, the SDK cannot access any parameters other than the response
* stream. So we fake response parameter.
*/
export declare const injectSessionIdMiddleware: () => InitializeMiddleware<any, any>;
export declare const injectSessionIdMiddlewareOptions: InitializeHandlerOptions;

View File

@@ -0,0 +1,22 @@
import type { AuthScheme, RequestHandler, RequestSigner } from "@smithy/types";
/**
* @public
*/
export interface WebSocketInputConfig {
}
interface PreviouslyResolved {
signer: (authScheme: AuthScheme) => Promise<RequestSigner>;
requestHandler: RequestHandler<any, any>;
}
export interface WebSocketResolvedConfig {
/**
* Resolved value of input config {@link AwsAuthInputConfig.signer}
*/
signer: (authScheme: AuthScheme) => Promise<RequestSigner>;
/**
* The HTTP handler to use. Fetch in browser and Https in Nodejs.
*/
requestHandler: RequestHandler<any, any>;
}
export declare const resolveWebSocketConfig: <T>(input: T & WebSocketInputConfig & PreviouslyResolved) => T & WebSocketResolvedConfig;
export {};

View File

@@ -0,0 +1,44 @@
import { HttpRequest } from "@smithy/protocol-http";
import { HttpResponse } from "@smithy/protocol-http";
import {
Logger,
Provider,
RequestHandler,
RequestHandlerMetadata,
} from "@smithy/types";
export interface WebSocketFetchHandlerOptions {
connectionTimeout?: number;
logger?: Logger;
}
export declare class WebSocketFetchHandler {
readonly metadata: RequestHandlerMetadata;
private config;
private configPromise;
private readonly httpHandler;
private readonly sockets;
static create(
instanceOrOptions?:
| WebSocketFetchHandler
| WebSocketFetchHandlerOptions
| Provider<WebSocketFetchHandlerOptions | void>,
httpHandler?: RequestHandler<any, any>
): WebSocketFetchHandler;
constructor(
options?:
| WebSocketFetchHandlerOptions
| Provider<WebSocketFetchHandlerOptions>,
httpHandler?: RequestHandler<any, any>
);
destroy(): void;
handle(request: HttpRequest): Promise<{
response: HttpResponse;
}>;
updateHttpClientConfig(
key: keyof WebSocketFetchHandlerOptions,
value: WebSocketFetchHandlerOptions[typeof key]
): void;
httpHandlerConfigs(): WebSocketFetchHandlerOptions;
private removeNotUsableSockets;
private waitForReady;
private connect;
}

View File

@@ -0,0 +1,45 @@
import { SignatureV4 as BaseSignatureV4 } from "@smithy/signature-v4";
import {
EventSigner,
EventSigningArguments,
FormattedEvent,
HttpRequest as IHttpRequest,
MessageSigner,
RequestPresigner,
RequestPresigningArguments,
RequestSigner,
RequestSigningArguments,
SignableMessage,
SignedMessage,
SigningArguments,
StringSigner,
} from "@smithy/types";
export declare class WebsocketSignatureV4
implements
RequestPresigner,
RequestSigner,
StringSigner,
EventSigner,
MessageSigner
{
private readonly signer;
constructor(options: { signer: BaseSignatureV4 });
presign(
originalRequest: IHttpRequest,
options?: RequestPresigningArguments
): Promise<IHttpRequest>;
sign(stringToSign: string, options?: SigningArguments): Promise<string>;
sign(event: FormattedEvent, options: EventSigningArguments): Promise<string>;
sign(
event: SignableMessage,
options: SigningArguments
): Promise<SignedMessage>;
sign(
requestToSign: IHttpRequest,
options?: RequestSigningArguments
): Promise<IHttpRequest>;
signMessage(
message: SignableMessage,
args: SigningArguments
): Promise<SignedMessage>;
}

View File

@@ -0,0 +1,11 @@
import { Pluggable, RequestHandler } from "@smithy/types";
interface WebSocketResolvedConfig {
requestHandler: RequestHandler<any, any>;
}
export declare const getWebSocketPlugin: (
config: WebSocketResolvedConfig,
options: {
headerPrefix: string;
}
) => Pluggable<any, any>;
export {};

View File

@@ -0,0 +1,4 @@
export * from "./WebSocketFetchHandler";
export * from "./getWebSocketPlugin";
export * from "./resolveWebSocketConfig";
export * from "./ws-eventstream/eventStreamPayloadHandlerProvider";

View File

@@ -0,0 +1,14 @@
import {
BuildMiddleware,
RelativeMiddlewareOptions,
RequestHandler,
} from "@smithy/types";
export declare const websocketEndpointMiddleware: (
config: {
requestHandler: RequestHandler<any, any>;
},
options: {
headerPrefix: string;
}
) => BuildMiddleware<any, any>;
export declare const websocketEndpointMiddlewareOptions: RelativeMiddlewareOptions;

View File

@@ -0,0 +1,6 @@
import { InitializeHandlerOptions, InitializeMiddleware } from "@smithy/types";
export declare const injectSessionIdMiddleware: () => InitializeMiddleware<
any,
any
>;
export declare const injectSessionIdMiddlewareOptions: InitializeHandlerOptions;

View File

@@ -0,0 +1,14 @@
import { AuthScheme, RequestHandler, RequestSigner } from "@smithy/types";
export interface WebSocketInputConfig {}
interface PreviouslyResolved {
signer: (authScheme: AuthScheme) => Promise<RequestSigner>;
requestHandler: RequestHandler<any, any>;
}
export interface WebSocketResolvedConfig {
signer: (authScheme: AuthScheme) => Promise<RequestSigner>;
requestHandler: RequestHandler<any, any>;
}
export declare const resolveWebSocketConfig: <T>(
input: T & WebSocketInputConfig & PreviouslyResolved
) => T & WebSocketResolvedConfig;
export {};

View File

@@ -0,0 +1,2 @@
import { HttpRequest } from "@smithy/types";
export declare const isWebSocketRequest: (request: HttpRequest) => boolean;

View File

@@ -0,0 +1,15 @@
import { EventStreamCodec } from "@smithy/eventstream-codec";
import { MessageSigner, Provider } from "@smithy/types";
export declare class EventSigningTransformStream extends TransformStream<
Uint8Array,
Uint8Array
> {
readable: ReadableStream<Uint8Array>;
writable: WritableStream<Uint8Array>;
constructor(
initialSignature: string,
messageSigner: MessageSigner,
eventStreamCodec: EventStreamCodec,
systemClockOffsetProvider: Provider<number>
);
}

View File

@@ -0,0 +1,31 @@
import {
Decoder,
Encoder,
EventStreamPayloadHandler as IEventStreamPayloadHandler,
FinalizeHandler,
FinalizeHandlerArguments,
FinalizeHandlerOutput,
HandlerExecutionContext,
MessageSigner,
MetadataBearer,
Provider,
} from "@smithy/types";
export interface EventStreamPayloadHandlerOptions {
messageSigner: Provider<MessageSigner>;
utf8Encoder: Encoder;
utf8Decoder: Decoder;
systemClockOffset?: number;
}
export declare class EventStreamPayloadHandler
implements IEventStreamPayloadHandler
{
private readonly messageSigner;
private readonly eventStreamCodec;
private readonly systemClockOffsetProvider;
constructor(options: EventStreamPayloadHandlerOptions);
handle<T extends MetadataBearer>(
next: FinalizeHandler<any, T>,
args: FinalizeHandlerArguments<any>,
context?: HandlerExecutionContext
): Promise<FinalizeHandlerOutput<T>>;
}

View File

@@ -0,0 +1,2 @@
import { EventStreamPayloadHandlerProvider } from "@smithy/types";
export declare const eventStreamPayloadHandlerProvider: EventStreamPayloadHandlerProvider;

View File

@@ -0,0 +1,2 @@
import type { HttpRequest } from "@smithy/types";
export declare const isWebSocketRequest: (request: HttpRequest) => boolean;

View File

@@ -0,0 +1,21 @@
import type { EventStreamCodec } from "@smithy/eventstream-codec";
import type { MessageSigner, Provider } from "@smithy/types";
/**
* A transform stream that signs the eventstream.
*
* Implementation replicated from @aws-sdk/eventstream-handler-node::EventSigningStream
* but modified to be compatible with web stream interface.
*
* @internal
*/
export declare class EventSigningTransformStream extends TransformStream<Uint8Array, Uint8Array> {
/**
* @override
*/
readable: ReadableStream<Uint8Array>;
/**
* @override
*/
writable: WritableStream<Uint8Array>;
constructor(initialSignature: string, messageSigner: MessageSigner, eventStreamCodec: EventStreamCodec, systemClockOffsetProvider: Provider<number>);
}

View File

@@ -0,0 +1,20 @@
import type { Decoder, Encoder, EventStreamPayloadHandler as IEventStreamPayloadHandler, FinalizeHandler, FinalizeHandlerArguments, FinalizeHandlerOutput, HandlerExecutionContext, MessageSigner, MetadataBearer, Provider } from "@smithy/types";
/**
* @internal
*/
export interface EventStreamPayloadHandlerOptions {
messageSigner: Provider<MessageSigner>;
utf8Encoder: Encoder;
utf8Decoder: Decoder;
systemClockOffset?: number;
}
/**
* @internal
*/
export declare class EventStreamPayloadHandler implements IEventStreamPayloadHandler {
private readonly messageSigner;
private readonly eventStreamCodec;
private readonly systemClockOffsetProvider;
constructor(options: EventStreamPayloadHandlerOptions);
handle<T extends MetadataBearer>(next: FinalizeHandler<any, T>, args: FinalizeHandlerArguments<any>, context?: HandlerExecutionContext): Promise<FinalizeHandlerOutput<T>>;
}

View File

@@ -0,0 +1,5 @@
import type { EventStreamPayloadHandlerProvider } from "@smithy/types";
/**
* @internal
*/
export declare const eventStreamPayloadHandlerProvider: EventStreamPayloadHandlerProvider;

View File

@@ -0,0 +1,68 @@
{
"name": "@aws-sdk/middleware-websocket",
"version": "3.972.14",
"main": "./dist-cjs/index.js",
"module": "./dist-es/index.js",
"types": "./dist-types/index.d.ts",
"scripts": {
"build": "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
"build:cjs": "node ../../scripts/compilation/inline middleware-websocket",
"build:es": "tsc -p tsconfig.es.json",
"build:include:deps": "yarn g:turbo run build -F=\"$npm_package_name\"",
"build:types": "tsc -p tsconfig.types.json",
"build:types:downlevel": "downlevel-dts dist-types dist-types/ts3.4",
"clean": "premove dist-cjs dist-es dist-types tsconfig.cjs.tsbuildinfo tsconfig.es.tsbuildinfo tsconfig.types.tsbuildinfo",
"test": "yarn g:vitest run",
"test:integration": "yarn g:vitest run -c vitest.config.integ.mts",
"test:watch": "yarn g:vitest watch",
"test:integration:watch": "yarn g:vitest watch -c vitest.config.integ.mts"
},
"sideEffects": false,
"author": {
"name": "AWS SDK for JavaScript Team",
"url": "https://aws.amazon.com/javascript/"
},
"license": "Apache-2.0",
"dependencies": {
"@aws-sdk/types": "^3.973.6",
"@aws-sdk/util-format-url": "^3.972.8",
"@smithy/eventstream-codec": "^4.2.12",
"@smithy/eventstream-serde-browser": "^4.2.12",
"@smithy/fetch-http-handler": "^5.3.15",
"@smithy/protocol-http": "^5.3.12",
"@smithy/signature-v4": "^5.3.12",
"@smithy/types": "^4.13.1",
"@smithy/util-base64": "^4.3.2",
"@smithy/util-hex-encoding": "^4.2.2",
"@smithy/util-utf8": "^4.2.2",
"tslib": "^2.6.2"
},
"devDependencies": {
"@tsconfig/recommended": "1.0.1",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"mock-socket": "9.1.5",
"premove": "4.0.0",
"typescript": "~5.8.3",
"vitest-websocket-mock": "0.2.3"
},
"engines": {
"node": ">= 14.0.0"
},
"typesVersions": {
"<4.5": {
"dist-types/*": [
"dist-types/ts3.4/*"
]
}
},
"files": [
"dist-*/**"
],
"homepage": "https://github.com/aws/aws-sdk-js-v3/tree/main/packages-internal/middleware-websocket",
"repository": {
"type": "git",
"url": "https://github.com/aws/aws-sdk-js-v3.git",
"directory": "packages-internal/middleware-websocket"
}
}