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.
- package/CHANGELOG.md +32 -0
- package/dist/agent-runtime/sandbox-broker.d.ts.map +1 -1
- package/dist/browser/stream.d.ts +3 -2
- package/dist/browser/stream.d.ts.map +1 -1
- package/dist/contract/runtime-context.d.ts +3 -1
- package/dist/contract/runtime-context.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/sandbox.js +13 -27
- package/dist/entrypoints/bin/upgrade-cli.d.ts.map +1 -1
- package/dist/entrypoints/bin/upgrade-cli.js +123 -29
- package/dist/entrypoints/cli/publish.js +1 -1
- package/dist/entrypoints/cli.js +2 -2
- package/dist/entrypoints/http.d.ts +2 -0
- package/dist/entrypoints/http.d.ts.map +1 -1
- package/dist/entrypoints/http.js +5 -1
- package/dist/entrypoints/index.d.ts +1 -0
- package/dist/entrypoints/index.d.ts.map +1 -1
- package/dist/entrypoints/index.js +5 -1
- package/dist/entrypoints/node.d.ts +1 -0
- package/dist/entrypoints/node.d.ts.map +1 -1
- package/dist/entrypoints/node.js +3 -1
- package/dist/entrypoints/observability.js +24 -9
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.d.ts +1 -0
- package/dist/entrypoints/server.d.ts.map +1 -1
- package/dist/entrypoints/server.js +24 -3
- package/dist/entrypoints/telegram.js +3 -3
- package/dist/entrypoints/testing.js +1 -1
- package/dist/entrypoints/tools/connections.js +16 -31
- package/dist/entrypoints/tools.js +39 -7
- package/dist/{index-jk44mbqb.js → index-1y0arq4z.js} +3 -57
- package/dist/index-cjbn98zt.js +68 -0
- package/dist/{index-s0xbnpfh.js → index-kdnfe0sr.js} +1 -1
- package/dist/{index-s6d8zsha.js → index-krng2a5j.js} +64 -110
- package/dist/index-qndsr7f0.js +55 -0
- package/dist/{index-n7hrpngg.js → index-syzngt7v.js} +1 -1
- package/dist/{index-3h0ztg0z.js → index-t65erk4z.js} +5 -21
- package/dist/internal/bounded-body.d.ts +44 -0
- package/dist/internal/bounded-body.d.ts.map +1 -0
- package/dist/internal/bounded-lines.d.ts +1 -2
- package/dist/internal/bounded-lines.d.ts.map +1 -1
- package/dist/internal/secure-fetch.d.ts.map +1 -1
- package/dist/internal/stream-chunks.d.ts +13 -0
- package/dist/internal/stream-chunks.d.ts.map +1 -0
- package/dist/internal/upgrade-affects.d.ts +5 -0
- package/dist/internal/upgrade-affects.d.ts.map +1 -1
- package/dist/internal/upgrade-plan.d.ts +18 -3
- package/dist/internal/upgrade-plan.d.ts.map +1 -1
- package/dist/internal/upgrade-usage.d.ts +21 -5
- package/dist/internal/upgrade-usage.d.ts.map +1 -1
- package/dist/observability/audit.d.ts +10 -0
- package/dist/observability/audit.d.ts.map +1 -1
- package/dist/observability/event.d.ts +5 -0
- package/dist/observability/event.d.ts.map +1 -1
- package/dist/server/multipart.d.ts.map +1 -1
- package/dist/server/oauth/endpoints.d.ts.map +1 -1
- package/dist/server/oauth/provider.d.ts +5 -0
- package/dist/server/oauth/provider.d.ts.map +1 -1
- package/dist/server/raw.d.ts +6 -3
- package/dist/server/raw.d.ts.map +1 -1
- package/dist/server/request-body.d.ts.map +1 -1
- package/dist/server/request-completion.d.ts.map +1 -1
- package/dist/server/request-ingress.d.ts +31 -0
- package/dist/server/request-ingress.d.ts.map +1 -0
- package/dist/server/unix-client-body.d.ts.map +1 -1
- package/dist/tools/connections/limits.d.ts.map +1 -1
- package/llms/http.txt +3 -0
- package/llms/observability.txt +19 -2
- package/llms/server.2.txt +4 -0
- package/llms/server.5.txt +2 -1
- package/llms/server.txt +42 -0
- package/llms/stitchkit.2.txt +28 -0
- package/llms/stitchkit.txt +3 -3
- package/llms/tools.3.txt +1 -1
- package/llms/tools.txt +4 -0
- package/llms/{upgrading-0.101.0-0.110.0.txt → upgrading-0.101.0-0.111.0.txt} +29 -3
- package/llms/upgrading.txt +8 -2
- package/llms-full.txt +136 -8
- package/llms.txt +6 -6
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../src/observability/event.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE5C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,mCAAmC;IACnC,MAAM,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2EAA2E;IAC3E,SAAS,CAAC,EAAE,WAAW,GAAG,aAAa,CAAC;IACxC,6EAA6E;IAC7E,GAAG,CAAC,EAAE,cAAc,CAAC;IACrB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,EAAE,EAAE,OAAO,CAAC;IACZ;;;OAGG;IACH,OAAO,CAAC,EAAE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AAM,CAAC;IACtB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,iBAAiB;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../src/server/multipart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAuB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"multipart.d.ts","sourceRoot":"","sources":["../../src/server/multipart.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAuB,MAAM,0BAA0B,CAAC;AASzF,OAAO,KAAK,EAAE,iBAAiB,EAA2B,MAAM,SAAS,CAAC;AAK1E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,kFAAkF;AAClF,MAAM,WAAW,eAAgB,SAAQ,kBAAkB;IACzD,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC;CACjB;AAqFD;;;GAGG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,OAAO,EACZ,UAAU,EAAE,mBAAmB,EAC/B,YAAY,CAAC,EAAE;IAAE,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAA;CAAE,EACjD,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,GAC5C,OAAO,CAAC,eAAe,CAAC,CAoH1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/server/oauth/endpoints.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"endpoints.d.ts","sourceRoot":"","sources":["../../../src/server/oauth/endpoints.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAOzC,OAAO,KAAK,EAGV,6BAA6B,EAC7B,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,wCAAwC;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;QAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;QAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;KACxB,CAAC;IACF,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,6BAA6B,CAAC,KAAK,CAAC,CAAC,GAAG,SAAS,CAAC;IACpF,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IAClE,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC;IACxE,gBAAgB,CACd,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,CAAC;CACpB;AAiCD;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAIlF;AAmDD,gEAAgE;AAChE,wBAAgB,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,QAAQ,CA8BjE;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,GAAG,EAAE,oBAAoB,GAAG,QAAQ,CA+EjE;AAED,6FAA6F;AAC7F,wBAAgB,cAAc,CAAC,GAAG,EAAE,oBAAoB,GAAG,QAAQ,CAiIlE;AAED,kFAAkF;AAClF,wBAAgB,UAAU,CAAC,GAAG,EAAE,oBAAoB,GAAG,QAAQ,CAmG9D"}
|
|
@@ -85,6 +85,11 @@ export interface OAuthProviderConfig {
|
|
|
85
85
|
scopesSupported?: string[];
|
|
86
86
|
/** Path prefix for the OAuth endpoints. Default `/oauth`. */
|
|
87
87
|
basePath?: string;
|
|
88
|
+
/**
|
|
89
|
+
* The most bytes `/token` and `/register` read of a request body, a positive safe integer; a
|
|
90
|
+
* larger body is answered `413` with `invalid_request`. Default 64 KiB.
|
|
91
|
+
*/
|
|
92
|
+
maxRequestBodyBytes?: number;
|
|
88
93
|
/** Client discovery policy. Default: CIMD enabled, DCR disabled. */
|
|
89
94
|
clientRegistration?: OAuthClientRegistrationConfig;
|
|
90
95
|
/** Single-use authorization-code store. `take` must atomically read+delete. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/server/oauth/provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../../src/server/oauth/provider.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAG/B,MAAM,QAAQ,CAAC;AAYhB;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ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IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAAC;KAClD,CAAC;IACF,uEAAuE;IACvE,aAAa,CAAC,EAAE;QACd,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;KAClD,CAAC;IAEF;;;;OAIG;IACH,aAAa,CACX,GAAG,EAAE,OAAO,EACZ,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAA;KAAE,GAAG,QAAQ,CAAC,CAAC;CAC9E;AAMD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,mBAAmB,GAAG,QAAQ,EAAE,CA6E1E"}
|
package/dist/server/raw.d.ts
CHANGED
|
@@ -18,8 +18,9 @@ export declare function respondJson(data: unknown): Response;
|
|
|
18
18
|
export declare function errorResponse(error: unknown): Response;
|
|
19
19
|
/**
|
|
20
20
|
* Parse and validate a JSON request body. Returns the typed value, or `null` for
|
|
21
|
-
* a non-JSON
|
|
22
|
-
* response). The
|
|
21
|
+
* a non-JSON, schema-invalid or too large body (never throws — the caller decides the
|
|
22
|
+
* error response). The body is read up to `options.maxBytes` (1 MiB by default, a positive
|
|
23
|
+
* safe integer — anything else throws, since a silent no-limit is worse) and not a byte further. The error helpers (`badRequest`, …) **throw**, so raise one inside a
|
|
23
24
|
* `try` and render it in the `catch` with `errorResponse(err)`:
|
|
24
25
|
*
|
|
25
26
|
* ```ts
|
|
@@ -32,5 +33,7 @@ export declare function errorResponse(error: unknown): Response;
|
|
|
32
33
|
* }
|
|
33
34
|
* ```
|
|
34
35
|
*/
|
|
35
|
-
export declare function parseBody<T>(req: Request, schema: ZodType<T
|
|
36
|
+
export declare function parseBody<T>(req: Request, schema: ZodType<T>, options?: {
|
|
37
|
+
maxBytes?: number;
|
|
38
|
+
}): Promise<T | null>;
|
|
36
39
|
//# sourceMappingURL=raw.d.ts.map
|
package/dist/server/raw.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/server/raw.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"raw.d.ts","sourceRoot":"","sources":["../../src/server/raw.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAMnC,kFAAkF;AAClF,wBAAgB,WAAW,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ,CAGnD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAMtD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,EAClB,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAClC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAMnB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-body.d.ts","sourceRoot":"","sources":["../../src/server/request-body.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-body.d.ts","sourceRoot":"","sources":["../../src/server/request-body.ts"],"names":[],"mappings":"AAKA,6FAA6F;AAC7F,wBAAsB,eAAe,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAWtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-completion.d.ts","sourceRoot":"","sources":["../../src/server/request-completion.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"request-completion.d.ts","sourceRoot":"","sources":["../../src/server/request-completion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA2CrE,gEAAgE;AAChE,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,OAAO,EAC3C,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,EAC5B,MAAM,EAAE,aAAa,GACpB,eAAe,CAoFjB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** What a context hands back about its request: the `Request` the handler of the core received. */
|
|
2
|
+
export interface RequestIngressSource {
|
|
3
|
+
readonly req?: Request | undefined;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A typed channel for facts about a request that the request itself cannot carry: the code that
|
|
7
|
+
* built the `Request` (a local socket ingress, a relay, a test harness) attaches a value, and the
|
|
8
|
+
* endpoint reads it from its context.
|
|
9
|
+
*
|
|
10
|
+
* Nothing on the wire reaches it. A header, a body, `clone()` and `new Request(request)` are other
|
|
11
|
+
* channels or other objects, so a request from another ingress simply has no value. Only the code
|
|
12
|
+
* that holds the key can attach or read; two keys never meet, even with the same name.
|
|
13
|
+
*/
|
|
14
|
+
export interface RequestIngress<T> {
|
|
15
|
+
/** For messages only; the key is its own identity. */
|
|
16
|
+
readonly name: string;
|
|
17
|
+
/**
|
|
18
|
+
* Attach `value` to `request` before it is handed to the fetch handler of the core. A request
|
|
19
|
+
* carries one value per key: a second `attach` is refused, never merged or replaced.
|
|
20
|
+
*/
|
|
21
|
+
attach(request: Request, value: T): void;
|
|
22
|
+
/**
|
|
23
|
+
* The value attached to the request behind `source`, or `undefined` when there is none — in an
|
|
24
|
+
* endpoint handler, `authorize`, `beforeHandle` and `onError` (`ctx` is the source). `ctx.req`
|
|
25
|
+
* is the `Request` the handler of the core received, which is what makes this lookup sound.
|
|
26
|
+
*/
|
|
27
|
+
from(source: RequestIngressSource): T | undefined;
|
|
28
|
+
}
|
|
29
|
+
/** Define a key for request attributes an ingress attaches and an endpoint reads. */
|
|
30
|
+
export declare function defineRequestIngress<T>(name: string): RequestIngress<T>;
|
|
31
|
+
//# sourceMappingURL=request-ingress.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-ingress.d.ts","sourceRoot":"","sources":["../../src/server/request-ingress.ts"],"names":[],"mappings":"AAAA,mGAAmG;AACnG,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;CACpC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC;IAC/B,sDAAsD;IACtD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;OAGG;IACH,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IACzC;;;;OAIG;IACH,IAAI,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,GAAG,SAAS,CAAC;CACnD;AAED,qFAAqF;AACrF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,CAgBvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unix-client-body.d.ts","sourceRoot":"","sources":["../../src/server/unix-client-body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"unix-client-body.d.ts","sourceRoot":"","sources":["../../src/server/unix-client-body.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAIjD,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAejC;AAED,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,MAAM,EAAE,MAAM,IAAI,GACjB,cAAc,CAAC,UAAU,CAAC,CAsE5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/limits.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../../src/tools/connections/limits.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,gFAAgF;AAChF,eAAO,MAAM,6BAA6B,QAAS,CAAC;AACpD,eAAO,MAAM,0BAA0B,QAAc,CAAC;AAEtD,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAMrE;AAED,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAI5E;AAED,8FAA8F;AAC9F,wBAAgB,eAAe,CAAC,CAAC,EAC/B,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,EACnB,MAAM,EAAE,WAAW,GAAG,SAAS,GAC9B,OAAO,CAAC,CAAC,CAAC,CAEZ;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,qBAAqB,EAC9B,YAAY,EAAE,WAAW,GAAG,SAAS,EACrC,IAAI,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,OAAO,CAAC,CAAC,CAAC,GAClD,OAAO,CAAC,CAAC,CAAC,CAYZ;AAED,4EAA4E;AAC5E,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,gFAAgF;AAChF,wBAAsB,uBAAuB,CAC3C,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,MAAM,CAAC,CAejB"}
|
package/llms/http.txt
CHANGED
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
|
|
6
6
|
Contains: API reference: `stitchkit/http` (docs/api/reference.md)
|
|
7
7
|
|
|
8
|
+
Also read:
|
|
9
|
+
- see `llms/stitchkit.txt` for the Typed client guide
|
|
10
|
+
|
|
8
11
|
==============================================================================
|
|
9
12
|
# API reference: `stitchkit/http` (docs/api/reference.md)
|
|
10
13
|
==============================================================================
|
package/llms/observability.txt
CHANGED
|
@@ -266,7 +266,7 @@ queryable across all three:
|
|
|
266
266
|
| `ok` / `statusCode` | legacy success bit plus real HTTP status, or `200`/`400` for a tool; an opted-in cancellation is `false` / `499`. `statusCode` is **absent** on a job — it had no transport to have a status on, and inventing one would be the same defect as the `method: 'AGENT'` this replaced. A job's outcome is `ok`, plus `errorCode` when it failed |
|
|
267
267
|
| `durationMs` / `startedAt` | timing |
|
|
268
268
|
| `errorCode` / `errorMessage` / `errorDetail` | failures only — `errorDetail` carries the structure the message flattens (e.g. Zod issues) |
|
|
269
|
-
| `payload` | sanitised tool arguments; HTTP is `null` unless request `includePayload` is enabled |
|
|
269
|
+
| `payload` | sanitised tool arguments; HTTP is `null` unless request `includePayload` is enabled, or when the body was larger than `payloadMaxBytes` (then `payloadTruncated: true`) |
|
|
270
270
|
| `resultSize` / `responseBytes` | result item count + serialised size |
|
|
271
271
|
| `userId` / `ipAddress` / `userAgent` | identity |
|
|
272
272
|
|
|
@@ -638,6 +638,23 @@ createObservability({
|
|
|
638
638
|
`redact`, `truncatePreview` and `measureSize` are exported on their own if you
|
|
639
639
|
need to sanitise something outside the audit path.
|
|
640
640
|
|
|
641
|
+
### How much of a body the audit row reads
|
|
642
|
+
|
|
643
|
+
With `includePayload: true` the row reads a clone of the request body, and it reads at most
|
|
644
|
+
`payloadMaxBytes` of it. Unset, the limit is the handler's `maxJsonBodyBytes`, or 1 MiB when the
|
|
645
|
+
handler has none, so one number bounds both. The clone is taken when the request opens, before
|
|
646
|
+
a route is matched, so an endpoint's own `maxJsonBodyBytes` is not known to it: set
|
|
647
|
+
`payloadMaxBytes` when endpoints accept more than the handler default. A body that is larger
|
|
648
|
+
is cancelled at the limit, its `payload` is `null`, and the row carries `payloadTruncated: true` — a `null` payload with that flag
|
|
649
|
+
means "too large to record", not "no body". Set `payloadMaxBytes` (a positive integer) to record
|
|
650
|
+
more or less than the handler accepts:
|
|
651
|
+
|
|
652
|
+
```ts
|
|
653
|
+
createObservability({
|
|
654
|
+
request: { write, includePayload: true, payloadMaxBytes: 256 * 1024 },
|
|
655
|
+
})
|
|
656
|
+
```
|
|
657
|
+
|
|
641
658
|
## The raw hooks
|
|
642
659
|
|
|
643
660
|
Tool observability is built on hooks you can also use directly — for a one-off
|
|
@@ -887,7 +904,7 @@ audit event. See the [Observability guide](../guide/observability.md).
|
|
|
887
904
|
| `ObservabilityDrainReport` | _type_ | final closed/drained snapshot, `durationMs` (the shared drain's age, not this call's wait), and `drained` — read from the counters, `false` only when `total.pending + total.preparing` is nonzero |
|
|
888
905
|
| `ObservabilitySinkStatusSchema` / `ObservabilityStatusSchema` / `ObservabilityDrainReportSchema` | schema | runtime schemas for status/report integration boundaries |
|
|
889
906
|
| `RequestEventSinkConfig` | _type_ | `write`, filter/sanitisation, `maxPending`, `onSinkError` and `onDrop` |
|
|
890
|
-
| `RequestObservabilityConfig` | _type_ | request sink plus opt-in payload capture and default-off `includeCancelled` rows |
|
|
907
|
+
| `RequestObservabilityConfig` | _type_ | request sink plus opt-in payload capture (`payloadMaxBytes` bounds the body read, `payloadTruncated` marks a cut one) and default-off `includeCancelled` rows |
|
|
891
908
|
| `SinkDropReason` | _type_ | `'capacity' \| 'closed'` |
|
|
892
909
|
| `SinkError` | _type_ | isolated sink/projection failure and optional event |
|
|
893
910
|
| `SinkDrop` | _type_ | rejected event, reason and current pending count |
|
package/llms/server.2.txt
CHANGED
|
@@ -85,6 +85,10 @@ handler: async (req) => {
|
|
|
85
85
|
}
|
|
86
86
|
```
|
|
87
87
|
|
|
88
|
+
`parseBody` reads the body up to `{ maxBytes }` — 1 MiB when you pass none, as the third
|
|
89
|
+
argument — and returns `null` for a larger one without reading further, so a raw route
|
|
90
|
+
never holds an unbounded body in memory.
|
|
91
|
+
|
|
88
92
|
The error helpers (`badRequest`, `notFound`, …) **throw** an `AppError`, so raise
|
|
89
93
|
them inside the `try` and let `errorResponse(err)` render it — that runs any
|
|
90
94
|
thrown value through the framework's `normalizeError`, so a raw route returns the
|
package/llms/server.5.txt
CHANGED
|
@@ -62,9 +62,10 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
62
62
|
| `formatZodError` | function | a `ZodError` → a readable, field-summarised string |
|
|
63
63
|
| `zodIssues` | function | a `ZodError` → structured `{ path, code, message }[]` — the machine-readable sibling of `formatZodError` |
|
|
64
64
|
| `ZodIssueSummary` | _type_ | one structured validation issue (`{ path, code, message }`) |
|
|
65
|
-
| `parseBody` | function | parse + Zod-validate a JSON body → `data` or `null` (no throw) |
|
|
65
|
+
| `parseBody` | function | parse + Zod-validate a JSON body → `data` or `null` (no throw); reads at most `options.maxBytes` (1 MiB by default) and is `null` for a larger body |
|
|
66
66
|
| `HandlerConfig` | _type_ | config for `createHandler`, including optional `maxJsonBodyBytes`; bound to `BunServer` on this entrypoint |
|
|
67
67
|
| `BunServerConfig` | _type_ | config for `createServer` (Bun); `unix` listens on a unix domain socket (mutually exclusive with `port`/`hostname`) — [details](../guide/server.md#local-daemon-over-a-unix-socket) |
|
|
68
|
+
| `defineRequestIngress` / `RequestIngress` / `RequestIngressSource` | function / _type_ | a typed key the code that builds a `Request` attaches a value to (`attach(request, value)`) and an endpoint, `authorize`, `beforeHandle` or `onError` reads from its `ctx` (`from(ctx)`); a header, `clone()` and `new Request(request)` carry nothing, a second `attach` is refused, and `ctx.req` is the very request the handler received — [guide](../guide/server.md#request-attributes-from-the-ingress) |
|
|
68
69
|
| `ProxyOriginConfig` | _type_ | explicit real-peer trust for Bun `createServer({ proxyOrigin })`; strict external-scheme normalization before composition — [details](../guide/server.md#external-origin-behind-a-trusted-proxy) |
|
|
69
70
|
| `UnixListenConfig` | _type_ | unix listener — a socket path, or `{ path, mode }` to tighten the file mode after listen |
|
|
70
71
|
| `BunServerHandle` | _type_ | managed Bun handle (`url`, `port`, `runtime`, `status`, `shutdown`) |
|
package/llms/server.txt
CHANGED
|
@@ -61,6 +61,48 @@ Every handler receives one `ctx` argument:
|
|
|
61
61
|
The same handler runs for HTTP, MCP and agent calls — `ctx.source` tells you
|
|
62
62
|
which. Anything an auth hook attaches (e.g. the resolved user) is also on `ctx`.
|
|
63
63
|
|
|
64
|
+
### Request attributes from the ingress
|
|
65
|
+
|
|
66
|
+
When your own code builds the `Request` — a local socket ingress, a relay, a test harness —
|
|
67
|
+
and calls the fetch handler of the core, it often knows something an endpoint needs and the
|
|
68
|
+
request cannot be allowed to say for itself: which authenticated peer sent it. A header can be
|
|
69
|
+
forged by any client. `defineRequestIngress` is the channel the request cannot carry:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { createHandler, defineRequestIngress, implement } from 'stitchkit/server'
|
|
73
|
+
|
|
74
|
+
interface Peer {
|
|
75
|
+
node: string
|
|
76
|
+
}
|
|
77
|
+
export const peer = defineRequestIngress<Peer>('peer')
|
|
78
|
+
|
|
79
|
+
// The ingress, after it has authenticated the peer and built the request:
|
|
80
|
+
peer.attach(request, { node: 'node-7' })
|
|
81
|
+
const response = await handler(request)
|
|
82
|
+
|
|
83
|
+
// An endpoint, `authorize`, `beforeHandle` or `onError` — `ctx` is the source:
|
|
84
|
+
implement(contract, {
|
|
85
|
+
place: (ctx) => ({ node: peer.from(ctx)?.node ?? null }),
|
|
86
|
+
})
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- The value belongs to the key. A header, a body, `request.clone()` and `new Request(request)`
|
|
90
|
+
carry nothing; a request from another ingress has no value, and `from` answers `undefined`.
|
|
91
|
+
Two keys never meet, even under one name, and a second `attach` of the same key to the same
|
|
92
|
+
request is an error.
|
|
93
|
+
- `ctx.req` is the `Request` the fetch handler of the core received, on every HTTP context: an
|
|
94
|
+
endpoint, `authorize`, `beforeHandle`, and the `onError` context of a validation failure, an
|
|
95
|
+
unknown path, a refused method or an `onRequest` that threw. That is the guarantee the lookup
|
|
96
|
+
stands on, and the ingress tests hold it.
|
|
97
|
+
- A raw route, `streamingRoute` and `onRequest` receive the request without a context: read with
|
|
98
|
+
`peer.from({ req })`. The MCP, agent and CLI lanes carry no `Request`, so there is nothing to
|
|
99
|
+
read.
|
|
100
|
+
- With `proxyOrigin` configured, the request is replaced before `wrapFetch`: attach in
|
|
101
|
+
`wrapFetch` or later, to the request you are handed.
|
|
102
|
+
- A Socket.IO handshake is routed before `wrapFetch` on Bun and rebuilt as a new `Request` on
|
|
103
|
+
Node: it never carries an attached value.
|
|
104
|
+
- `stitchkit/node` exports the same names.
|
|
105
|
+
|
|
64
106
|
### `createImplement` — a fixed context type
|
|
65
107
|
|
|
66
108
|
To type `ctx` with your app's extras (the user an auth hook injects), fix the
|
package/llms/stitchkit.2.txt
CHANGED
|
@@ -398,6 +398,33 @@ that ends inside a line throws `StreamTruncatedLineError` (`lineBytes`) instead
|
|
|
398
398
|
fragment as a value — the right policy for a socket or a child process, where a missing newline
|
|
399
399
|
means the writer died. Both errors extend the `RangeError` / `SyntaxError` they replace.
|
|
400
400
|
|
|
401
|
+
## Reading a body up to a byte limit
|
|
402
|
+
|
|
403
|
+
`readBoundedBody` (from `stitchkit` or `stitchkit/http`) reads a request or response body, a
|
|
404
|
+
`ReadableStream<Uint8Array>` or any `AsyncIterable<Uint8Array>`, and never reads past
|
|
405
|
+
`maxBytes` plus one chunk. Whoever owns the boundary picks the two errors, so a body that is too
|
|
406
|
+
large and a read that was cancelled stay different outcomes:
|
|
407
|
+
|
|
408
|
+
```ts
|
|
409
|
+
import { readBoundedBody } from 'stitchkit'
|
|
410
|
+
|
|
411
|
+
const bytes = await readBoundedBody(request.body, {
|
|
412
|
+
maxBytes: 64 * 1024,
|
|
413
|
+
signal: request.signal,
|
|
414
|
+
limitError: (observedBytes) => new PayloadTooLarge(observedBytes),
|
|
415
|
+
abortError: (reason) => new ClientGone({ cause: reason }),
|
|
416
|
+
})
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
- The source is cancelled when the limit is crossed and when `signal` aborts. A read that never
|
|
420
|
+
settles does not hold the call after an abort, and an abort is honoured before the first read
|
|
421
|
+
(even for a `null` body).
|
|
422
|
+
- A body of exactly `maxBytes` is read; one more byte calls `limitError` with the bytes seen so far
|
|
423
|
+
(the chunk that crossed the limit included).
|
|
424
|
+
- A `null` body, such as a request without one, is an empty result.
|
|
425
|
+
- Without `abortError` the signal's own reason is thrown.
|
|
426
|
+
- `maxBytes` is a positive safe integer.
|
|
427
|
+
|
|
401
428
|
## Resumable streams
|
|
402
429
|
|
|
403
430
|
A stream that survives a dropped connection needs four things beyond opening it:
|
|
@@ -554,6 +581,7 @@ The browser-and-server entrypoint. Re-exports everything from
|
|
|
554
581
|
| `parseSSE` | function | parse SSE from a `Response`, a web stream or an async byte iterable into an async generator — [guide](../guide/client.md#sse) |
|
|
555
582
|
| `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) |
|
|
556
583
|
| `createNDJSONDecoder` / `NDJSONDecoder` | function / _type_ | the same bounded NDJSON reading driven by `push(chunk)` / `end()`, for a socket `data` callback |
|
|
584
|
+
| `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) |
|
|
557
585
|
| `StreamByteSource` | _type_ | `Response \| ReadableStream<Uint8Array> \| AsyncIterable<Uint8Array>`, what the NDJSON and SSE readers accept |
|
|
558
586
|
| `StreamLineLimitError` / `StreamTruncatedLineError` | class | a line past `maxLineBytes` (`limitBytes`, `lineBytes`; a `RangeError`) and a source ended inside a line under `require-newline` (`lineBytes`; a `SyntaxError`) |
|
|
559
587
|
| `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) |
|
package/llms/stitchkit.txt
CHANGED
|
@@ -85,12 +85,12 @@ own, recorded as an ADR.
|
|
|
85
85
|
| `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
|
|
86
86
|
| `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
|
|
87
87
|
| `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
|
|
88
|
-
| `stitchkit/observability` | server | stable<br>_redefined in 2 of the
|
|
88
|
+
| `stitchkit/observability` | server | stable<br>_redefined in 2 of the 56 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
|
|
89
89
|
| `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
|
|
90
90
|
| `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
|
|
91
91
|
| `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
|
|
92
92
|
| `stitchkit/react/keyboard` | browser | evolving | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
|
|
93
|
-
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the
|
|
93
|
+
| `stitchkit/agent-runtime` | server | evolving<br>_redefined in 23 of the 56 minors since 0.56.2, most recently 0.105.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
|
|
94
94
|
| `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
|
|
95
95
|
| `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
|
|
96
96
|
| `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
|
|
@@ -102,7 +102,7 @@ own, recorded as an ADR.
|
|
|
102
102
|
| `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
|
|
103
103
|
| `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
|
|
104
104
|
| `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
|
|
105
|
-
| `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the
|
|
105
|
+
| `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 56 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
|
|
106
106
|
| `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
|
|
107
107
|
| `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
|
|
108
108
|
| `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
|
package/llms/tools.3.txt
CHANGED
|
@@ -196,7 +196,7 @@ A native remote-connector auth surface for MCP — [guide](../guide/mcp-and-agen
|
|
|
196
196
|
| `protectedResourceMetadataUrl` | function | build the metadata URL for a resource |
|
|
197
197
|
| `wwwAuthenticateHeader` | function | build the `WWW-Authenticate` challenge header |
|
|
198
198
|
| `PROTECTED_RESOURCE_PATH` | const | the well-known metadata path |
|
|
199
|
-
| `OAuthProviderConfig` | _type_ | config for `mountOAuthProvider` |
|
|
199
|
+
| `OAuthProviderConfig` | _type_ | config for `mountOAuthProvider`; `maxRequestBodyBytes` bounds the `/token` and `/register` bodies (64 KiB by default) |
|
|
200
200
|
| `ProtectedResourceConfig` | _type_ | config for `oauthProtectedResourceRoute` |
|
|
201
201
|
| `ApplicationType` | _type_ | DCR `application_type` — `'native'` (loopback allowed) \| `'web'` (https only) |
|
|
202
202
|
| `AuthCodeData` | _type_ | a stored authorization-code record |
|
package/llms/tools.txt
CHANGED
|
@@ -926,6 +926,10 @@ default; DCR is off unless `clientRegistration.dcr` supplies both `register` and
|
|
|
926
926
|
exactly equals its URL, explicit redirect URIs and
|
|
927
927
|
`token_endpoint_auth_method: 'none'`.
|
|
928
928
|
|
|
929
|
+
The token endpoint and `/register` read at most 64 KiB of a request body, or
|
|
930
|
+
`maxRequestBodyBytes` when you set it; a larger one is answered `413` with
|
|
931
|
+
`invalid_request` and the rest is not read.
|
|
932
|
+
|
|
929
933
|
The production fetcher rejects credentials, fragments, non-HTTPS URLs and
|
|
930
934
|
private/reserved targets. Every redirect is DNS-resolved and IP-pinned again;
|
|
931
935
|
timeouts, redirect count and body size are bounded. Its bounded cache respects
|
|
@@ -1,14 +1,40 @@
|
|
|
1
|
-
# Upgrading 0.101.0 → 0.
|
|
1
|
+
# Upgrading 0.101.0 → 0.111.0 — stitchkit docs slice
|
|
2
2
|
|
|
3
3
|
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
4
|
> `llms.txt` in this package.
|
|
5
5
|
|
|
6
|
-
Contains: Guide: Upgrading, 0.101.0 → 0.
|
|
6
|
+
Contains: Guide: Upgrading, 0.101.0 → 0.111.0 (docs/guide/upgrading.md)
|
|
7
7
|
|
|
8
8
|
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.101.0 → 0.
|
|
9
|
+
# Guide: Upgrading, 0.101.0 → 0.111.0 (docs/guide/upgrading.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
+
## Released migration: 0.111.0
|
|
13
|
+
|
|
14
|
+
**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.
|
|
15
|
+
|
|
16
|
+
### Bounded raw and OAuth bodies
|
|
17
|
+
|
|
18
|
+
`parseBody` reads at most 1 MiB and returns `null` for a larger body, where it used to read any size. A route that takes larger JSON states its limit:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
// before
|
|
22
|
+
const body = await parseBody(req, Schema)
|
|
23
|
+
// after
|
|
24
|
+
const body = await parseBody(req, Schema, { maxBytes: 8 * 1024 * 1024 })
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`mountOAuthProvider` reads at most 64 KiB of a `/token` or `/register` body and answers `413` with `invalid_request` for a larger one. A deployment whose clients register larger metadata raises the limit:
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
// before
|
|
31
|
+
mountOAuthProvider({ issuer, signingSecret, resource, codes, authorizeUser })
|
|
32
|
+
// after
|
|
33
|
+
mountOAuthProvider({ issuer, signingSecret, resource, codes, authorizeUser, maxRequestBodyBytes: 256 * 1024 })
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Both limits must be a positive safe integer; anything else is refused when the route is built or called.
|
|
37
|
+
|
|
12
38
|
## Released migration: 0.110.0
|
|
13
39
|
|
|
14
40
|
### Interrupted process drains
|
package/llms/upgrading.txt
CHANGED
|
@@ -11,7 +11,7 @@ Contains: Guide: Upgrading, general (docs/guide/upgrading.md)
|
|
|
11
11
|
|
|
12
12
|
Load this slice, then every range slice between your installed version and the target:
|
|
13
13
|
|
|
14
|
-
- 0.101.0 → 0.
|
|
14
|
+
- 0.101.0 → 0.111.0: `llms/upgrading-0.101.0-0.111.0.txt`
|
|
15
15
|
- 0.74.0 → 0.100.0: `llms/upgrading-0.74.0-0.100.0.txt`
|
|
16
16
|
- 0.61.0 → 0.73.0: `llms/upgrading-0.61.0-0.73.0.txt`
|
|
17
17
|
- 0.44.0 → 0.60.0: `llms/upgrading-0.44.0-0.60.0.txt`
|
|
@@ -36,7 +36,7 @@ Run it inside the project that depends on stitchkit. It reads your installed
|
|
|
36
36
|
version out of `node_modules`, reads the changelog **shipped inside the
|
|
37
37
|
package**, and prints every breaking section your range crosses, oldest first,
|
|
38
38
|
each with its **Who must act** line — the list this guide's migrations expand
|
|
39
|
-
on. Nothing to clone, nothing to be told: `--from` / `--to` override either end
|
|
39
|
+
on — and then the fixes of that range that name what they touch. Nothing to clone, nothing to be told: `--from` / `--to` override either end
|
|
40
40
|
of the range if you want a different one.
|
|
41
41
|
|
|
42
42
|
So upgrading is: read the `### ⚠️ Breaking changes` of every version *above* your
|
|
@@ -67,6 +67,12 @@ beside a `package.json`, which is build output) and gives each item one verdict:
|
|
|
67
67
|
- **not declared — check by hand** — an item from before the line existed, with the files that
|
|
68
68
|
import the entrypoints it leads with.
|
|
69
69
|
|
|
70
|
+
A fix that names what it touches gets the same verdicts. Since 0.110.7 every `### Fixed` item that
|
|
71
|
+
leads with an entrypoint carries the `**Affects:**` line, and `upgrade` prints them in a second
|
|
72
|
+
section, **Fixes that touch this project** (`fixes` in `--json`): a fix to `runNativeCommand` is
|
|
73
|
+
listed with the `path:line` that imports it, or as *not used here*. Fixes of earlier releases that
|
|
74
|
+
carry no line are not judged; one line counts them (`fixesWithoutAffects` in `--json`).
|
|
75
|
+
|
|
70
76
|
`--json` prints the same verdicts per item for a CI step. The scan reads static `import` and
|
|
71
77
|
`export … from` declarations, bare imports and `import()` / `require()` of a literal specifier; a
|
|
72
78
|
specifier built at run time is invisible to it, and so is a file of another kind (`.astro`,
|