stitchkit 0.110.6 → 0.111.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.
Files changed (88) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -1
  3. package/dist/application/grammy-update-admission.d.ts.map +1 -1
  4. package/dist/browser/stream.d.ts +3 -2
  5. package/dist/browser/stream.d.ts.map +1 -1
  6. package/dist/contract/runtime-context.d.ts +3 -1
  7. package/dist/contract/runtime-context.d.ts.map +1 -1
  8. package/dist/entrypoints/agent-runtime/sandbox.js +13 -27
  9. package/dist/entrypoints/application/grammy.js +11 -2
  10. package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
  11. package/dist/entrypoints/bin/upgrade-cli.js +123 -29
  12. package/dist/entrypoints/cli/publish.js +1 -1
  13. package/dist/entrypoints/cli.js +2 -2
  14. package/dist/entrypoints/http.d.ts +2 -0
  15. package/dist/entrypoints/http.d.ts.map +1 -1
  16. package/dist/entrypoints/http.js +5 -1
  17. package/dist/entrypoints/index.d.ts +1 -0
  18. package/dist/entrypoints/index.d.ts.map +1 -1
  19. package/dist/entrypoints/index.js +5 -1
  20. package/dist/entrypoints/node.d.ts +1 -0
  21. package/dist/entrypoints/node.d.ts.map +1 -1
  22. package/dist/entrypoints/node.js +3 -1
  23. package/dist/entrypoints/observability.js +24 -9
  24. package/dist/entrypoints/remote.js +1 -1
  25. package/dist/entrypoints/server.d.ts +1 -0
  26. package/dist/entrypoints/server.d.ts.map +1 -1
  27. package/dist/entrypoints/server.js +24 -3
  28. package/dist/entrypoints/telegram.js +3 -3
  29. package/dist/entrypoints/testing.js +1 -1
  30. package/dist/entrypoints/tools/connections.js +16 -31
  31. package/dist/entrypoints/tools/mcp.js +1 -1
  32. package/dist/entrypoints/tools.js +40 -8
  33. package/dist/entrypoints/voice.js +17 -10
  34. package/dist/{index-s6d8zsha.js → index-2qymcsq2.js} +66 -121
  35. package/dist/index-5efrpfmj.js +55 -0
  36. package/dist/{index-s2eybn7b.js → index-c5374vpt.js} +10 -9
  37. package/dist/{index-jk44mbqb.js → index-c5at3ykd.js} +3 -57
  38. package/dist/index-cjbn98zt.js +68 -0
  39. package/dist/{index-3h0ztg0z.js → index-cxpcdswt.js} +5 -21
  40. package/dist/{index-s0xbnpfh.js → index-erv5shjq.js} +1 -1
  41. package/dist/{index-n7hrpngg.js → index-v2eyj2ws.js} +1 -1
  42. package/dist/internal/bounded-body.d.ts +44 -0
  43. package/dist/internal/bounded-body.d.ts.map +1 -0
  44. package/dist/internal/bounded-lines.d.ts +1 -2
  45. package/dist/internal/bounded-lines.d.ts.map +1 -1
  46. package/dist/internal/secure-fetch.d.ts.map +1 -1
  47. package/dist/internal/stream-chunks.d.ts +13 -0
  48. package/dist/internal/stream-chunks.d.ts.map +1 -0
  49. package/dist/internal/upgrade-affects.d.ts +5 -0
  50. package/dist/internal/upgrade-affects.d.ts.map +1 -1
  51. package/dist/internal/upgrade-plan.d.ts +18 -3
  52. package/dist/internal/upgrade-plan.d.ts.map +1 -1
  53. package/dist/internal/upgrade-usage.d.ts +21 -5
  54. package/dist/internal/upgrade-usage.d.ts.map +1 -1
  55. package/dist/observability/audit.d.ts +10 -0
  56. package/dist/observability/audit.d.ts.map +1 -1
  57. package/dist/observability/event.d.ts +5 -0
  58. package/dist/observability/event.d.ts.map +1 -1
  59. package/dist/server/contract-stream.d.ts.map +1 -1
  60. package/dist/server/multipart.d.ts.map +1 -1
  61. package/dist/server/oauth/endpoints.d.ts.map +1 -1
  62. package/dist/server/oauth/provider.d.ts +5 -0
  63. package/dist/server/oauth/provider.d.ts.map +1 -1
  64. package/dist/server/raw.d.ts +6 -3
  65. package/dist/server/raw.d.ts.map +1 -1
  66. package/dist/server/request-body.d.ts.map +1 -1
  67. package/dist/server/request-completion.d.ts.map +1 -1
  68. package/dist/server/request-ingress.d.ts +31 -0
  69. package/dist/server/request-ingress.d.ts.map +1 -0
  70. package/dist/server/unix-client-body.d.ts.map +1 -1
  71. package/dist/tools/connections/limits.d.ts.map +1 -1
  72. package/dist/tools/mcp/handler.d.ts.map +1 -1
  73. package/dist/voice/speech-queue.d.ts +6 -1
  74. package/dist/voice/speech-queue.d.ts.map +1 -1
  75. package/llms/http.txt +3 -0
  76. package/llms/observability.txt +19 -2
  77. package/llms/server.2.txt +4 -0
  78. package/llms/server.5.txt +2 -1
  79. package/llms/server.txt +42 -0
  80. package/llms/stitchkit.2.txt +28 -0
  81. package/llms/stitchkit.txt +3 -3
  82. package/llms/tools.3.txt +1 -1
  83. package/llms/tools.txt +4 -0
  84. package/llms/{upgrading-0.101.0-0.110.0.txt → upgrading-0.101.0-0.111.0.txt} +29 -3
  85. package/llms/upgrading.txt +8 -2
  86. package/llms-full.txt +136 -8
  87. package/llms.txt +6 -6
  88. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -15,6 +15,45 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
15
15
 
16
16
  ## [Unreleased]
17
17
 
18
+ ## [0.111.1] - 2026-10-17
19
+
20
+ ### Fixed
21
+
22
+ - `stitchkit/server` — **an open contract stream keeps a constant number of objects however many frames it sends.** Each frame raced the source against a promise that lived as long as the stream, so every frame left a reaction and the frame itself retained until the stream ended; a subscription sending a frame a second grew by about 1.6 MB a minute. The stream now waits for each frame through a listener it removes itself. A source that never has to wait is also stopped at the stream's `lifetimeMs`, which it used to outlive. → ADR 0264
23
+ **Affects:** `stitchkit/server` createServer, createHandler, implement
24
+ - `stitchkit/voice` — **`SpeechQueue` no longer keeps a reaction and the spoken clip for every sentence it has said.** → ADR 0264
25
+ **Affects:** `stitchkit/voice` SpeechQueue
26
+ - `stitchkit/tools/mcp` — **`createMcpHandler` no longer keeps the authenticated principal of every request it has answered until it is closed.** → ADR 0264
27
+ **Affects:** `stitchkit/tools/mcp` createMcpHandler
28
+ - `stitchkit/application/grammy` — **the update gate follows grammY's polling signal once instead of adding a listener on every `getUpdates`.** → ADR 0264
29
+ **Affects:** `stitchkit/application/grammy` behaviour
30
+
31
+ ## [0.111.0] - 2026-10-17
32
+
33
+ ### ⚠️ Breaking changes
34
+
35
+ **Who must act:** applications whose raw routes call `parseBody` on JSON larger than 1 MiB, and applications whose OAuth clients send `/register` or `/token` bodies larger than 64 KiB. Everyone else changes nothing.
36
+
37
+ - `stitchkit/server` — **`parseBody` reads at most 1 MiB by default** and returns `null` for a larger body, where it used to read any size into memory. An unbounded read of a raw route's body is a hole in the bounded-everything rule (I10), and `maxJsonBodyBytes` never covered raw routes. Before: `await parseBody(req, Schema)` parsed a body of any size; after: pass the limit your route needs, `await parseBody(req, Schema, { maxBytes: 8 * 1024 * 1024 })`. → ADR 0262
38
+ **Affects:** `stitchkit/server` parseBody
39
+ - `stitchkit/tools` — **`mountOAuthProvider` reads at most 64 KiB of a `/token` or `/register` body** and answers `413` with `invalid_request` for a larger one, where it used to read any size. Before: no limit; after: the default is 64 KiB and `mountOAuthProvider({ ..., maxRequestBodyBytes: 256 * 1024 })` raises it. → ADR 0262
40
+ **Affects:** `stitchkit/tools` mountOAuthProvider
41
+
42
+ ### Added
43
+
44
+ - `stitchkit/observability`: `request.payloadMaxBytes` sets how much of a request body the audit row reads with `includePayload` (default: the handler's `maxJsonBodyBytes`, or 1 MiB), and an event whose body was larger carries `payloadTruncated: true` beside its `null` payload.
45
+ - `stitchkit/tools`: `mountOAuthProvider({ maxRequestBodyBytes })` sets the most bytes `/token` and `/register` read of a request body (default 64 KiB).
46
+ - `stitchkit`, `stitchkit/http`: `readBoundedBody(source, { maxBytes, signal?, limitError, abortError? })` reads a `ReadableStream<Uint8Array>`, an async byte iterable or a `null` body into bytes without reading past `maxBytes` plus one chunk. The source is cancelled when the limit is crossed and when the signal aborts, an abort is honoured before the first read and while a read never settles, and the caller picks both errors. A consuming project no longer needs its own copy; the request-text, unix-client, connection-response, capped-download and sandbox-gateway readers of the framework now run on the same chunk loop. → ADR 0262
47
+ - `stitchkit/server`, `stitchkit/node`: `defineRequestIngress<T>(name)` returns a typed key whose `attach(request, value)` is called by the code that builds a `Request` (a local socket ingress, a relay) and whose `from(ctx)` an endpoint, `authorize`, `beforeHandle` or `onError` reads. A header, `clone()` and `new Request(request)` carry nothing; a request from another ingress has no value. `ctx.req` is documented, and tested on every HTTP context, as the very `Request` the handler received. → ADR 0261
48
+ - `stitchkit upgrade` prints a second section, **Fixes that touch this project**, with the same verdicts as breaking items for every fix of the range that names what it touches (`fixes` and `fixesWithoutAffects` in `--json`); `release:check` requires the `**Affects:**` line on a Fixed item that leads with a public entrypoint, from the release after 0.110.6. → ADR 0263
49
+
50
+ ### Fixed
51
+
52
+ - `stitchkit/server`, `stitchkit/node`: a `createUnixClientTransport` request that is aborted while its body is being read rejects with the abort reason at once instead of waiting for the next chunk of a stalled source, and cancels the body when it crosses the request size limit.
53
+ **Affects:** `stitchkit/server`, `stitchkit/node` createUnixClientTransport
54
+ - `stitchkit/server`: with `observability.includePayload`, the audit row reads the cloned request body up to `payloadMaxBytes` (by default the handler's `maxJsonBodyBytes`, or 1 MiB; an endpoint's own `maxJsonBodyBytes` is not known when the body is cloned, so set `payloadMaxBytes` for endpoints that accept more) and cancels that branch there; before, the clone branch of the body stream drained the whole body into memory even when the handler's own branch was cut at `maxJsonBodyBytes`.
55
+ **Affects:** `stitchkit/server` createServer(observability.includePayload)
56
+
18
57
  ## [0.110.6] - 2026-10-15
19
58
 
20
59
  ### Added
@@ -24,7 +63,9 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
24
63
  ### Fixed
25
64
 
26
65
  - `stitchkit/process`: bounded process-group settlement observations remain readable through nested cleanup errors in Node CI, including up to 16 actual states, the group id, sample count and elapsed time. Observation failures retain their original cause. Cleanup deadlines and the definition of a live process are unchanged; these diagnostics do not claim to repair a historical native termination failure.
66
+ **Affects:** `stitchkit/process` runNativeCommand
27
67
  - `stitchkit/process`: stopping a process group repeats `SIGKILL` for members still confirmed alive within the original cleanup deadline. Fresh kernel absence ends further signals; dead-only, invalid and failed process observations never trigger a blind re-signal.
68
+ **Affects:** `stitchkit/process` runNativeCommand
28
69
 
29
70
  ## [0.110.5] - 2026-10-15
30
71
 
@@ -63,6 +104,7 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
63
104
  ### Fixed
64
105
 
65
106
  - Process-group cleanup accepts a fresh kernel absence after SIGKILL instead of relying only on a potentially stale process-table snapshot. Permission refusals and unknown/exiting states still require proof; the same cleanup deadline applies and failures retain their last observed states.
107
+ **Affects:** `stitchkit/process` runNativeCommand
66
108
  - A synchronously throwing injected Socket.IO peer loader now reaches `onConnectError`, clears connection intent and allows the next `connect()` to retry, just like an asynchronously rejected loader.
67
109
 
68
110
  ## [0.110.0] - 2026-10-14
@@ -77,6 +119,7 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
77
119
  ### Fixed
78
120
 
79
121
  - A fast owner-loss guard exit no longer overtakes a buffered start handshake or discards captured output while the handshake is in flight. The control stream determines whether the handshake was missing, and output readers attach before waiting for it. Native lifetime qualification checks descendant death within its cleanup window before asserting stable output.
122
+ **Affects:** `stitchkit/process` runNativeCommand(ownerLoss: 'terminate')
80
123
 
81
124
  ### Added
82
125
 
@@ -90,6 +133,7 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
90
133
  timer on a loaded host. The grace wait and the Darwin permission retry read the clock once for both
91
134
  the decision to wait and the length of the wait, so Node no longer prints `TimeoutNegativeWarning`
92
135
  to the application's stderr when the deadline passes between two reads.
136
+ **Affects:** `stitchkit/process` runNativeCommand
93
137
 
94
138
  ## [0.109.3] - 2026-10-13
95
139
 
@@ -217,6 +261,7 @@ scripts relied on spelling-based conversion of dotted values.
217
261
  `Command deadline exceeded`. Under Bun a command is now launched through `Bun.spawn`, presented to the
218
262
  command owner with the same events, streams, group ownership and failure reporting; Node still uses
219
263
  `node:child_process`. The deadline, stop policy and process-group cleanup are unchanged.
264
+ **Affects:** `stitchkit/process` runNativeCommand
220
265
 
221
266
  ## [0.108.0] - 2026-10-06
222
267
 
@@ -1 +1 @@
1
- {"version":3,"file":"sandbox-broker.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-broker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,6FAA6F;AAC7F,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,oBAAoB,EACrC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;;;GA4HlC"}
1
+ {"version":3,"file":"sandbox-broker.d.ts","sourceRoot":"","sources":["../../src/agent-runtime/sandbox-broker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,KAAK,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE7E,6FAA6F;AAC7F,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,oBAAoB,EACrC,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI;;;GA4GlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"grammy-update-admission.d.ts","sourceRoot":"","sources":["../../src/application/grammy-update-admission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,mBAAmB;IAClC,gGAAgG;IAChG,IAAI,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI,CAAC;IAC5D,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,6EAA6E;IAC7E,OAAO,IAAI,IAAI,CAAC;CACjB;AAsDD,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAmDvF"}
1
+ {"version":3,"file":"grammy-update-admission.d.ts","sourceRoot":"","sources":["../../src/application/grammy-update-admission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,mBAAmB;IAClC,gGAAgG;IAChG,IAAI,CAAC,SAAS,EAAE,wBAAwB,GAAG,SAAS,GAAG,IAAI,CAAC;IAC5D,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,6EAA6E;IAC7E,OAAO,IAAI,IAAI,CAAC;CACjB;AAiED,qFAAqF;AACrF,wBAAgB,mBAAmB,CAAC,CAAC,SAAS,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAmDvF"}
@@ -1,6 +1,7 @@
1
1
  import type { StreamFinalLinePolicy } from '../contract/define.js';
2
- import { type StreamByteSource } from '../internal/bounded-lines.js';
3
- export { DEFAULT_STREAM_LINE_BYTES, type StreamByteSource, StreamLineLimitError, StreamTruncatedLineError, } from '../internal/bounded-lines.js';
2
+ import type { StreamByteSource } from '../internal/stream-chunks.js';
3
+ export { DEFAULT_STREAM_LINE_BYTES, StreamLineLimitError, StreamTruncatedLineError, } from '../internal/bounded-lines.js';
4
+ export type { StreamByteSource } from '../internal/stream-chunks.js';
4
5
  /** Options for `parseNDJSON` and `createNDJSONDecoder`. */
5
6
  export interface ParseNDJSONOptions {
6
7
  /** Maximum bytes retained for one line; past it, `StreamLineLimitError`. Default 1 MiB. */
@@ -1 +1 @@
1
- {"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/browser/stream.ts"],"names":[],"mappings":"AAAA,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,aAAa,CAAC,CAAC,CAAC,CAkClB;AAED,8BAA8B;AAC9B,MAAM,WAAW,eAAe;IAC9B,+FAA+F;IAC/F,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sEAAsE;IACtE,YAAY,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACnD,4FAA4F;IAC5F,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAuB,QAAQ,CAAC,CAAC,EAC/B,MAAM,EAAE,gBAAgB,EACxB,OAAO,CAAC,EAAE,eAAe,GACxB,cAAc,CAAC,CAAC,CAAC,CA6BnB"}
@@ -81,7 +81,9 @@ export interface RuntimeContext {
81
81
  * validation failure). Absent on the non-HTTP transports (MCP / agent / CLI /
82
82
  * a bring-your-own lane), which carry no `Request`, so they are optional and a
83
83
  * reader narrows them. Web Fetch types only — the core stays Fetch-clean
84
- * (→ ADR 0013).
84
+ * (→ ADR 0013). On every HTTP context it is the very `Request` the handler of
85
+ * the core received, never a copy: a `RequestIngress` key attached by the code
86
+ * that built that request reads its value through this identity.
85
87
  */
86
88
  req?: Request;
87
89
  url?: URL;
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-context.d.ts","sourceRoot":"","sources":["../../src/contract/runtime-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAIhD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACjD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GAChD,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAQrC;AAED,mFAAmF;AACnF,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AA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} from "../../index-7r4knwf8.js";
21
21
  import"../../index-zrtrjkbf.js";
22
+ import {
23
+ readBoundedBody2
24
+ } from "../../index-5efrpfmj.js";
22
25
  import {
23
26
  MAX_TIMER_MS
24
27
  } from "../../index-eemvahkc.js";
@@ -108,15 +111,10 @@ async function createSandboxBroker(socketPath, getPolicy, onError) {
108
111
  req.on("aborted", abort);
109
112
  res.on("close", abort);
110
113
  try {
111
- const chunks = [];
112
- let size = 0;
113
- for await (const chunk of req) {
114
- const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
115
- size += bytes.byteLength;
116
- if (size > maxBytes)
117
- throw new SandboxError("SANDBOX_LIMIT", "Sandbox request limit exceeded");
118
- chunks.push(bytes);
119
- }
114
+ const requestBody = await readBoundedBody2(req, {
115
+ maxBytes,
116
+ limitError: () => new SandboxError("SANDBOX_LIMIT", "Sandbox request limit exceeded")
117
+ });
120
118
  const target = new URL(req.url, rule.origin);
121
119
  if (target.origin !== new URL(rule.origin).origin)
122
120
  throw new SandboxError("SANDBOX_NETWORK_DENIED", "Sandbox network denied");
@@ -133,31 +131,19 @@ async function createSandboxBroker(socketPath, getPolicy, onError) {
133
131
  headers,
134
132
  redirect: "manual",
135
133
  signal: controller.signal,
136
- ...size > 0 && { body: Buffer.concat(chunks) }
134
+ ...requestBody.byteLength > 0 && { body: requestBody }
137
135
  });
138
136
  if (response.status >= 300 && response.status < 400) {
139
137
  await response.body?.cancel();
140
138
  throw new SandboxError("SANDBOX_NETWORK_DENIED", "Sandbox redirects are denied");
141
139
  }
142
- const reader = response.body?.getReader();
143
- const output = [];
144
- size = 0;
145
- try {
146
- while (reader) {
147
- const next = await reader.read();
148
- if (next.done)
149
- break;
150
- size += next.value.byteLength;
151
- if (size > maxBytes)
152
- throw new SandboxError("SANDBOX_LIMIT", "Sandbox response limit exceeded");
153
- output.push(next.value);
154
- }
155
- } finally {
156
- await reader?.cancel();
157
- }
140
+ const output = await readBoundedBody2(response.body, {
141
+ maxBytes,
142
+ limitError: () => new SandboxError("SANDBOX_LIMIT", "Sandbox response limit exceeded")
143
+ });
158
144
  const type = response.headers.get("content-type");
159
145
  res.writeHead(response.status, type ? { "content-type": type } : {});
160
- res.end(Buffer.concat(output));
146
+ res.end(output);
161
147
  } catch (cause) {
162
148
  try {
163
149
  onError(cause);
@@ -15,7 +15,7 @@ function batchSize(result) {
15
15
  function abortError() {
16
16
  return new DOMException("Telegram polling stopped", "AbortError");
17
17
  }
18
- function untilAborted(signal) {
18
+ function untilNoLongerAdmitted(signal) {
19
19
  return new Promise((_, reject) => {
20
20
  if (signal.aborted)
21
21
  reject(abortError());
@@ -29,10 +29,19 @@ async function admitted(admission, signal) {
29
29
  } catch {
30
30
  if (signal.aborted)
31
31
  throw abortError();
32
- return untilAborted(signal);
32
+ return untilNoLongerAdmitted(signal);
33
33
  }
34
34
  }
35
+ var followers = new WeakMap;
35
36
  function followed(signal) {
37
+ const known = followers.get(signal);
38
+ if (known)
39
+ return known;
40
+ const follower = follow(signal);
41
+ followers.set(signal, follower);
42
+ return follower;
43
+ }
44
+ function follow(signal) {
36
45
  const controller = new AbortController;
37
46
  if (signal.aborted)
38
47
  controller.abort(abortError());
@@ -1 +1 @@
1
- {"version":3,"file":"upgrade-cli.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/bin/upgrade-cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,MAAM,EAA2C,MAAM,SAAS,CAAC;AAI/E,OAAO,EACL,KAAK,aAAa,EAKnB,MAAM,8BAA8B,CAAC;AA4BtC,mGAAmG;AACnG,MAAM,WAAW,eAAe;IAC9B,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAAC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED,yFAAyF;AACzF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAA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AC;IAAC,SAAS,EAAE,SAAS,EAAE,CAAA;CAAE,CAiCtD;AAoCD,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,gBAAgB,CA8EvE;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CASrF"}
@@ -47,6 +47,31 @@ function breakingItems(section) {
47
47
  flush();
48
48
  return items;
49
49
  }
50
+ function fixedSectionItems(releaseBody) {
51
+ const items = [];
52
+ let section;
53
+ let fenced = false;
54
+ const flush = () => {
55
+ if (section)
56
+ items.push(...breakingItems(section.join(`
57
+ `)));
58
+ section = undefined;
59
+ };
60
+ for (const line of releaseBody.split(`
61
+ `)) {
62
+ if (FENCE.test(line))
63
+ fenced = !fenced;
64
+ if (!fenced && /^### /.test(line)) {
65
+ flush();
66
+ if (/^### Fixed\b/.test(line))
67
+ section = [];
68
+ continue;
69
+ }
70
+ section?.push(line);
71
+ }
72
+ flush();
73
+ return items;
74
+ }
50
75
  function affectsLineOf(itemMarkdown) {
51
76
  let fenced = false;
52
77
  const lines = [];
@@ -127,13 +152,13 @@ function parseAffectsLine(line) {
127
152
  // src/internal/upgrade-plan.ts
128
153
  var BREAKING_HEADING = /^### \s*⚠️?\s*Breaking changes[^\n]*$/m;
129
154
  var NOT_DECLARED = "Not declared in this legacy changelog section.";
130
- function leadingEntrypoints(item) {
155
+ function leadingEntrypoints(item, accept = () => true) {
131
156
  let rest = item.replace(/^[-*+] /, "").replace(/^\*\*/, "");
132
157
  const names = [];
133
158
  for (;; ) {
134
- const match = /^`(stitchkit(?:\/[a-z0-9][a-z0-9-]*)*)`/.exec(rest);
159
+ const match = /^`(stitchkit(?:-[a-z0-9-]+)?(?:\/[a-z0-9][a-z0-9-]*)*)`/.exec(rest);
135
160
  const name = match?.[1];
136
- if (!match || name === undefined)
161
+ if (!match || name === undefined || !accept(name))
137
162
  break;
138
163
  names.push(name);
139
164
  rest = rest.slice(match[0].length);
@@ -157,18 +182,32 @@ function itemAudience(item) {
157
182
  const who = /\*\*Who must act:\*\*\s*(.*?)(?=\s+See \[|\s+→|\s+\*\*Affects:\*\*|$)/.exec(flat)?.[1];
158
183
  return who?.trim() || undefined;
159
184
  }
185
+ function upgradeItem(version, item, title = itemTitle) {
186
+ const line = affectsLineOf(item);
187
+ return {
188
+ version,
189
+ entrypoints: leadingEntrypoints(item),
190
+ title: title(item.replace(/^[ \t]*\*\*Affects:\*\*.*$/gm, "").trimEnd()),
191
+ affects: line === undefined ? undefined : parseAffectsLine(line),
192
+ markdown: item
193
+ };
194
+ }
195
+ function fixTitle(item) {
196
+ const flat = item.replace(/\s+/g, " ").replace(/^[-*+] /, "").trim();
197
+ const prefix = /^(?:`stitchkit[^`]*`(?:, and |, | and | \+ )?)+\s*[:—-]?\s*/.exec(flat);
198
+ const text = flat.slice(prefix?.[0].length ?? 0).replace(/\*\*/g, "");
199
+ const sentence = /^(.*?[.!?])(?:\s|$)/.exec(text)?.[1] ?? text;
200
+ const trimmed = sentence.replace(/[.:]$/, "");
201
+ return trimmed.length > 100 ? `${trimmed.slice(0, 99)}…` : trimmed;
202
+ }
203
+ function fixedItem(version, item) {
204
+ return upgradeItem(version, item, fixTitle);
205
+ }
160
206
  function sectionItems(version, markdown, sectionAudience) {
161
- return breakingItems(markdown).map(({ markdown: item }) => {
162
- const line = affectsLineOf(item);
163
- return {
164
- version,
165
- entrypoints: leadingEntrypoints(item),
166
- title: itemTitle(item),
167
- affects: line === undefined ? undefined : parseAffectsLine(line),
168
- whoMustAct: itemAudience(item) ?? sectionAudience,
169
- markdown: item
170
- };
171
- });
207
+ return breakingItems(markdown).map(({ markdown: item }) => ({
208
+ ...upgradeItem(version, item),
209
+ whoMustAct: itemAudience(item) ?? sectionAudience
210
+ }));
172
211
  }
173
212
  function semverParts(version) {
174
213
  const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
@@ -190,14 +229,14 @@ function compareSemver(left, right) {
190
229
  }
191
230
  return 0;
192
231
  }
193
- function planUpgrade(changelog, from, to) {
232
+ function releasesInRange(changelog, from, to) {
194
233
  semverParts(from);
195
234
  semverParts(to);
196
235
  if (compareSemver(from, to) >= 0) {
197
236
  throw new Error(`Upgrade range must increase: ${from} → ${to}`);
198
237
  }
199
238
  const releases = [...changelog.matchAll(/^## \[(\d+\.\d+\.\d+)\].*$/gm)];
200
- const changes = [];
239
+ const found = [];
201
240
  for (const [index, release] of releases.entries()) {
202
241
  const version = release[1];
203
242
  if (version === undefined)
@@ -206,7 +245,13 @@ function planUpgrade(changelog, from, to) {
206
245
  continue;
207
246
  const bodyStart = (release.index ?? 0) + release[0].length;
208
247
  const bodyEnd = releases[index + 1]?.index ?? changelog.length;
209
- const body = changelog.slice(bodyStart, bodyEnd);
248
+ found.push({ version, body: changelog.slice(bodyStart, bodyEnd) });
249
+ }
250
+ return found;
251
+ }
252
+ function planUpgrade(changelog, from, to) {
253
+ const changes = [];
254
+ for (const { version, body } of releasesInRange(changelog, from, to)) {
210
255
  const breakingHeader = BREAKING_HEADING.exec(body);
211
256
  if (!breakingHeader)
212
257
  continue;
@@ -225,6 +270,17 @@ function planUpgrade(changelog, from, to) {
225
270
  }
226
271
  return changes.sort((left, right) => compareSemver(left.version, right.version));
227
272
  }
273
+ function fixedItems(version, body) {
274
+ return fixedSectionItems(body).map(({ markdown }) => fixedItem(version, markdown));
275
+ }
276
+ function planFixes(changelog, from, to) {
277
+ const releases = releasesInRange(changelog, from, to).sort((left, right) => compareSemver(left.version, right.version));
278
+ const all = releases.flatMap(({ version, body }) => fixedItems(version, body));
279
+ return {
280
+ declared: all.filter((item) => item.affects !== undefined),
281
+ withoutAffects: all.filter((item) => item.affects === undefined).length
282
+ };
283
+ }
228
284
  function renderUpgradePlan(changes, from, to) {
229
285
  const header = `# Stitchkit upgrade ${from} → ${to}`;
230
286
  if (changes.length === 0)
@@ -411,10 +467,8 @@ var VERDICT_TEXT = {
411
467
  behavioural: "behavioural — check by hand",
412
468
  "not-declared": "not declared — check by hand"
413
469
  };
414
- function renderUpgradeVerdicts(verdicts) {
415
- if (verdicts.length === 0)
416
- return "";
417
- const lines = ["## Does it touch this project?", ""];
470
+ function renderVerdictLines(verdicts) {
471
+ const lines = [];
418
472
  for (const { item, verdict } of verdicts) {
419
473
  const where = item.entrypoints.length > 0 ? ` ${item.entrypoints.map((name) => `\`${name}\``).join(", ")}` : "";
420
474
  lines.push(`- **${item.version}**${where} — ${item.title}: **${VERDICT_TEXT[verdict.kind]}**`);
@@ -425,23 +479,47 @@ function renderUpgradeVerdicts(verdicts) {
425
479
  for (const file of verdict.files)
426
480
  lines.push(` - ${file}`);
427
481
  }
482
+ return lines;
483
+ }
484
+ function renderUpgradeVerdicts(verdicts) {
485
+ if (verdicts.length === 0)
486
+ return "";
487
+ return `${["## Does it touch this project?", "", ...renderVerdictLines(verdicts)].join(`
488
+ `)}
489
+ `;
490
+ }
491
+ function renderUpgradeFixes(verdicts, withoutAffects) {
492
+ if (verdicts.length === 0 && withoutAffects === 0)
493
+ return "";
494
+ const lines = ["## Fixes that touch this project", ""];
495
+ lines.push(...renderVerdictLines(verdicts));
496
+ if (verdicts.length === 0)
497
+ lines.push("No fix of this range names what it touches.");
498
+ if (withoutAffects > 0)
499
+ lines.push("", `${withoutAffects} more fix${withoutAffects === 1 ? "" : "es"} in this range carry no machine line and are not judged here.`);
428
500
  return `${lines.join(`
429
501
  `)}
430
502
  `;
431
503
  }
432
504
  function upgradeVerdictsJson(verdicts) {
433
- return verdicts.map(({ item, verdict }) => ({
505
+ return verdicts.map((entry) => verdictJson(entry, entry.item.whoMustAct));
506
+ }
507
+ function upgradeFixesJson(verdicts) {
508
+ return verdicts.map((entry) => verdictJson(entry));
509
+ }
510
+ function verdictJson({ item, verdict }, whoMustAct) {
511
+ return {
434
512
  version: item.version,
435
513
  entrypoints: item.entrypoints,
436
514
  title: item.title,
437
- whoMustAct: item.whoMustAct,
515
+ ...whoMustAct !== undefined && { whoMustAct },
438
516
  affects: item.affects ?? null,
439
517
  verdict: verdict.kind,
440
518
  ...verdict.kind === "affects" && { uses: verdict.uses },
441
519
  ...(verdict.kind === "behavioural" || verdict.kind === "not-declared") && {
442
520
  files: verdict.files
443
521
  }
444
- }));
522
+ };
445
523
  }
446
524
 
447
525
  // src/entrypoints/bin/upgrade-cli.ts
@@ -455,11 +533,13 @@ Options
455
533
  --to <version> target version (default: the version of this package)
456
534
  --cwd <dir> project to read the installed version and imports from (default: .)
457
535
  --changelog <path> changelog to plan from (default: the one in this package)
458
- --json print the breaking items and their verdicts as JSON
536
+ --json print the breaking items, the fixes and their verdicts as JSON
459
537
 
460
538
  Each breaking item is matched against what the project imports from stitchkit:
461
539
  "affects this project" (with file:line), "not used here", "behavioural — check
462
540
  by hand" or, for an item written before machine lines, "not declared — check by hand".
541
+ The fixes of the range that name what they touch get the same verdicts in a
542
+ second section; a fix that carries no such line is only counted.
463
543
  `;
464
544
  var SKIPPED_DIRECTORIES = new Set(["node_modules", ".git", ".next", ".turbo", ".cache"]);
465
545
  var OUTPUT_DIRECTORIES = new Set(["dist", "build", "out", "coverage"]);
@@ -555,7 +635,7 @@ ${USAGE}`, code: 1 };
555
635
  const json = argv.includes("--json");
556
636
  if (from === to) {
557
637
  return json ? {
558
- output: `${JSON.stringify({ from, to, items: [], unscanned: [] }, null, 2)}
638
+ output: `${JSON.stringify({ from, to, items: [], fixes: [], fixesWithoutAffects: 0, unscanned: [] }, null, 2)}
559
639
  `,
560
640
  code: 0
561
641
  } : { output: `Already on ${to}. Nothing to upgrade.
@@ -569,14 +649,28 @@ ${USAGE}`, code: 1 };
569
649
  throw new Error(`Cannot read the changelog at ${changelogPath}`);
570
650
  }
571
651
  const plan = planUpgrade(changelog, from, to);
652
+ const fixes = planFixes(changelog, from, to);
572
653
  const { sources, unscanned } = projectSources(cwd);
573
- const verdicts = upgradeVerdicts(plan.flatMap((change) => change.items), scanStitchkitImports(sources));
654
+ const imports = scanStitchkitImports(sources);
655
+ const verdicts = upgradeVerdicts(plan.flatMap((change) => change.items), imports);
656
+ const fixVerdicts = upgradeVerdicts(fixes.declared, imports);
574
657
  if (json) {
575
- const document = { from, to, items: upgradeVerdictsJson(verdicts), unscanned };
658
+ const document = {
659
+ from,
660
+ to,
661
+ items: upgradeVerdictsJson(verdicts),
662
+ fixes: upgradeFixesJson(fixVerdicts),
663
+ fixesWithoutAffects: fixes.withoutAffects,
664
+ unscanned
665
+ };
576
666
  return { output: `${JSON.stringify(document, null, 2)}
577
667
  `, code: 0 };
578
668
  }
579
- const usage = renderUpgradeVerdicts(verdicts);
669
+ const usage = [
670
+ renderUpgradeVerdicts(verdicts),
671
+ renderUpgradeFixes(fixVerdicts, fixes.withoutAffects)
672
+ ].filter(Boolean).join(`
673
+ `);
580
674
  const skipped = unscanned.length === 0 ? "" : `
581
675
  ## Not scanned
582
676
 
@@ -15,7 +15,7 @@ import {
15
15
  gzipCliAsset,
16
16
  decodeCliAsset,
17
17
  compareCliVersions2
18
- } from "../../index-s0xbnpfh.js";
18
+ } from "../../index-erv5shjq.js";
19
19
  import {
20
20
  withExclusiveLock2
21
21
  } from "../../index-w9mqgnz9.js";
@@ -16,7 +16,7 @@ import {
16
16
  renderCliView2,
17
17
  pollUntilDone2,
18
18
  createCli2
19
- } from "../index-n7hrpngg.js";
19
+ } from "../index-v2eyj2ws.js";
20
20
  import"../index-fynr93w4.js";
21
21
  import"../index-ct75c3at.js";
22
22
  import"../index-q6crhe1n.js";
@@ -40,7 +40,7 @@ import {
40
40
  checkCliUpdate2,
41
41
  applyCliUpdate2,
42
42
  rollbackCliUpdate2
43
- } from "../index-s0xbnpfh.js";
43
+ } from "../index-erv5shjq.js";
44
44
  import {
45
45
  writeFileAtomicSync2
46
46
  } from "../index-07dcf2yn.js";
@@ -3,4 +3,6 @@ export { ApiError } from '../browser/api-error.js';
3
3
  export { type ChunkedUploadConfig, type ChunkedUploadPart, type ChunkedUploadProgress, type ChunkedUploadStart, type ChunkSource, uploadInChunks, } from '../browser/chunked-upload.js';
4
4
  export { type ClientConfig, type ClientContract, type ClientFetch, type ClientRegistryValue, type ContractClientConfig, contractEndpointMatchers, createClient, createClients, createScopedClients, createScopedUrlBuilders, createUrlBuilder, createUrlBuilders, type PathPrefixArgs, type RegistryScope, type ScopeClientConfigs, type ScopedClientRegistry, type ScopedUrlBuilderRegistry, type UrlBuilderConfig, } from '../browser/client.js';
5
5
  export { type ApiEvent, type ApiEventListener, type ConfiguredHttpClient, createHttpClient, type HeaderProvider, type HttpClient, type HttpClientConfig, type RequestOptions, type UnauthorizedMatcher, } from '../browser/http.js';
6
+ export { type BoundedBodyOptions, readBoundedBody } from '../internal/bounded-body.js';
7
+ export type { StreamByteSource } from '../internal/stream-chunks.js';
6
8
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/entrypoints/http.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/entrypoints/http.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,EACvB,KAAK,WAAW,EAChB,cAAc,GACf,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,wBAAwB,EACxB,YAAY,EACZ,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,GACtB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -14,10 +14,13 @@ import {
14
14
  createUrlBuilder2,
15
15
  createUrlBuilders2,
16
16
  createScopedUrlBuilders2
17
- } from "../index-jk44mbqb.js";
17
+ } from "../index-c5at3ykd.js";
18
18
  import {
19
19
  ApiError2
20
20
  } from "../index-kfjkb396.js";
21
+ import {
22
+ readBoundedBody2
23
+ } from "../index-5efrpfmj.js";
21
24
  export {
22
25
  ApiError2 as ApiError,
23
26
  contractEndpointMatchers2 as contractEndpointMatchers,
@@ -28,5 +31,6 @@ export {
28
31
  createScopedUrlBuilders2 as createScopedUrlBuilders,
29
32
  createUrlBuilder2 as createUrlBuilder,
30
33
  createUrlBuilders2 as createUrlBuilders,
34
+ readBoundedBody2 as readBoundedBody,
31
35
  uploadInChunks2 as uploadInChunks
32
36
  };
@@ -13,6 +13,7 @@ export type { RealtimeClient, RealtimeClientOptions, SocketEventMap, SocketIOCli
13
13
  export { createRealtimeClient, createSocketIOClient } from '../browser/socket-io.js';
14
14
  export { createNDJSONDecoder, type NDJSONDecoder, type ParseNDJSONOptions, type ParseSSEOptions, parseNDJSON, parseSSE, type StreamByteSource, StreamLineLimitError, StreamTruncatedLineError, } from '../browser/stream.js';
15
15
  export { type Backoff, type BackoffPolicy, BackoffPolicySchema, createBackoff, } from '../internal/backoff.js';
16
+ export { type BoundedBodyOptions, readBoundedBody } from '../internal/bounded-body.js';
16
17
  export type { StitchLogger } from '../internal/logger.js';
17
18
  export { formatZodError, type ZodIssueSummary, zodIssues } from '../internal/zod-issues.js';
18
19
  export { childSpan, createTraceContext, formatTraceparent, parseTraceparent, type TraceContext, } from '../observability/trace.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entrypoints/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB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cAAc,EAAE,MAAM,qBAAqB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,KAAK,gBAAgB,EACrB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,KAAK,kBAAkB,EACvB,KAAK,wBAAwB,GAC9B,MAAM,gCAAgC,CAAC;AACxC,YAAY,EACV,cAAc,EACd,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAClF,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,WAAW,EACX,QAAQ,EACR,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,aAAa,EAClB,mBAAmB,EACnB,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,KAAK,kBAAkB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACpF,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAKvD,OAAO,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAGzF,OAAO,EACL,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -71,7 +71,7 @@ import {
71
71
  createUrlBuilder2,
72
72
  createUrlBuilders2,
73
73
  createScopedUrlBuilders2
74
- } from "../index-jk44mbqb.js";
74
+ } from "../index-c5at3ykd.js";
75
75
  import {
76
76
  createRetainedTopics2,
77
77
  createRealtimeClientWithPeer,
@@ -83,6 +83,9 @@ import {
83
83
  import {
84
84
  ApiError2
85
85
  } from "../index-kfjkb396.js";
86
+ import {
87
+ readBoundedBody2
88
+ } from "../index-5efrpfmj.js";
86
89
  import {
87
90
  sleep
88
91
  } from "../index-eemvahkc.js";
@@ -419,6 +422,7 @@ export {
419
422
  parseSSE2 as parseSSE,
420
423
  parseTraceparent2 as parseTraceparent,
421
424
  rateLimited2 as rateLimited,
425
+ readBoundedBody2 as readBoundedBody,
422
426
  resumableIterator,
423
427
  unauthorized2 as unauthorized,
424
428
  uploadInChunks2 as uploadInChunks,
@@ -11,6 +11,7 @@ export type { LogFormat } from '../server/logger.js';
11
11
  export { type NodeRuntimeServer, type NodeServerConfig, type NodeServerHandle, type NodeSocketLifecycle, serveNode, } from '../server/node.js';
12
12
  export { bindProcessSignals, type ProcessSignalName, type ProcessSignalsBinding, type ProcessSignalsErrorPhase, type ProcessSignalsOptions, type ShutdownTarget, type SignalSource, } from '../server/process-signals.js';
13
13
  export { bindRealtimeServer, type RealtimeServer, type RealtimeServerConnection, type RealtimeServerHandle, } from '../server/realtime.js';
14
+ export { defineRequestIngress, type RequestIngress, type RequestIngressSource, } from '../server/request-ingress.js';
14
15
  export { type ManagedServerHandle, type ShutdownOptions, ShutdownOptionsSchema, type ShutdownResult, ShutdownResultSchema, type ShutdownState, ShutdownStateSchema, type ShutdownStatus, ShutdownStatusSchema, } from '../server/shutdown.js';
15
16
  export { createNodeSocketIOServer as createSocketIOServer, type NodeSocketIOServerHandle as SocketIOServerHandle, type SocketIOHandshakeConfig, type SocketIOPeerLoaders, type SocketIORequestPolicy, type SocketIOServerConfig, } from '../server/socket-io-node.js';
16
17
  export type { EffectiveScope, FetchComposition, FetchHandler, HandlerConfig, LoggingConfig, LogOutcome, RawRoute, RawRouteContext, ScopeContexts, ScopedHandlers, ServiceDef, } from '../server/types.js';