stitchkit 0.110.6 → 0.111.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.
Files changed (79) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -1
  3. package/dist/browser/stream.d.ts +3 -2
  4. package/dist/browser/stream.d.ts.map +1 -1
  5. package/dist/contract/runtime-context.d.ts +3 -1
  6. package/dist/contract/runtime-context.d.ts.map +1 -1
  7. package/dist/entrypoints/agent-runtime/sandbox.js +13 -27
  8. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
  9. package/dist/entrypoints/bin/upgrade-cli.js +123 -29
  10. package/dist/entrypoints/cli/publish.js +1 -1
  11. package/dist/entrypoints/cli.js +2 -2
  12. package/dist/entrypoints/http.d.ts +2 -0
  13. package/dist/entrypoints/http.d.ts.map +1 -1
  14. package/dist/entrypoints/http.js +5 -1
  15. package/dist/entrypoints/index.d.ts +1 -0
  16. package/dist/entrypoints/index.d.ts.map +1 -1
  17. package/dist/entrypoints/index.js +5 -1
  18. package/dist/entrypoints/node.d.ts +1 -0
  19. package/dist/entrypoints/node.d.ts.map +1 -1
  20. package/dist/entrypoints/node.js +3 -1
  21. package/dist/entrypoints/observability.js +24 -9
  22. package/dist/entrypoints/remote.js +1 -1
  23. package/dist/entrypoints/server.d.ts +1 -0
  24. package/dist/entrypoints/server.d.ts.map +1 -1
  25. package/dist/entrypoints/server.js +24 -3
  26. package/dist/entrypoints/telegram.js +3 -3
  27. package/dist/entrypoints/testing.js +1 -1
  28. package/dist/entrypoints/tools/connections.js +16 -31
  29. package/dist/entrypoints/tools.js +39 -7
  30. package/dist/{index-jk44mbqb.js → index-1y0arq4z.js} +3 -57
  31. package/dist/index-cjbn98zt.js +68 -0
  32. package/dist/{index-s0xbnpfh.js → index-kdnfe0sr.js} +1 -1
  33. package/dist/{index-s6d8zsha.js → index-krng2a5j.js} +64 -110
  34. package/dist/index-qndsr7f0.js +55 -0
  35. package/dist/{index-n7hrpngg.js → index-syzngt7v.js} +1 -1
  36. package/dist/{index-3h0ztg0z.js → index-t65erk4z.js} +5 -21
  37. package/dist/internal/bounded-body.d.ts +44 -0
  38. package/dist/internal/bounded-body.d.ts.map +1 -0
  39. package/dist/internal/bounded-lines.d.ts +1 -2
  40. package/dist/internal/bounded-lines.d.ts.map +1 -1
  41. package/dist/internal/secure-fetch.d.ts.map +1 -1
  42. package/dist/internal/stream-chunks.d.ts +13 -0
  43. package/dist/internal/stream-chunks.d.ts.map +1 -0
  44. package/dist/internal/upgrade-affects.d.ts +5 -0
  45. package/dist/internal/upgrade-affects.d.ts.map +1 -1
  46. package/dist/internal/upgrade-plan.d.ts +18 -3
  47. package/dist/internal/upgrade-plan.d.ts.map +1 -1
  48. package/dist/internal/upgrade-usage.d.ts +21 -5
  49. package/dist/internal/upgrade-usage.d.ts.map +1 -1
  50. package/dist/observability/audit.d.ts +10 -0
  51. package/dist/observability/audit.d.ts.map +1 -1
  52. package/dist/observability/event.d.ts +5 -0
  53. package/dist/observability/event.d.ts.map +1 -1
  54. package/dist/server/multipart.d.ts.map +1 -1
  55. package/dist/server/oauth/endpoints.d.ts.map +1 -1
  56. package/dist/server/oauth/provider.d.ts +5 -0
  57. package/dist/server/oauth/provider.d.ts.map +1 -1
  58. package/dist/server/raw.d.ts +6 -3
  59. package/dist/server/raw.d.ts.map +1 -1
  60. package/dist/server/request-body.d.ts.map +1 -1
  61. package/dist/server/request-completion.d.ts.map +1 -1
  62. package/dist/server/request-ingress.d.ts +31 -0
  63. package/dist/server/request-ingress.d.ts.map +1 -0
  64. package/dist/server/unix-client-body.d.ts.map +1 -1
  65. package/dist/tools/connections/limits.d.ts.map +1 -1
  66. package/llms/http.txt +3 -0
  67. package/llms/observability.txt +19 -2
  68. package/llms/server.2.txt +4 -0
  69. package/llms/server.5.txt +2 -1
  70. package/llms/server.txt +42 -0
  71. package/llms/stitchkit.2.txt +28 -0
  72. package/llms/stitchkit.txt +3 -3
  73. package/llms/tools.3.txt +1 -1
  74. package/llms/tools.txt +4 -0
  75. package/llms/{upgrading-0.101.0-0.110.0.txt → upgrading-0.101.0-0.111.0.txt} +29 -3
  76. package/llms/upgrading.txt +8 -2
  77. package/llms-full.txt +136 -8
  78. package/llms.txt +6 -6
  79. package/package.json +1 -1
@@ -27,6 +27,14 @@ import {
27
27
  bindContract,
28
28
  mediaTypeEssence
29
29
  } from "./index-pzw0fpek.js";
30
+ import {
31
+ readBoundedChunks,
32
+ concatChunks,
33
+ readBoundedBody2
34
+ } from "./index-qndsr7f0.js";
35
+ import {
36
+ abortReason
37
+ } from "./index-a5qr2rj6.js";
30
38
  import {
31
39
  assertPositiveSafeInteger
32
40
  } from "./index-0s4xebbg.js";
@@ -418,27 +426,10 @@ async function collectFile(part, stream) {
418
426
  });
419
427
  }
420
428
  async function readText(stream, maxBytes) {
421
- const chunks = [];
422
- const reader = stream.getReader();
423
- let total = 0;
424
- while (true) {
425
- const result = await reader.read();
426
- if (result.done)
427
- break;
428
- total += result.value.length;
429
- if (total > maxBytes) {
430
- await reader.cancel();
431
- badRequest2(`Multipart text field exceeds ${maxBytes} bytes`);
432
- }
433
- chunks.push(result.value);
434
- }
435
- const value = new Uint8Array(total);
436
- let offset = 0;
437
- for (const chunk of chunks) {
438
- value.set(chunk, offset);
439
- offset += chunk.length;
440
- }
441
- return decoder.decode(value);
429
+ const result = await readBoundedChunks(stream, { maxBytes });
430
+ if (result.kind === "over-limit")
431
+ badRequest2(`Multipart text field exceeds ${maxBytes} bytes`);
432
+ return decoder.decode(concatChunks(result.chunks, result.total));
442
433
  }
443
434
  function required(policy) {
444
435
  return policy.required !== false;
@@ -896,63 +887,16 @@ function mergeContextContribution(ctx, value, scope) {
896
887
  }
897
888
 
898
889
  // src/server/request-body.ts
899
- function requestAbortReason(req) {
900
- return req.signal.reason ?? new DOMException("The connection was closed", "AbortError");
901
- }
902
- function throwIfRequestAborted(req) {
903
- if (req.signal.aborted)
904
- throw requestAbortReason(req);
905
- }
906
890
  async function readRequestText(req, maxBytes) {
907
- throwIfRequestAborted(req);
891
+ if (req.signal.aborted)
892
+ throw abortReason(req.signal);
908
893
  if (maxBytes === undefined)
909
894
  return req.text();
910
895
  assertPositiveSafeInteger("maxJsonBodyBytes", maxBytes, Error);
911
- const reader = req.body?.getReader();
912
- if (!reader)
913
- return "";
914
- const chunks = [];
915
- let total = 0;
916
- let rejectAbortedRead = (_reason) => {
917
- return;
918
- };
919
- const abortedRead = new Promise((_resolve, reject) => {
920
- rejectAbortedRead = reject;
921
- });
922
- const onAbort = () => {
923
- const reason = requestAbortReason(req);
924
- rejectAbortedRead(reason);
925
- reader.cancel(reason).catch(() => {
926
- return;
927
- });
928
- };
929
- req.signal.addEventListener("abort", onAbort, { once: true });
930
- if (req.signal.aborted)
931
- onAbort();
932
- try {
933
- while (true) {
934
- const { done, value } = await Promise.race([reader.read(), abortedRead]);
935
- if (done)
936
- break;
937
- total += value.byteLength;
938
- if (total > maxBytes) {
939
- await reader.cancel();
940
- badRequest2(`JSON body exceeds the ${maxBytes}-byte limit`);
941
- }
942
- chunks.push(value);
943
- }
944
- } finally {
945
- req.signal.removeEventListener("abort", onAbort);
946
- if (!req.signal.aborted)
947
- reader.releaseLock();
948
- }
949
- const bytes = new Uint8Array(total);
950
- let offset = 0;
951
- for (const chunk of chunks) {
952
- bytes.set(chunk, offset);
953
- offset += chunk.byteLength;
954
- }
955
- return new TextDecoder().decode(bytes);
896
+ const result = await readBoundedChunks(req.body, { maxBytes, signal: req.signal });
897
+ if (result.kind === "over-limit")
898
+ badRequest2(`JSON body exceeds the ${maxBytes}-byte limit`);
899
+ return new TextDecoder().decode(concatChunks(result.chunks, result.total));
956
900
  }
957
901
 
958
902
  // src/server/context.ts
@@ -1979,13 +1923,25 @@ function logOutgoing(entry) {
1979
1923
 
1980
1924
  // src/server/request-completion.ts
1981
1925
  var BODY_METHODS = new Set(["POST", "PUT", "PATCH", "DELETE"]);
1926
+ var DEFAULT_PAYLOAD_LOG_BYTES = 1024 * 1024;
1927
+ async function readPayload(clone, maxBytes) {
1928
+ try {
1929
+ const result = await readBoundedChunks(clone.body, { maxBytes, signal: clone.signal });
1930
+ if (result.kind === "over-limit")
1931
+ return { value: undefined, truncated: true };
1932
+ return {
1933
+ value: JSON.parse(new TextDecoder().decode(concatChunks(result.chunks, result.total))),
1934
+ truncated: false
1935
+ };
1936
+ } catch {
1937
+ return { value: undefined, truncated: false };
1938
+ }
1939
+ }
1982
1940
  function openRequestCompletion(state, window) {
1983
1941
  const { logConfig, customLogger, useDefaultLog, observability } = state;
1984
1942
  const { req, url, traceId, startedAt, ipAddress } = window;
1985
1943
  const shouldLogRequest = logConfig !== null && shouldLog(url.pathname, req.method) && !shouldSkipLog(logConfig, req, url);
1986
- const payload = observability?.includePayload && BODY_METHODS.has(req.method) ? req.clone().json().catch(() => {
1987
- return;
1988
- }) : undefined;
1944
+ const payloadRead = observability?.includePayload && BODY_METHODS.has(req.method) ? readPayload(req.clone(), observability.payloadMaxBytes ?? state.config.maxJsonBodyBytes ?? DEFAULT_PAYLOAD_LOG_BYTES) : undefined;
1989
1945
  const logFormat = resolveLogFormat(logConfig?.format);
1990
1946
  let reqLog;
1991
1947
  if (shouldLogRequest && useDefaultLog) {
@@ -2026,7 +1982,10 @@ function openRequestCompletion(state, window) {
2026
1982
  context,
2027
1983
  statusCode: status,
2028
1984
  durationMs,
2029
- payload,
1985
+ ...payloadRead && {
1986
+ payload: payloadRead.then((read) => read.value),
1987
+ payloadTruncated: payloadRead.then((read) => read.truncated)
1988
+ },
2030
1989
  ...outcome !== undefined && { outcome }
2031
1990
  });
2032
1991
  } catch {}
@@ -2367,6 +2326,23 @@ function bindProcessSignals2(handle, options = {}) {
2367
2326
  return { promise, close };
2368
2327
  }
2369
2328
 
2329
+ // src/server/request-ingress.ts
2330
+ function defineRequestIngress2(name) {
2331
+ const values = new WeakMap;
2332
+ return {
2333
+ name,
2334
+ attach(request, value) {
2335
+ if (values.has(request)) {
2336
+ throw new TypeError(`[stitchkit] request ingress ${JSON.stringify(name)} is already attached to this request`);
2337
+ }
2338
+ values.set(request, value);
2339
+ },
2340
+ from(source) {
2341
+ return source.req && values.get(source.req);
2342
+ }
2343
+ };
2344
+ }
2345
+
2370
2346
  // src/server/websocket.ts
2371
2347
  function webSocketLane2(lane) {
2372
2348
  const { match, handlers } = lane;
@@ -2630,39 +2606,17 @@ import {
2630
2606
 
2631
2607
  // src/server/unix-client-body.ts
2632
2608
  async function readBoundedRequestBody(request, maxBytes) {
2633
- const body = request.body;
2634
- if (!body)
2609
+ if (!request.body)
2635
2610
  return;
2611
+ const tooLarge = () => new UnixClientTransportError2("UNIX_REQUEST_TOO_LARGE", `Unix request body exceeds the ${maxBytes} byte limit`, "not-dispatched");
2636
2612
  const declared = request.headers.get("content-length");
2637
- if (declared !== null && Number(declared) > maxBytes) {
2638
- throw new UnixClientTransportError2("UNIX_REQUEST_TOO_LARGE", `Unix request body exceeds the ${maxBytes} byte limit`, "not-dispatched");
2639
- }
2640
- const reader = body.getReader();
2641
- const chunks = [];
2642
- let total = 0;
2643
- try {
2644
- for (;; ) {
2645
- if (request.signal.aborted)
2646
- throw request.signal.reason;
2647
- const chunk = await reader.read();
2648
- if (chunk.done)
2649
- break;
2650
- total += chunk.value.byteLength;
2651
- if (total > maxBytes) {
2652
- throw new UnixClientTransportError2("UNIX_REQUEST_TOO_LARGE", `Unix request body exceeds the ${maxBytes} byte limit`, "not-dispatched");
2653
- }
2654
- chunks.push(chunk.value);
2655
- }
2656
- } finally {
2657
- reader.releaseLock();
2658
- }
2659
- const result = new Uint8Array(total);
2660
- let offset = 0;
2661
- for (const chunk of chunks) {
2662
- result.set(chunk, offset);
2663
- offset += chunk.byteLength;
2664
- }
2665
- return result;
2613
+ if (declared !== null && Number(declared) > maxBytes)
2614
+ throw tooLarge();
2615
+ return readBoundedBody2(request.body, {
2616
+ maxBytes,
2617
+ signal: request.signal,
2618
+ limitError: tooLarge
2619
+ });
2666
2620
  }
2667
2621
  function incomingResponseBody(response, maxBytes, onDone) {
2668
2622
  let finished = false;
@@ -3474,4 +3428,4 @@ function createUnixClientTransport2(config) {
3474
3428
  };
3475
3429
  }
3476
3430
 
3477
- export { contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2, createScopedImplementRegistry2, implementRegistry2, createImplementRegistry2, bindProcessSignals2, webSocketLane2, composeWebSocketHandlers2, createSocketIOServer2, socketIoLane2, UnixClientTransportError2, createUnixClientTransport2 };
3431
+ export { contextContributionDelta, prepareContextContribution, mergeContextContribution, parseMultipart2, DEFAULT_STREAM_HEARTBEAT_MS2, streamingRoute2, ndjsonRoute2, sseRoute2, createHandler2, createScopedImplementRegistry2, implementRegistry2, createImplementRegistry2, bindProcessSignals2, defineRequestIngress2, webSocketLane2, composeWebSocketHandlers2, createSocketIOServer2, socketIoLane2, UnixClientTransportError2, createUnixClientTransport2 };
@@ -0,0 +1,55 @@
1
+ import {
2
+ chunksOf
3
+ } from "./index-cjbn98zt.js";
4
+ import {
5
+ abortReason
6
+ } from "./index-a5qr2rj6.js";
7
+ import {
8
+ assertPositiveSafeInteger
9
+ } from "./index-0s4xebbg.js";
10
+
11
+ // src/internal/bounded-body.ts
12
+ async function readBoundedChunks(source, options) {
13
+ options.signal?.throwIfAborted();
14
+ const chunks = [];
15
+ let total = 0;
16
+ if (source === null)
17
+ return { kind: "complete", chunks, total };
18
+ for await (const chunk of chunksOf(source, options.signal)) {
19
+ if (!(chunk instanceof Uint8Array)) {
20
+ throw new TypeError("A bounded body source must yield bytes (Uint8Array chunks)");
21
+ }
22
+ total += chunk.byteLength;
23
+ options.onChunk?.(chunk);
24
+ if (total > options.maxBytes)
25
+ return { kind: "over-limit", total };
26
+ chunks.push(chunk);
27
+ }
28
+ return { kind: "complete", chunks, total };
29
+ }
30
+ function concatChunks(chunks, total) {
31
+ const bytes = new Uint8Array(total);
32
+ let offset = 0;
33
+ for (const chunk of chunks) {
34
+ bytes.set(chunk, offset);
35
+ offset += chunk.byteLength;
36
+ }
37
+ return bytes;
38
+ }
39
+ async function readBoundedBody2(source, options) {
40
+ assertPositiveSafeInteger("maxBytes", options.maxBytes);
41
+ let result;
42
+ try {
43
+ result = await readBoundedChunks(source, options);
44
+ } catch (error) {
45
+ const { signal, abortError } = options;
46
+ if (signal?.aborted && abortError)
47
+ throw abortError(abortReason(signal));
48
+ throw error;
49
+ }
50
+ if (result.kind === "over-limit")
51
+ throw options.limitError(result.total);
52
+ return concatChunks(result.chunks, result.total);
53
+ }
54
+
55
+ export { readBoundedChunks, concatChunks, readBoundedBody2 };
@@ -26,7 +26,7 @@ import {
26
26
  import {
27
27
  fetchGuarded,
28
28
  readCapped
29
- } from "./index-3h0ztg0z.js";
29
+ } from "./index-t65erk4z.js";
30
30
  import {
31
31
  isWithinDir2
32
32
  } from "./index-5cc6r990.js";
@@ -1,6 +1,9 @@
1
1
  import {
2
2
  raceAbort
3
3
  } from "./index-b0kddvzw.js";
4
+ import {
5
+ readBoundedChunks
6
+ } from "./index-qndsr7f0.js";
4
7
 
5
8
  // src/internal/secure-fetch.ts
6
9
  import { lookup } from "node:dns/promises";
@@ -259,27 +262,8 @@ async function fetchPinnedDocument(start, options) {
259
262
  throw new Error("too many redirects");
260
263
  }
261
264
  async function readCapped(res, max) {
262
- const reader = res.body?.getReader();
263
- if (!reader)
264
- return Buffer.alloc(0);
265
- const chunks = [];
266
- let total = 0;
267
- try {
268
- while (true) {
269
- const { done, value } = await reader.read();
270
- if (done)
271
- break;
272
- total += value.length;
273
- if (total > max) {
274
- await reader.cancel();
275
- return null;
276
- }
277
- chunks.push(value);
278
- }
279
- } finally {
280
- reader.releaseLock();
281
- }
282
- return Buffer.concat(chunks);
265
+ const result = await readBoundedChunks(res.body, { maxBytes: max });
266
+ return result.kind === "over-limit" ? null : Buffer.concat(result.chunks);
283
267
  }
284
268
 
285
269
  export { fetchGuarded, PrivateAddressRefusal, fetchPinnedDocument, readCapped };
@@ -0,0 +1,44 @@
1
+ import { type StreamByteSource } from './stream-chunks.js';
2
+ /** How a bounded read of a byte source ended, other than by an abort. */
3
+ export type BoundedChunksResult = {
4
+ readonly kind: 'complete';
5
+ readonly chunks: Uint8Array[];
6
+ readonly total: number;
7
+ }
8
+ /** The source crossed `maxBytes`; `total` counts the chunk that crossed it. */
9
+ | {
10
+ readonly kind: 'over-limit';
11
+ readonly total: number;
12
+ };
13
+ export interface BoundedChunksOptions {
14
+ readonly maxBytes: number;
15
+ readonly signal?: AbortSignal;
16
+ /** Called with every chunk read, including the one that crosses the limit. */
17
+ readonly onChunk?: (chunk: Uint8Array) => void;
18
+ }
19
+ /**
20
+ * Read a source up to `maxBytes`. The read stops at the first chunk that crosses the limit, so
21
+ * memory stays bounded by the limit plus one chunk, and the source is cancelled. A `null` source
22
+ * is empty. An abort rejects with the signal's reason, before the first read as well as during
23
+ * one; it is checked ahead of the empty-source answer.
24
+ */
25
+ export declare function readBoundedChunks(source: StreamByteSource | null, options: BoundedChunksOptions): Promise<BoundedChunksResult>;
26
+ /** One byte array from the chunks of a finished read. */
27
+ export declare function concatChunks(chunks: readonly Uint8Array[], total: number): Uint8Array<ArrayBuffer>;
28
+ export interface BoundedBodyOptions {
29
+ /** The most bytes the body may hold; a body of exactly `maxBytes` is read, one byte more is not. */
30
+ maxBytes: number;
31
+ /** Stops the read; the source is cancelled and the read rejects with `abortError` or the signal's reason. */
32
+ signal?: AbortSignal;
33
+ /** The error to throw when the body crosses `maxBytes`; `observedBytes` counts the chunk that crossed it. */
34
+ limitError: (observedBytes: number) => unknown;
35
+ /** The error to throw when `signal` aborts; the signal's reason when omitted. */
36
+ abortError?: (reason: unknown) => unknown;
37
+ }
38
+ /**
39
+ * The whole body as bytes, never reading past `maxBytes` plus one chunk. A `null` body is an empty
40
+ * result. The source is cancelled when the limit is crossed and when the signal aborts, and the
41
+ * caller picks both errors, so a limit and a cancellation stay different outcomes.
42
+ */
43
+ export declare function readBoundedBody(source: StreamByteSource | null, options: BoundedBodyOptions): Promise<Uint8Array<ArrayBuffer>>;
44
+ //# sourceMappingURL=bounded-body.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bounded-body.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-body.ts"],"names":[],"mappings":"AACA,OAAO,EAAY,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGlE,yEAAyE;AACzE,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE;AACtF,+EAA+E;GAC7E;IAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAAC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CAChD;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,gBAAgB,GAAG,IAAI,EAC/B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAiB9B;AAED,yDAAyD;AACzD,wBAAgB,YAAY,CAC1B,MAAM,EAAE,SAAS,UAAU,EAAE,EAC7B,KAAK,EAAE,MAAM,GACZ,UAAU,CAAC,WAAW,CAAC,CAQzB;AAED,MAAM,WAAW,kBAAkB;IACjC,oGAAoG;IACpG,QAAQ,EAAE,MAAM,CAAC;IACjB,6GAA6G;IAC7G,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,6GAA6G;IAC7G,UAAU,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C,iFAAiF;IACjF,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;CAC3C;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,gBAAgB,GAAG,IAAI,EAC/B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAYlC"}
@@ -1,3 +1,4 @@
1
+ import { type StreamByteSource } from './stream-chunks.js';
1
2
  export declare const DEFAULT_STREAM_LINE_BYTES: number;
2
3
  /**
3
4
  * A line grew past its byte limit. The reader throws as soon as the retained bytes cross the
@@ -24,8 +25,6 @@ export declare class StreamTruncatedLineError extends SyntaxError {
24
25
  /** Bytes of the unterminated final line. */
25
26
  lineBytes: number);
26
27
  }
27
- /** Bytes a line reader accepts: a `Response` body, a web stream, or any async byte iterable. */
28
- export type StreamByteSource = Response | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
29
28
  /**
30
29
  * Push-driven bounded line splitter for sources that deliver bytes through a callback, such as
31
30
  * a `Bun.listen`/`Bun.connect` socket's `data` handler. Lines are split on `\n` in bytes and
@@ -1 +1 @@
1
- {"version":3,"file":"bounded-lines.d.ts","sourceRoot":"","sources":["../../src/internal/bounded-lines.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,yBAAyB,QAAc,CAAC;AAErD;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAGhD,qCAAqC;IACrC,QAAQ,CAAC,UAAU,EAAE,MAAM;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,SAAS,EAAE,MAAM;IAL5B,SAAkB,IAAI,0BAA0B;IAChD;IACE,qCAAqC;IAC5B,UAAU,EAAE,MAAM;IAC3B,yFAAyF;IAChF,SAAS,EAAE,MAAM,EAG3B;CACF;AAED,iGAAiG;AACjG,qBAAa,wBAAyB,SA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C,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,YAAY,CAChC,KAAK,EAAE,GAAG,EACV,YAAY,EAAE,OAAO,EACrB,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,QAAQ,CAAC,CAiDnB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,6DAA6D;IAC7D,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,UAAU,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;CACV;AAED;;;;;;;;GAQG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,QAAQ,CAAC,IAAI,2BAA2B;CACzC;AA8CD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,GAAG,EACV,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,sBAAsB,CAAC,CAkFjC;AAED;;;;GAIG;AACH,wBAAsB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGnF"}
@@ -0,0 +1,13 @@
1
+ /** Bytes a stream reader accepts: a `Response` body, a web stream, or any async byte iterable. */
2
+ export type StreamByteSource = Response | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
3
+ /**
4
+ * Every chunk of a byte source: the chunk loop the line readers and the bounded body readers
5
+ * share. The source is cancelled or returned on every exit path.
6
+ *
7
+ * An abort ends the loop with the signal's reason even while a read is pending: the pending read
8
+ * is cancelled but not waited for, because a transport stream may leave it pending for good. For
9
+ * the same reason a lock is not released after an abort — releasing it under a pending read throws
10
+ * on some runtimes — and the cancellation is not awaited.
11
+ */
12
+ export declare function chunksOf(source: StreamByteSource, signal?: AbortSignal): AsyncGenerator<Uint8Array>;
13
+ //# sourceMappingURL=stream-chunks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stream-chunks.d.ts","sourceRoot":"","sources":["../../src/internal/stream-chunks.ts"],"names":[],"mappings":"AAEA,kGAAkG;AAClG,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,cAAc,CAAC,UAAU,CAAC,GAC1B,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9B;;;;;;;;GAQG;AACH,wBAAuB,QAAQ,CAC7B,MAAM,EAAE,gBAAgB,EACxB,MAAM,CAAC,EAAE,WAAW,GACnB,cAAc,CAAC,UAAU,CAAC,CA+C5B"}
@@ -48,6 +48,11 @@ export declare class UpgradeAffectsError extends Error {
48
48
  * it, and the next unindented line closes it.
49
49
  */
50
50
  export declare function breakingItems(section: string): UpgradeBreakingItemText[];
51
+ /**
52
+ * The items of every `### Fixed` section of a release body; a release may hold more than one.
53
+ * A section ends at the next `### ` heading outside a fence.
54
+ */
55
+ export declare function fixedSectionItems(releaseBody: string): UpgradeBreakingItemText[];
51
56
  /**
52
57
  * The text after `**Affects:**` in an item, or undefined when it declares none.
53
58
  * An item carries at most one such line; a second is refused, never dropped.
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-affects.d.ts","sourceRoot":"","sources":["../../src/internal/upgrade-affects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,sEAAsE;AACtE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,yFAAyF;IACzF,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,2EAA2E;AAC3E,MAAM,MAAM,oBAAoB,GAC5B;IACE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CA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AAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GAC3D;IAAE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;CAAE,CAAC;AAEjE,gFAAgF;AAChF,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAOD,yEAAyE;AACzE,qBAAa,mBAAoB,SAAQ,KAAK;IAC5C,SAAkB,IAAI,yBAAyB;CAChD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,uBAAuB,EAAE,CA6BxE;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,uBAAuB,EAAE,CAmBhF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAiBtE;AAyDD,+FAA+F;AAC/F,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,EAAE,CAGrE"}
@@ -8,8 +8,8 @@
8
8
  * range by whoever cut the release.
9
9
  */
10
10
  import { type UpgradeAffectsTarget } from './upgrade-affects.js';
11
- /** One breaking item of a release, with its machine line when it declares one. */
12
- export interface UpgradeBreakingItem {
11
+ /** One `- ` item of a release section, with its machine line when it declares one. */
12
+ export interface UpgradeItem {
13
13
  version: string;
14
14
  /** The backticked entrypoints the item leads with. */
15
15
  entrypoints: string[];
@@ -17,9 +17,12 @@ export interface UpgradeBreakingItem {
17
17
  title: string;
18
18
  /** What the item touches; `undefined` for an item written before the `**Affects:**` line. */
19
19
  affects: UpgradeAffectsTarget[] | undefined;
20
+ markdown: string;
21
+ }
22
+ /** One breaking item of a release. */
23
+ export interface UpgradeBreakingItem extends UpgradeItem {
20
24
  /** The item's own `**Who must act:**`, or its section's. */
21
25
  whoMustAct: string;
22
- markdown: string;
23
26
  }
24
27
  export interface UpgradeBreakingChange {
25
28
  version: string;
@@ -32,7 +35,19 @@ export interface UpgradeBreakingChange {
32
35
  * read it through this one expression, so a heading one accepts is a heading the other finds.
33
36
  */
34
37
  export declare const BREAKING_HEADING: RegExp;
38
+ /** The backticked `stitchkit` (or `stitchkit-…` package) entrypoints an item leads with, in order. */
39
+ export declare function leadingEntrypoints(item: string, accept?: (entrypoint: string) => boolean): string[];
35
40
  /** Extract every breaking section crossed by an exact `from` (exclusive) → `to` (inclusive) upgrade. */
36
41
  export declare function planUpgrade(changelog: string, from: string, to: string): UpgradeBreakingChange[];
42
+ /** The items of every `### Fixed` section of a release body. */
43
+ export declare function fixedItems(version: string, body: string): UpgradeItem[];
44
+ /** The fixes of an exact `from` (exclusive) → `to` (inclusive) upgrade, oldest first. */
45
+ export interface UpgradeFixes {
46
+ /** Fixes that name what they touch. */
47
+ declared: UpgradeItem[];
48
+ /** Fixes of the range that carry no machine line, before the rule that asks for one. */
49
+ withoutAffects: number;
50
+ }
51
+ export declare function planFixes(changelog: string, from: string, to: string): UpgradeFixes;
37
52
  export declare function renderUpgradePlan(changes: readonly UpgradeBreakingChange[], from: string, to: string): string;
38
53
  //# sourceMappingURL=upgrade-plan.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-plan.d.ts","sourceRoot":"","sources":["../../src/internal/upgrade-plan.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAE3B,kFAAkF;AAClF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,gDAAgD;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,OAAO,EAAE,oBAAoB,EAAE,GAAG,SAAS,CAAC;IAC5C,4DAA4D;IAC5D,UAAU,EAAE,MA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;GAGG;AACH,eAAO,MAAM,gBAAgB,QAA2C,CAAC;AAIzE,sGAAsG;AACtG,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAoB,GACnD,MAAM,EAAE,CAcV;AA0GD,wGAAwG;AACxG,wBAAgB,WAAW,CACzB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,qBAAqB,EAAE,CAmBzB;AAED,gEAAgE;AAChE,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,WAAW,EAAE,CAEvE;AAED,yFAAyF;AACzF,MAAM,WAAW,YAAY;IAC3B,uCAAuC;IACvC,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,wFAAwF;IACxF,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,CASnF;AAED,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,SAAS,qBAAqB,EAAE,EACzC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,GACT,MAAM,CASR"}
@@ -12,7 +12,7 @@
12
12
  * quote or a comment marker can hide what follows it.
13
13
  */
14
14
  import type { UpgradeAffectsTarget } from './upgrade-affects.js';
15
- import type { UpgradeBreakingItem } from './upgrade-plan.js';
15
+ import type { UpgradeBreakingItem, UpgradeItem } from './upgrade-plan.js';
16
16
  /** One project file, by a path relative to the project root. */
17
17
  export interface ProjectSource {
18
18
  readonly path: string;
@@ -37,22 +37,38 @@ export type UpgradeVerdict = {
37
37
  readonly kind: 'not-declared';
38
38
  readonly files: readonly string[];
39
39
  };
40
- export interface UpgradeItemVerdict {
41
- readonly item: UpgradeBreakingItem;
40
+ export interface UpgradeItemVerdict<TItem extends UpgradeItem = UpgradeBreakingItem> {
41
+ readonly item: TItem;
42
42
  readonly verdict: UpgradeVerdict;
43
43
  }
44
44
  /** Every name the given sources import from a `stitchkit` entrypoint. */
45
45
  export declare function scanStitchkitImports(sources: readonly ProjectSource[]): StitchkitImport[];
46
46
  /** One verdict per item, in plan order. */
47
- export declare function upgradeVerdicts(items: readonly UpgradeBreakingItem[], imports: readonly StitchkitImport[]): UpgradeItemVerdict[];
47
+ export declare function upgradeVerdicts<TItem extends UpgradeItem>(items: readonly TItem[], imports: readonly StitchkitImport[]): UpgradeItemVerdict<TItem>[];
48
48
  /** The verdicts as the Markdown section `stitchkit upgrade` prints after the plan. */
49
49
  export declare function renderUpgradeVerdicts(verdicts: readonly UpgradeItemVerdict[]): string;
50
+ /**
51
+ * The fixes of the range as the Markdown section `stitchkit upgrade` prints after the breaking
52
+ * verdicts. A fix of an earlier release carries no machine line and is only counted.
53
+ */
54
+ export declare function renderUpgradeFixes(verdicts: readonly UpgradeItemVerdict<UpgradeItem>[], withoutAffects: number): string;
50
55
  /** The verdicts as the `--json` document's items. */
51
56
  export declare function upgradeVerdictsJson(verdicts: readonly UpgradeItemVerdict[]): {
52
57
  version: string;
53
58
  entrypoints: string[];
54
59
  title: string;
55
- whoMustAct: string;
60
+ whoMustAct?: string | undefined;
61
+ affects: UpgradeAffectsTarget[] | null;
62
+ verdict: "affects" | "behavioural" | "not-declared" | "not-used";
63
+ uses?: readonly StitchkitImport[] | undefined;
64
+ files?: readonly string[] | undefined;
65
+ }[];
66
+ /** The fix verdicts as the `--json` document's `fixes`. */
67
+ export declare function upgradeFixesJson(verdicts: readonly UpgradeItemVerdict<UpgradeItem>[]): {
68
+ version: string;
69
+ entrypoints: string[];
70
+ title: string;
71
+ whoMustAct?: string | undefined;
56
72
  affects: UpgradeAffectsTarget[] | null;
57
73
  verdict: "affects" | "behavioural" | "not-declared" | "not-used";
58
74
  uses?: readonly StitchkitImport[] | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-usage.d.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AAC;IAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAC;AAEzE,MAAM,WAAW,kBAAkB,CAAC,KAAK,SAAS,WAAW,GAAG,mBAAmB;IACjF,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAsHD,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,SAAS,aAAa,EAAE,GAAG,eAAe,EAAE,CA+BzF;AAyBD,2CAA2C;AAC3C,wBAAgB,eAAe,CAAC,KAAK,SAAS,WAAW,EACvD,KAAK,EAAE,SAAS,KAAK,EAAE,EACvB,OAAO,EAAE,SAAS,eAAe,EAAE,GAClC,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAiB7B;AA8BD,sFAAsF;AACtF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAGrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,SAAS,kBAAkB,CAAC,WAAW,CAAC,EAAE,EACpD,cAAc,EAAE,MAAM,GACrB,MAAM,CAWR;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,EAAE;;;;;;;;;IAE1E;AAED,2DAA2D;AAC3D,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,SAAS,kBAAkB,CAAC,WAAW,CAAC,EAAE;;;;;;;;;IAEpF"}
@@ -42,6 +42,12 @@ export interface SinkDrop {
42
42
  export interface RequestObservabilityConfig extends RequestEventSinkConfig {
43
43
  /** Clone and record JSON request bodies. Default false. */
44
44
  includePayload?: boolean;
45
+ /**
46
+ * The most bytes of a request body the audit row reads, a positive safe integer. A larger body
47
+ * is cancelled at the limit and the row carries `payloadTruncated: true`. Default: the
48
+ * handler's `maxJsonBodyBytes`, or 1 MiB when that is unset.
49
+ */
50
+ payloadMaxBytes?: number;
45
51
  /** Emit client-closed HTTP requests as `outcome: 'cancelled'`. Default false. */
46
52
  includeCancelled?: boolean;
47
53
  }
@@ -59,12 +65,16 @@ export interface HttpRequestCompletion {
59
65
  statusCode?: number;
60
66
  durationMs: number;
61
67
  payload?: Promise<unknown>;
68
+ /** Settles `true` when the body was larger than the audit limit and `payload` is empty for that reason. */
69
+ payloadTruncated?: Promise<boolean>;
62
70
  /** Framework-owned neutral cancellation; currently paired with HTTP 499. */
63
71
  outcome?: 'cancelled';
64
72
  }
65
73
  /** Server-facing request projection returned by `createObservability`. */
66
74
  export interface HttpRequestObserver {
67
75
  includePayload: boolean;
76
+ /** The configured audit body limit; `undefined` follows the handler's `maxJsonBodyBytes`. */
77
+ payloadMaxBytes?: number | undefined;
68
78
  complete(completion: HttpRequestCompletion): void;
69
79
  }
70
80
  /** What `createObservability` returns — one wiring point per enabled surface. */
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../src/observability/audit.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,EAIL,KAAK,uBAAuB,EAE7B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,kBAAkB,EAEvB,KAAK,cAAc,EAEpB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAe,KAAK,eAAe,EAAmB,MAAM,YAAY,CAAC;AAChF,OAAO,EAEL,KAAK,wBAAwB,EAG7B,KAAK,mBAAmB,EAEzB,MAAM,UAAU,CAAC;AAGlB,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,KAAK,EAAE,CAAC,K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AQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,KAAK,mBAAmB,CAAC;IACrF,kEAAkE;IAClE,SAAS,CAAC,EAAE,kBAAkB,CAAC;CAChC;AAED,MAAM,WAAW,mBAAmB,CAAC,QAAQ,SAAS,cAAc,EAAE,OAAO;IAC3E,OAAO,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,GAAG,IAAI,CAAC;IAClD,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,GAAG,OAAO,CAAC;IACrE,KAAK,CAAC,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CAClE;AAgBD;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,SAAS,cAAc,GAAG,cAAc,EAChD,OAAO,GAAG,OAAO,EAEjB,MAAM,EAAE,yBAAyB,CAAC,QAAQ,EAAE,OAAO,CAAC,GACnD,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC,CAcxC;AAwFD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,mBAAmB,GAAG,aAAa,CAqM9E"}
@@ -99,6 +99,11 @@ export interface RequestEvent {
99
99
  errorDetail?: JsonValue;
100
100
  /** Sanitised request payload — the HTTP body or the tool arguments. */
101
101
  payload: JsonValue | null;
102
+ /**
103
+ * Set when an HTTP body was larger than the request sink's `payloadMaxBytes`: `payload` is
104
+ * `null` for that reason, not because there was no body.
105
+ */
106
+ payloadTruncated?: true;
102
107
  /** Item count of the result, when it is a list. */
103
108
  resultSize: number | null;
104
109
  /** Serialised byte length of the result. */