stitchkit 0.134.1 → 0.134.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +6 -6
- package/dist/agent-runtime/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/sqlite-schema.d.ts +2 -2
- package/dist/agent-runtime/sqlite.d.ts +1 -1
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/application/grammy.d.ts +1 -1
- package/dist/browser/contract-identity.d.ts +1 -1
- package/dist/browser/http-fetch.d.ts +1 -1
- package/dist/browser/socket-io-contract.d.ts +1 -1
- package/dist/contract/bridge-envelope.d.ts +1 -1
- package/dist/contract/client-types.d.ts +1 -1
- package/dist/contract/define.d.ts +2 -2
- package/dist/contract/errors-factory.d.ts +1 -1
- package/dist/contract/fingerprint.d.ts +1 -1
- package/dist/device-relay/hub.d.ts +1 -1
- package/dist/entrypoints/agent-runtime/postgres.js +3 -3
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +1 -1
- package/dist/entrypoints/agent-runtime/sqlite/node.js +1 -1
- package/dist/entrypoints/bin/upgrade-cli.js +1 -1
- package/dist/entrypoints/files/packaging.js +2 -2
- package/dist/entrypoints/handler.js +2 -2
- package/dist/entrypoints/node.js +2 -2
- package/dist/entrypoints/server.js +2 -2
- package/dist/entrypoints/tools/mcp.js +3 -3
- package/dist/entrypoints/tools/toolkit.js +3 -3
- package/dist/entrypoints/tools.js +2 -2
- package/dist/files/native-packaging-layout.d.ts +1 -1
- package/dist/{index-654rhe5d.js → index-7mjsb7zv.js} +5 -1
- package/dist/{index-kdw0n92g.js → index-a09r9ff0.js} +1 -1
- package/dist/{index-epyj7ptp.js → index-a84wj6y8.js} +4 -4
- package/dist/{index-qymek778.js → index-m2b49tvc.js} +76 -22
- package/dist/{index-mrng24wq.js → index-zag9sjpd.js} +1 -1
- package/dist/internal/postgres-query.d.ts +1 -1
- package/dist/react/query-client.d.ts +1 -1
- package/dist/server/bridge-host.d.ts +1 -1
- package/dist/server/bun.d.ts +1 -1
- package/dist/server/endpoint-dispatch.d.ts.map +1 -1
- package/dist/server/middleware/cors.d.ts +3 -3
- package/dist/server/middleware/cors.d.ts.map +1 -1
- package/dist/server/socket-io-config.d.ts +1 -1
- package/dist/service-host/identity.d.ts +1 -1
- package/dist/service-host/systemd-inspect.d.ts +1 -1
- package/dist/testing/manual-clock.d.ts +1 -1
- package/dist/tools/connections/types.d.ts +1 -1
- package/dist/tools/mcp/handler.d.ts +1 -1
- package/dist/tools/mcp/lazy-discovery.d.ts +1 -1
- package/dist/tools/mcp/mount.d.ts +1 -1
- package/dist/tools/mcp/stdio.d.ts +1 -1
- package/llms/agent-runtime-browser.txt +1 -1
- package/llms/agent-runtime-sqlite-bun.txt +1 -1
- package/llms/agent-runtime.2.txt +1 -1
- package/llms/agent-runtime.3.txt +4 -4
- package/llms/agent-runtime.txt +3 -3
- package/llms/application.2.txt +4 -4
- package/llms/application.txt +4 -4
- package/llms/cli.2.txt +27 -6
- package/llms/cli.txt +2 -2
- package/llms/contract.txt +1 -1
- package/llms/files-packaging.txt +1 -1
- package/llms/geo.txt +1 -1
- package/llms/live.txt +1 -1
- package/llms/oauth.txt +4 -4
- package/llms/observability.txt +3 -3
- package/llms/primitives.txt +1 -1
- package/llms/process.2.txt +7 -7
- package/llms/react.txt +4 -4
- package/llms/server.2.txt +7 -7
- package/llms/server.3.txt +5 -5
- package/llms/server.4.txt +6 -6
- package/llms/server.txt +13 -5
- package/llms/stitchkit.2.txt +3 -3
- package/llms/stitchkit.3.txt +1 -1
- package/llms/stitchkit.txt +4 -4
- package/llms/telegram.txt +1 -1
- package/llms/testing.txt +4 -4
- package/llms/tools-connections.txt +1 -1
- package/llms/tools-toolkit.txt +3 -1
- package/llms/tools.2.txt +6 -6
- package/llms/tools.3.txt +8 -8
- package/llms/upgrading-0.106.0-0.126.0.txt +1 -1
- package/llms/upgrading-0.128.0-0.134.0.txt +7 -1
- package/llms/upgrading-0.37.0-0.53.0.txt +7 -7
- package/llms/upgrading-0.69.0-0.95.0.txt +1 -1
- package/llms/upgrading-0.96.0-0.105.0.txt +1 -1
- package/llms-full.txt +149 -112
- package/llms.txt +5 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,19 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.134.2] - 2026-11-29
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- Standardized Stitch family naming across `stitchkit` docs, guides, API reference, CLI upgrade output, error messages, and comments to `StitchKit` / `stitchkit` (zero single-capital `Stitchkit` forms), normalized `DEFAULT_CORS_ALLOW_HEADERS` to emit lowercase `x-stitchkit-timeout-ms` (`DEADLINE_BUDGET_HEADER`, case-insensitive per RFC 9110), and added a mechanical casing regression test in `packages/core/tests/current-docs.test.ts`. Persisted macOS `Info.plist` key `BUNDLE_SPEC_DIGEST_PLIST_KEY` (`StitchkitBundleSpecDigest`) remains unchanged to preserve live bundle idempotency.
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
|
|
26
|
+
- `stitchkit/server` — `dispatchEndpoint` now disarms the open-phase deadline timer (`method.timeout` and inbound `x-stitchkit-timeout-ms`) as soon as a streaming endpoint handler returns its `AsyncIterable` instead of keeping the timer armed across the open stream lifetime, keeps `ctx.signal` linked directly to `req.signal` (client disconnect), managed shutdown, and `stream.lifetimeMs` without leaking listeners, switches `ctx.remainingTimeoutMs` to `stream.lifetimeMs` (or `undefined`) after open, closes a late-returned iterable with `408 REQUEST_TIMEOUT` if the open deadline expired before the handler returned, and preserves `ctx.signal` client-disconnect forwarding on `rawResponse: true` responses with a body after disarming the open timer.
|
|
27
|
+
**Affects:** `stitchkit/server` createHandler, createServer
|
|
28
|
+
- `stitchkit/tools/toolkit` — updated the `0.134.0` peer-free migration guide (`docs/guide/upgrading.md` and generated `llms/upgrading-*.txt` slices), `docs/guide/cli.md`, `docs/guide/getting-started.md`, and `docs/api/reference.md` to explicitly list `stitchkit/tools/toolkit` alongside `stitchkit/tools/agent` and `stitchkit/agent-runtime/ai-sdk` as `ai`-requiring entrypoints under ADR 0284, document the direct MCP-only and peer-free replacements (`stitchkit/tools/mcp`, `stitchkit/tools`, `stitchkit/cli`), and lock the `ai` optional-peer documentation list against `OPTIONAL_PEER_MATRIX` with regression tests.
|
|
29
|
+
**Affects:** `stitchkit/tools/toolkit` createToolkit
|
|
30
|
+
|
|
18
31
|
## [0.134.1] - 2026-11-28
|
|
19
32
|
|
|
20
33
|
### Added
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/max-listov/stitchkit/master/assets/avatar.png" alt="
|
|
2
|
+
<img src="https://raw.githubusercontent.com/max-listov/stitchkit/master/assets/avatar.png" alt="StitchKit — a blue ball of yarn with a golden needle" width="128" height="128" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -55,7 +55,7 @@ supported via `stitchkit/node`.
|
|
|
55
55
|
|
|
56
56
|
## Install
|
|
57
57
|
|
|
58
|
-
Start a production-shaped Next.js,
|
|
58
|
+
Start a production-shaped Next.js, StitchKit and PostgreSQL application:
|
|
59
59
|
|
|
60
60
|
```bash
|
|
61
61
|
bun create stitchkit my-app
|
|
@@ -64,7 +64,7 @@ cd my-app
|
|
|
64
64
|
bun run dev
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
To add
|
|
67
|
+
To add StitchKit to an existing project instead:
|
|
68
68
|
|
|
69
69
|
```bash
|
|
70
70
|
bun add stitchkit # Bun
|
|
@@ -291,7 +291,7 @@ const tools = mountAgent(service, {
|
|
|
291
291
|
const result = await generateText({ model, tools, prompt: 'Create a user named Max' })
|
|
292
292
|
```
|
|
293
293
|
|
|
294
|
-
For applications that want
|
|
294
|
+
For applications that want StitchKit to own durable message/run transitions,
|
|
295
295
|
stream checkpoints, interruption and managed-tool fencing without external AI SDK
|
|
296
296
|
dependencies, use the peer-free [`stitchkit/agent-runtime`](docs/guide/agent-runtime.md)
|
|
297
297
|
with `mountAgentTools` from `stitchkit/tools`. `mountAgent` (`stitchkit/tools/agent`)
|
|
@@ -490,7 +490,7 @@ UI catalogue. Its only source is
|
|
|
490
490
|
[`packages/create-stitchkit/template`](./packages/create-stitchkit/template).
|
|
491
491
|
The application owns its Prisma schema and migrations while PostgreSQL remains
|
|
492
492
|
external infrastructure configured through `DATABASE_URL`.
|
|
493
|
-
The template owns a committed Bun lockfile and an explicit
|
|
493
|
+
The template owns a committed Bun lockfile and an explicit StitchKit catalog
|
|
494
494
|
range, so framework and scaffolder releases advance independently.
|
|
495
495
|
|
|
496
496
|
For a minimal terminal coding-agent host, choose the second explicit profile:
|
|
@@ -508,7 +508,7 @@ lazy skills and direct approval-gated coding tools over the same headless Agent
|
|
|
508
508
|
searches the full tool-capable catalog and shows weekly popularity independently from sourced
|
|
509
509
|
benchmark observations. `/status` exposes the local session ID so another process can `send` or
|
|
510
510
|
`interrupt` through the terminal's existing controller. The renderer and provider dependencies do
|
|
511
|
-
not enter
|
|
511
|
+
not enter StitchKit core or the default application. → [ADR 0133](./docs/decisions/0133-agent-tui-is-an-optional-package-over-one-controller.md)
|
|
512
512
|
|
|
513
513
|
## Documentation — two roads
|
|
514
514
|
|
|
@@ -114,11 +114,6 @@ export declare function parseRunRow(value: unknown): {
|
|
|
114
114
|
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
115
115
|
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
116
116
|
parts: ({
|
|
117
|
-
type: "source";
|
|
118
|
-
sourceId: string;
|
|
119
|
-
url?: string | undefined;
|
|
120
|
-
title?: string | undefined;
|
|
121
|
-
} | {
|
|
122
117
|
type: "text";
|
|
123
118
|
text: string;
|
|
124
119
|
provider?: {
|
|
@@ -134,11 +129,6 @@ export declare function parseRunRow(value: unknown): {
|
|
|
134
129
|
provider: string;
|
|
135
130
|
data: Record<string, z.JSONType>;
|
|
136
131
|
} | undefined;
|
|
137
|
-
} | {
|
|
138
|
-
type: "file";
|
|
139
|
-
mediaType: string;
|
|
140
|
-
reference: string;
|
|
141
|
-
filename?: string | undefined;
|
|
142
132
|
} | {
|
|
143
133
|
type: "tool-call";
|
|
144
134
|
callId: string;
|
|
@@ -160,6 +150,16 @@ export declare function parseRunRow(value: unknown): {
|
|
|
160
150
|
provider: string;
|
|
161
151
|
data: Record<string, z.JSONType>;
|
|
162
152
|
} | undefined;
|
|
153
|
+
} | {
|
|
154
|
+
type: "file";
|
|
155
|
+
mediaType: string;
|
|
156
|
+
reference: string;
|
|
157
|
+
filename?: string | undefined;
|
|
158
|
+
} | {
|
|
159
|
+
type: "source";
|
|
160
|
+
sourceId: string;
|
|
161
|
+
url?: string | undefined;
|
|
162
|
+
title?: string | undefined;
|
|
163
163
|
} | {
|
|
164
164
|
type: "tool-approval-request";
|
|
165
165
|
approvalId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type SqliteDatabase } from '../internal/sqlite.js';
|
|
2
2
|
/**
|
|
3
|
-
* Create
|
|
4
|
-
* An orphaned partial
|
|
3
|
+
* Create StitchKit's schema without claiming an application's tables or SQLite user_version.
|
|
4
|
+
* An orphaned partial StitchKit schema is refused rather than destructively repaired.
|
|
5
5
|
*/
|
|
6
6
|
export declare function initializeAgentRuntimeSqlite(database: SqliteDatabase): void;
|
|
7
7
|
//# sourceMappingURL=sqlite-schema.d.ts.map
|
|
@@ -5,7 +5,7 @@ import { createAgentRuntimeStore } from './store-create.js';
|
|
|
5
5
|
export type { SqliteDatabase, SqliteStatement, SqliteValue } from '../internal/sqlite.js';
|
|
6
6
|
export interface SqliteAgentRuntimeStoreConfig {
|
|
7
7
|
database: SqliteDatabase;
|
|
8
|
-
/** Create or validate
|
|
8
|
+
/** Create or validate StitchKit's namespaced schema. Default true. */
|
|
9
9
|
initialize?: boolean;
|
|
10
10
|
}
|
|
11
11
|
export interface SqliteAgentRuntimeStore {
|
|
@@ -131,6 +131,11 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
131
131
|
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
132
132
|
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
133
133
|
parts: ({
|
|
134
|
+
type: "source";
|
|
135
|
+
sourceId: string;
|
|
136
|
+
url?: string | undefined;
|
|
137
|
+
title?: string | undefined;
|
|
138
|
+
} | {
|
|
134
139
|
type: "text";
|
|
135
140
|
text: string;
|
|
136
141
|
provider?: {
|
|
@@ -146,6 +151,11 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
146
151
|
provider: string;
|
|
147
152
|
data: Record<string, import("zod").JSONType>;
|
|
148
153
|
} | undefined;
|
|
154
|
+
} | {
|
|
155
|
+
type: "file";
|
|
156
|
+
mediaType: string;
|
|
157
|
+
reference: string;
|
|
158
|
+
filename?: string | undefined;
|
|
149
159
|
} | {
|
|
150
160
|
type: "tool-call";
|
|
151
161
|
callId: string;
|
|
@@ -167,16 +177,6 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
167
177
|
provider: string;
|
|
168
178
|
data: Record<string, import("zod").JSONType>;
|
|
169
179
|
} | undefined;
|
|
170
|
-
} | {
|
|
171
|
-
type: "file";
|
|
172
|
-
mediaType: string;
|
|
173
|
-
reference: string;
|
|
174
|
-
filename?: string | undefined;
|
|
175
|
-
} | {
|
|
176
|
-
type: "source";
|
|
177
|
-
sourceId: string;
|
|
178
|
-
url?: string | undefined;
|
|
179
|
-
title?: string | undefined;
|
|
180
180
|
} | {
|
|
181
181
|
type: "tool-approval-request";
|
|
182
182
|
approvalId: string;
|
|
@@ -321,6 +321,11 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
321
321
|
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
322
322
|
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
323
323
|
parts: ({
|
|
324
|
+
type: "source";
|
|
325
|
+
sourceId: string;
|
|
326
|
+
url?: string | undefined;
|
|
327
|
+
title?: string | undefined;
|
|
328
|
+
} | {
|
|
324
329
|
type: "text";
|
|
325
330
|
text: string;
|
|
326
331
|
provider?: {
|
|
@@ -336,6 +341,11 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
336
341
|
provider: string;
|
|
337
342
|
data: Record<string, import("zod").JSONType>;
|
|
338
343
|
} | undefined;
|
|
344
|
+
} | {
|
|
345
|
+
type: "file";
|
|
346
|
+
mediaType: string;
|
|
347
|
+
reference: string;
|
|
348
|
+
filename?: string | undefined;
|
|
339
349
|
} | {
|
|
340
350
|
type: "tool-call";
|
|
341
351
|
callId: string;
|
|
@@ -357,16 +367,6 @@ export declare function fencingPhase(store: AgentRuntimeStore, conversationId: s
|
|
|
357
367
|
provider: string;
|
|
358
368
|
data: Record<string, import("zod").JSONType>;
|
|
359
369
|
} | undefined;
|
|
360
|
-
} | {
|
|
361
|
-
type: "file";
|
|
362
|
-
mediaType: string;
|
|
363
|
-
reference: string;
|
|
364
|
-
filename?: string | undefined;
|
|
365
|
-
} | {
|
|
366
|
-
type: "source";
|
|
367
|
-
sourceId: string;
|
|
368
|
-
url?: string | undefined;
|
|
369
|
-
title?: string | undefined;
|
|
370
370
|
} | {
|
|
371
371
|
type: "tool-approval-request";
|
|
372
372
|
approvalId: string;
|
|
@@ -6,11 +6,6 @@ export declare function userMessage(conversationId: string, id: string): {
|
|
|
6
6
|
role: "assistant" | "summary" | "system" | "tool" | "user";
|
|
7
7
|
status: "committed" | "completed" | "failed" | "interrupted" | "streaming" | "superseded";
|
|
8
8
|
parts: ({
|
|
9
|
-
type: "source";
|
|
10
|
-
sourceId: string;
|
|
11
|
-
url?: string | undefined;
|
|
12
|
-
title?: string | undefined;
|
|
13
|
-
} | {
|
|
14
9
|
type: "text";
|
|
15
10
|
text: string;
|
|
16
11
|
provider?: {
|
|
@@ -26,11 +21,6 @@ export declare function userMessage(conversationId: string, id: string): {
|
|
|
26
21
|
provider: string;
|
|
27
22
|
data: Record<string, import("zod").JSONType>;
|
|
28
23
|
} | undefined;
|
|
29
|
-
} | {
|
|
30
|
-
type: "file";
|
|
31
|
-
mediaType: string;
|
|
32
|
-
reference: string;
|
|
33
|
-
filename?: string | undefined;
|
|
34
24
|
} | {
|
|
35
25
|
type: "tool-call";
|
|
36
26
|
callId: string;
|
|
@@ -52,6 +42,16 @@ export declare function userMessage(conversationId: string, id: string): {
|
|
|
52
42
|
provider: string;
|
|
53
43
|
data: Record<string, import("zod").JSONType>;
|
|
54
44
|
} | undefined;
|
|
45
|
+
} | {
|
|
46
|
+
type: "file";
|
|
47
|
+
mediaType: string;
|
|
48
|
+
reference: string;
|
|
49
|
+
filename?: string | undefined;
|
|
50
|
+
} | {
|
|
51
|
+
type: "source";
|
|
52
|
+
sourceId: string;
|
|
53
|
+
url?: string | undefined;
|
|
54
|
+
title?: string | undefined;
|
|
55
55
|
} | {
|
|
56
56
|
type: "tool-approval-request";
|
|
57
57
|
approvalId: string;
|
|
@@ -46,16 +46,6 @@ export declare function appliedSnapshot(result: AgentStoreMutationResult, operat
|
|
|
46
46
|
provider: string;
|
|
47
47
|
data: Record<string, import("zod").JSONType>;
|
|
48
48
|
} | undefined;
|
|
49
|
-
} | {
|
|
50
|
-
type: "file";
|
|
51
|
-
mediaType: string;
|
|
52
|
-
reference: string;
|
|
53
|
-
filename?: string | undefined;
|
|
54
|
-
} | {
|
|
55
|
-
type: "source";
|
|
56
|
-
sourceId: string;
|
|
57
|
-
url?: string | undefined;
|
|
58
|
-
title?: string | undefined;
|
|
59
49
|
} | {
|
|
60
50
|
type: "tool-call";
|
|
61
51
|
callId: string;
|
|
@@ -77,6 +67,16 @@ export declare function appliedSnapshot(result: AgentStoreMutationResult, operat
|
|
|
77
67
|
provider: string;
|
|
78
68
|
data: Record<string, import("zod").JSONType>;
|
|
79
69
|
} | undefined;
|
|
70
|
+
} | {
|
|
71
|
+
type: "file";
|
|
72
|
+
mediaType: string;
|
|
73
|
+
reference: string;
|
|
74
|
+
filename?: string | undefined;
|
|
75
|
+
} | {
|
|
76
|
+
type: "source";
|
|
77
|
+
sourceId: string;
|
|
78
|
+
url?: string | undefined;
|
|
79
|
+
title?: string | undefined;
|
|
80
80
|
} | {
|
|
81
81
|
type: "tool-approval-request";
|
|
82
82
|
approvalId: string;
|
|
@@ -60,7 +60,7 @@ export declare class GrammyWebhookUnavailableError extends AppError<'GRAMMY_WEBH
|
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Create a managed admission gate around an injected grammY webhook bot.
|
|
63
|
-
* HTTP parsing, webhook hosting and Telegram payload persistence remain outside
|
|
63
|
+
* HTTP parsing, webhook hosting and Telegram payload persistence remain outside StitchKit.
|
|
64
64
|
*/
|
|
65
65
|
export declare function createGrammyWebhookResource<C extends Context>(config: GrammyWebhookResourceConfig<C>): GrammyWebhookResource<C>;
|
|
66
66
|
//# sourceMappingURL=grammy.d.ts.map
|
|
@@ -13,7 +13,7 @@ export interface ContractIdentity {
|
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
15
|
* Read the server's contract fingerprint in one call and return it beside the
|
|
16
|
-
* client's own. A difference is a value to act on, never a throw:
|
|
16
|
+
* client's own. A difference is a value to act on, never a throw: StitchKit
|
|
17
17
|
* computes both identities and the application decides what a mismatch means.
|
|
18
18
|
* A failure to reach the server at all still rejects, as any call does.
|
|
19
19
|
*/
|
|
@@ -18,7 +18,7 @@ export declare function createRetryAwareFetch(transportFetch: ClientFetch, unix?
|
|
|
18
18
|
/**
|
|
19
19
|
* Query parameters as a serialized search string; `undefined` drops a key, an
|
|
20
20
|
* array repeats it. Serializes here (rather than returning `URLSearchParams`)
|
|
21
|
-
* so neither
|
|
21
|
+
* so neither StitchKit nor Ky reads `URLSearchParams.prototype.size`, which
|
|
22
22
|
* polyfills such as `react-native-url-polyfill` omit (`undefined`).
|
|
23
23
|
*/
|
|
24
24
|
export declare function searchParamsOf(params: Record<string, ParamValue | ParamArrayValue>): string | undefined;
|
|
@@ -165,7 +165,7 @@ export interface SocketIOClient<TServerEvents extends SocketEventMap, TClientEve
|
|
|
165
165
|
*/
|
|
166
166
|
onConnectionChange(listener: (connected: boolean, reason?: string) => void): () => void;
|
|
167
167
|
}
|
|
168
|
-
/** Minimal
|
|
168
|
+
/** Minimal StitchKit client transport required by a validated realtime binding. */
|
|
169
169
|
export interface RealtimeClient<TServerToClient extends RealtimeEventRegistry, TClientToServer extends RealtimeEventRegistry> extends BoundRealtimeClient<TServerToClient, TClientToServer> {
|
|
170
170
|
connect(): void;
|
|
171
171
|
disconnect(): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Wire envelope for the `postMessage` bridge carrying Fetch `Request` and
|
|
3
|
-
* `Response` frames between a WebView / DOM window and a
|
|
3
|
+
* `Response` frames between a WebView / DOM window and a StitchKit handler host.
|
|
4
4
|
*
|
|
5
5
|
* Textual payloads in one frame only in v1: binary bodies, streaming responses
|
|
6
6
|
* and bytes that are not UTF-8 — under a text type or none — are refused
|
|
@@ -99,7 +99,7 @@ export interface ClientRequestOptions {
|
|
|
99
99
|
timeout?: number;
|
|
100
100
|
/**
|
|
101
101
|
* Propagate the remaining relative timeout budget in `x-stitchkit-timeout-ms` so downstream
|
|
102
|
-
*
|
|
102
|
+
* StitchKit servers can bound admission waits and nested hops. Defaults to `true` when per-call
|
|
103
103
|
* `timeout` is given, otherwise inherits the client's `propagateDeadline` setting (`false` by default).
|
|
104
104
|
*/
|
|
105
105
|
propagateDeadline?: boolean;
|
|
@@ -19,7 +19,7 @@ export interface EndpointResponseMeta {
|
|
|
19
19
|
export interface ResponseMetadata {
|
|
20
20
|
headers: Headers;
|
|
21
21
|
}
|
|
22
|
-
/** Whether the wire carries
|
|
22
|
+
/** Whether the wire carries StitchKit protocol envelopes or schema-owned items. */
|
|
23
23
|
export type ContractStreamFraming = 'envelope' | 'item';
|
|
24
24
|
/** What conclusively completes one contract-first stream operation. */
|
|
25
25
|
export type ContractStreamCompletion = 'stream-end' | 'terminal';
|
|
@@ -61,7 +61,7 @@ export type EndpointStreamDescriptor<TItem extends ZodType = ZodType> = (Endpoin
|
|
|
61
61
|
/** Default `envelope`: `data` / safe `error` / `end` protocol frames. */
|
|
62
62
|
framing?: 'envelope';
|
|
63
63
|
} & (StreamEndCompletion | TerminalItemCompletion)) | (EndpointStreamDescriptorBase<TItem> & {
|
|
64
|
-
/** Schema-owned NDJSON frames with no
|
|
64
|
+
/** Schema-owned NDJSON frames with no StitchKit protocol envelope. */
|
|
65
65
|
framing: 'item';
|
|
66
66
|
format?: 'ndjson';
|
|
67
67
|
finalLine?: StreamFinalLinePolicy;
|
|
@@ -115,7 +115,7 @@ export type FrozenErrorDefinitions<TDefinitions extends ErrorDefinitions> = {
|
|
|
115
115
|
/** The union of an application's declared error codes. */
|
|
116
116
|
export type ErrorVocabularyCode<TDefinitions extends ErrorDefinitions> = Extract<keyof TDefinitions, string>;
|
|
117
117
|
export type ErrorVocabularyMapping<TDefinitions extends ErrorDefinitions> = {
|
|
118
|
-
/** Require an explicit application code for every
|
|
118
|
+
/** Require an explicit application code for every StitchKit code. */
|
|
119
119
|
exhaustive: true;
|
|
120
120
|
map: Record<StitchErrorCode, ErrorVocabularyCode<TDefinitions>>;
|
|
121
121
|
fallback?: never;
|
|
@@ -47,7 +47,7 @@ export interface FingerprintedOperation {
|
|
|
47
47
|
export declare function fingerprintOperations(operations: Iterable<FingerprintedOperation>): ContractFingerprint;
|
|
48
48
|
/**
|
|
49
49
|
* The fingerprint of the operations a client of these contracts can call —
|
|
50
|
-
* every endpoint HTTP carries.
|
|
50
|
+
* every endpoint HTTP carries. StitchKit computes it; what a difference means
|
|
51
51
|
* is the application's decision.
|
|
52
52
|
*/
|
|
53
53
|
export declare function contractFingerprint(contracts: ContractDef<Record<string, EndpointDef>, string> | readonly ContractDef<Record<string, EndpointDef>, string>[]): ContractFingerprint;
|
|
@@ -112,6 +112,6 @@ export interface DeviceRelayHub<TIdentity = unknown> {
|
|
|
112
112
|
sweepExpiredLeases(): Promise<void>;
|
|
113
113
|
close(): Promise<void>;
|
|
114
114
|
}
|
|
115
|
-
/** Create a backend User Device Relay hub over existing
|
|
115
|
+
/** Create a backend User Device Relay hub over existing StitchKit realtime connections. */
|
|
116
116
|
export declare function createDeviceRelayHub<TIdentity = unknown>(config: DeviceRelayHubConfig<TIdentity>): DeviceRelayHub<TIdentity>;
|
|
117
117
|
//# sourceMappingURL=hub.d.ts.map
|
|
@@ -241,16 +241,16 @@ async function initializePostgresAgentStore(session, prefix, createTables) {
|
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
if (!present.includes(tables.meta)) {
|
|
244
|
-
throw new Error(`Refusing an unversioned partial
|
|
244
|
+
throw new Error(`Refusing an unversioned partial StitchKit agent store schema under prefix "${checked}"`);
|
|
245
245
|
}
|
|
246
246
|
const versionRow = await session.get(`SELECT value FROM ${tables.meta} WHERE key = 'schema_version'`);
|
|
247
247
|
const version = versionRow === undefined ? undefined : Number(VersionRowSchema.parse(versionRow).value);
|
|
248
248
|
if (version !== POSTGRES_AGENT_STORE_SCHEMA_VERSION) {
|
|
249
|
-
throw new Error(`Unsupported
|
|
249
|
+
throw new Error(`Unsupported StitchKit agent store schema version ${version ?? "none"} under prefix "${checked}"; expected ${POSTGRES_AGENT_STORE_SCHEMA_VERSION}`);
|
|
250
250
|
}
|
|
251
251
|
const missingTables = expected.filter((table) => !present.includes(table));
|
|
252
252
|
if (missingTables.length > 0) {
|
|
253
|
-
throw new Error(`Refusing a partial
|
|
253
|
+
throw new Error(`Refusing a partial StitchKit agent store schema under prefix "${checked}"; missing ${missingTables.join(", ")}`);
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -11,7 +11,7 @@ import"../../../index-79vqbjcz.js";
|
|
|
11
11
|
import {
|
|
12
12
|
initializeAgentRuntimeSqlite2,
|
|
13
13
|
createSqliteAgentRuntimeStore2
|
|
14
|
-
} from "../../../index-
|
|
14
|
+
} from "../../../index-a84wj6y8.js";
|
|
15
15
|
import"../../../index-werjqesf.js";
|
|
16
16
|
import"../../../index-6kec3b14.js";
|
|
17
17
|
import"../../../index-tgehj4bp.js";
|
|
@@ -11,7 +11,7 @@ import"../../../index-79vqbjcz.js";
|
|
|
11
11
|
import {
|
|
12
12
|
initializeAgentRuntimeSqlite2,
|
|
13
13
|
createSqliteAgentRuntimeStore2
|
|
14
|
-
} from "../../../index-
|
|
14
|
+
} from "../../../index-a84wj6y8.js";
|
|
15
15
|
import"../../../index-werjqesf.js";
|
|
16
16
|
import"../../../index-6kec3b14.js";
|
|
17
17
|
import"../../../index-tgehj4bp.js";
|
|
@@ -288,7 +288,7 @@ function planFixes(changelog, from, to) {
|
|
|
288
288
|
};
|
|
289
289
|
}
|
|
290
290
|
function renderUpgradePlan(changes, from, to) {
|
|
291
|
-
const header = `#
|
|
291
|
+
const header = `# StitchKit upgrade ${from} → ${to}`;
|
|
292
292
|
if (changes.length === 0)
|
|
293
293
|
return `${header}
|
|
294
294
|
|
|
@@ -1025,7 +1025,7 @@ var NativeAssetEntrySchema = z4.strictObject({
|
|
|
1025
1025
|
});
|
|
1026
1026
|
var NativeAssetManifestSchema = z4.strictObject({
|
|
1027
1027
|
formatVersion: z4.literal(2, {
|
|
1028
|
-
error: "Native asset manifest formatVersion must be 2 for this
|
|
1028
|
+
error: "Native asset manifest formatVersion must be 2 for this StitchKit"
|
|
1029
1029
|
}),
|
|
1030
1030
|
loader: RelativePathSchema,
|
|
1031
1031
|
assets: z4.strictObject({
|
|
@@ -1298,7 +1298,7 @@ function installedPackageRoot() {
|
|
|
1298
1298
|
break;
|
|
1299
1299
|
directory = parent;
|
|
1300
1300
|
}
|
|
1301
|
-
throw new Error("Native packaging must run from its installed
|
|
1301
|
+
throw new Error("Native packaging must run from its installed StitchKit package");
|
|
1302
1302
|
}
|
|
1303
1303
|
function readVerifiedAsset(root, published, platform, architecture) {
|
|
1304
1304
|
const missing = {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
bridgeBodyKind,
|
|
6
6
|
readBridgeBodyText
|
|
7
7
|
} from "../index-w3s79kcb.js";
|
|
8
|
-
import"../index-
|
|
8
|
+
import"../index-7mjsb7zv.js";
|
|
9
9
|
import"../index-m38ej7e5.js";
|
|
10
10
|
import"../index-78da4g74.js";
|
|
11
11
|
import"../index-yrhw10ef.js";
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
isTrustProxyHandler,
|
|
18
18
|
createHandler2
|
|
19
|
-
} from "../index-
|
|
19
|
+
} from "../index-m2b49tvc.js";
|
|
20
20
|
import {
|
|
21
21
|
secretsEqual
|
|
22
22
|
} from "../index-apv5xfef.js";
|
package/dist/entrypoints/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import"../index-78da4g74.js";
|
|
2
2
|
import"../index-yrhw10ef.js";
|
|
3
|
-
import"../index-
|
|
3
|
+
import"../index-7mjsb7zv.js";
|
|
4
4
|
import"../index-m38ej7e5.js";
|
|
5
5
|
import"../index-yt1gg11x.js";
|
|
6
6
|
import {
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
} from "../index-y68gavb5.js";
|
|
36
36
|
import {
|
|
37
37
|
createHandler2
|
|
38
|
-
} from "../index-
|
|
38
|
+
} from "../index-m2b49tvc.js";
|
|
39
39
|
import {
|
|
40
40
|
createMultipartStream2,
|
|
41
41
|
implement2,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
DEFAULT_CORS_EXPOSE_HEADERS2,
|
|
14
14
|
corsHeaders2,
|
|
15
15
|
corsPreflightResponse2
|
|
16
|
-
} from "../index-
|
|
16
|
+
} from "../index-7mjsb7zv.js";
|
|
17
17
|
import {
|
|
18
18
|
joinRoutePath,
|
|
19
19
|
parseTrailingWildcard
|
|
@@ -89,7 +89,7 @@ import {
|
|
|
89
89
|
ndjsonRoute2,
|
|
90
90
|
sseRoute2,
|
|
91
91
|
createHandler2
|
|
92
|
-
} from "../index-
|
|
92
|
+
} from "../index-m2b49tvc.js";
|
|
93
93
|
import {
|
|
94
94
|
secretsEqual
|
|
95
95
|
} from "../index-apv5xfef.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"../../index-
|
|
1
|
+
import"../../index-7mjsb7zv.js";
|
|
2
2
|
import"../../index-78da4g74.js";
|
|
3
3
|
import"../../index-dsa676h8.js";
|
|
4
4
|
import"../../index-27hck3z2.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
createMcpHandler2,
|
|
22
22
|
createMcpHttpRoute2,
|
|
23
23
|
createStdioMcpServer2
|
|
24
|
-
} from "../../index-
|
|
24
|
+
} from "../../index-zag9sjpd.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_PROCESS_SIGNALS,
|
|
27
27
|
defaultSignalSource,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
guardSignalCallback
|
|
30
30
|
} from "../../index-3prvb42w.js";
|
|
31
31
|
import"../../index-67pnt4bh.js";
|
|
32
|
-
import"../../index-
|
|
32
|
+
import"../../index-a09r9ff0.js";
|
|
33
33
|
import"../../index-k9g061ma.js";
|
|
34
34
|
import {
|
|
35
35
|
MCP_CATALOG_META_KEY2,
|
|
@@ -19,15 +19,15 @@ import"../../index-0x4mnwg5.js";
|
|
|
19
19
|
import"../../index-6kec3b14.js";
|
|
20
20
|
import"../../index-gy9x38a2.js";
|
|
21
21
|
import"../../index-yrhw10ef.js";
|
|
22
|
-
import"../../index-
|
|
22
|
+
import"../../index-7mjsb7zv.js";
|
|
23
23
|
import {
|
|
24
24
|
mountMcp2,
|
|
25
25
|
buildMcpServer2,
|
|
26
26
|
createMcpHandler2,
|
|
27
27
|
createStdioMcpServer2
|
|
28
|
-
} from "../../index-
|
|
28
|
+
} from "../../index-zag9sjpd.js";
|
|
29
29
|
import"../../index-67pnt4bh.js";
|
|
30
|
-
import"../../index-
|
|
30
|
+
import"../../index-a09r9ff0.js";
|
|
31
31
|
import"../../index-k9g061ma.js";
|
|
32
32
|
import {
|
|
33
33
|
mountAgentTools2
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "../index-xrsryvd2.js";
|
|
7
7
|
import {
|
|
8
8
|
DEFAULT_CORS_ALLOW_HEADERS2
|
|
9
|
-
} from "../index-
|
|
9
|
+
} from "../index-7mjsb7zv.js";
|
|
10
10
|
import"../index-27hck3z2.js";
|
|
11
11
|
import"../index-ngwf1s3c.js";
|
|
12
12
|
import {
|
|
@@ -75,7 +75,7 @@ import {
|
|
|
75
75
|
wwwAuthenticateHeader2,
|
|
76
76
|
oauthProtectedResourceRoute2,
|
|
77
77
|
createMcpProgressReporter
|
|
78
|
-
} from "../index-
|
|
78
|
+
} from "../index-a09r9ff0.js";
|
|
79
79
|
import {
|
|
80
80
|
PORTABLE_JSON_SCHEMA_FORMATS2,
|
|
81
81
|
findNonPortableFormats2,
|
|
@@ -12,7 +12,7 @@ export declare const NativeLayoutSchema: z.ZodObject<{
|
|
|
12
12
|
x64: z.ZodString;
|
|
13
13
|
}, z.core.$strict>;
|
|
14
14
|
}, z.core.$strict>;
|
|
15
|
-
/** One published addon: its package path and the size and SHA256 of the bytes
|
|
15
|
+
/** One published addon: its package path and the size and SHA256 of the bytes StitchKit built. */
|
|
16
16
|
export declare const NativeAssetEntrySchema: z.ZodObject<{
|
|
17
17
|
path: z.ZodString;
|
|
18
18
|
size: z.ZodInt;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEADLINE_BUDGET_HEADER2
|
|
3
|
+
} from "./index-k137ezb6.js";
|
|
4
|
+
|
|
1
5
|
// src/server/middleware/cors.ts
|
|
2
6
|
import { z } from "zod";
|
|
3
7
|
var CorsOriginDecisionSchema = z.union([
|
|
@@ -47,7 +51,7 @@ function deniedRequestCors(config) {
|
|
|
47
51
|
safelistedBody: "refused"
|
|
48
52
|
};
|
|
49
53
|
}
|
|
50
|
-
var DEFAULT_CORS_ALLOW_HEADERS2 =
|
|
54
|
+
var DEFAULT_CORS_ALLOW_HEADERS2 = `Content-Type, Authorization, X-Trace-Id, traceparent, tracestate, ${DEADLINE_BUDGET_HEADER2}`;
|
|
51
55
|
var DEFAULT_CORS_EXPOSE_HEADERS2 = "Content-Disposition, Content-Length, Content-Range, Accept-Ranges, ETag, Last-Modified, X-Request-Id, X-Build-Id";
|
|
52
56
|
function assertCorsConfig(config) {
|
|
53
57
|
if (isOriginPolicy(config)) {
|