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
|
@@ -1,14 +1,148 @@
|
|
|
1
|
-
# Upgrading 0.
|
|
1
|
+
# Upgrading 0.62.0 → 0.78.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.
|
|
6
|
+
Contains: Guide: Upgrading, 0.62.0 → 0.78.0 (docs/guide/upgrading.md)
|
|
7
7
|
|
|
8
8
|
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.
|
|
9
|
+
# Guide: Upgrading, 0.62.0 → 0.78.0 (docs/guide/upgrading.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
+
## Released migration: 0.78.0
|
|
13
|
+
|
|
14
|
+
Two mechanical edits. Find them both:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
rg -n "createDecisionPipeline|createDiagnosticJournal" --glob '*.ts' --glob '*.tsx'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**1. `createDecisionPipeline` takes a deadline.**
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// before
|
|
24
|
+
createDecisionPipeline([policyA, policyB])
|
|
25
|
+
// after
|
|
26
|
+
createDecisionPipeline([policyA, policyB], { policyTimeoutMs: 2_000 })
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Pick a number your slowest policy comfortably beats. There is no default on
|
|
30
|
+
purpose: a policy that never settles hangs every caller of the operation it
|
|
31
|
+
guards, and the framework has no basis for choosing that number for you.
|
|
32
|
+
|
|
33
|
+
Past the deadline — and on a throw, and on a non-decision — the pipeline raises
|
|
34
|
+
`DecisionPolicyError` naming the policy, with the trace so far. If you already
|
|
35
|
+
catch that for a bad return value, you now catch two more cases with it.
|
|
36
|
+
|
|
37
|
+
**2. `createDiagnosticJournal` moved.**
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
// before
|
|
41
|
+
import { createDiagnosticJournal } from 'stitchkit/application'
|
|
42
|
+
// after
|
|
43
|
+
import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Only the factory moved. `DiagnosticJournalConfig`, every
|
|
47
|
+
`DiagnosticJournal*Schema` and `readDiagnosticJournalLockDiagnosis` stay where
|
|
48
|
+
they were.
|
|
49
|
+
|
|
50
|
+
**If you restart resources**, nothing to change — but three things that did not
|
|
51
|
+
work now do: a managed schedule can be restarted, a restarted keyspace accepts
|
|
52
|
+
writes again, and a restarted managed server is actually shut down at exit. If
|
|
53
|
+
you pass `managedServerResource` a server *instance*, a restart is now refused
|
|
54
|
+
by name; pass a factory (`server: (context) => …`) to restart it.
|
|
55
|
+
|
|
56
|
+
## Released migration: 0.77.0
|
|
57
|
+
|
|
58
|
+
Two type renames, and only if you named them. Nothing runtime moved.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
rg -n "EventDecision|EventUndecided" --glob '*.ts' --glob '*.tsx'
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
// before
|
|
66
|
+
import type { EventDecision, EventUndecided } from 'stitchkit/live'
|
|
67
|
+
// after
|
|
68
|
+
import type { PolicyDecision, UndecidedOutcome } from 'stitchkit/live'
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The shapes are identical — `{ outcome: 'allow' } | { outcome: 'deny', reason } | { outcome: 'defer' }`
|
|
72
|
+
and `'allow' | 'deny'`. If you only ever *return* decisions from listeners and never named the
|
|
73
|
+
type, the search above finds nothing and there is nothing to do.
|
|
74
|
+
|
|
75
|
+
They were renamed because `createDecisionPipeline` (new in this release) votes with exactly the
|
|
76
|
+
same three outcomes, and two identical types under two names is the thing that makes a search for
|
|
77
|
+
either one return half the truth.
|
|
78
|
+
|
|
79
|
+
## Released migration: 0.76.0
|
|
80
|
+
|
|
81
|
+
One change, and only if you hand `createWatchClient` a transport you wrote yourself.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
rg -n "createWatchClient" --glob '*.ts'
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
If the `transport:` you pass is a bound realtime client — `bindRealtimeClient(...)` or
|
|
88
|
+
`createRealtimeClient(...)` — there is nothing to do: it already carries
|
|
89
|
+
`onConnectionChange`. If it is an object you assembled, add the fourth member:
|
|
90
|
+
|
|
91
|
+
```ts
|
|
92
|
+
onConnectionChange(listener: (connected: boolean, reason?: string) => void): () => void
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
It is required because the client recovers through it: on a drop it publishes
|
|
96
|
+
`unavailable` to subscribers and forgets what was opened, and on a fresh
|
|
97
|
+
connection it re-opens every key that still has a listener. Without it a watch
|
|
98
|
+
stays "open" on the client after a server restart while the hub remembers
|
|
99
|
+
nothing, and the face stops updating without saying so.
|
|
100
|
+
|
|
101
|
+
## Released migration: 0.75.0
|
|
102
|
+
|
|
103
|
+
Two mechanical renames and one option that has to move. Nothing about a passing
|
|
104
|
+
request changes.
|
|
105
|
+
|
|
106
|
+
### 1. A route group's `onRequest`
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
rg -n "hooks:\s*\{[^}]*onRequest" --glob '*.ts'
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Any match **inside a `groups: [...]` entry** must move. The hook was accepted and
|
|
113
|
+
never dispatched, so the behaviour you have today is "no hook"; the fix is to
|
|
114
|
+
decide which one you meant:
|
|
115
|
+
|
|
116
|
+
```ts
|
|
117
|
+
// refuse before dispatch, for the whole server
|
|
118
|
+
createServer({ groups, hooks: { onRequest: gate } });
|
|
119
|
+
|
|
120
|
+
// gate this group once the endpoint is known
|
|
121
|
+
groups: [{ pathPrefix: '/admin', services, hooks: { authorize: gate } }]
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
A group that still declares `onRequest` fails at startup with that message.
|
|
125
|
+
|
|
126
|
+
### 2. The SQLite boundary type
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
rg -l "AgentRuntimeSqlite(Database|Statement|Value)" | xargs sed -i \
|
|
130
|
+
-e 's/AgentRuntimeSqliteDatabase/SqliteDatabase/g' \
|
|
131
|
+
-e 's/AgentRuntimeSqliteStatement/SqliteStatement/g' \
|
|
132
|
+
-e 's/AgentRuntimeSqliteValue/SqliteValue/g'
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Type-only: the same three methods, the same structural compatibility with
|
|
136
|
+
`bun:sqlite` and a `node:sqlite` wrapper, imported from the same entrypoints.
|
|
137
|
+
`initializeAgentRuntimeSqlite` keeps its name — it really is the agent runtime's
|
|
138
|
+
schema.
|
|
139
|
+
|
|
140
|
+
### 3. Nothing else
|
|
141
|
+
|
|
142
|
+
`stitchkit/live`, the watch hub, the keyspace and the trust fence are all
|
|
143
|
+
additive. Adopt them when you want them; the guide is
|
|
144
|
+
[Live data](./live.md).
|
|
145
|
+
|
|
12
146
|
## Released migration: 0.74.0
|
|
13
147
|
|
|
14
148
|
One change, and it only reaches you if you catch a refusal the **client** raised — one it made while
|
|
@@ -957,140 +1091,3 @@ exhaustively on any of those enums, add the arm** — that is the part of this
|
|
|
957
1091
|
release that can break a build rather than a behaviour. The record itself is
|
|
958
1092
|
kept: it is excluded from the projection, not deleted, so an operator can still
|
|
959
1093
|
see what was thrown away.
|
|
960
|
-
|
|
961
|
-
## Released migration: 0.61.0
|
|
962
|
-
|
|
963
|
-
Three behaviour changes between versions. None moves an export — the surface is
|
|
964
|
-
strictly additive — and all three change what a running system does, which is
|
|
965
|
-
what this heading is for.
|
|
966
|
-
|
|
967
|
-
### A failed `start()` now drains before it rejects
|
|
968
|
-
|
|
969
|
-
The rollback of a failed startup used to close every resource with a zero
|
|
970
|
-
budget: it returned almost at once, by severing requests the server had already
|
|
971
|
-
accepted. It now spends the application's shutdown budget, so a request already
|
|
972
|
-
in flight is answered rather than killed.
|
|
973
|
-
|
|
974
|
-
**What to check.** Nothing, if a failed startup has nothing in flight — the
|
|
975
|
-
rollback still returns immediately. The case to think about is a request that
|
|
976
|
-
never finishes: a hung upstream, a client ignoring a close frame, a streaming
|
|
977
|
-
subscription. Under the default 30s grace and 5s force, a `start()` that used to
|
|
978
|
-
reject in milliseconds can now take 35 seconds to reject.
|
|
979
|
-
|
|
980
|
-
If a fast failure matters more than draining — a supervisor waiting to restart,
|
|
981
|
-
a boot check in CI — declare a smaller budget. The same field is the default for
|
|
982
|
-
`shutdown()` with no options, so this is one decision, not two:
|
|
983
|
-
|
|
984
|
-
```ts
|
|
985
|
-
// before
|
|
986
|
-
createApplication({ id: 'app', resources })
|
|
987
|
-
|
|
988
|
-
// after
|
|
989
|
-
createApplication({
|
|
990
|
-
id: 'app',
|
|
991
|
-
resources,
|
|
992
|
-
shutdown: { gracePeriodMs: 5_000, forceTimeoutMs: 1_000 },
|
|
993
|
-
})
|
|
994
|
-
```
|
|
995
|
-
|
|
996
|
-
The budget is a real bound: a `close` that never returns is abandoned when it
|
|
997
|
-
runs out and reported as a `close` failure, and the startup error remains the
|
|
998
|
-
`cause` of the `AggregateError` `start()` rejects with. → ADR 0107
|
|
999
|
-
|
|
1000
|
-
### A refused realtime frame now answers its sender
|
|
1001
|
-
|
|
1002
|
-
A frame that fails the receiver's `args` schema used to be dropped where it
|
|
1003
|
-
landed. If the event carries an acknowledgement, the receiver now answers it
|
|
1004
|
-
with a reserved envelope and the sender's `request()` rejects at once with
|
|
1005
|
-
`RealtimeRequestRejectedError`. → ADR 0106
|
|
1006
|
-
|
|
1007
|
-
**What to check before you upgrade one half of a distributed pair.** Look at the
|
|
1008
|
-
`ack` schemas on the OLDER peer:
|
|
1009
|
-
|
|
1010
|
-
```ts
|
|
1011
|
-
// safe: a contract-first acknowledgement refuses the envelope, so the older
|
|
1012
|
-
// peer raises RealtimeRequestInvalidAcknowledgementError at once instead of
|
|
1013
|
-
// waiting out its deadline. Different error, still an error, and sooner.
|
|
1014
|
-
ack: z.object({ stored: z.boolean() })
|
|
1015
|
-
|
|
1016
|
-
// NOT safe: a schema that validates nothing accepts the refusal AS A VALUE.
|
|
1017
|
-
// The older peer reads a refusal as a successful acknowledgement — silently.
|
|
1018
|
-
ack: z.unknown()
|
|
1019
|
-
ack: z.looseObject({})
|
|
1020
|
-
```
|
|
1021
|
-
|
|
1022
|
-
If any acknowledgement on the older side is permissive, tighten it before the
|
|
1023
|
-
rollout, or upgrade both halves together.
|
|
1024
|
-
|
|
1025
|
-
Also: the receiver now invokes the peer's raw acknowledgement callback for a
|
|
1026
|
-
refused frame, including when the peer is a plain Socket.IO client. That
|
|
1027
|
-
callback previously could not run on a refused frame and now can.
|
|
1028
|
-
|
|
1029
|
-
`RealtimeRejectedEvent['reason']` gained `'rejected-by-peer'`. If you `switch`
|
|
1030
|
-
over it exhaustively with an `assertNever` default, that stops compiling — add
|
|
1031
|
-
the case.
|
|
1032
|
-
|
|
1033
|
-
### Two smaller behaviour changes, easy to miss
|
|
1034
|
-
|
|
1035
|
-
**`streamSSE`'s `cancel` no longer awaits the generator.** Teardown is now
|
|
1036
|
-
unordered relative to request completion. If your generator releases a resource
|
|
1037
|
-
in `return()`/`finally` — a temp file, a pooled connection — and anything
|
|
1038
|
-
downstream assumed that had finished by the time the response settled, it no
|
|
1039
|
-
longer has. Release in the generator's own `finally` and do not depend on the
|
|
1040
|
-
ordering.
|
|
1041
|
-
|
|
1042
|
-
**A `socket.io-client` peer that cannot load no longer kills the process.** With
|
|
1043
|
-
`onConnectError` configured, the failure is delivered there with
|
|
1044
|
-
`terminal: true` instead of crashing. If your handler logs and moves on, you now
|
|
1045
|
-
have a live process whose client will never connect, where a supervisor used to
|
|
1046
|
-
restart it. Treat `terminal: true` as fatal if that is what you want.
|
|
1047
|
-
|
|
1048
|
-
### `reportHealth` inside `start` is no longer discarded
|
|
1049
|
-
|
|
1050
|
-
Becoming ready assigned `healthy` unconditionally, throwing away whatever a
|
|
1051
|
-
resource reported during `start`. It is now kept, and only a resource that
|
|
1052
|
-
reported nothing is assumed healthy.
|
|
1053
|
-
|
|
1054
|
-
**How to find what this touches:** grep your `start` bodies for **every**
|
|
1055
|
-
`reportHealth` call, not only the ones reporting `degraded`. The old
|
|
1056
|
-
unconditional assignment was also a repair — a resource that reported
|
|
1057
|
-
`'unhealthy'` early in `start` and never corrected itself was quietly fixed up
|
|
1058
|
-
on the way to ready.
|
|
1059
|
-
|
|
1060
|
-
Two cases, and they need opposite fixes.
|
|
1061
|
-
|
|
1062
|
-
**1. A resource that is genuinely expected to start degraded** — up, but still
|
|
1063
|
-
dialling something external. `required` defaults to **`true`**, and readiness
|
|
1064
|
-
requires every required resource to be healthy, so such a resource now refuses
|
|
1065
|
-
the whole startup where before its report vanished. That is the invariant
|
|
1066
|
-
working as intended; what changed is that it can be reached. Say what it is:
|
|
1067
|
-
|
|
1068
|
-
```ts
|
|
1069
|
-
// before: started, and its report was discarded
|
|
1070
|
-
defineManagedResource({ id: 'dialling', start: ({ reportHealth }) => reportHealth('degraded') })
|
|
1071
|
-
|
|
1072
|
-
// after: says what it is, and does not gate the application
|
|
1073
|
-
defineManagedResource({ id: 'dialling', required: false, start: ({ reportHealth }) => reportHealth('degraded') })
|
|
1074
|
-
```
|
|
1075
|
-
|
|
1076
|
-
**2. A resource that reported `'unhealthy'` early and became healthy later** —
|
|
1077
|
-
a pessimistic report before a connection settled. Here `required: false` is the
|
|
1078
|
-
**wrong** fix: it would hide a real failure. Report the recovery instead:
|
|
1079
|
-
|
|
1080
|
-
```ts
|
|
1081
|
-
start: async ({ reportHealth }) => {
|
|
1082
|
-
reportHealth('unhealthy')
|
|
1083
|
-
await connect()
|
|
1084
|
-
reportHealth('healthy') // ← previously unnecessary; now it is the fix
|
|
1085
|
-
}
|
|
1086
|
-
```
|
|
1087
|
-
|
|
1088
|
-
**Also check your health endpoint.** An **optional** resource reporting
|
|
1089
|
-
non-healthy during `start` now moves the application aggregate to `degraded`,
|
|
1090
|
-
where before it stayed `healthy`. A readiness probe that maps `degraded` to a
|
|
1091
|
-
non-200 will flip on upgrade — and a supervisor that restarts on that will loop.
|
|
1092
|
-
|
|
1093
|
-
The refusals now say which of the two happened: a resource that was never
|
|
1094
|
-
healthy is told it "is not healthy" and pointed at `required: false`; one that
|
|
1095
|
-
was healthy and stopped is told it "lost readiness" and pointed at
|
|
1096
|
-
`onResourceFailure`.
|
|
@@ -1,14 +1,95 @@
|
|
|
1
|
-
# Upgrading 0.
|
|
1
|
+
# Upgrading 0.79.0 → 0.103.13 — 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.
|
|
6
|
+
Contains: Guide: Upgrading, 0.79.0 → 0.103.13 (docs/guide/upgrading.md)
|
|
7
7
|
|
|
8
8
|
==============================================================================
|
|
9
|
-
# Guide: Upgrading, 0.
|
|
9
|
+
# Guide: Upgrading, 0.79.0 → 0.103.13 (docs/guide/upgrading.md)
|
|
10
10
|
==============================================================================
|
|
11
11
|
|
|
12
|
+
## Released migration: 0.103.13
|
|
13
|
+
|
|
14
|
+
### Darwin native assets in JS distributions
|
|
15
|
+
|
|
16
|
+
**Who must act:** Bun builds that import `stitchkit/server`, `stitchkit/files` or
|
|
17
|
+
`stitchkit/process` (Linux-only server apps included) and use `--outfile`, copy only
|
|
18
|
+
`outputs[0]`, or package a single file; custom single-file/archive packagers and installers
|
|
19
|
+
delivering native process/files capabilities.
|
|
20
|
+
First affected publication: **0.103.13**, through **0.104.2**. It shipped as a patch; its
|
|
21
|
+
changed delivery graph requires this migration despite unchanged API signatures.
|
|
22
|
+
|
|
23
|
+
In those versions every Bun bundle that reaches the lock or process-identity code,
|
|
24
|
+
`stitchkit/server` included, carries both Darwin `.node` addons as extra outputs on every
|
|
25
|
+
operating system. `bun build --outfile` then fails with
|
|
26
|
+
`cannot write multiple output files without an output directory`, and `--outdir` writes the
|
|
27
|
+
addons next to a Linux artifact. Releases after 0.104.2 resolve the default loader at run time,
|
|
28
|
+
so these bundles are one JS file with no `.node` output again. The static loader exists only
|
|
29
|
+
in a build that uses the `stitchkit/files/packaging` plugin.
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
# Before: one JS file was assumed to be the entire distribution.
|
|
33
|
+
bun build src/native.ts --target=bun --outfile=dist/native.js
|
|
34
|
+
# After: retain every output, with its relative path.
|
|
35
|
+
bun build src/native.ts --target=bun --outdir=dist --entry-naming=native.js
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
For `Bun.build`, copy **all** `result.outputs`, not just the JS entry or `outputs[0]`.
|
|
39
|
+
A single-file JS distribution cannot embed a native `.node` addon automatically.
|
|
40
|
+
An archive may contain JS plus companion assets, materialized together before execution.
|
|
41
|
+
Custom output layout uses the evolving build-only packaging contract in the
|
|
42
|
+
[native IO guide](native-io.md#public-native-packaging).
|
|
43
|
+
|
|
44
|
+
Three deliveries have different rules: an ordinary npm install retains the package's
|
|
45
|
+
native assets; a JS distribution must ship its complete output graph; a Bun compiled
|
|
46
|
+
executable embeds the matching addon and may still use `--outfile`. In 0.103.13–0.104.2 a plain
|
|
47
|
+
`bun build` carries the addon without a plugin. Later releases load it from a bundle only when
|
|
48
|
+
the build uses `createNativePackaging` (`delivery: 'companion'` for JS, `'embedded'` for a
|
|
49
|
+
compiled executable). Without the plugin, Bun may still copy the addon's bytes into a compiled
|
|
50
|
+
executable, but the loader never uses them, so their presence proves nothing.
|
|
51
|
+
|
|
52
|
+
What an unpackaged bundle does depends on the release:
|
|
53
|
+
|
|
54
|
+
- **0.105.0–0.106.1:** the bundle carries the absolute path of the package on the build machine,
|
|
55
|
+
because the loader read `__dirname`. It looks for the addon there, so it works only on that
|
|
56
|
+
machine, and the path itself leaks into a distributed artifact. Rebuild with a later release.
|
|
57
|
+
- **0.107.0 and later:** no build path is in the artifact, and the first call that needs the
|
|
58
|
+
addon reports the Darwin backend `unavailable` with stage `packaging`.
|
|
59
|
+
|
|
60
|
+
Only macOS is affected, and only process identity (`observeProcessInstance`,
|
|
61
|
+
`probeProcessOwner`), exclusive locks and contained Agent file operations load the addon. The
|
|
62
|
+
managed file boundary, atomic writes and the chunk spool never do. The
|
|
63
|
+
[native IO guide](native-io.md#libraries-with-a-zod-only-runtime) is the canonical recipe and
|
|
64
|
+
shows how to check an artifact by its loader without running it on a Mac. Check the resulting
|
|
65
|
+
artifact offline outside the build tree and `node_modules`, including process identity,
|
|
66
|
+
live-owner lock refusal, dead-owner recovery and contained IO. A missing or corrupt addon
|
|
67
|
+
remains `unavailable`, never evidence that an owner died.
|
|
68
|
+
|
|
69
|
+
### CLI: repeated options are refused
|
|
70
|
+
|
|
71
|
+
**Who must act:** wrappers, aliases and scripts that append `--json`, `--profile X` or an
|
|
72
|
+
application global to arguments the user may already have given, and anything that passes the
|
|
73
|
+
same global twice.
|
|
74
|
+
First affected publication: **0.103.13**. It shipped as a patch; the change in grammar needs
|
|
75
|
+
this migration.
|
|
76
|
+
|
|
77
|
+
A repeated option that is not an array field is an argument error:
|
|
78
|
+
`--json --json` and `--profile a --profile b` fail with `--json was passed 2 times`. Before
|
|
79
|
+
0.103.13 the last value won, for framework globals, application globals and repeated
|
|
80
|
+
`kind: 'other'` fields alike. Array fields, and untyped passthrough fields that keep their
|
|
81
|
+
raw-list grammar, still repeat.
|
|
82
|
+
|
|
83
|
+
```sh
|
|
84
|
+
# Before: a wrapper appended its default and the last value won.
|
|
85
|
+
mytool deploy --profile staging "$@" --profile production
|
|
86
|
+
# After: build the argument list once, so each option appears once.
|
|
87
|
+
mytool deploy --profile "${PROFILE:-production}" "$@"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Dotted leaves such as `--filter.name` follow the same rule as their parent field. Declare a
|
|
91
|
+
field as an array when repetition is meant.
|
|
92
|
+
|
|
12
93
|
## Released migration: 0.103.0
|
|
13
94
|
|
|
14
95
|
### Diagnostic journal startup preserves torn evidence and inspects archives
|
|
@@ -981,137 +1062,3 @@ that will never update again.
|
|
|
981
1062
|
**If you need a tool contract in a browser**, `stitchkit/tools/contract` now
|
|
982
1063
|
carries the async-operation helpers, its schemas and the view-file input/output
|
|
983
1064
|
without the runtime. `stitchkit/tools` still exports all of them.
|
|
984
|
-
|
|
985
|
-
## Released migration: 0.78.0
|
|
986
|
-
|
|
987
|
-
Two mechanical edits. Find them both:
|
|
988
|
-
|
|
989
|
-
```bash
|
|
990
|
-
rg -n "createDecisionPipeline|createDiagnosticJournal" --glob '*.ts' --glob '*.tsx'
|
|
991
|
-
```
|
|
992
|
-
|
|
993
|
-
**1. `createDecisionPipeline` takes a deadline.**
|
|
994
|
-
|
|
995
|
-
```ts
|
|
996
|
-
// before
|
|
997
|
-
createDecisionPipeline([policyA, policyB])
|
|
998
|
-
// after
|
|
999
|
-
createDecisionPipeline([policyA, policyB], { policyTimeoutMs: 2_000 })
|
|
1000
|
-
```
|
|
1001
|
-
|
|
1002
|
-
Pick a number your slowest policy comfortably beats. There is no default on
|
|
1003
|
-
purpose: a policy that never settles hangs every caller of the operation it
|
|
1004
|
-
guards, and the framework has no basis for choosing that number for you.
|
|
1005
|
-
|
|
1006
|
-
Past the deadline — and on a throw, and on a non-decision — the pipeline raises
|
|
1007
|
-
`DecisionPolicyError` naming the policy, with the trace so far. If you already
|
|
1008
|
-
catch that for a bad return value, you now catch two more cases with it.
|
|
1009
|
-
|
|
1010
|
-
**2. `createDiagnosticJournal` moved.**
|
|
1011
|
-
|
|
1012
|
-
```ts
|
|
1013
|
-
// before
|
|
1014
|
-
import { createDiagnosticJournal } from 'stitchkit/application'
|
|
1015
|
-
// after
|
|
1016
|
-
import { createDiagnosticJournal } from 'stitchkit/application/diagnostic-journal'
|
|
1017
|
-
```
|
|
1018
|
-
|
|
1019
|
-
Only the factory moved. `DiagnosticJournalConfig`, every
|
|
1020
|
-
`DiagnosticJournal*Schema` and `readDiagnosticJournalLockDiagnosis` stay where
|
|
1021
|
-
they were.
|
|
1022
|
-
|
|
1023
|
-
**If you restart resources**, nothing to change — but three things that did not
|
|
1024
|
-
work now do: a managed schedule can be restarted, a restarted keyspace accepts
|
|
1025
|
-
writes again, and a restarted managed server is actually shut down at exit. If
|
|
1026
|
-
you pass `managedServerResource` a server *instance*, a restart is now refused
|
|
1027
|
-
by name; pass a factory (`server: (context) => …`) to restart it.
|
|
1028
|
-
|
|
1029
|
-
## Released migration: 0.77.0
|
|
1030
|
-
|
|
1031
|
-
Two type renames, and only if you named them. Nothing runtime moved.
|
|
1032
|
-
|
|
1033
|
-
```bash
|
|
1034
|
-
rg -n "EventDecision|EventUndecided" --glob '*.ts' --glob '*.tsx'
|
|
1035
|
-
```
|
|
1036
|
-
|
|
1037
|
-
```ts
|
|
1038
|
-
// before
|
|
1039
|
-
import type { EventDecision, EventUndecided } from 'stitchkit/live'
|
|
1040
|
-
// after
|
|
1041
|
-
import type { PolicyDecision, UndecidedOutcome } from 'stitchkit/live'
|
|
1042
|
-
```
|
|
1043
|
-
|
|
1044
|
-
The shapes are identical — `{ outcome: 'allow' } | { outcome: 'deny', reason } | { outcome: 'defer' }`
|
|
1045
|
-
and `'allow' | 'deny'`. If you only ever *return* decisions from listeners and never named the
|
|
1046
|
-
type, the search above finds nothing and there is nothing to do.
|
|
1047
|
-
|
|
1048
|
-
They were renamed because `createDecisionPipeline` (new in this release) votes with exactly the
|
|
1049
|
-
same three outcomes, and two identical types under two names is the thing that makes a search for
|
|
1050
|
-
either one return half the truth.
|
|
1051
|
-
|
|
1052
|
-
## Released migration: 0.76.0
|
|
1053
|
-
|
|
1054
|
-
One change, and only if you hand `createWatchClient` a transport you wrote yourself.
|
|
1055
|
-
|
|
1056
|
-
```bash
|
|
1057
|
-
rg -n "createWatchClient" --glob '*.ts'
|
|
1058
|
-
```
|
|
1059
|
-
|
|
1060
|
-
If the `transport:` you pass is a bound realtime client — `bindRealtimeClient(...)` or
|
|
1061
|
-
`createRealtimeClient(...)` — there is nothing to do: it already carries
|
|
1062
|
-
`onConnectionChange`. If it is an object you assembled, add the fourth member:
|
|
1063
|
-
|
|
1064
|
-
```ts
|
|
1065
|
-
onConnectionChange(listener: (connected: boolean, reason?: string) => void): () => void
|
|
1066
|
-
```
|
|
1067
|
-
|
|
1068
|
-
It is required because the client recovers through it: on a drop it publishes
|
|
1069
|
-
`unavailable` to subscribers and forgets what was opened, and on a fresh
|
|
1070
|
-
connection it re-opens every key that still has a listener. Without it a watch
|
|
1071
|
-
stays "open" on the client after a server restart while the hub remembers
|
|
1072
|
-
nothing, and the face stops updating without saying so.
|
|
1073
|
-
|
|
1074
|
-
## Released migration: 0.75.0
|
|
1075
|
-
|
|
1076
|
-
Two mechanical renames and one option that has to move. Nothing about a passing
|
|
1077
|
-
request changes.
|
|
1078
|
-
|
|
1079
|
-
### 1. A route group's `onRequest`
|
|
1080
|
-
|
|
1081
|
-
```bash
|
|
1082
|
-
rg -n "hooks:\s*\{[^}]*onRequest" --glob '*.ts'
|
|
1083
|
-
```
|
|
1084
|
-
|
|
1085
|
-
Any match **inside a `groups: [...]` entry** must move. The hook was accepted and
|
|
1086
|
-
never dispatched, so the behaviour you have today is "no hook"; the fix is to
|
|
1087
|
-
decide which one you meant:
|
|
1088
|
-
|
|
1089
|
-
```ts
|
|
1090
|
-
// refuse before dispatch, for the whole server
|
|
1091
|
-
createServer({ groups, hooks: { onRequest: gate } });
|
|
1092
|
-
|
|
1093
|
-
// gate this group once the endpoint is known
|
|
1094
|
-
groups: [{ pathPrefix: '/admin', services, hooks: { authorize: gate } }]
|
|
1095
|
-
```
|
|
1096
|
-
|
|
1097
|
-
A group that still declares `onRequest` fails at startup with that message.
|
|
1098
|
-
|
|
1099
|
-
### 2. The SQLite boundary type
|
|
1100
|
-
|
|
1101
|
-
```bash
|
|
1102
|
-
rg -l "AgentRuntimeSqlite(Database|Statement|Value)" | xargs sed -i \
|
|
1103
|
-
-e 's/AgentRuntimeSqliteDatabase/SqliteDatabase/g' \
|
|
1104
|
-
-e 's/AgentRuntimeSqliteStatement/SqliteStatement/g' \
|
|
1105
|
-
-e 's/AgentRuntimeSqliteValue/SqliteValue/g'
|
|
1106
|
-
```
|
|
1107
|
-
|
|
1108
|
-
Type-only: the same three methods, the same structural compatibility with
|
|
1109
|
-
`bun:sqlite` and a `node:sqlite` wrapper, imported from the same entrypoints.
|
|
1110
|
-
`initializeAgentRuntimeSqlite` keeps its name — it really is the agent runtime's
|
|
1111
|
-
schema.
|
|
1112
|
-
|
|
1113
|
-
### 3. Nothing else
|
|
1114
|
-
|
|
1115
|
-
`stitchkit/live`, the watch hub, the keyspace and the trust fence are all
|
|
1116
|
-
additive. Adopt them when you want them; the guide is
|
|
1117
|
-
[Live data](./live.md).
|
package/llms/upgrading.txt
CHANGED
|
@@ -11,11 +11,11 @@ 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.
|
|
15
|
-
- 0.
|
|
16
|
-
- 0.
|
|
17
|
-
- 0.44.0 → 0.
|
|
18
|
-
- 0.37.0 → 0.
|
|
14
|
+
- 0.104.0 → 0.114.0: `llms/upgrading-0.104.0-0.114.0.txt`
|
|
15
|
+
- 0.79.0 → 0.103.13: `llms/upgrading-0.79.0-0.103.13.txt`
|
|
16
|
+
- 0.62.0 → 0.78.0: `llms/upgrading-0.62.0-0.78.0.txt`
|
|
17
|
+
- 0.44.0 → 0.61.0: `llms/upgrading-0.44.0-0.61.0.txt`
|
|
18
|
+
- 0.37.0 → 0.44.0: `llms/upgrading-0.37.0-0.44.0.txt`
|
|
19
19
|
|
|
20
20
|
# Upgrading stitchkit
|
|
21
21
|
|