stitchkit 0.44.0 → 0.44.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 (2) hide show
  1. package/llms-full.txt +34 -0
  2. package/package.json +1 -1
package/llms-full.txt CHANGED
@@ -4607,6 +4607,40 @@ stateless. `legacy: 'serve'` (default) lets the official SDK negotiate supported
4607
4607
  pre-2026 stateless clients on the same endpoint; `legacy: 'reject'` makes it
4608
4608
  modern-only. This is not a stateful compatibility transport.
4609
4609
 
4610
+ #### Output shape depends on the negotiated protocol era
4611
+
4612
+ Stitchkit always validates the handler result against the declared output
4613
+ schema. The negotiated MCP era determines only its wire representation:
4614
+
4615
+ | Negotiated era | Non-object `structuredContent` |
4616
+ |---|---|
4617
+ | MCP `2026-07-28` | the exact schema-valid JSON root: array, scalar or `null` |
4618
+ | supported legacy era | the official SDK codec adapts it to `{ result: value }` |
4619
+
4620
+ Object roots keep their object shape in both eras. Do not change every consumer
4621
+ expectation to the modern shape while `legacy: 'serve'` remains enabled. Pin
4622
+ both protocol versions in the consumer's transport E2E and assert the boundary
4623
+ explicitly:
4624
+
4625
+ ```ts
4626
+ await expectToolOutputForProtocol('2026-07-28', ['a', 'b'])
4627
+ await expectToolOutputForProtocol('2025-11-25', { result: ['a', 'b'] })
4628
+
4629
+ async function expectToolOutputForProtocol(
4630
+ protocolVersion: '2026-07-28' | '2025-11-25',
4631
+ expected: unknown,
4632
+ ) {
4633
+ const client = await connectConsumerMcpClient({ protocolVersion })
4634
+ const result = await client.callTool({ name: 'list_notes', arguments: {} })
4635
+ expect(result.structuredContent).toEqual(expected)
4636
+ await client.close()
4637
+ }
4638
+ ```
4639
+
4640
+ `connectConsumerMcpClient` represents the consumer's real HTTP or stdio setup;
4641
+ configure its official client with `versionNegotiation.mode.pin` so the test
4642
+ cannot silently negotiate a different era.
4643
+
4610
4644
  The stdio helper now returns an owned lifecycle handle:
4611
4645
 
4612
4646
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.44.0",
3
+ "version": "0.44.1",
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",