@declaw/sdk 1.2.0 → 1.2.1
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 +15 -0
- package/dist/index.cjs +17 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,21 @@ All notable changes to the Declaw TypeScript / JavaScript SDK are documented in
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.2.1]
|
|
9
|
+
|
|
10
|
+
_HTTP/2 burst performance._
|
|
11
|
+
|
|
12
|
+
### Performance
|
|
13
|
+
|
|
14
|
+
- Unblocked HTTP/2 multiplexing on burst create: removed `pipelining: 1`
|
|
15
|
+
from the undici Agent, which was capping each H2 connection to a single
|
|
16
|
+
in-flight stream and silently defeating `allowH2` — a 100-concurrent burst
|
|
17
|
+
queued ~36 requests behind the connection cap. Also: eagerly initialize the
|
|
18
|
+
undici dispatcher at module load (the lazy `import('undici')` was blocking
|
|
19
|
+
the first burst), cache the resolved dispatcher synchronously (skips a
|
|
20
|
+
per-request microtask yield), and lower the retry backoff base from 0.5s to
|
|
21
|
+
0.1s. No public API change (#359).
|
|
22
|
+
|
|
8
23
|
## [1.2.0]
|
|
9
24
|
|
|
10
25
|
_2026-06 train: file-granular volumes, OPA governance._
|
package/dist/index.cjs
CHANGED
|
@@ -254,6 +254,8 @@ var CommandExitError = class extends SandboxError {
|
|
|
254
254
|
|
|
255
255
|
// src/api/client.ts
|
|
256
256
|
var _dispatcherPromise;
|
|
257
|
+
var _resolvedDispatcher;
|
|
258
|
+
var _dispatcherResolved = false;
|
|
257
259
|
function getDispatcher() {
|
|
258
260
|
if (_dispatcherPromise) return _dispatcherPromise;
|
|
259
261
|
_dispatcherPromise = (async () => {
|
|
@@ -278,7 +280,14 @@ function getDispatcher() {
|
|
|
278
280
|
maxConcurrentStreams,
|
|
279
281
|
keepAliveTimeout: 3e4,
|
|
280
282
|
keepAliveMaxTimeout: 6e4,
|
|
281
|
-
|
|
283
|
+
// NOTE: do NOT set `pipelining` here. undici applies it to H2 sessions
|
|
284
|
+
// too, where `pipelining: 1` caps each connection to ONE in-flight
|
|
285
|
+
// stream — silently defeating the H2 multiplexing that allowH2 enables.
|
|
286
|
+
// Omitted, H2 sessions default to unlimited concurrent streams (capped
|
|
287
|
+
// by maxConcurrentStreams) and H1.1 fallback defaults to 1 (safe, no
|
|
288
|
+
// head-of-line risk on non-idempotent POSTs). This is the single
|
|
289
|
+
// biggest burst-latency lever: with pipelining:1 a 100-concurrent burst
|
|
290
|
+
// queued ~36 requests behind the `connections` cap.
|
|
282
291
|
allowH2: true,
|
|
283
292
|
connect: { keepAlive: true, keepAliveInitialDelay: 5e3 }
|
|
284
293
|
});
|
|
@@ -286,8 +295,13 @@ function getDispatcher() {
|
|
|
286
295
|
return void 0;
|
|
287
296
|
}
|
|
288
297
|
})();
|
|
298
|
+
void _dispatcherPromise.then((d) => {
|
|
299
|
+
_resolvedDispatcher = d;
|
|
300
|
+
_dispatcherResolved = true;
|
|
301
|
+
});
|
|
289
302
|
return _dispatcherPromise;
|
|
290
303
|
}
|
|
304
|
+
void getDispatcher();
|
|
291
305
|
var STATUS_ERROR_MAP = {
|
|
292
306
|
400: InvalidArgumentError,
|
|
293
307
|
401: AuthenticationError,
|
|
@@ -307,7 +321,7 @@ var ApiClient = class {
|
|
|
307
321
|
constructor(config, opts) {
|
|
308
322
|
this.config = config ?? new ConnectionConfig();
|
|
309
323
|
this.maxRetries = opts?.maxRetries ?? 3;
|
|
310
|
-
this.retryDelay = opts?.retryDelay ?? 0.
|
|
324
|
+
this.retryDelay = opts?.retryDelay ?? 0.1;
|
|
311
325
|
this.abortController = new AbortController();
|
|
312
326
|
}
|
|
313
327
|
/** Send a GET request and return parsed JSON. */
|
|
@@ -401,7 +415,7 @@ var ApiClient = class {
|
|
|
401
415
|
signals.push(AbortSignal.timeout(timeoutMs));
|
|
402
416
|
}
|
|
403
417
|
const signal = signals.length === 1 ? signals[0] : AbortSignal.any(signals);
|
|
404
|
-
const dispatcher = await getDispatcher();
|
|
418
|
+
const dispatcher = _dispatcherResolved ? _resolvedDispatcher : await getDispatcher();
|
|
405
419
|
const fetchOpts = {
|
|
406
420
|
method,
|
|
407
421
|
headers,
|