stitchkit 0.124.1 → 0.124.2
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/browser/client-executors.d.ts.map +1 -1
- package/dist/browser/contract-stream.d.ts +7 -2
- package/dist/browser/contract-stream.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +1 -1
- package/dist/entrypoints/cli/publish.js +1 -1
- package/dist/entrypoints/cli.js +2 -2
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +3 -3
- package/dist/entrypoints/node.js +1 -1
- package/dist/entrypoints/process.js +1 -1
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.js +2 -2
- package/dist/entrypoints/testing.js +1 -1
- package/dist/entrypoints/tools/connections.js +1 -1
- package/dist/entrypoints/tools/toolkit.js +1 -1
- package/dist/entrypoints/tools.js +2 -2
- package/dist/{index-03qrr49d.js → index-b2sey031.js} +1 -1
- package/dist/{index-x0769xt9.js → index-btjwc7xr.js} +1 -1
- package/dist/{index-6qrspvxp.js → index-gbj964dt.js} +1 -1
- package/dist/{index-e1x6vze4.js → index-hzk4ydpy.js} +1 -1
- package/dist/{index-45dyex0j.js → index-m9hb9wnk.js} +1 -1
- package/dist/{index-zbzagr9k.js → index-ne4j9998.js} +16 -15
- package/dist/{index-cjbn98zt.js → index-ss67fxhj.js} +21 -3
- package/dist/{index-5efrpfmj.js → index-wxadzdb7.js} +1 -1
- package/dist/internal/stream-chunks.d.ts +10 -0
- package/dist/internal/stream-chunks.d.ts.map +1 -1
- package/llms/stitchkit.2.txt +6 -0
- package/llms/stitchkit.3.txt +1 -1
- package/llms-full.txt +7 -1
- package/llms.txt +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,21 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.124.2] - 2026-11-17
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
|
|
22
|
+
- `stitchkit`, `stitchkit/http` — **a streaming endpoint reads the response of another runtime's
|
|
23
|
+
fetch.** The typed client refused any response that was not the global `Response` class with
|
|
24
|
+
`Streaming endpoint did not return a Response`, so a `ClientFetch` built on `expo/fetch` in React
|
|
25
|
+
Native — whose `FetchResponse` is its own class — never read a stream, and the bare-fetch client
|
|
26
|
+
failed on it with a `TypeError`. Both client paths now take a response by its shape, a `body`
|
|
27
|
+
with `getReader()`, and both refuse one without a readable body with that same error.
|
|
28
|
+
`parseNDJSON`, `parseSSE` and `readBoundedBody` recognise a source by its shape as well: a
|
|
29
|
+
reader, then `Symbol.asyncIterator`, else the response's `body`; a response with no `body` at
|
|
30
|
+
all is a `TypeError` that says so.
|
|
31
|
+
**Affects:** `stitchkit` createClient(stream), createClients(stream), parseNDJSON, parseSSE, readBoundedBody; `stitchkit/http` createClient(stream), createClients(stream), readBoundedBody
|
|
32
|
+
|
|
18
33
|
## [0.124.1] - 2026-11-17
|
|
19
34
|
|
|
20
35
|
### Added
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-executors.d.ts","sourceRoot":"","sources":["../../src/browser/client-executors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAInE,OAAO,EACL,KAAK,UAAU,IAAI,WAAW,EAG/B,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"client-executors.d.ts","sourceRoot":"","sources":["../../src/browser/client-executors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAOtD,OAAO,KAAK,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAInE,OAAO,EACL,KAAK,UAAU,IAAI,WAAW,EAG/B,MAAM,QAAQ,CAAC;AA6DhB,MAAM,MAAM,qBAAqB,GAAG,CAClC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,OAAO,CAAC,EAAE,oBAAoB,KAC3B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,MAAM,EACjD,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,WAAW,EACnB,MAAM,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC/B,qBAAqB,CA+DvB;AAED,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,MAAM,EAClD,QAAQ,EAAE,WAAW,EACrB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,YAAY,EACpB,cAAc,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC,GACvC,qBAAqB,CA4HvB"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { ZodType } from 'zod';
|
|
2
2
|
import type { EndpointStreamDescriptor } from '../contract/define.js';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Convert a streaming endpoint's response into an immediately-owned schema-derived iterator. The
|
|
5
|
+
* response is recognised by its shape — a `body` with `getReader()` — so the response class of
|
|
6
|
+
* another runtime's fetch (`expo/fetch` in React Native) streams like the global `Response`; one
|
|
7
|
+
* without a readable body is refused by name, and the request is aborted.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseContractStream<T>(response: unknown, descriptor: EndpointStreamDescriptor<ZodType<T>>, abort: () => void): AsyncIterableIterator<T>;
|
|
5
10
|
//# sourceMappingURL=contract-stream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-stream.d.ts","sourceRoot":"","sources":["../../src/browser/contract-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"contract-stream.d.ts","sourceRoot":"","sources":["../../src/browser/contract-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACnC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAqInE;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACnC,QAAQ,EAAE,OAAO,EACjB,UAAU,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,EAChD,KAAK,EAAE,MAAM,IAAI,GAChB,qBAAqB,CAAC,CAAC,CAAC,CAM1B"}
|
package/dist/entrypoints/cli.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
renderCliView2,
|
|
18
18
|
pollUntilDone2,
|
|
19
19
|
createCli2
|
|
20
|
-
} from "../index-
|
|
20
|
+
} from "../index-hzk4ydpy.js";
|
|
21
21
|
import"../index-ndjzbt2v.js";
|
|
22
22
|
import"../index-ct75c3at.js";
|
|
23
23
|
import"../index-tynna0n4.js";
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
checkCliUpdate2,
|
|
47
47
|
applyCliUpdate2,
|
|
48
48
|
rollbackCliUpdate2
|
|
49
|
-
} from "../index-
|
|
49
|
+
} from "../index-btjwc7xr.js";
|
|
50
50
|
import"../index-bqzgaj57.js";
|
|
51
51
|
import"../index-3ymcmpa9.js";
|
|
52
52
|
import"../index-fa53vygr.js";
|
package/dist/entrypoints/http.js
CHANGED
|
@@ -14,13 +14,13 @@ import {
|
|
|
14
14
|
createUrlBuilder2,
|
|
15
15
|
createUrlBuilders2,
|
|
16
16
|
createScopedUrlBuilders2
|
|
17
|
-
} from "../index-
|
|
17
|
+
} from "../index-ne4j9998.js";
|
|
18
18
|
import {
|
|
19
19
|
ApiError2
|
|
20
20
|
} from "../index-kfjkb396.js";
|
|
21
21
|
import {
|
|
22
22
|
readBoundedBody2
|
|
23
|
-
} from "../index-
|
|
23
|
+
} from "../index-wxadzdb7.js";
|
|
24
24
|
export {
|
|
25
25
|
ApiError2 as ApiError,
|
|
26
26
|
contractEndpointMatchers2 as contractEndpointMatchers,
|
|
@@ -71,11 +71,11 @@ import {
|
|
|
71
71
|
createUrlBuilder2,
|
|
72
72
|
createUrlBuilders2,
|
|
73
73
|
createScopedUrlBuilders2
|
|
74
|
-
} from "../index-
|
|
74
|
+
} from "../index-ne4j9998.js";
|
|
75
75
|
import {
|
|
76
76
|
StreamLineLimitError2,
|
|
77
77
|
StreamTruncatedLineError2
|
|
78
|
-
} from "../index-
|
|
78
|
+
} from "../index-m9hb9wnk.js";
|
|
79
79
|
import {
|
|
80
80
|
createRetainedTopics2,
|
|
81
81
|
createRealtimeClientWithPeer,
|
|
@@ -92,7 +92,7 @@ import {
|
|
|
92
92
|
} from "../index-wqzw3qg9.js";
|
|
93
93
|
import {
|
|
94
94
|
readBoundedBody2
|
|
95
|
-
} from "../index-
|
|
95
|
+
} from "../index-wxadzdb7.js";
|
|
96
96
|
import {
|
|
97
97
|
sleep
|
|
98
98
|
} from "../index-eemvahkc.js";
|
package/dist/entrypoints/node.js
CHANGED
|
@@ -53,7 +53,7 @@ import {
|
|
|
53
53
|
socketIoLane2,
|
|
54
54
|
UnixClientTransportError2,
|
|
55
55
|
createUnixClientTransport2
|
|
56
|
-
} from "../index-
|
|
56
|
+
} from "../index-gbj964dt.js";
|
|
57
57
|
import {
|
|
58
58
|
createFileStateStore2
|
|
59
59
|
} from "../index-1szhrfsf.js";
|
|
@@ -113,7 +113,7 @@ import {
|
|
|
113
113
|
import {
|
|
114
114
|
readBoundedChunks,
|
|
115
115
|
concatChunks
|
|
116
|
-
} from "../index-
|
|
116
|
+
} from "../index-wxadzdb7.js";
|
|
117
117
|
import {
|
|
118
118
|
assertPositiveSafeInteger
|
|
119
119
|
} from "../index-0s4xebbg.js";
|
|
@@ -105,11 +105,11 @@ import {
|
|
|
105
105
|
fetchGuarded,
|
|
106
106
|
fetchPinnedDocument,
|
|
107
107
|
readCapped
|
|
108
|
-
} from "../index-
|
|
108
|
+
} from "../index-b2sey031.js";
|
|
109
109
|
import {
|
|
110
110
|
readBoundedChunks,
|
|
111
111
|
concatChunks
|
|
112
|
-
} from "../index-
|
|
112
|
+
} from "../index-wxadzdb7.js";
|
|
113
113
|
import {
|
|
114
114
|
assertPositiveSafeInteger
|
|
115
115
|
} from "../index-0s4xebbg.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
DEFAULT_STREAM_LINE_BYTES,
|
|
19
19
|
createBoundedLineDecoder,
|
|
20
20
|
readBoundedUtf8Lines
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-m9hb9wnk.js";
|
|
22
22
|
import {
|
|
23
23
|
inputIsQuery
|
|
24
24
|
} from "./index-xhzq2qvj.js";
|
|
@@ -26,6 +26,9 @@ import {
|
|
|
26
26
|
ApiError2,
|
|
27
27
|
refuseLocally
|
|
28
28
|
} from "./index-kfjkb396.js";
|
|
29
|
+
import {
|
|
30
|
+
isStreamResponse
|
|
31
|
+
} from "./index-ss67fxhj.js";
|
|
29
32
|
import {
|
|
30
33
|
typedEntries,
|
|
31
34
|
isRecord,
|
|
@@ -415,17 +418,17 @@ async function* parseSSE2(source, options) {
|
|
|
415
418
|
}
|
|
416
419
|
|
|
417
420
|
// src/browser/contract-stream.ts
|
|
418
|
-
function sourceFor(
|
|
421
|
+
function sourceFor(body, descriptor) {
|
|
419
422
|
const options = {
|
|
420
423
|
maxLineBytes: descriptor.maxFrameBytes ?? DEFAULT_CONTRACT_STREAM_FRAME_BYTES2,
|
|
421
424
|
finalLine: descriptor.finalLine
|
|
422
425
|
};
|
|
423
|
-
return descriptor.format === "sse" ? parseSSE2(
|
|
426
|
+
return descriptor.format === "sse" ? parseSSE2(body, options) : parseNDJSON2(body, options);
|
|
424
427
|
}
|
|
425
|
-
async function* readContractStream(
|
|
428
|
+
async function* readContractStream(body, descriptor, abort) {
|
|
426
429
|
let ended = false;
|
|
427
430
|
let terminalSeen = descriptor.terminal === undefined;
|
|
428
|
-
const source = sourceFor(
|
|
431
|
+
const source = sourceFor(body, descriptor);
|
|
429
432
|
try {
|
|
430
433
|
for (;; ) {
|
|
431
434
|
const next = await source.next();
|
|
@@ -525,7 +528,11 @@ class OwnedContractStream {
|
|
|
525
528
|
}
|
|
526
529
|
}
|
|
527
530
|
function parseContractStream(response, descriptor, abort) {
|
|
528
|
-
|
|
531
|
+
if (!isStreamResponse(response)) {
|
|
532
|
+
abort();
|
|
533
|
+
throw new Error("Streaming endpoint did not return a Response");
|
|
534
|
+
}
|
|
535
|
+
return new OwnedContractStream(readContractStream(response.body, descriptor, abort), abort);
|
|
529
536
|
}
|
|
530
537
|
|
|
531
538
|
// src/browser/client-executors.ts
|
|
@@ -543,15 +550,9 @@ function withOutput(endpoint, result, abortStream) {
|
|
|
543
550
|
if (endpoint.rawResponse)
|
|
544
551
|
return result;
|
|
545
552
|
if ("stream" in endpoint && endpoint.stream) {
|
|
546
|
-
return result.then((value) => {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
throw new Error("Streaming endpoint did not return a Response");
|
|
550
|
-
}
|
|
551
|
-
return parseContractStream(value, endpoint.stream, abortStream ?? (() => {
|
|
552
|
-
return;
|
|
553
|
-
}));
|
|
554
|
-
}, (error) => {
|
|
553
|
+
return result.then((value) => parseContractStream(value, endpoint.stream, abortStream ?? (() => {
|
|
554
|
+
return;
|
|
555
|
+
})), (error) => {
|
|
555
556
|
abortStream?.();
|
|
556
557
|
throw error;
|
|
557
558
|
});
|
|
@@ -2,14 +2,32 @@ import {
|
|
|
2
2
|
abortReason,
|
|
3
3
|
untilAborted
|
|
4
4
|
} from "./index-a5qr2rj6.js";
|
|
5
|
+
import {
|
|
6
|
+
isRecord
|
|
7
|
+
} from "./index-hkxgennw.js";
|
|
5
8
|
|
|
6
9
|
// src/internal/stream-chunks.ts
|
|
10
|
+
function isReadableByteStream(value) {
|
|
11
|
+
return isRecord(value) && typeof value.getReader === "function";
|
|
12
|
+
}
|
|
13
|
+
function isStreamResponse(value) {
|
|
14
|
+
return isRecord(value) && isReadableByteStream(value.body);
|
|
15
|
+
}
|
|
16
|
+
function bytesOf(source) {
|
|
17
|
+
if (isReadableByteStream(source))
|
|
18
|
+
return source;
|
|
19
|
+
if (Symbol.asyncIterator in source)
|
|
20
|
+
return source;
|
|
21
|
+
if (source.body === undefined)
|
|
22
|
+
throw new TypeError("The response has no body stream to read");
|
|
23
|
+
return source.body;
|
|
24
|
+
}
|
|
7
25
|
async function* chunksOf(source, signal) {
|
|
8
26
|
signal?.throwIfAborted();
|
|
9
|
-
const stream = source
|
|
27
|
+
const stream = bytesOf(source);
|
|
10
28
|
if (stream === null)
|
|
11
29
|
return;
|
|
12
|
-
if (stream
|
|
30
|
+
if (isReadableByteStream(stream)) {
|
|
13
31
|
const reader = stream.getReader();
|
|
14
32
|
const abort = () => {
|
|
15
33
|
if (signal)
|
|
@@ -65,4 +83,4 @@ async function* chunksOf(source, signal) {
|
|
|
65
83
|
}
|
|
66
84
|
}
|
|
67
85
|
|
|
68
|
-
export { chunksOf };
|
|
86
|
+
export { isStreamResponse, chunksOf };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
/** Bytes a stream reader accepts: a `Response` body, a web stream, or any async byte iterable. */
|
|
2
2
|
export type StreamByteSource = Response | ReadableStream<Uint8Array> | AsyncIterable<Uint8Array>;
|
|
3
|
+
/** A response of any fetch runtime whose body can be read as a web stream. */
|
|
4
|
+
export type StreamResponse = {
|
|
5
|
+
readonly body: ReadableStream<Uint8Array>;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Whether a value is a response with a readable body — the global `Response` or another runtime's,
|
|
9
|
+
* such as the `FetchResponse` of `expo/fetch`, which is its own class. A response without a body is
|
|
10
|
+
* not one.
|
|
11
|
+
*/
|
|
12
|
+
export declare function isStreamResponse(value: unknown): value is StreamResponse;
|
|
3
13
|
/**
|
|
4
14
|
* Every chunk of a byte source: the chunk loop the line readers and the bounded body readers
|
|
5
15
|
* share. The source is cancelled or returned on every exit path.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream-chunks.d.ts","sourceRoot":"","sources":["../../src/internal/stream-chunks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stream-chunks.d.ts","sourceRoot":"","sources":["../../src/internal/stream-chunks.ts"],"names":[],"mappings":"AAGA,kGAAkG;AAClG,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,cAAc,CAAC,UAAU,CAAC,GAC1B,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9B,8EAA8E;AAC9E,MAAM,MAAM,cAAc,GAAG;IAAE,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,CAAA;CAAE,CAAC;AAO3E;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAmBD;;;;;;;;GAQG;AACH,wBAAuB,QAAQ,CAC7B,MAAM,EAAE,gBAAgB,EACxB,MAAM,CAAC,EAAE,WAAW,GACnB,cAAc,CAAC,UAAU,CAAC,CA+C5B"}
|
package/llms/stitchkit.2.txt
CHANGED
|
@@ -501,6 +501,12 @@ body until it ends or is cancelled. This is the same for a Fetch-config client,
|
|
|
501
501
|
Unix transport. Cancelling a quiet stream therefore releases its server source
|
|
502
502
|
and transport connection instead of only settling the local iterator.
|
|
503
503
|
|
|
504
|
+
A stream is read from any response whose `body` has `getReader()`, not only from
|
|
505
|
+
the global `Response` class: a `fetch` of another runtime — `expo/fetch` in
|
|
506
|
+
React Native, which answers with its own `FetchResponse` — streams the same way.
|
|
507
|
+
A response without a readable body is refused with `Streaming endpoint did not
|
|
508
|
+
return a Response`.
|
|
509
|
+
|
|
504
510
|
An established NDJSON protocol may keep its item schema as the complete wire
|
|
505
511
|
frame. This mode requires a terminal item because an unwrapped response has no
|
|
506
512
|
separate safe error/end envelope:
|
package/llms/stitchkit.3.txt
CHANGED
|
@@ -88,7 +88,7 @@ The browser-and-server entrypoint. Re-exports everything from
|
|
|
88
88
|
| `parseNDJSON` | function | parse bounded fatal-UTF-8 NDJSON from a `Response`, a `ReadableStream<Uint8Array>` or an `AsyncIterable<Uint8Array>` (a child's stdout); blank keep-alives are skipped, `finalLine: 'require-newline'` makes the delimiter mandatory and `signal` cancels the source — [guide](../guide/client.md#any-byte-source) |
|
|
89
89
|
| `createNDJSONDecoder` / `NDJSONDecoder` | function / _type_ | the same bounded NDJSON reading driven by `push(chunk)` / `end()`, for a socket `data` callback |
|
|
90
90
|
| `readBoundedBody` / `BoundedBodyOptions` | function / _type_ | the whole body of a `ReadableStream<Uint8Array>` or async byte iterable as bytes, never reading past `maxBytes` plus one chunk; `limitError(observedBytes)` and `abortError(reason)` choose the two errors, the source is cancelled on both, a `null` body is empty — [guide](../guide/client.md#reading-a-body-up-to-a-byte-limit) |
|
|
91
|
-
| `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept |
|
|
91
|
+
| `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept; each is recognised by its shape, not its class — a reader, `Symbol.asyncIterator`, else the response's `body` — so another runtime's fetch response (`expo/fetch`) reads like the global `Response` |
|
|
92
92
|
| `StreamLineLimitError` / `StreamTruncatedLineError` | class | a line past `maxLineBytes` (`limitBytes`, `lineBytes`; a `RangeError`) and a source ended inside a line under `require-newline` (`lineBytes`; a `SyntaxError`) |
|
|
93
93
|
| `resumableIterator` | function | re-open a long-lived stream from the last delivered cursor, with jittered backoff, a caller-owned terminal item and prompt abort — [guide](../guide/client.md#resumable-streams) |
|
|
94
94
|
| `createBackoff` | function | exponential backoff with subtractive jitter as a value: `next()` / `reset()` |
|
package/llms-full.txt
CHANGED
|
@@ -3753,6 +3753,12 @@ body until it ends or is cancelled. This is the same for a Fetch-config client,
|
|
|
3753
3753
|
Unix transport. Cancelling a quiet stream therefore releases its server source
|
|
3754
3754
|
and transport connection instead of only settling the local iterator.
|
|
3755
3755
|
|
|
3756
|
+
A stream is read from any response whose `body` has `getReader()`, not only from
|
|
3757
|
+
the global `Response` class: a `fetch` of another runtime — `expo/fetch` in
|
|
3758
|
+
React Native, which answers with its own `FetchResponse` — streams the same way.
|
|
3759
|
+
A response without a readable body is refused with `Streaming endpoint did not
|
|
3760
|
+
return a Response`.
|
|
3761
|
+
|
|
3756
3762
|
An established NDJSON protocol may keep its item schema as the complete wire
|
|
3757
3763
|
frame. This mode requires a terminal item because an unwrapped response has no
|
|
3758
3764
|
separate safe error/end envelope:
|
|
@@ -23440,7 +23446,7 @@ The browser-and-server entrypoint. Re-exports everything from
|
|
|
23440
23446
|
| `parseNDJSON` | function | parse bounded fatal-UTF-8 NDJSON from a `Response`, a `ReadableStream<Uint8Array>` or an `AsyncIterable<Uint8Array>` (a child's stdout); blank keep-alives are skipped, `finalLine: 'require-newline'` makes the delimiter mandatory and `signal` cancels the source — [guide](../guide/client.md#any-byte-source) |
|
|
23441
23447
|
| `createNDJSONDecoder` / `NDJSONDecoder` | function / _type_ | the same bounded NDJSON reading driven by `push(chunk)` / `end()`, for a socket `data` callback |
|
|
23442
23448
|
| `readBoundedBody` / `BoundedBodyOptions` | function / _type_ | the whole body of a `ReadableStream<Uint8Array>` or async byte iterable as bytes, never reading past `maxBytes` plus one chunk; `limitError(observedBytes)` and `abortError(reason)` choose the two errors, the source is cancelled on both, a `null` body is empty — [guide](../guide/client.md#reading-a-body-up-to-a-byte-limit) |
|
|
23443
|
-
| `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept |
|
|
23449
|
+
| `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept; each is recognised by its shape, not its class — a reader, `Symbol.asyncIterator`, else the response's `body` — so another runtime's fetch response (`expo/fetch`) reads like the global `Response` |
|
|
23444
23450
|
| `StreamLineLimitError` / `StreamTruncatedLineError` | class | a line past `maxLineBytes` (`limitBytes`, `lineBytes`; a `RangeError`) and a source ended inside a line under `require-newline` (`lineBytes`; a `SyntaxError`) |
|
|
23445
23451
|
| `resumableIterator` | function | re-open a long-lived stream from the last delivered cursor, with jittered backoff, a caller-owned terminal item and prompt abort — [guide](../guide/client.md#resumable-streams) |
|
|
23446
23452
|
| `createBackoff` | function | exponential backoff with subtractive jitter as a value: `next()` / `reset()` |
|
package/llms.txt
CHANGED
|
@@ -9,7 +9,7 @@ Build with stitchkit: define a contract once, then `implement` it and serve it (
|
|
|
9
9
|
Load the slice for each entrypoint your code imports — `import … from 'stitchkit/server'` → `llms/server.txt`; the root `stitchkit` import → `llms/stitchkit.txt`. A slice holds that entrypoint's API reference section and the guide pages whose home it is; every guide lives in exactly one slice, and a slice that needs another's guide names it under "Also read". Each file is at most 50.0 KB; a longer one continues in numbered parts, each naming the next at its top. Moving across versions: load `llms/upgrading.txt` and the range slices it lists between your version and the target. `llms-full.txt` inlines everything; it is far larger than a context window, so do not read it whole.
|
|
10
10
|
|
|
11
11
|
## Entrypoint slices
|
|
12
|
-
- **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 45.2 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt)
|
|
12
|
+
- **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 45.2 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 31.2 KB → [llms/stitchkit.3.txt](llms/stitchkit.3.txt) 19.3 KB
|
|
13
13
|
- **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.2 KB
|
|
14
14
|
- **stitchkit/react**: [llms/react.txt](llms/react.txt) 8.7 KB
|
|
15
15
|
- **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 22.7 KB
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stitchkit",
|
|
3
|
-
"version": "0.124.
|
|
3
|
+
"version": "0.124.2",
|
|
4
4
|
"description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bun",
|
|
@@ -409,20 +409,20 @@
|
|
|
409
409
|
"@modelcontextprotocol/server": "^2.4.0",
|
|
410
410
|
"@openrouter/ai-sdk-provider": "^3.1.0",
|
|
411
411
|
"@opentelemetry/api": "^1.10.0",
|
|
412
|
-
"@seriousme/openapi-schema-validator": "^2.
|
|
412
|
+
"@seriousme/openapi-schema-validator": "^2.12.0",
|
|
413
413
|
"@socket.io/bun-engine": "^0.1.2",
|
|
414
414
|
"@socket.io/component-emitter": "^3.1.2",
|
|
415
|
-
"@tanstack/react-query": "5.
|
|
415
|
+
"@tanstack/react-query": "5.108.0",
|
|
416
416
|
"@types/bun": "^1.4.4",
|
|
417
417
|
"@types/json-schema": "^7.0.15",
|
|
418
418
|
"@types/react": "^19.3.0",
|
|
419
419
|
"@types/react-dom": "^19.3.0",
|
|
420
420
|
"@typescript/typescript6": "^6.0.2",
|
|
421
|
-
"ai": "^7.0.
|
|
421
|
+
"ai": "^7.0.173",
|
|
422
422
|
"ajv": "^8.20.0",
|
|
423
423
|
"exceljs": "^4.4.0",
|
|
424
|
-
"fake-indexeddb": "^6.2.
|
|
425
|
-
"google-auth-library": "^11.3.
|
|
424
|
+
"fake-indexeddb": "^6.2.8",
|
|
425
|
+
"google-auth-library": "^11.3.4",
|
|
426
426
|
"grammy": "^1.46.0",
|
|
427
427
|
"react": "^19.3.1",
|
|
428
428
|
"react-dom": "^19.3.1",
|