stitchkit 0.113.3 → 0.114.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.
- package/CHANGELOG.md +42 -0
- package/README.md +1 -1
- package/dist/browser/client-url.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +1 -1
- package/dist/entrypoints/agent-runtime/harness.js +4 -4
- package/dist/entrypoints/agent-runtime/realtime.js +2 -2
- package/dist/entrypoints/agent-runtime/sandbox.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/node.js +3 -3
- package/dist/entrypoints/agent-runtime/testing.js +4 -4
- package/dist/entrypoints/agent-runtime.js +12 -12
- package/dist/entrypoints/application/directory-inbox.js +3 -3
- package/dist/entrypoints/application.js +4 -4
- package/dist/entrypoints/cli/publish.js +1 -1
- package/dist/entrypoints/cli.js +4 -4
- package/dist/entrypoints/contract.js +2 -2
- package/dist/entrypoints/http.js +2 -2
- package/dist/entrypoints/index.js +5 -5
- package/dist/entrypoints/node.js +3 -3
- package/dist/entrypoints/observability.js +3 -3
- package/dist/entrypoints/react/keyboard/testing.d.ts +2 -0
- package/dist/entrypoints/react/keyboard/testing.d.ts.map +1 -0
- package/dist/entrypoints/react/keyboard/testing.js +127 -0
- package/dist/entrypoints/react/keyboard.d.ts +4 -2
- package/dist/entrypoints/react/keyboard.d.ts.map +1 -1
- package/dist/entrypoints/react/keyboard.js +83 -319
- package/dist/entrypoints/react.js +15 -3
- package/dist/entrypoints/realtime.js +1 -1
- package/dist/entrypoints/remote.js +1 -1
- package/dist/entrypoints/server.js +18 -18
- package/dist/entrypoints/telegram/grammy.d.ts +2 -0
- package/dist/entrypoints/telegram/grammy.d.ts.map +1 -0
- package/dist/entrypoints/telegram/grammy.js +50 -0
- package/dist/entrypoints/telegram/screens.js +1 -1
- package/dist/entrypoints/telegram.d.ts +1 -0
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +254 -8
- package/dist/entrypoints/testing.js +3 -3
- package/dist/entrypoints/tools/connections.js +10 -10
- package/dist/entrypoints/tools.js +19 -19
- package/dist/entrypoints/tracking.js +1 -1
- package/dist/{index-xvj9h8yh.js → index-61hve0ez.js} +15 -28
- package/dist/index-6j725ez5.js +25 -0
- package/dist/{index-1csp1hwm.js → index-6p3frkv5.js} +1 -1
- package/dist/{index-fy4av0hq.js → index-9bwcthxw.js} +1 -1
- package/dist/{index-523tq7y4.js → index-a3462dqf.js} +1 -1
- package/dist/{index-506kd458.js → index-aw6zahv1.js} +1 -1
- package/dist/{index-tpwbct8j.js → index-dc9ere5p.js} +1 -1
- package/dist/{index-erv5shjq.js → index-kdnfe0sr.js} +1 -1
- package/dist/{index-k7z3j3hr.js → index-km2qw407.js} +4 -4
- package/dist/{index-7fc0c2np.js → index-n3v695sb.js} +1 -1
- package/dist/index-p02zgk8x.js +351 -0
- package/dist/{index-vtann8bz.js → index-p0rf7sq9.js} +8 -8
- package/dist/{index-aykhzcnf.js → index-qj1sy4ep.js} +1 -1
- package/dist/{index-cxpcdswt.js → index-t65erk4z.js} +1 -1
- package/dist/{index-c5at3ykd.js → index-tsngj2b5.js} +22 -10
- package/dist/react/entity-cache.d.ts +24 -2
- package/dist/react/entity-cache.d.ts.map +1 -1
- package/dist/react/keyboard/hooks.d.ts +41 -10
- package/dist/react/keyboard/hooks.d.ts.map +1 -1
- package/dist/react/keyboard/layers.d.ts +27 -8
- package/dist/react/keyboard/layers.d.ts.map +1 -1
- package/dist/react/keyboard/modality.d.ts +21 -0
- package/dist/react/keyboard/modality.d.ts.map +1 -0
- package/dist/react/keyboard/refs.d.ts +13 -0
- package/dist/react/keyboard/refs.d.ts.map +1 -0
- package/dist/react/keyboard/testing.d.ts +80 -0
- package/dist/react/keyboard/testing.d.ts.map +1 -0
- package/dist/react/keyboard/zone.d.ts +60 -10
- package/dist/react/keyboard/zone.d.ts.map +1 -1
- package/dist/telegram/budget-transformer.d.ts +35 -0
- package/dist/telegram/budget-transformer.d.ts.map +1 -0
- package/dist/telegram/outbound-budget.d.ts +101 -0
- package/dist/telegram/outbound-budget.d.ts.map +1 -0
- package/dist/telegram/send-failure.d.ts +6 -1
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/llms/react-keyboard-testing.txt +24 -0
- package/llms/react-keyboard.txt +264 -4
- package/llms/react.txt +1 -1
- package/llms/server.3.txt +31 -0
- package/llms/server.4.txt +5 -0
- package/llms/stitchkit.2.txt +118 -0
- package/llms/stitchkit.txt +8 -122
- package/llms/telegram-grammy.txt +22 -0
- package/llms/telegram.txt +76 -2
- package/llms/{upgrading-0.103.13-0.113.0.txt → upgrading-0.104.0-0.114.0.txt} +45 -84
- package/llms/upgrading-0.37.0-0.44.0.txt +444 -0
- package/llms/{upgrading-0.44.0-0.60.0.txt → upgrading-0.44.0-0.61.0.txt} +140 -271
- package/llms/{upgrading-0.61.0-0.74.0.txt → upgrading-0.62.0-0.78.0.txt} +137 -140
- package/llms/{upgrading-0.75.0-0.103.0.txt → upgrading-0.79.0-0.103.13.txt} +84 -137
- package/llms/upgrading.txt +5 -5
- package/llms-full.txt +453 -11
- package/llms.txt +12 -10
- package/package.json +9 -1
- package/llms/upgrading-0.37.0.txt +0 -176
- package/dist/{index-616xh7f2.js → index-4qnzda76.js} +0 -0
- package/dist/{index-fsw1ybf3.js → index-d9hq291n.js} +3 -3
- package/dist/{index-bjcjqj46.js → index-m8a44e64.js} +3 -3
- package/dist/{index-5efrpfmj.js → index-qndsr7f0.js} +3 -3
- package/dist/{index-zktz242w.js → index-s47ac8zt.js} +3 -3
- package/dist/{index-56yx8dxp.js → index-tvtacc9a.js} +3 -3
- /package/dist/{index-v1tswj0z.js → index-txg1npmg.js} +0 -0
package/llms.txt
CHANGED
|
@@ -9,10 +9,11 @@ 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)
|
|
12
|
+
- **stitchkit**: [llms/stitchkit.txt](llms/stitchkit.txt) 43.2 KB → [llms/stitchkit.2.txt](llms/stitchkit.2.txt) 43.1 KB
|
|
13
13
|
- **stitchkit/live**: [llms/live.txt](llms/live.txt) 21.2 KB
|
|
14
|
-
- **stitchkit/react**: [llms/react.txt](llms/react.txt) 8.
|
|
15
|
-
- **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt)
|
|
14
|
+
- **stitchkit/react**: [llms/react.txt](llms/react.txt) 8.7 KB
|
|
15
|
+
- **stitchkit/react/keyboard**: [llms/react-keyboard.txt](llms/react-keyboard.txt) 21.5 KB
|
|
16
|
+
- **stitchkit/react/keyboard/testing**: [llms/react-keyboard-testing.txt](llms/react-keyboard-testing.txt) 1.9 KB
|
|
16
17
|
- **stitchkit/tools**: [llms/tools.txt](llms/tools.txt) 46.7 KB → [llms/tools.2.txt](llms/tools.2.txt) 30.4 KB → [llms/tools.3.txt](llms/tools.3.txt) 26.3 KB
|
|
17
18
|
- **stitchkit/tools/mcp**: [llms/tools-mcp.txt](llms/tools-mcp.txt) 1.8 KB
|
|
18
19
|
- **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
|
|
@@ -23,7 +24,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
23
24
|
- **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
|
|
24
25
|
- **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
|
|
25
26
|
- **stitchkit/primitives**: [llms/primitives.txt](llms/primitives.txt) 11.7 KB
|
|
26
|
-
- **stitchkit/server**: [llms/server.txt](llms/server.txt) 44.2 KB → [llms/server.2.txt](llms/server.2.txt) 20.5 KB → [llms/server.3.txt](llms/server.3.txt)
|
|
27
|
+
- **stitchkit/server**: [llms/server.txt](llms/server.txt) 44.2 KB → [llms/server.2.txt](llms/server.2.txt) 20.5 KB → [llms/server.3.txt](llms/server.3.txt) 47.0 KB → [llms/server.4.txt](llms/server.4.txt) 38.6 KB → [llms/server.5.txt](llms/server.5.txt) 22.9 KB
|
|
27
28
|
- **stitchkit/observability**: [llms/observability.txt](llms/observability.txt) 46.9 KB
|
|
28
29
|
- **stitchkit/agent-runtime**: [llms/agent-runtime.txt](llms/agent-runtime.txt) 43.2 KB → [llms/agent-runtime.2.txt](llms/agent-runtime.2.txt) 45.9 KB → [llms/agent-runtime.3.txt](llms/agent-runtime.3.txt) 42.2 KB
|
|
29
30
|
- **stitchkit/agent-runtime/testing**: [llms/agent-runtime-testing.txt](llms/agent-runtime-testing.txt) 2.6 KB
|
|
@@ -42,7 +43,8 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
42
43
|
- **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 33.6 KB
|
|
43
44
|
- **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
|
|
44
45
|
- **stitchkit/files**: [llms/files.txt](llms/files.txt) 5.7 KB
|
|
45
|
-
- **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt)
|
|
46
|
+
- **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 41.6 KB
|
|
47
|
+
- **stitchkit/telegram/grammy**: [llms/telegram-grammy.txt](llms/telegram-grammy.txt) 1.2 KB
|
|
46
48
|
- **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
|
|
47
49
|
- **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
|
|
48
50
|
- **stitchkit/tracking**: [llms/tracking.txt](llms/tracking.txt) 18.1 KB
|
|
@@ -64,11 +66,11 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
|
|
|
64
66
|
|
|
65
67
|
## Upgrading slices
|
|
66
68
|
- **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 12.7 KB
|
|
67
|
-
- **Upgrading 0.
|
|
68
|
-
- **Upgrading 0.
|
|
69
|
-
- **Upgrading 0.
|
|
70
|
-
- **Upgrading 0.44.0 → 0.
|
|
71
|
-
- **Upgrading 0.37.0 → 0.
|
|
69
|
+
- **Upgrading 0.104.0 → 0.114.0**: [llms/upgrading-0.104.0-0.114.0.txt](llms/upgrading-0.104.0-0.114.0.txt) 43.6 KB
|
|
70
|
+
- **Upgrading 0.79.0 → 0.103.13**: [llms/upgrading-0.79.0-0.103.13.txt](llms/upgrading-0.79.0-0.103.13.txt) 46.3 KB
|
|
71
|
+
- **Upgrading 0.62.0 → 0.78.0**: [llms/upgrading-0.62.0-0.78.0.txt](llms/upgrading-0.62.0-0.78.0.txt) 42.2 KB
|
|
72
|
+
- **Upgrading 0.44.0 → 0.61.0**: [llms/upgrading-0.44.0-0.61.0.txt](llms/upgrading-0.44.0-0.61.0.txt) 41.4 KB
|
|
73
|
+
- **Upgrading 0.37.0 → 0.44.0**: [llms/upgrading-0.37.0-0.44.0.txt](llms/upgrading-0.37.0-0.44.0.txt) 14.7 KB
|
|
72
74
|
|
|
73
75
|
## Guide (web)
|
|
74
76
|
- [Getting started](https://github.com/max-listov/stitchkit/blob/master/docs/guide/getting-started.md): install, entrypoints, and a first contract → server → client app
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stitchkit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.114.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",
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
"types": "./dist/entrypoints/react/keyboard.d.ts",
|
|
74
74
|
"import": "./dist/entrypoints/react/keyboard.js"
|
|
75
75
|
},
|
|
76
|
+
"./react/keyboard/testing": {
|
|
77
|
+
"types": "./dist/entrypoints/react/keyboard/testing.d.ts",
|
|
78
|
+
"import": "./dist/entrypoints/react/keyboard/testing.js"
|
|
79
|
+
},
|
|
76
80
|
"./tools": {
|
|
77
81
|
"types": "./dist/entrypoints/tools.d.ts",
|
|
78
82
|
"import": "./dist/entrypoints/tools.js"
|
|
@@ -193,6 +197,10 @@
|
|
|
193
197
|
"types": "./dist/entrypoints/telegram.d.ts",
|
|
194
198
|
"import": "./dist/entrypoints/telegram.js"
|
|
195
199
|
},
|
|
200
|
+
"./telegram/grammy": {
|
|
201
|
+
"types": "./dist/entrypoints/telegram/grammy.d.ts",
|
|
202
|
+
"import": "./dist/entrypoints/telegram/grammy.js"
|
|
203
|
+
},
|
|
196
204
|
"./telegram/html": {
|
|
197
205
|
"types": "./dist/entrypoints/telegram/html.d.ts",
|
|
198
206
|
"import": "./dist/entrypoints/telegram/html.js"
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
# Upgrading 0.37.0 → 0.37.0 — stitchkit docs slice
|
|
2
|
-
|
|
3
|
-
> Generated from the `docs/` tree by `bun run gen:llms`. The index of all slices is
|
|
4
|
-
> `llms.txt` in this package.
|
|
5
|
-
|
|
6
|
-
Contains: Guide: Upgrading, 0.37.0 → 0.37.0 (docs/guide/upgrading.md)
|
|
7
|
-
|
|
8
|
-
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.37.0 → 0.37.0 (docs/guide/upgrading.md)
|
|
10
|
-
==============================================================================
|
|
11
|
-
|
|
12
|
-
## The 0.37 migration
|
|
13
|
-
|
|
14
|
-
Tool presentation is no longer an executable Zod parser. Replace the removed
|
|
15
|
-
flatten helpers with the JSON Schema compiler, and choose the explicit
|
|
16
|
-
`MountableTool` surface when using the advanced collection API:
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
// before
|
|
20
|
-
const flat = flattenUnionsDeep(zodSchema)
|
|
21
|
-
mountable.schema
|
|
22
|
-
|
|
23
|
-
// after
|
|
24
|
-
const flat = flattenToolJsonSchema(
|
|
25
|
-
z.toJSONSchema(zodSchema, { target: 'draft-07', io: 'input' }),
|
|
26
|
-
)
|
|
27
|
-
mountable.presentationSchema // model/MCP/manifest JSON Schema
|
|
28
|
-
mountable.argumentSchema // executable CLI argument adapter only
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Contract and native handlers keep their original Zod schemas; MCP and agent SDK
|
|
32
|
-
adapters now forward raw arguments so defaults, coercions, refinements and
|
|
33
|
-
transforms execute exactly once inside Stitchkit. There are no compatibility
|
|
34
|
-
exports for `flattenDiscriminatedUnion`, `flattenUnionsDeep` or
|
|
35
|
-
`MountableTool.schema`. → ADR 0050
|
|
36
|
-
|
|
37
|
-
Tool-call hooks now take one options object. Migrate all three callbacks; there
|
|
38
|
-
are no positional overloads:
|
|
39
|
-
|
|
40
|
-
```ts
|
|
41
|
-
// before
|
|
42
|
-
beforeToolCall: (toolName, args, context, endpoint) => {}
|
|
43
|
-
afterToolCall: (toolName, args, result, durationMs, context, endpoint, error) => {}
|
|
44
|
-
onToolError: (toolName, error, context, endpoint) => {}
|
|
45
|
-
|
|
46
|
-
// after
|
|
47
|
-
beforeToolCall: ({ toolName, args, context, endpoint }) => {}
|
|
48
|
-
afterToolCall: ({ toolName, args, result, durationMs, context, endpoint, error }) => {}
|
|
49
|
-
onToolError: ({ toolName, error, context, endpoint }) => {}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### MCP schema validation
|
|
53
|
-
|
|
54
|
-
The standalone validator now takes one object and live MCP configs carry the
|
|
55
|
-
same rules under `schemaValidation`. Migrate every positional call and every
|
|
56
|
-
`onIncompatibleSchema` field; there is no old-shape overload:
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
// before
|
|
60
|
-
validateMcpSchemas(services, 'throw', logger, { requireTypedProperties: true })
|
|
61
|
-
createMcpHandler({ services, onIncompatibleSchema: 'throw' })
|
|
62
|
-
|
|
63
|
-
// after
|
|
64
|
-
validateMcpSchemas({ services, policy: 'throw', logger, requireTypedProperties: true })
|
|
65
|
-
createMcpHandler({ services, schemaValidation: { policy: 'throw' } })
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Put `extend` and `flattenUnionInput` beside `services`, not inside
|
|
69
|
-
`schemaValidation`. The handler applies the profile to the exact prepared schema
|
|
70
|
-
it advertises. Add `requirePortableFormats: true` when every custom JSON Schema
|
|
71
|
-
format must be rejected before a client sees it.
|
|
72
|
-
|
|
73
|
-
Native MCP registration also changed shape in 0.37. Move protected tools to the
|
|
74
|
-
framework registrar; keep an SDK-raw tool only by naming the opt-out:
|
|
75
|
-
|
|
76
|
-
```ts
|
|
77
|
-
// before
|
|
78
|
-
nativeTools: (server, auth) => server.registerTool(name, config, handler)
|
|
79
|
-
|
|
80
|
-
// after — lifecycle, hooks and schema policy apply
|
|
81
|
-
nativeTools: ({ registerTool }, auth) => registerTool({
|
|
82
|
-
name, description, identity, input, output, handler,
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
// after — intentionally raw
|
|
86
|
-
nativeTools: ({ rawServer }, auth) => rawServer.registerTool(name, config, handler)
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
If a tool hook annotated `endpoint` as `MethodDef`, remove that annotation or
|
|
90
|
-
use `OperationIdentity`: native operations have service/action/scope/method but
|
|
91
|
-
no HTTP path.
|
|
92
|
-
|
|
93
|
-
### Node-facing server types
|
|
94
|
-
|
|
95
|
-
`stitchkit/server` remains Bun-concrete: an explicitly annotated `RawRoute`
|
|
96
|
-
still receives `BunServer`. `stitchkit/node` no longer drags Bun declarations
|
|
97
|
-
into a Node project. Its raw routes default the host server to `unknown`, and
|
|
98
|
-
its Socket.IO handle exposes only Node capabilities:
|
|
99
|
-
|
|
100
|
-
```ts
|
|
101
|
-
// before — Node entry still leaked Bun-only fields and ambient types
|
|
102
|
-
const route: RawRoute = { handler: (_req, ctx) => ctx.server?.upgrade(...) }
|
|
103
|
-
const socket = await createSocketIOServer(config)
|
|
104
|
-
socket.websocket
|
|
105
|
-
|
|
106
|
-
// after — name a custom embedding host only when one exists
|
|
107
|
-
const route: RawRoute<MyHostServer> = {
|
|
108
|
-
handler: (_req, ctx) => useHost(ctx.server),
|
|
109
|
-
}
|
|
110
|
-
const socket = await createSocketIOServer(config)
|
|
111
|
-
socket.io
|
|
112
|
-
socket.attach(nodeHttpServer)
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
Node consumers can remove `@types/bun` unless another dependency independently
|
|
116
|
-
requires it.
|
|
117
|
-
|
|
118
|
-
### Managed server shutdown
|
|
119
|
-
|
|
120
|
-
`createServer()` and `serveNode()` now return the same structural managed
|
|
121
|
-
lifecycle. Replace every direct runtime stop and parallel Socket.IO close:
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
// before — split ownership
|
|
125
|
-
const socket = await createSocketIOServer(config)
|
|
126
|
-
const server = createServer({
|
|
127
|
-
services,
|
|
128
|
-
websocket: socket.websocket,
|
|
129
|
-
rawRoutes: [socket.route],
|
|
130
|
-
})
|
|
131
|
-
server.stop()
|
|
132
|
-
await socket.io.close()
|
|
133
|
-
|
|
134
|
-
// after — one owner and one total deadline
|
|
135
|
-
const socket = await createSocketIOServer(config)
|
|
136
|
-
const server = createServer({ services, socket })
|
|
137
|
-
const result = await server.shutdown({ gracePeriodMs: 30_000 })
|
|
138
|
-
```
|
|
139
|
-
|
|
140
|
-
On Node, keep the same `socket` field and replace `handle.close()` with
|
|
141
|
-
`handle.shutdown()`. Runtime-specific diagnostics move under `handle.runtime`;
|
|
142
|
-
do not use it as a second shutdown path. Standalone CLI/tools that create a
|
|
143
|
-
Socket.IO handle without an HTTP server call `await socket.close()`.
|
|
144
|
-
|
|
145
|
-
If Bun Socket.IO shares the port with a raw lane, keep the explicit composition
|
|
146
|
-
but let the server mount the Socket.IO route:
|
|
147
|
-
|
|
148
|
-
```ts
|
|
149
|
-
createServer({
|
|
150
|
-
services,
|
|
151
|
-
socket,
|
|
152
|
-
websocket: composeWebSocketHandlers([
|
|
153
|
-
webSocketLane({ match: isRaw, handlers: rawHandlers }),
|
|
154
|
-
socketIoLane(socket.websocket),
|
|
155
|
-
]),
|
|
156
|
-
rawRoutes: [rawUpgradeRoute],
|
|
157
|
-
})
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
Move native Bun `routes` entries to `rawRoutes`. Native routes run before the
|
|
161
|
-
Fetch handler and therefore cannot participate in admission or drain. Wire
|
|
162
|
-
`SIGTERM`/`SIGINT` in the application; the first signal starts `shutdown()`, and
|
|
163
|
-
a later signal may abort the same controller. Close MCP, databases and queues
|
|
164
|
-
after the server result—those resources remain application-owned.
|
|
165
|
-
|
|
166
|
-
Move a handshake policy from the Node-only callback shape inside
|
|
167
|
-
`serverOptions` to the runtime-neutral top-level policy. It receives a Web
|
|
168
|
-
`Request`, may be async, and returns whether to admit the handshake:
|
|
169
|
-
|
|
170
|
-
```ts
|
|
171
|
-
// before
|
|
172
|
-
serverOptions: { allowRequest: (request, done) => done(null, allowed(request)) }
|
|
173
|
-
|
|
174
|
-
// after
|
|
175
|
-
allowRequest: (request) => allowed(request)
|
|
176
|
-
```
|
|
File without changes
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveRouteParamsSchema
|
|
3
3
|
} from "./index-m38ej7e5.js";
|
|
4
|
-
import {
|
|
5
|
-
assertPositiveSafeInteger
|
|
6
|
-
} from "./index-0s4xebbg.js";
|
|
7
4
|
import {
|
|
8
5
|
isUnsafeKey
|
|
9
6
|
} from "./index-zsarb5xp.js";
|
|
7
|
+
import {
|
|
8
|
+
assertPositiveSafeInteger
|
|
9
|
+
} from "./index-0s4xebbg.js";
|
|
10
10
|
import {
|
|
11
11
|
isRecord
|
|
12
12
|
} from "./index-9jfdm5tg.js";
|
|
@@ -2,14 +2,14 @@ import {
|
|
|
2
2
|
RealtimeRequestTimeoutError2,
|
|
3
3
|
RealtimeRequestDisconnectedError2
|
|
4
4
|
} from "./index-4s0fep5q.js";
|
|
5
|
-
import {
|
|
6
|
-
isModuleNotFound
|
|
7
|
-
} from "./index-srs8hj9c.js";
|
|
8
5
|
import {
|
|
9
6
|
realtimeRequestTraces,
|
|
10
7
|
createRequestTracer,
|
|
11
8
|
bindRealtimeClient2
|
|
12
9
|
} from "./index-jk29rwkr.js";
|
|
10
|
+
import {
|
|
11
|
+
isModuleNotFound
|
|
12
|
+
} from "./index-srs8hj9c.js";
|
|
13
13
|
|
|
14
14
|
// src/browser/retained.ts
|
|
15
15
|
function createRetainedTopics2() {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chunksOf
|
|
3
3
|
} from "./index-cjbn98zt.js";
|
|
4
|
-
import {
|
|
5
|
-
assertPositiveSafeInteger
|
|
6
|
-
} from "./index-0s4xebbg.js";
|
|
7
4
|
import {
|
|
8
5
|
abortReason
|
|
9
6
|
} from "./index-a5qr2rj6.js";
|
|
7
|
+
import {
|
|
8
|
+
assertPositiveSafeInteger
|
|
9
|
+
} from "./index-0s4xebbg.js";
|
|
10
10
|
|
|
11
11
|
// src/internal/bounded-body.ts
|
|
12
12
|
async function readBoundedChunks(source, options) {
|
|
@@ -22,12 +22,12 @@ import {
|
|
|
22
22
|
readContainedUtf8Handle,
|
|
23
23
|
scanContainedFiles
|
|
24
24
|
} from "./index-zrtrjkbf.js";
|
|
25
|
-
import {
|
|
26
|
-
stagingName
|
|
27
|
-
} from "./index-j4zh647a.js";
|
|
28
25
|
import {
|
|
29
26
|
defineRuntimeTool2
|
|
30
27
|
} from "./index-ega3yz4c.js";
|
|
28
|
+
import {
|
|
29
|
+
stagingName
|
|
30
|
+
} from "./index-j4zh647a.js";
|
|
31
31
|
import {
|
|
32
32
|
AppError2,
|
|
33
33
|
forbidden2,
|
|
@@ -14,12 +14,12 @@ import {
|
|
|
14
14
|
ParkRecordDecodeError2,
|
|
15
15
|
ParkAbortedError2
|
|
16
16
|
} from "./index-snef22zr.js";
|
|
17
|
-
import {
|
|
18
|
-
raceAbort
|
|
19
|
-
} from "./index-b0kddvzw.js";
|
|
20
17
|
import {
|
|
21
18
|
isJsonData
|
|
22
19
|
} from "./index-m6w6jtda.js";
|
|
20
|
+
import {
|
|
21
|
+
raceAbort
|
|
22
|
+
} from "./index-b0kddvzw.js";
|
|
23
23
|
import {
|
|
24
24
|
MAX_TIMER_MS
|
|
25
25
|
} from "./index-eemvahkc.js";
|
|
File without changes
|