dsh-antigravity-auth 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/LICENSE +21 -0
- package/README.md +168 -0
- package/README.zh.md +159 -0
- package/cordis.patch.yml +12 -0
- package/lib/capability-lifecycle--tgGKajs.js +1896 -0
- package/lib/client.cjs +2123 -0
- package/lib/client.cjs.map +1 -0
- package/lib/image.js +564 -0
- package/lib/index.js +176 -0
- package/lib/invariant.js +2 -0
- package/lib/live-gate-runner.js +542 -0
- package/lib/live-gates.js +97 -0
- package/lib/llm-adapter.js +916 -0
- package/lib/media-admission.js +206 -0
- package/lib/private-failure-B9vzUkQ7.js +23 -0
- package/lib/private-transport-urF138qW.js +641 -0
- package/lib/private-transport.js +2 -0
- package/lib/project-context.js +133 -0
- package/lib/quota.js +283 -0
- package/lib/replay.js +156 -0
- package/lib/rpc-contract-BFWfdKKs.js +491 -0
- package/lib/rpc-contract.js +2 -0
- package/lib/safe-text-AlEyN8q_.js +12 -0
- package/lib/search.js +259 -0
- package/lib/status-D0-em3Ru.js +125 -0
- package/lib/types/auth-service.d.ts +64 -0
- package/lib/types/auth-service.d.ts.map +1 -0
- package/lib/types/auth-store.d.ts +45 -0
- package/lib/types/auth-store.d.ts.map +1 -0
- package/lib/types/bootstrap-service.d.ts +6 -0
- package/lib/types/bootstrap-service.d.ts.map +1 -0
- package/lib/types/capability-gates.d.ts +19 -0
- package/lib/types/capability-gates.d.ts.map +1 -0
- package/lib/types/capability-lifecycle.d.ts +26 -0
- package/lib/types/capability-lifecycle.d.ts.map +1 -0
- package/lib/types/client/AntigravityAuthSettings.d.ts +19 -0
- package/lib/types/client/AntigravityAuthSettings.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +18 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +121 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/styles.d.ts +4 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/credential-coordinator.d.ts +84 -0
- package/lib/types/credential-coordinator.d.ts.map +1 -0
- package/lib/types/image.d.ts +39 -0
- package/lib/types/image.d.ts.map +1 -0
- package/lib/types/index.d.ts +21 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/invariant.d.ts +3 -0
- package/lib/types/invariant.d.ts.map +1 -0
- package/lib/types/live-gate-attachments.d.ts +6 -0
- package/lib/types/live-gate-attachments.d.ts.map +1 -0
- package/lib/types/live-gate-auth.d.ts +5 -0
- package/lib/types/live-gate-auth.d.ts.map +1 -0
- package/lib/types/live-gate-image.d.ts +5 -0
- package/lib/types/live-gate-image.d.ts.map +1 -0
- package/lib/types/live-gate-llm.d.ts +10 -0
- package/lib/types/live-gate-llm.d.ts.map +1 -0
- package/lib/types/live-gate-outcome.d.ts +8 -0
- package/lib/types/live-gate-outcome.d.ts.map +1 -0
- package/lib/types/live-gate-runner.d.ts +15 -0
- package/lib/types/live-gate-runner.d.ts.map +1 -0
- package/lib/types/live-gate-search.d.ts +5 -0
- package/lib/types/live-gate-search.d.ts.map +1 -0
- package/lib/types/live-gate-video.d.ts +8 -0
- package/lib/types/live-gate-video.d.ts.map +1 -0
- package/lib/types/live-gates.d.ts +25 -0
- package/lib/types/live-gates.d.ts.map +1 -0
- package/lib/types/llm-adapter.d.ts +65 -0
- package/lib/types/llm-adapter.d.ts.map +1 -0
- package/lib/types/login-types.d.ts +36 -0
- package/lib/types/login-types.d.ts.map +1 -0
- package/lib/types/media-admission.d.ts +54 -0
- package/lib/types/media-admission.d.ts.map +1 -0
- package/lib/types/model-catalog.d.ts +19 -0
- package/lib/types/model-catalog.d.ts.map +1 -0
- package/lib/types/oauth-flow.d.ts +87 -0
- package/lib/types/oauth-flow.d.ts.map +1 -0
- package/lib/types/private-failure.d.ts +6 -0
- package/lib/types/private-failure.d.ts.map +1 -0
- package/lib/types/private-transport-error.d.ts +13 -0
- package/lib/types/private-transport-error.d.ts.map +1 -0
- package/lib/types/private-transport.d.ts +48 -0
- package/lib/types/private-transport.d.ts.map +1 -0
- package/lib/types/project-context.d.ts +30 -0
- package/lib/types/project-context.d.ts.map +1 -0
- package/lib/types/quota.d.ts +43 -0
- package/lib/types/quota.d.ts.map +1 -0
- package/lib/types/raw-http.d.ts +11 -0
- package/lib/types/raw-http.d.ts.map +1 -0
- package/lib/types/replay.d.ts +30 -0
- package/lib/types/replay.d.ts.map +1 -0
- package/lib/types/rpc-contract.d.ts +33 -0
- package/lib/types/rpc-contract.d.ts.map +1 -0
- package/lib/types/rpc-vocabulary.d.ts +7 -0
- package/lib/types/rpc-vocabulary.d.ts.map +1 -0
- package/lib/types/rpc.d.ts +11 -0
- package/lib/types/rpc.d.ts.map +1 -0
- package/lib/types/safe-text.d.ts +3 -0
- package/lib/types/safe-text.d.ts.map +1 -0
- package/lib/types/search.d.ts +42 -0
- package/lib/types/search.d.ts.map +1 -0
- package/lib/types/status.d.ts +62 -0
- package/lib/types/status.d.ts.map +1 -0
- package/lib/types/video.d.ts +42 -0
- package/lib/types/video.d.ts.map +1 -0
- package/lib/types/wire-identity.d.ts +49 -0
- package/lib/types/wire-identity.d.ts.map +1 -0
- package/lib/video.js +320 -0
- package/lib/wire-identity.js +162 -0
- package/package.json +189 -0
- package/scripts/live-gates.mjs +4 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
import { ANTIGRAVITY_WIRE_ORIGIN, createWireIdentity } from "./wire-identity.js";
|
|
2
|
+
import { Buffer } from "node:buffer";
|
|
3
|
+
import * as net from "node:net";
|
|
4
|
+
import { PassThrough, Readable, Transform } from "node:stream";
|
|
5
|
+
import * as tls from "node:tls";
|
|
6
|
+
import { createGunzip } from "node:zlib";
|
|
7
|
+
//#region src/private-transport-error.ts
|
|
8
|
+
var PrivateTransportError = class extends Error {
|
|
9
|
+
code;
|
|
10
|
+
status;
|
|
11
|
+
/** Whether an upstream could have accepted the request before the failure. */
|
|
12
|
+
accepted;
|
|
13
|
+
constructor(code, message, options = {}) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = "PrivateTransportError";
|
|
16
|
+
this.code = code;
|
|
17
|
+
this.accepted = options.accepted ?? true;
|
|
18
|
+
if (options.status !== void 0) this.status = options.status;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/raw-http.ts
|
|
23
|
+
/** Literal HTTP/1.1 dispatcher for the fixed Antigravity wire profile. */
|
|
24
|
+
const DEFAULT_HTTPS_PORT = 443;
|
|
25
|
+
const DEFAULT_PROXY_PORT = 8080;
|
|
26
|
+
const MAX_RESPONSE_HEAD_BYTES = 65536;
|
|
27
|
+
/** Dispatch one request using the immutable plugin-owned Wire Identity. */
|
|
28
|
+
function createRawPrivateDispatcher() {
|
|
29
|
+
const wire = createWireIdentity();
|
|
30
|
+
return async (input) => {
|
|
31
|
+
if (input.signal?.aborted === true) throw cancelled(false);
|
|
32
|
+
const url = new URL(input.url);
|
|
33
|
+
const request = wire.serialize(input.url, {
|
|
34
|
+
authorization: `Bearer ${input.accessToken}`,
|
|
35
|
+
body: input.body
|
|
36
|
+
});
|
|
37
|
+
const socket = await connectTls(url, input.responseHeaderTimeoutMs, input.signal);
|
|
38
|
+
let dispatched = false;
|
|
39
|
+
const abort = () => {
|
|
40
|
+
socket.destroy(cancelled(dispatched));
|
|
41
|
+
};
|
|
42
|
+
try {
|
|
43
|
+
if (isAborted$1(input.signal)) throw cancelled(false);
|
|
44
|
+
input.signal?.addEventListener("abort", abort, { once: true });
|
|
45
|
+
socket.write(request);
|
|
46
|
+
dispatched = true;
|
|
47
|
+
const { head, leftover } = await waitForHead(socket, input.responseHeaderTimeoutMs, dispatched, input.signal);
|
|
48
|
+
const parsed = parseResponseHead(head);
|
|
49
|
+
const body = buildResponseBody(socket, leftover, parsed, input.signal);
|
|
50
|
+
return new Response(body, {
|
|
51
|
+
status: parsed.status,
|
|
52
|
+
statusText: parsed.statusText,
|
|
53
|
+
headers: parsed.headers
|
|
54
|
+
});
|
|
55
|
+
} catch (error) {
|
|
56
|
+
socket.destroy();
|
|
57
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
58
|
+
throw new PrivateTransportError("offline", "The private endpoint could not be reached", { accepted: dispatched });
|
|
59
|
+
} finally {
|
|
60
|
+
input.signal?.removeEventListener("abort", abort);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async function connectTls(url, timeoutMs, signal) {
|
|
65
|
+
const proxy = httpsProxy(url);
|
|
66
|
+
return proxy === void 0 ? connectDirect(url, timeoutMs, signal) : connectThroughProxy(proxy, url, timeoutMs, signal);
|
|
67
|
+
}
|
|
68
|
+
async function connectDirect(url, timeoutMs, signal) {
|
|
69
|
+
const socket = tls.connect({
|
|
70
|
+
host: url.hostname,
|
|
71
|
+
port: Number(url.port || DEFAULT_HTTPS_PORT),
|
|
72
|
+
servername: url.hostname
|
|
73
|
+
});
|
|
74
|
+
await waitForConnect(socket, "secureConnect", timeoutMs, signal);
|
|
75
|
+
return socket;
|
|
76
|
+
}
|
|
77
|
+
async function connectThroughProxy(proxy, target, timeoutMs, signal) {
|
|
78
|
+
const proxyAuthorization = proxyAuthorizationHeader(proxy);
|
|
79
|
+
const proxySocket = net.connect({
|
|
80
|
+
host: proxy.hostname,
|
|
81
|
+
port: Number(proxy.port || DEFAULT_PROXY_PORT)
|
|
82
|
+
});
|
|
83
|
+
await waitForConnect(proxySocket, "connect", timeoutMs, signal);
|
|
84
|
+
const targetPort = Number(target.port || DEFAULT_HTTPS_PORT);
|
|
85
|
+
proxySocket.write(`CONNECT ${target.hostname}:${targetPort} HTTP/1.1\r\nHost: ${target.hostname}:${targetPort}\r\n` + proxyAuthorization + "\r\n");
|
|
86
|
+
const { head, leftover } = await waitForHead(proxySocket, timeoutMs, false, signal);
|
|
87
|
+
if (!/^HTTP\/1\.[01]\s+2\d\d(?:\s|$)/u.test(head.split("\r\n", 1)[0] ?? "")) {
|
|
88
|
+
proxySocket.destroy();
|
|
89
|
+
throw new PrivateTransportError("offline", "The HTTPS proxy rejected the private connection", { accepted: false });
|
|
90
|
+
}
|
|
91
|
+
if (leftover.byteLength > 0) proxySocket.unshift(leftover);
|
|
92
|
+
proxySocket.resume();
|
|
93
|
+
const socket = tls.connect({
|
|
94
|
+
socket: proxySocket,
|
|
95
|
+
servername: target.hostname
|
|
96
|
+
});
|
|
97
|
+
await waitForConnect(socket, "secureConnect", timeoutMs, signal);
|
|
98
|
+
return socket;
|
|
99
|
+
}
|
|
100
|
+
async function waitForConnect(socket, event, timeoutMs, signal) {
|
|
101
|
+
await new Promise((resolve, reject) => {
|
|
102
|
+
let settled = false;
|
|
103
|
+
const finish = (action) => {
|
|
104
|
+
if (settled) return;
|
|
105
|
+
settled = true;
|
|
106
|
+
clearTimeout(timer);
|
|
107
|
+
socket.removeListener(event, onConnect);
|
|
108
|
+
socket.removeListener("error", onError);
|
|
109
|
+
signal?.removeEventListener("abort", onAbort);
|
|
110
|
+
action();
|
|
111
|
+
};
|
|
112
|
+
const onConnect = () => finish(resolve);
|
|
113
|
+
const onError = () => finish(() => reject(new PrivateTransportError("offline", "The private endpoint could not be reached", { accepted: false })));
|
|
114
|
+
const onAbort = () => finish(() => {
|
|
115
|
+
socket.destroy();
|
|
116
|
+
reject(cancelled(false));
|
|
117
|
+
});
|
|
118
|
+
const timer = setTimeout(() => finish(() => {
|
|
119
|
+
socket.destroy();
|
|
120
|
+
reject(new PrivateTransportError("timeout", "The private endpoint connection timed out", { accepted: false }));
|
|
121
|
+
}), timeoutMs);
|
|
122
|
+
socket.once(event, onConnect);
|
|
123
|
+
socket.once("error", onError);
|
|
124
|
+
if (signal?.aborted === true) onAbort();
|
|
125
|
+
else signal?.addEventListener("abort", onAbort, { once: true });
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
async function waitForHead(socket, timeoutMs, accepted, signal) {
|
|
129
|
+
return new Promise((resolve, reject) => {
|
|
130
|
+
let buffer = Buffer.alloc(0);
|
|
131
|
+
let settled = false;
|
|
132
|
+
const finish = (action) => {
|
|
133
|
+
if (settled) return;
|
|
134
|
+
settled = true;
|
|
135
|
+
clearTimeout(timer);
|
|
136
|
+
socket.removeListener("data", onData);
|
|
137
|
+
socket.removeListener("error", onError);
|
|
138
|
+
signal?.removeEventListener("abort", onAbort);
|
|
139
|
+
action();
|
|
140
|
+
};
|
|
141
|
+
const onError = (error) => finish(() => reject(error instanceof PrivateTransportError ? error : new PrivateTransportError("offline", "The private endpoint closed before response headers", { accepted })));
|
|
142
|
+
const onAbort = () => finish(() => {
|
|
143
|
+
socket.destroy();
|
|
144
|
+
reject(cancelled(accepted));
|
|
145
|
+
});
|
|
146
|
+
const onData = (chunk) => {
|
|
147
|
+
buffer = Buffer.concat([buffer, chunk]);
|
|
148
|
+
const marker = buffer.indexOf("\r\n\r\n");
|
|
149
|
+
if (marker < 0) {
|
|
150
|
+
if (buffer.byteLength > MAX_RESPONSE_HEAD_BYTES) finish(() => reject(new PrivateTransportError("protocol-drift", "The private response headers exceeded the limit", { accepted })));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (marker > MAX_RESPONSE_HEAD_BYTES) {
|
|
154
|
+
finish(() => reject(new PrivateTransportError("protocol-drift", "The private response headers exceeded the limit", { accepted })));
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
socket.pause();
|
|
158
|
+
const head = buffer.subarray(0, marker).toString("latin1");
|
|
159
|
+
const leftover = buffer.subarray(marker + 4);
|
|
160
|
+
finish(() => resolve({
|
|
161
|
+
head,
|
|
162
|
+
leftover
|
|
163
|
+
}));
|
|
164
|
+
};
|
|
165
|
+
const timer = setTimeout(() => finish(() => {
|
|
166
|
+
socket.destroy();
|
|
167
|
+
reject(new PrivateTransportError("timeout", "The private request timed out before response headers", { accepted }));
|
|
168
|
+
}), timeoutMs);
|
|
169
|
+
socket.on("data", onData);
|
|
170
|
+
socket.once("error", onError);
|
|
171
|
+
if (signal?.aborted === true) onAbort();
|
|
172
|
+
else signal?.addEventListener("abort", onAbort, { once: true });
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function parseResponseHead(value) {
|
|
176
|
+
const lines = value.split("\r\n");
|
|
177
|
+
const statusLine = lines.shift() ?? "";
|
|
178
|
+
const match = /^HTTP\/1\.[01]\s+(\d{3})(?:\s+([^\r\n]*))?$/u.exec(statusLine);
|
|
179
|
+
if (match === null) throw new PrivateTransportError("protocol-drift", "The private response status line was malformed");
|
|
180
|
+
const status = Number(match[1]);
|
|
181
|
+
if (status < 200 || status > 599 || hasInvalidHeaderValue(match[2] ?? "")) throw new PrivateTransportError("protocol-drift", "The private response status was unsupported");
|
|
182
|
+
const headers = new Headers();
|
|
183
|
+
let chunked = false;
|
|
184
|
+
let gzip = false;
|
|
185
|
+
let contentLength;
|
|
186
|
+
for (const line of lines) {
|
|
187
|
+
if (line.length === 0 || /^[ \t]/u.test(line)) throw new PrivateTransportError("protocol-drift", "The private response headers were malformed");
|
|
188
|
+
const separator = line.indexOf(":");
|
|
189
|
+
if (separator <= 0) throw new PrivateTransportError("protocol-drift", "The private response headers were malformed");
|
|
190
|
+
const name = line.slice(0, separator);
|
|
191
|
+
const raw = line.slice(separator + 1).trim();
|
|
192
|
+
if (!/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u.test(name) || hasInvalidHeaderValue(raw)) throw new PrivateTransportError("protocol-drift", "The private response headers were malformed");
|
|
193
|
+
const lowerName = name.toLowerCase();
|
|
194
|
+
const lowerValue = raw.toLowerCase();
|
|
195
|
+
if (lowerName === "transfer-encoding") {
|
|
196
|
+
if (chunked || lowerValue !== "chunked") throw new PrivateTransportError("protocol-drift", "The private response framing was unsupported");
|
|
197
|
+
chunked = true;
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
200
|
+
if (lowerName === "content-encoding") {
|
|
201
|
+
if (gzip || lowerValue !== "gzip") throw new PrivateTransportError("protocol-drift", "The private response encoding was unsupported");
|
|
202
|
+
gzip = true;
|
|
203
|
+
continue;
|
|
204
|
+
}
|
|
205
|
+
if (lowerName === "content-length") {
|
|
206
|
+
if (contentLength !== void 0 || !/^\d+$/u.test(raw)) throw new PrivateTransportError("protocol-drift", "The private response length was ambiguous");
|
|
207
|
+
const parsed = Number(raw);
|
|
208
|
+
if (!Number.isSafeInteger(parsed) || parsed < 0) throw new PrivateTransportError("protocol-drift", "The private response length was malformed");
|
|
209
|
+
contentLength = parsed;
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
headers.append(name, raw);
|
|
213
|
+
}
|
|
214
|
+
if (chunked && contentLength !== void 0) throw new PrivateTransportError("protocol-drift", "The private response framing was ambiguous");
|
|
215
|
+
if (!gzip && contentLength !== void 0) headers.set("content-length", String(contentLength));
|
|
216
|
+
return {
|
|
217
|
+
status,
|
|
218
|
+
statusText: match[2] ?? "",
|
|
219
|
+
headers,
|
|
220
|
+
chunked,
|
|
221
|
+
gzip,
|
|
222
|
+
...contentLength === void 0 ? {} : { contentLength }
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function buildResponseBody(socket, leftover, head, signal) {
|
|
226
|
+
const source = new PassThrough();
|
|
227
|
+
let current = source;
|
|
228
|
+
if (head.chunked) current = pipeStage(current, new ChunkedDecoder());
|
|
229
|
+
else if (head.contentLength !== void 0) current = pipeStage(current, new ContentLengthDecoder(head.contentLength));
|
|
230
|
+
if (head.gzip) {
|
|
231
|
+
const gunzip = createGunzip();
|
|
232
|
+
current = pipeStage(current, gunzip);
|
|
233
|
+
current = pipeStage(current, new PassThrough(), () => new PrivateTransportError("protocol-drift", "The private gzip response was malformed"));
|
|
234
|
+
}
|
|
235
|
+
const abort = () => {
|
|
236
|
+
socket.destroy(cancelled(true));
|
|
237
|
+
};
|
|
238
|
+
const cleanup = () => {
|
|
239
|
+
signal?.removeEventListener("abort", abort);
|
|
240
|
+
socket.destroy();
|
|
241
|
+
};
|
|
242
|
+
socket.once("error", (error) => source.destroy(error instanceof PrivateTransportError ? error : new PrivateTransportError("offline", "The private response stream failed")));
|
|
243
|
+
if (leftover.byteLength > 0) source.write(leftover);
|
|
244
|
+
socket.pipe(source);
|
|
245
|
+
socket.resume();
|
|
246
|
+
if (signal?.aborted === true) abort();
|
|
247
|
+
else signal?.addEventListener("abort", abort, { once: true });
|
|
248
|
+
current.once("end", cleanup);
|
|
249
|
+
current.once("error", cleanup);
|
|
250
|
+
current.once("close", cleanup);
|
|
251
|
+
return Readable.toWeb(current);
|
|
252
|
+
}
|
|
253
|
+
function pipeStage(source, target, mapError = (error) => error) {
|
|
254
|
+
source.once("error", (error) => target.destroy(mapError(error)));
|
|
255
|
+
return source.pipe(target);
|
|
256
|
+
}
|
|
257
|
+
var ContentLengthDecoder = class extends Transform {
|
|
258
|
+
remaining;
|
|
259
|
+
constructor(contentLength) {
|
|
260
|
+
super();
|
|
261
|
+
this.remaining = contentLength;
|
|
262
|
+
if (contentLength === 0) this.push(null);
|
|
263
|
+
}
|
|
264
|
+
_transform(chunk, _encoding, callback) {
|
|
265
|
+
if (this.remaining <= 0 || chunk.byteLength > this.remaining) {
|
|
266
|
+
callback(new PrivateTransportError("protocol-drift", "The private response exceeded its declared length"));
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
this.remaining -= chunk.byteLength;
|
|
270
|
+
this.push(chunk);
|
|
271
|
+
if (this.remaining === 0) this.push(null);
|
|
272
|
+
callback();
|
|
273
|
+
}
|
|
274
|
+
_flush(callback) {
|
|
275
|
+
callback(this.remaining === 0 ? void 0 : new PrivateTransportError("protocol-drift", "The private response ended before its declared length"));
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
var ChunkedDecoder = class extends Transform {
|
|
279
|
+
buffer = Buffer.alloc(0);
|
|
280
|
+
finished = false;
|
|
281
|
+
_transform(chunk, _encoding, callback) {
|
|
282
|
+
if (this.finished && chunk.byteLength > 0) {
|
|
283
|
+
callback(new PrivateTransportError("protocol-drift", "The private chunked response contained trailing bytes"));
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
this.buffer = Buffer.concat([this.buffer, chunk]);
|
|
287
|
+
try {
|
|
288
|
+
this.flushChunks();
|
|
289
|
+
callback();
|
|
290
|
+
} catch (error) {
|
|
291
|
+
callback(error instanceof Error ? error : new PrivateTransportError("protocol-drift", "The private chunked response was malformed"));
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
_flush(callback) {
|
|
295
|
+
try {
|
|
296
|
+
this.flushChunks();
|
|
297
|
+
callback(this.finished ? void 0 : new PrivateTransportError("protocol-drift", "The private chunked response ended early"));
|
|
298
|
+
} catch (error) {
|
|
299
|
+
callback(error instanceof Error ? error : new PrivateTransportError("protocol-drift", "The private chunked response was malformed"));
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
flushChunks() {
|
|
303
|
+
while (!this.finished) {
|
|
304
|
+
const lineEnd = this.buffer.indexOf("\r\n");
|
|
305
|
+
if (lineEnd < 0) return;
|
|
306
|
+
const sizeText = this.buffer.subarray(0, lineEnd).toString("latin1").split(";", 1)[0]?.trim() ?? "";
|
|
307
|
+
if (!/^[0-9A-Fa-f]+$/u.test(sizeText)) throw new PrivateTransportError("protocol-drift", "The private chunk size was malformed");
|
|
308
|
+
const size = Number.parseInt(sizeText, 16);
|
|
309
|
+
if (!Number.isSafeInteger(size) || size < 0) throw new PrivateTransportError("protocol-drift", "The private chunk size was malformed");
|
|
310
|
+
const chunkStart = lineEnd + 2;
|
|
311
|
+
const chunkEnd = chunkStart + size;
|
|
312
|
+
const end = chunkEnd + 2;
|
|
313
|
+
if (!Number.isSafeInteger(end)) throw new PrivateTransportError("protocol-drift", "The private chunk size was malformed");
|
|
314
|
+
if (this.buffer.byteLength < end) return;
|
|
315
|
+
if (this.buffer[chunkEnd] !== 13 || this.buffer[chunkEnd + 1] !== 10) throw new PrivateTransportError("protocol-drift", "The private chunk terminator was malformed");
|
|
316
|
+
const payload = this.buffer.subarray(chunkStart, chunkEnd);
|
|
317
|
+
this.buffer = this.buffer.subarray(end);
|
|
318
|
+
if (size === 0) {
|
|
319
|
+
if (this.buffer.byteLength > 0) throw new PrivateTransportError("protocol-drift", "The private chunked response contained trailing bytes");
|
|
320
|
+
this.finished = true;
|
|
321
|
+
this.push(null);
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this.push(payload);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
function proxyAuthorizationHeader(proxy) {
|
|
329
|
+
if (proxy.username.length === 0) return "";
|
|
330
|
+
let username;
|
|
331
|
+
let password;
|
|
332
|
+
try {
|
|
333
|
+
username = decodeURIComponent(proxy.username);
|
|
334
|
+
password = decodeURIComponent(proxy.password);
|
|
335
|
+
} catch {
|
|
336
|
+
throw new PrivateTransportError("offline", "The configured HTTPS proxy credentials are invalid", { accepted: false });
|
|
337
|
+
}
|
|
338
|
+
if (username.length > 1024 || password.length > 1024 || username.includes(":") || hasInvalidHeaderValue(username) || hasInvalidHeaderValue(password)) throw new PrivateTransportError("offline", "The configured HTTPS proxy credentials are invalid", { accepted: false });
|
|
339
|
+
return `Proxy-Authorization: Basic ${Buffer.from(`${username}:${password}`).toString("base64")}\r\n`;
|
|
340
|
+
}
|
|
341
|
+
function httpsProxy(url) {
|
|
342
|
+
const noProxy = process.env.NO_PROXY ?? process.env.no_proxy ?? "";
|
|
343
|
+
if (matchesNoProxy(url.hostname, noProxy)) return void 0;
|
|
344
|
+
const raw = process.env.HTTPS_PROXY ?? process.env.https_proxy ?? process.env.ALL_PROXY ?? process.env.all_proxy;
|
|
345
|
+
if (raw === void 0 || raw.length === 0) return void 0;
|
|
346
|
+
try {
|
|
347
|
+
const proxy = new URL(raw);
|
|
348
|
+
if (proxy.protocol !== "http:") throw new PrivateTransportError("offline", "The configured HTTPS proxy protocol is unsupported", { accepted: false });
|
|
349
|
+
return proxy;
|
|
350
|
+
} catch (error) {
|
|
351
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
352
|
+
throw new PrivateTransportError("offline", "The configured HTTPS proxy URL is invalid", { accepted: false });
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
function matchesNoProxy(hostname, value) {
|
|
356
|
+
const host = hostname.toLowerCase();
|
|
357
|
+
return value.split(",").map((item) => item.trim().toLowerCase()).some((item) => item === "*" || (item.startsWith(".") ? host.endsWith(item) : item.length > 0 && (host === item || host.endsWith(`.${item}`))));
|
|
358
|
+
}
|
|
359
|
+
function hasInvalidHeaderValue(value) {
|
|
360
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
361
|
+
const code = value.charCodeAt(index);
|
|
362
|
+
if (code < 32 && code !== 9 || code === 127) return true;
|
|
363
|
+
}
|
|
364
|
+
return false;
|
|
365
|
+
}
|
|
366
|
+
function isAborted$1(signal) {
|
|
367
|
+
return signal?.aborted === true;
|
|
368
|
+
}
|
|
369
|
+
function cancelled(accepted) {
|
|
370
|
+
return new PrivateTransportError("cancelled", "The private request was cancelled", { accepted });
|
|
371
|
+
}
|
|
372
|
+
//#endregion
|
|
373
|
+
//#region src/private-transport.ts
|
|
374
|
+
/** Bounded Host-only transport primitives for the private Antigravity endpoints. */
|
|
375
|
+
const DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS = 18e4;
|
|
376
|
+
const DEFAULT_PRIVATE_IDLE_TIMEOUT_MS = 6e4;
|
|
377
|
+
const DEFAULT_PRIVATE_TOTAL_TIMEOUT_MS = 3e5;
|
|
378
|
+
const DEFAULT_PRIVATE_RESPONSE_BYTES = 8388608;
|
|
379
|
+
const DEFAULT_PRIVATE_REQUEST_BYTES = 16777216;
|
|
380
|
+
const MAX_PRIVATE_REQUEST_BYTES = 67108864;
|
|
381
|
+
const DEFAULT_PRIVATE_FRAME_BYTES = 524288;
|
|
382
|
+
/** Build one fixed raw private transport. Callers cannot supply headers, identity, or origins. */
|
|
383
|
+
function createPrivateTransport(options = {}) {
|
|
384
|
+
let dispatch;
|
|
385
|
+
const headerTimeoutMs = boundedTimeout(options.responseHeaderTimeoutMs, DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS);
|
|
386
|
+
const maxRequestBytes = boundedRequestBytes(options.maxRequestBytes);
|
|
387
|
+
return { request: async (input) => {
|
|
388
|
+
if (isAborted(input.signal)) throw cancelledError(false);
|
|
389
|
+
if ((typeof input.body === "string" ? new TextEncoder().encode(input.body).byteLength : input.body.byteLength) > maxRequestBytes) throw new PrivateTransportError("request-too-large", "The private request exceeded the byte limit", { accepted: false });
|
|
390
|
+
if (dispatch === void 0) try {
|
|
391
|
+
dispatch = createRawPrivateDispatcher();
|
|
392
|
+
} catch {
|
|
393
|
+
throw new PrivateTransportError("attribution-rejected", "The private request identity could not be constructed", { accepted: false });
|
|
394
|
+
}
|
|
395
|
+
const response = await dispatch({
|
|
396
|
+
url: input.url,
|
|
397
|
+
accessToken: input.accessToken,
|
|
398
|
+
body: input.body,
|
|
399
|
+
...input.signal === void 0 ? {} : { signal: input.signal },
|
|
400
|
+
responseHeaderTimeoutMs: boundedTimeout(input.responseHeaderTimeoutMs, headerTimeoutMs)
|
|
401
|
+
});
|
|
402
|
+
if (!(response instanceof Response)) throw new PrivateTransportError("invalid-response", "The private endpoint returned no response");
|
|
403
|
+
return response;
|
|
404
|
+
} };
|
|
405
|
+
}
|
|
406
|
+
/** Convert a bounded response status to a safe provider error without exposing its body. */
|
|
407
|
+
function privateStatusError(status) {
|
|
408
|
+
if (status >= 200 && status < 300) return void 0;
|
|
409
|
+
if (status === 401) return new PrivateTransportError("authentication", "The private endpoint requires authentication", { status });
|
|
410
|
+
if (status === 403) return new PrivateTransportError("forbidden", "The private endpoint forbade this account", { status });
|
|
411
|
+
if (status === 429) return new PrivateTransportError("rate-limited", "The private endpoint is rate-limited", { status });
|
|
412
|
+
if (status >= 500) return new PrivateTransportError("upstream", "The private endpoint is unavailable", { status });
|
|
413
|
+
return new PrivateTransportError("protocol-drift", "The private endpoint returned an unexpected status", { status });
|
|
414
|
+
}
|
|
415
|
+
/** Read a response body with byte, idle, total, and cancellation bounds. */
|
|
416
|
+
async function readPrivateBytes(response, options = {}) {
|
|
417
|
+
const maxBytes = boundedBytes(options.maxBytes, DEFAULT_PRIVATE_RESPONSE_BYTES);
|
|
418
|
+
if (response.body === null) try {
|
|
419
|
+
const data = new Uint8Array(await response.arrayBuffer());
|
|
420
|
+
if (data.byteLength > maxBytes) throw new PrivateTransportError("response-too-large", "The private response exceeded the byte limit");
|
|
421
|
+
return data;
|
|
422
|
+
} catch (error) {
|
|
423
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
424
|
+
if (isAborted(options.signal)) throw cancelledError();
|
|
425
|
+
throw new PrivateTransportError("offline", "The private response body could not be read");
|
|
426
|
+
}
|
|
427
|
+
const reader = response.body.getReader();
|
|
428
|
+
const chunks = [];
|
|
429
|
+
let total = 0;
|
|
430
|
+
const startedAt = Date.now();
|
|
431
|
+
try {
|
|
432
|
+
for (;;) {
|
|
433
|
+
const chunk = await readChunk(reader, options, startedAt);
|
|
434
|
+
if (chunk.done) break;
|
|
435
|
+
const value = chunk.value;
|
|
436
|
+
total += value.byteLength;
|
|
437
|
+
if (total > maxBytes) {
|
|
438
|
+
await cancelReader(reader);
|
|
439
|
+
throw new PrivateTransportError("response-too-large", "The private response exceeded the byte limit");
|
|
440
|
+
}
|
|
441
|
+
chunks.push(value);
|
|
442
|
+
}
|
|
443
|
+
} catch (error) {
|
|
444
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
445
|
+
if (isAborted(options.signal)) throw cancelledError();
|
|
446
|
+
throw new PrivateTransportError("offline", "The private response body could not be read");
|
|
447
|
+
} finally {
|
|
448
|
+
reader.releaseLock();
|
|
449
|
+
}
|
|
450
|
+
const output = new Uint8Array(total);
|
|
451
|
+
let offset = 0;
|
|
452
|
+
for (const chunk of chunks) {
|
|
453
|
+
output.set(chunk, offset);
|
|
454
|
+
offset += chunk.byteLength;
|
|
455
|
+
}
|
|
456
|
+
return output;
|
|
457
|
+
}
|
|
458
|
+
async function readPrivateText(response, options = {}) {
|
|
459
|
+
try {
|
|
460
|
+
return new TextDecoder("utf-8", { fatal: true }).decode(await readPrivateBytes(response, options));
|
|
461
|
+
} catch (error) {
|
|
462
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
463
|
+
throw new PrivateTransportError("invalid-response", "The private response was not valid UTF-8");
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
/** Parse SSE/JSON responses without retaining unbounded provider frames. */
|
|
467
|
+
async function* iteratePrivateSse(response, options = {}) {
|
|
468
|
+
const maxBytes = boundedBytes(options.maxBytes, DEFAULT_PRIVATE_RESPONSE_BYTES);
|
|
469
|
+
const maxFrameBytes = boundedBytes(options.maxFrameBytes, DEFAULT_PRIVATE_FRAME_BYTES);
|
|
470
|
+
if (response.body === null) {
|
|
471
|
+
const text = await readPrivateText(response, options);
|
|
472
|
+
if (text.trim().length > 0) yield { data: text.trim() };
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const reader = response.body.getReader();
|
|
476
|
+
const decoder = new TextDecoder("utf-8", { fatal: true });
|
|
477
|
+
let buffer = "";
|
|
478
|
+
let eventName;
|
|
479
|
+
let dataLines = [];
|
|
480
|
+
let bytes = 0;
|
|
481
|
+
let frameBytes = 0;
|
|
482
|
+
let sawSseFrame = false;
|
|
483
|
+
let plainText = "";
|
|
484
|
+
const startedAt = Date.now();
|
|
485
|
+
const flush = () => {
|
|
486
|
+
if (dataLines.length === 0) {
|
|
487
|
+
eventName = void 0;
|
|
488
|
+
frameBytes = 0;
|
|
489
|
+
return;
|
|
490
|
+
}
|
|
491
|
+
const data = dataLines.join("\n");
|
|
492
|
+
const event = eventName;
|
|
493
|
+
dataLines = [];
|
|
494
|
+
eventName = void 0;
|
|
495
|
+
frameBytes = 0;
|
|
496
|
+
sawSseFrame = true;
|
|
497
|
+
return event === void 0 ? { data } : {
|
|
498
|
+
data,
|
|
499
|
+
event
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
try {
|
|
503
|
+
for (;;) {
|
|
504
|
+
const chunk = await readChunk(reader, options, startedAt);
|
|
505
|
+
if (chunk.done) break;
|
|
506
|
+
bytes += chunk.value.byteLength;
|
|
507
|
+
if (bytes > maxBytes) throw new PrivateTransportError("response-too-large", "The private response exceeded the byte limit");
|
|
508
|
+
let decoded;
|
|
509
|
+
try {
|
|
510
|
+
decoded = decoder.decode(chunk.value, { stream: true });
|
|
511
|
+
} catch {
|
|
512
|
+
throw new PrivateTransportError("invalid-response", "The private response was not valid UTF-8");
|
|
513
|
+
}
|
|
514
|
+
plainText += decoded;
|
|
515
|
+
buffer += decoded;
|
|
516
|
+
for (;;) {
|
|
517
|
+
const newline = buffer.indexOf("\n");
|
|
518
|
+
if (newline < 0) break;
|
|
519
|
+
let line = buffer.slice(0, newline);
|
|
520
|
+
buffer = buffer.slice(newline + 1);
|
|
521
|
+
if (line.endsWith("\r")) line = line.slice(0, -1);
|
|
522
|
+
if (utf8Bytes(line) > maxFrameBytes) throw new PrivateTransportError("frame-too-large", "The private response frame exceeded the byte limit");
|
|
523
|
+
if (line.length === 0) {
|
|
524
|
+
const event = flush();
|
|
525
|
+
if (event !== void 0) yield event;
|
|
526
|
+
continue;
|
|
527
|
+
}
|
|
528
|
+
if (line.startsWith(":")) continue;
|
|
529
|
+
frameBytes += utf8Bytes(line) + 1;
|
|
530
|
+
if (frameBytes > maxFrameBytes) throw new PrivateTransportError("frame-too-large", "The private response frame exceeded the byte limit");
|
|
531
|
+
if (line.startsWith("event:")) eventName = line.slice(6).trim() || void 0;
|
|
532
|
+
else if (line.startsWith("data:")) {
|
|
533
|
+
const value = line.slice(5).replace(/^ /u, "");
|
|
534
|
+
dataLines.push(value);
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
let tail;
|
|
539
|
+
try {
|
|
540
|
+
tail = decoder.decode();
|
|
541
|
+
} catch {
|
|
542
|
+
throw new PrivateTransportError("invalid-response", "The private response was not valid UTF-8");
|
|
543
|
+
}
|
|
544
|
+
plainText += tail;
|
|
545
|
+
buffer += tail;
|
|
546
|
+
if (buffer.length > 0) {
|
|
547
|
+
frameBytes += utf8Bytes(buffer);
|
|
548
|
+
if (frameBytes > maxFrameBytes) throw new PrivateTransportError("frame-too-large", "The private response frame exceeded the byte limit");
|
|
549
|
+
if (buffer.startsWith("data:")) dataLines.push(buffer.slice(5).replace(/^ /u, ""));
|
|
550
|
+
}
|
|
551
|
+
const event = flush();
|
|
552
|
+
if (event !== void 0) yield event;
|
|
553
|
+
if (!sawSseFrame && plainText.trim().length > 0) yield { data: plainText.trim() };
|
|
554
|
+
} catch (error) {
|
|
555
|
+
if (error instanceof PrivateTransportError) throw error;
|
|
556
|
+
if (isAborted(options.signal)) throw cancelledError();
|
|
557
|
+
throw new PrivateTransportError("offline", "The private response stream could not be read");
|
|
558
|
+
} finally {
|
|
559
|
+
await cancelReader(reader);
|
|
560
|
+
reader.releaseLock();
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
function assertPrivateEndpoint(url) {
|
|
564
|
+
let parsed;
|
|
565
|
+
try {
|
|
566
|
+
parsed = new URL(url);
|
|
567
|
+
} catch {
|
|
568
|
+
throw new PrivateTransportError("protocol-drift", "The private endpoint URL is invalid");
|
|
569
|
+
}
|
|
570
|
+
if (parsed.origin !== ANTIGRAVITY_WIRE_ORIGIN || parsed.protocol !== "https:" || parsed.search || parsed.hash) throw new PrivateTransportError("protocol-drift", "The private endpoint URL is not allowlisted");
|
|
571
|
+
}
|
|
572
|
+
async function readChunk(reader, options, startedAt) {
|
|
573
|
+
if (isAborted(options.signal)) {
|
|
574
|
+
await cancelReader(reader);
|
|
575
|
+
throw cancelledError();
|
|
576
|
+
}
|
|
577
|
+
const totalTimeout = boundedTimeout(options.totalTimeoutMs, DEFAULT_PRIVATE_TOTAL_TIMEOUT_MS);
|
|
578
|
+
const elapsed = Date.now() - startedAt;
|
|
579
|
+
if (elapsed >= totalTimeout) {
|
|
580
|
+
await cancelReader(reader);
|
|
581
|
+
throw new PrivateTransportError("timeout", "The private response exceeded the total timeout");
|
|
582
|
+
}
|
|
583
|
+
const idleTimeout = boundedTimeout(options.idleTimeoutMs, DEFAULT_PRIVATE_IDLE_TIMEOUT_MS);
|
|
584
|
+
let timer;
|
|
585
|
+
let removeAbort;
|
|
586
|
+
const abort = new Promise((_, reject) => {
|
|
587
|
+
const onAbort = () => reject(cancelledError());
|
|
588
|
+
removeAbort = () => options.signal?.removeEventListener("abort", onAbort);
|
|
589
|
+
if (options.signal === void 0) return;
|
|
590
|
+
if (options.signal.aborted) onAbort();
|
|
591
|
+
else options.signal.addEventListener("abort", onAbort, { once: true });
|
|
592
|
+
});
|
|
593
|
+
const idle = new Promise((_, reject) => {
|
|
594
|
+
timer = setTimeout(() => reject(new PrivateTransportError("timeout", "The private response stream stalled")), idleTimeout);
|
|
595
|
+
});
|
|
596
|
+
let totalHandle;
|
|
597
|
+
const remaining = totalTimeout - elapsed;
|
|
598
|
+
const total = new Promise((_, reject) => {
|
|
599
|
+
totalHandle = setTimeout(() => reject(new PrivateTransportError("timeout", "The private response exceeded the total timeout")), remaining);
|
|
600
|
+
});
|
|
601
|
+
try {
|
|
602
|
+
return await Promise.race([
|
|
603
|
+
reader.read(),
|
|
604
|
+
abort,
|
|
605
|
+
idle,
|
|
606
|
+
total
|
|
607
|
+
]);
|
|
608
|
+
} catch (error) {
|
|
609
|
+
await cancelReader(reader);
|
|
610
|
+
throw error;
|
|
611
|
+
} finally {
|
|
612
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
613
|
+
if (totalHandle !== void 0) clearTimeout(totalHandle);
|
|
614
|
+
removeAbort?.();
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
function utf8Bytes(value) {
|
|
618
|
+
return new TextEncoder().encode(value).byteLength;
|
|
619
|
+
}
|
|
620
|
+
function isAborted(signal) {
|
|
621
|
+
return signal !== void 0 && signal.aborted;
|
|
622
|
+
}
|
|
623
|
+
async function cancelReader(reader) {
|
|
624
|
+
try {
|
|
625
|
+
await reader.cancel();
|
|
626
|
+
} catch {}
|
|
627
|
+
}
|
|
628
|
+
function cancelledError(accepted = true) {
|
|
629
|
+
return new PrivateTransportError("cancelled", "The private request was cancelled", { accepted });
|
|
630
|
+
}
|
|
631
|
+
function boundedTimeout(value, fallback) {
|
|
632
|
+
return value === void 0 || !Number.isFinite(value) || value <= 0 ? fallback : Math.min(Math.floor(value), 6e5);
|
|
633
|
+
}
|
|
634
|
+
function boundedRequestBytes(value) {
|
|
635
|
+
return value === void 0 || !Number.isFinite(value) || value <= 0 ? DEFAULT_PRIVATE_REQUEST_BYTES : Math.min(Math.floor(value), MAX_PRIVATE_REQUEST_BYTES);
|
|
636
|
+
}
|
|
637
|
+
function boundedBytes(value, fallback) {
|
|
638
|
+
return value === void 0 || !Number.isFinite(value) || value <= 0 ? fallback : Math.min(Math.floor(value), fallback);
|
|
639
|
+
}
|
|
640
|
+
//#endregion
|
|
641
|
+
export { DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS as a, assertPrivateEndpoint as c, privateStatusError as d, readPrivateBytes as f, DEFAULT_PRIVATE_RESPONSE_BYTES as i, createPrivateTransport as l, PrivateTransportError as m, DEFAULT_PRIVATE_IDLE_TIMEOUT_MS as n, DEFAULT_PRIVATE_TOTAL_TIMEOUT_MS as o, readPrivateText as p, DEFAULT_PRIVATE_REQUEST_BYTES as r, MAX_PRIVATE_REQUEST_BYTES as s, DEFAULT_PRIVATE_FRAME_BYTES as t, iteratePrivateSse as u };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS, c as assertPrivateEndpoint, d as privateStatusError, f as readPrivateBytes, i as DEFAULT_PRIVATE_RESPONSE_BYTES, l as createPrivateTransport, m as PrivateTransportError, n as DEFAULT_PRIVATE_IDLE_TIMEOUT_MS, o as DEFAULT_PRIVATE_TOTAL_TIMEOUT_MS, p as readPrivateText, r as DEFAULT_PRIVATE_REQUEST_BYTES, s as MAX_PRIVATE_REQUEST_BYTES, t as DEFAULT_PRIVATE_FRAME_BYTES, u as iteratePrivateSse } from "./private-transport-urF138qW.js";
|
|
2
|
+
export { DEFAULT_PRIVATE_FRAME_BYTES, DEFAULT_PRIVATE_IDLE_TIMEOUT_MS, DEFAULT_PRIVATE_REQUEST_BYTES, DEFAULT_PRIVATE_RESPONSE_BYTES, DEFAULT_PRIVATE_RESPONSE_HEADER_TIMEOUT_MS, DEFAULT_PRIVATE_TOTAL_TIMEOUT_MS, MAX_PRIVATE_REQUEST_BYTES, PrivateTransportError, assertPrivateEndpoint, createPrivateTransport, iteratePrivateSse, privateStatusError, readPrivateBytes, readPrivateText };
|