akanjs 3.2.0-rc.18 → 3.2.0-rc.19
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/ARCHITECTURE.md +26 -26
- package/CHANGELOG.md +78 -15
- package/common/types.ts +4 -1
- package/document/noDocumentError.ts +4 -1
- package/document/queryEvaluator.ts +1 -1
- package/fetch/client/fetchClient.ts +68 -246
- package/fetch/client/fetchClientTypes.ts +49 -0
- package/fetch/client/requestScope.ts +32 -0
- package/fetch/client/signalCatalog.ts +131 -0
- package/fetch/client/wsClient.ts +10 -0
- package/package.json +1 -1
- package/server/akanApp.ts +1 -1
- package/server/akanServer.ts +144 -644
- package/server/artifact/builderRpc.ts +8 -4
- package/server/flightRowReader.ts +30 -7
- package/server/gateway/childSupervisor.ts +1 -0
- package/server/gateway/devHostChannel.ts +15 -8
- package/server/imageOptimizer.ts +4 -1
- package/server/lifecycle/parentChannel.ts +78 -0
- package/server/lifecycle/startGuard.ts +73 -0
- package/server/logging/serverLogging.ts +74 -0
- package/server/mcp/McpRouter.ts +1 -1
- package/server/mcp/McpUiSession.ts +2 -1
- package/server/oauth/OAuthClientIdMetadata.ts +2 -2
- package/server/resolver/database.resolver.ts +10 -417
- package/server/resolver/databaseModelInstance.ts +200 -0
- package/server/resolver/modelFacade.ts +136 -0
- package/server/resolver/modelLoaders.ts +52 -0
- package/server/resolver/modelSchema.ts +52 -0
- package/server/resolver/signal.resolver.ts +18 -20
- package/server/resolver/timedQuery.ts +16 -0
- package/server/routing/builtinRoutes.ts +194 -0
- package/server/routing/localRooms.ts +34 -0
- package/server/routing/roomReplay.ts +2 -2
- package/server/routing/serverListener.ts +194 -0
- package/server/rscClient.tsx +12 -11
- package/server/rscClientChunks.ts +100 -24
- package/server/rscClientPatch.ts +16 -13
- package/server/rscDocumentHead.tsx +170 -0
- package/server/rscFlightRenderer.ts +83 -0
- package/server/rscFlightStream.ts +257 -0
- package/server/rscHostReloads.ts +221 -0
- package/server/rscHostRenderStream.ts +290 -0
- package/server/rscHostRequests.ts +152 -0
- package/server/rscHttp.ts +8 -9
- package/server/rscRenderControl.ts +33 -0
- package/server/rscRenderFallbacks.ts +297 -0
- package/server/rscRenderHandler.ts +439 -0
- package/server/rscRenderStats.ts +49 -0
- package/server/rscResultCaches.ts +74 -0
- package/server/rscRouteDocument.tsx +299 -0
- package/server/rscWorker.tsx +76 -1337
- package/server/rscWorkerHost.ts +136 -803
- package/server/rscWorkerProcess.ts +154 -0
- package/server/rscWorkerRecycler.ts +128 -0
- package/server/serverConfig.ts +128 -0
- package/server/serverMetrics.ts +52 -0
- package/server/ssrFromRscRenderer.tsx +2 -2
- package/server/webRouter.ts +73 -57
- package/service/predefinedAdaptor/compress.adaptor.ts +2 -2
- package/service/predefinedAdaptor/solidQueue.adaptor.ts +2 -2
- package/service/predefinedAdaptor/solidSqlite.ts +3 -2
- package/service/predefinedAdaptor/sql/DocumentHydrator.ts +95 -0
- package/service/predefinedAdaptor/sql/DocumentRowCodec.ts +192 -0
- package/service/predefinedAdaptor/sql/DocumentWriter.ts +292 -0
- package/service/predefinedAdaptor/sql/QueryScope.ts +70 -0
- package/service/predefinedAdaptor/sql/QueryWriter.ts +200 -0
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +77 -1069
- package/service/predefinedAdaptor/sql/SqlTableSchema.ts +319 -0
- package/service/predefinedAdaptor/sql/StoredRows.ts +95 -0
- package/service/predefinedAdaptor/storage.adaptor.ts +2 -1
- package/service/predefinedAdaptor/websocket.adaptor.ts +50 -40
- package/signal/SignalFailure.ts +9 -8
- package/signal/byIdRead.ts +18 -0
- package/signal/endpointErrorContract.ts +1 -1
- package/signal/index.ts +1 -0
- package/signal/middleware.ts +6 -1
- package/signal/types.ts +11 -1
- package/types/common/types.d.ts +4 -1
- package/types/document/noDocumentError.d.ts +8 -1
- package/types/document/queryEvaluator.d.ts +1 -1
- package/types/fetch/client/fetchClient.d.ts +4 -35
- package/types/fetch/client/fetchClientTypes.d.ts +40 -0
- package/types/fetch/client/requestScope.d.ts +6 -0
- package/types/fetch/client/signalCatalog.d.ts +25 -0
- package/types/server/akanServer.d.ts +1 -1
- package/types/server/flightRowReader.d.ts +3 -1
- package/types/server/gateway/devHostChannel.d.ts +3 -2
- package/types/server/lifecycle/parentChannel.d.ts +13 -0
- package/types/server/lifecycle/startGuard.d.ts +9 -0
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/server/logging/serverLogging.d.ts +12 -0
- package/types/server/resolver/database.resolver.d.ts +2 -2
- package/types/server/resolver/databaseModelInstance.d.ts +4 -0
- package/types/server/resolver/modelFacade.d.ts +5 -0
- package/types/server/resolver/modelLoaders.d.ts +9 -0
- package/types/server/resolver/modelSchema.d.ts +6 -0
- package/types/server/resolver/signal.resolver.d.ts +1 -1
- package/types/server/resolver/timedQuery.d.ts +8 -0
- package/types/server/routing/builtinRoutes.d.ts +24 -0
- package/types/server/routing/localRooms.d.ts +14 -0
- package/types/server/routing/roomReplay.d.ts +2 -2
- package/types/server/routing/serverListener.d.ts +31 -0
- package/types/server/rscClientChunks.d.ts +2 -1
- package/types/server/rscClientPatch.d.ts +2 -1
- package/types/server/rscDocumentHead.d.ts +32 -0
- package/types/server/rscFlightRenderer.d.ts +14 -0
- package/types/server/rscFlightStream.d.ts +52 -0
- package/types/server/rscHostReloads.d.ts +52 -0
- package/types/server/rscHostRenderStream.d.ts +52 -0
- package/types/server/rscHostRequests.d.ts +28 -0
- package/types/server/rscHttp.d.ts +4 -3
- package/types/server/rscRenderControl.d.ts +12 -0
- package/types/server/rscRenderFallbacks.d.ts +41 -0
- package/types/server/rscRenderHandler.d.ts +29 -0
- package/types/server/rscRenderStats.d.ts +32 -0
- package/types/server/rscResultCaches.d.ts +18 -0
- package/types/server/rscRouteDocument.d.ts +52 -0
- package/types/server/rscWorker.d.ts +1 -3
- package/types/server/rscWorkerHost.d.ts +8 -71
- package/types/server/rscWorkerProcess.d.ts +30 -0
- package/types/server/rscWorkerRecycler.d.ts +22 -0
- package/types/server/serverConfig.d.ts +30 -0
- package/types/server/serverMetrics.d.ts +11 -0
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +1 -1
- package/types/service/predefinedAdaptor/sql/DocumentHydrator.d.ts +11 -0
- package/types/service/predefinedAdaptor/sql/DocumentRowCodec.d.ts +26 -0
- package/types/service/predefinedAdaptor/sql/DocumentWriter.d.ts +24 -0
- package/types/service/predefinedAdaptor/sql/QueryScope.d.ts +16 -0
- package/types/service/predefinedAdaptor/sql/QueryWriter.d.ts +20 -0
- package/types/service/predefinedAdaptor/sql/SqlDocumentStore.d.ts +1 -27
- package/types/service/predefinedAdaptor/sql/SqlTableSchema.d.ts +20 -0
- package/types/service/predefinedAdaptor/sql/StoredRows.d.ts +27 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +7 -3
- package/types/signal/byIdRead.d.ts +7 -0
- package/types/signal/index.d.ts +1 -1
- package/types/signal/types.d.ts +10 -1
- package/types/ui/Agent/Chat.d.ts +1 -1
- package/types/ui/recipe/badgeRecipe.d.ts +3 -3
- package/types/ui/recipe/buttonRecipe.d.ts +3 -3
- package/types/ui/recipe/inputRecipe.d.ts +1 -1
- package/ui/Agent/Chat.tsx +341 -164
- package/ui/Data/ListContainer.tsx +348 -181
- package/ui/Select.tsx +43 -51
- package/vendor/use-agentic/CHANGELOG.md +4 -4
- package/vendor/use-agentic/WIRE.md +24 -18
- package/vendor/use-agentic/httpRunner.ts +1 -1
package/ARCHITECTURE.md
CHANGED
|
@@ -96,14 +96,14 @@ Declared in [service/ipcTypes.ts](service/ipcTypes.ts).
|
|
|
96
96
|
| `live.models` | `SolidPubSub` | `AkanApp` |
|
|
97
97
|
| `queue.enqueued` | `SolidQueue` | `AkanApp` |
|
|
98
98
|
| `queue.wake` | `AkanApp` | `SolidQueue` |
|
|
99
|
-
| `health.ping` | `ChildSupervisor` | `
|
|
100
|
-
| `health.pong` | `
|
|
99
|
+
| `health.ping` | `ChildSupervisor` | `ParentChannel` |
|
|
100
|
+
| `health.pong` | `ParentChannel` | `AkanApp` |
|
|
101
101
|
| `ws.opened` | — | — |
|
|
102
102
|
| `ws.closed` | — | — |
|
|
103
|
-
| `metrics.report` | `
|
|
103
|
+
| `metrics.report` | `ServerMetrics` | `AkanApp` |
|
|
104
104
|
| `log.records` | `LogForwarder` | `AkanApp` |
|
|
105
|
-
| `log.level` | `ChildSupervisor`, `GatewayLogging` | `
|
|
106
|
-
| `shutdown` | `ChildSupervisor` | `
|
|
105
|
+
| `log.level` | `ChildSupervisor`, `GatewayLogging` | `ParentChannel` |
|
|
106
|
+
| `shutdown` | `ChildSupervisor` | `ParentChannel` |
|
|
107
107
|
| `file.resolve` | `NativeFile` | — |
|
|
108
108
|
| `file.resolved` | — | `NativeFile` |
|
|
109
109
|
| `secret.request` | `NativeSecret` | — |
|
|
@@ -120,19 +120,19 @@ Declared in [server/artifact/ipcTypes.ts](server/artifact/ipcTypes.ts).
|
|
|
120
120
|
| `build-csr` | `BuilderRpc` | `AkanApp`, `BuilderRequestRelay`, `DevBackend`, `IncrementalBuilder` |
|
|
121
121
|
| `build-graph` | `BuilderRpc` | `AkanApp`, `BuilderRequestRelay`, `DevBackend`, `IncrementalBuilder` |
|
|
122
122
|
| `build-route-res` | `BuilderRequestRelay`, `IncrementalBuilder` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
123
|
-
| `build-csr-res` | `BuilderRequestRelay`, `
|
|
123
|
+
| `build-csr-res` | `BuilderRequestRelay`, `CsrRegistry` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
124
124
|
| `build-graph-res` | `BuilderRequestRelay`, `IncrementalBuilder` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
125
125
|
| `builder-shutdown` | `IncrementalBuilderHost` | `IncrementalBuilder` |
|
|
126
|
-
| `builder-ready` | `
|
|
126
|
+
| `builder-ready` | `BuilderBoot`, `BuilderChannel` | `AkanApp`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
127
127
|
| `backend-ready` | `ChildSupervisor` | `DevBackend` |
|
|
128
128
|
| `invalidate` | `DevRecycler`, `prepareDevWatchBatch` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `DevBuilder`, `IncrementalBuilderHost` |
|
|
129
129
|
| `css-updated` | `BuildBatch`, `IncrementalBuilder` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `DevBuilder`, `IncrementalBuilderHost`, `shouldRelayRecycledFrontendState` |
|
|
130
130
|
| `pages-updated` | `BuildBatch`, `IncrementalBuilder` | `AkanApp`, `AkanAppHost`, `BuilderRpc`, `DevBuilder`, `IncrementalBuilderHost`, `shouldRelayRecycledFrontendState` |
|
|
131
|
-
| `csr-updated` | `BuildBatch`, `
|
|
132
|
-
| `ssr-updated` | `BuildBatch`, `
|
|
133
|
-
| `build-status` | `BuildBatch`, `DevBackend`, `DevHostChannel`, `
|
|
134
|
-
| `builder-metrics` | `
|
|
135
|
-
| `boot-armed` | `IncrementalBuilder` | `AkanAppHost`, `IncrementalBuilderHost` |
|
|
131
|
+
| `csr-updated` | `BuildBatch`, `CsrRegistry` | `AkanApp`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
132
|
+
| `ssr-updated` | `BuildBatch`, `SsrRegistry` | `AkanApp`, `BuilderRpc`, `IncrementalBuilderHost` |
|
|
133
|
+
| `build-status` | `BuildBatch`, `BuilderBoot`, `DevBackend`, `DevHostChannel`, `sendBuildStatus` | `AkanApp`, `AkanAppHost`, `BuildBatchRunner`, `BuilderRpc`, `DevBackend`, `DevBuilder`, `IncrementalBuilderHost` |
|
|
134
|
+
| `builder-metrics` | `BuilderLanes` | `AkanAppHost`, `DevBuilder`, `IncrementalBuilderHost` |
|
|
135
|
+
| `boot-armed` | `BuilderBoot`, `IncrementalBuilder` | `AkanAppHost`, `IncrementalBuilderHost` |
|
|
136
136
|
|
|
137
137
|
### `InMsg`: server → RSC worker
|
|
138
138
|
|
|
@@ -140,10 +140,10 @@ Declared in [server/rscWorker.tsx](server/rscWorker.tsx).
|
|
|
140
140
|
|
|
141
141
|
| Message | Sent by | Handled by |
|
|
142
142
|
| --- | --- | --- |
|
|
143
|
-
| `init` | `
|
|
144
|
-
| `render` | `
|
|
145
|
-
| `cancel` | `
|
|
146
|
-
| `reload` | `
|
|
143
|
+
| `init` | `RscHostReloads` | `RscRenderer` |
|
|
144
|
+
| `render` | `RscHostRequests` | `RscRenderer` |
|
|
145
|
+
| `cancel` | `RscHostRequests` | `RscRenderer` |
|
|
146
|
+
| `reload` | `RscHostReloads` | `RscRenderer` |
|
|
147
147
|
| `updateCssAssets` | `RscWorker` | `RscRenderer` |
|
|
148
148
|
| `invalidate-cache` | `createRscWorkerInvalidateCacheMessage` | `RscRenderer` |
|
|
149
149
|
| `log-level` | `RscWorker` | `RscRenderer` |
|
|
@@ -161,22 +161,22 @@ Declared in [server/rscWorkerHost.ts](server/rscWorkerHost.ts).
|
|
|
161
161
|
| `hello` | `RscRenderer` | `RscWorker` |
|
|
162
162
|
| `ready` | `RscRenderer` | `RscWorker` |
|
|
163
163
|
| `reloaded` | `RscRenderer` | `RscWorker` |
|
|
164
|
-
| `meta` | `
|
|
165
|
-
| `theme` | `
|
|
166
|
-
| `cache-state` | `
|
|
167
|
-
| `chunk` | `
|
|
168
|
-
| `end` | `
|
|
169
|
-
| `redirect` | `
|
|
170
|
-
| `late-redirect` | `
|
|
171
|
-
| `late-not-found` | `
|
|
172
|
-
| `not-found` | `
|
|
164
|
+
| `meta` | `RscFlightStream`, `RscRenderHandler` | `RscWorker` |
|
|
165
|
+
| `theme` | `RscFlightStream` | `RscWorker` |
|
|
166
|
+
| `cache-state` | `RscFlightStream` | `RscWorker` |
|
|
167
|
+
| `chunk` | `RscFlightStream` | `RscWorker` |
|
|
168
|
+
| `end` | `RscFlightStream`, `RscRenderHandler` | `RscWorker` |
|
|
169
|
+
| `redirect` | `RscRenderFallbacks` | `RscWorker` |
|
|
170
|
+
| `late-redirect` | `RscFlightStream` | `RscWorker` |
|
|
171
|
+
| `late-not-found` | `RscFlightStream` | `RscWorker` |
|
|
172
|
+
| `not-found` | `RscRenderFallbacks` | `RscWorker` |
|
|
173
173
|
| `metrics` | `RscRenderer` | `RscWorker` |
|
|
174
174
|
| `log.records` | `LogForwarder` | `RscWorker` |
|
|
175
175
|
| `page-prompts.result` | `RscRenderer` | `RscWorker` |
|
|
176
176
|
| `page-prompt.result` | `RscRenderer` | `RscWorker` |
|
|
177
177
|
| `page-prompts.visible.result` | `RscRenderer` | `RscWorker` |
|
|
178
178
|
| `web-manifest.result` | `RscRenderer` | `RscWorker` |
|
|
179
|
-
| `error` | `RscRenderer` | `RscWorker` |
|
|
179
|
+
| `error` | `RscRenderFallbacks`, `RscRenderer` | `RscWorker` |
|
|
180
180
|
|
|
181
181
|
### `HmrMessage`: dev server → browser tab
|
|
182
182
|
|
package/CHANGELOG.md
CHANGED
|
@@ -74,10 +74,20 @@
|
|
|
74
74
|
|
|
75
75
|
- 8c70603: A failed agent turn now names a code a host can branch on, beside the message it already sent, which is unchanged. No upgrade step is needed: the fields are new.
|
|
76
76
|
|
|
77
|
-
- The relay's `error` event and `AgentTurnStream.failure` carry `code`, named the way a failed MCP tool call is. That is the
|
|
78
|
-
- `use-agentic`'s `RunnerEvent` error gains an optional `code`. `httpRunner` reads it from a stream's error event and keeps it only when it is a dictionary key or one camelCase token. A failure answered before the stream opens is named by its body's bounded code, else by its status. A 401 or 403 takes no dictionary key there either, so a refusal reads the
|
|
77
|
+
- The relay's `error` event and `AgentTurnStream.failure` carry `code`, named the way a failed MCP tool call is: by the body the relay would have answered with before its stream opened, so a failure, a 5xx included, reads the same code either side of it. That is the dictionary key in the body, else its code token, else the status's name. The token is an `AkanError`'s own code when its JSON carries it, as a generalized answer always does, or the code a third-party error's own JSON carries. A 401 or 403 takes no key, and a guard's is named by its status alone. `SignalFailure.codeOf(error, status)` holds that rule, and a failed MCP tool call is now named through it too.
|
|
78
|
+
- `use-agentic`'s `RunnerEvent` error gains an optional `code`. `httpRunner` reads it from a stream's error event and keeps it only when it is a dictionary key or one camelCase token. A failure answered before the stream opens is named by its JSON body's bounded code, whether or not the body carries a message, else by its status. A 401 or 403 takes no dictionary key there either, so a refusal or a 5xx reads the code a streamed `error` event names for it. WIRE.md states that rule, and the two cases where the akan server still names a failure differently.
|
|
79
79
|
- The in-page chat keeps the key as `code` after translating the message. The session records it on the failed assistant message as `ChatMessage.errorCode`, which a host reads and the transcript never sends back.
|
|
80
80
|
|
|
81
|
+
- 0a81afa: A generated `<model>` or `light<Model>` read asked for an id that does not exist now logs its 404 at debug, not as an ERROR line. A page guard that checks a document exists, such as `await fetch.memo(memoId)`, used to send every stale link, crawler hit or made-up id to error alerts. The caller still gets the same 404 `base.error.documentNotFound`, and OpenAPI and the MCP catalogue are unchanged.
|
|
82
|
+
|
|
83
|
+
Only the miss of the document the read was asked for, by its model and the call's id, is quieted. Every other missing document still logs as an error, including one inside that same read:
|
|
84
|
+
|
|
85
|
+
- a second document an overriding `get<Model>` or a resource guard loads, such as a removed owner;
|
|
86
|
+
- a query miss (`pick`, `pickOne`);
|
|
87
|
+
- a missing document in a generated `update<Model>` or `remove<Model>`, or in a custom endpoint.
|
|
88
|
+
|
|
89
|
+
`NoDocumentError` gains an optional `lookup: { refName, id }`, which the by-id reads set (`get<Model>`, a model's `pickById` and the SQL store's by-id reads) and which never goes on the wire. No upgrade step is needed.
|
|
90
|
+
|
|
81
91
|
- dcb7e61: The signal and service facets throw coded failures instead of a bare `Error`. Each one keeps its message, so a test or a log matching the text still matches. Each one carries a `code` that a caller, an agent or an MCP client can branch on, for example `DocumentStoreError.is(error, "invalidQuery")`.
|
|
82
92
|
|
|
83
93
|
| Class | Codes | Status |
|
|
@@ -148,6 +158,12 @@
|
|
|
148
158
|
|
|
149
159
|
`new Err(...)`, `Err.is`, `Err.fromJSON` and `instanceof Err` type as before, on `Err` and on each status class (`new Err.NotFound(...)`, `Err.NotFound.is(...)`). The statics `Err` inherited from `Error` — `captureStackTrace`, `prepareStackTrace`, `stackTraceLimit` and `isError` — are no longer on its type; call them on `Error`.
|
|
150
160
|
|
|
161
|
+
- 1a43215: **A `pubsub` room's `onResync` now also runs after the server's link to Redis returns.** While the Redis WebSocket adaptor's subscriber is down, events other servers publish never reach the server, and its clients' sockets stay open with no hole in their numbering, so a plain `pubsub` room silently missed them; only live rooms were invalidated. On recovery the server now sends each such room a `resync` frame (`WebsocketResyncData`, a new member of `WebsocketResData`), numbered among the room's frames so that a socket that loses it under backpressure sees a hole instead, and the client calls the room's `onResync`. Live rooms are invalidated as before.
|
|
162
|
+
|
|
163
|
+
Both now wait until Redis has answered the resubscribes, so a room that refetches cannot miss an event published in between. On a link that has not answered after 3 s, the rooms are told then and again once it answers; a link that drops again first has them told at its next return. A client of an earlier release logs the `resync` frame as an unknown message type and ignores it.
|
|
164
|
+
|
|
165
|
+
Upgrading: `WebsocketAdaptor.onRecovered` now hands its handler the rooms held on the server, `(rooms: string[]) => void`. A custom adaptor that implements `onRecovered` must call the handler with every room a socket on the server is still in, live rooms included, and only once events published to those rooms reach the server again, since each room refetches on it. Code that only reads `WebsocketResData` needs no change beyond handling, or ignoring, `type: "resync"`.
|
|
166
|
+
|
|
151
167
|
- bc5fdb0: `--akan-theme-color` on the root now drives the browser's `theme-color`, and a native app's status bar icons when the app names the `appearance` plugin.
|
|
152
168
|
|
|
153
169
|
- **The variable outranks the root layout's `.viewport({ themeColor })`.** Set it per theme beside the tokens (`--akan-theme-color: var(--background)`), or at run time on `document.documentElement.style`. The page reads it again when the root's `style`, `class` or `data-theme` changes, or the OS scheme flips. With neither the variable nor a `themeColor`, no tag is written, as before.
|
|
@@ -167,8 +183,8 @@
|
|
|
167
183
|
- A tool error carries `_meta["akanjs/failure"]: { code, statusCode }`, beside the server's own `_meta` for a 2026-07-28 client. The code is the one an HTTP caller gets:
|
|
168
184
|
- a domain `Err` by its dictionary key, such as `base.error.documentNotFound`;
|
|
169
185
|
- an `AkanError` by its code, such as `invalidArgument` for an argument the call got wrong;
|
|
170
|
-
- a 401 or 403 by its status alone (`unauthorized`, `forbidden`);
|
|
171
|
-
- a 5xx by
|
|
186
|
+
- a guard's 401 or 403 by its status alone (`unauthorized`, `forbidden`);
|
|
187
|
+
- a 5xx by the dictionary key or code token its HTTP answer carries, else by its status (`internalError`, `serviceUnavailable`). Its text is redacted but its code is not, and the code comes from the error's own JSON when that carries one, which can be a third-party library's.
|
|
172
188
|
- A JSON-RPC error carries `data.code`, which tells apart what `-32602` covers:
|
|
173
189
|
- `unknownTool`, `unknownPrompt` (an unlisted page prompt included) and `unknownResource`;
|
|
174
190
|
- `invalidArgument` for bad arguments or a missing tool name, prompt name or resource uri;
|
|
@@ -378,6 +394,7 @@
|
|
|
378
394
|
|
|
379
395
|
- 73f8830: An error an endpoint declares in `errors` and throws with that status under 500 is now logged at debug, as a returned call is, rather than as an ERROR line. A public endpoint that answers a bad token with a declared 404 no longer sends every probe, token scan or mistyped webhook URL to real-error alerts. Undeclared errors, a declared key thrown with another status, and every 5xx still log as errors.
|
|
380
396
|
- 5691327: `setErrorConstructor` on `FetchClient`, `HttpClient` and `WsClient`, `HttpClientOptions.ErrorCls` and `FetchClient.build`'s `Err` option are deprecated. Every dictionary's `Err` is `akanjs/common`'s `Err`, which a restored error already is, so they change nothing. They keep working. A generated `lib/sig.ts` no longer calls `fetch.setErrorConstructor(Err)`, and a generated `lib/useClient.ts` no longer passes `{ Err: pageProto.Err }`; `akan sync` rewrites both. No upgrade step is needed.
|
|
397
|
+
- 14134d3: Under `akan start`, a backend replica that crashes while it waits on the builder no longer has that answer handed to the replica respawned in its place, where it could settle the new process's own request of the same id with its predecessor's route, CSR or graph result. The gateway now forgets a replica's open builder requests when it exits, and passes each answer only to the process that asked.
|
|
381
398
|
- 958f175: A dev server now answers only the host names it can be reached under locally. Under `akan start`, or on a local dev runtime, with `AKAN_ALLOWED_HOSTS` unset, it answers `localhost` and `*.localhost`, IPv4 and IPv6 addresses (a phone on the LAN included), and the app's own hosts: its route domains and `<app>-<environment>.<serveDomain>`. A request under any other `Host`, the HMR socket and the `/_akan/*` dev routes included, gets a 403 that names `AKAN_ALLOWED_HOSTS`. To open a dev server under another name, such as a container's service name or a forwarded editor URL, list every `host:port` it should answer there; a set list replaces the default, as before. A deployed server with the variable unset still answers every `Host`.
|
|
382
399
|
|
|
383
400
|
`akan tunnel` and `akan start --share` keep working: the tunnel agent now dials the local app under the app's own address and leaves the public host name in `x-forwarded-host`, which is where the app already reads it. A redirect a page raises during SSR now sends a same-origin target as a relative `Location`, so a tunnel or proxy caller lands on the host it used rather than the one the server was dialed as; a target on another origin stays absolute.
|
|
@@ -411,15 +428,24 @@
|
|
|
411
428
|
- e143263: The optional `happy-dom` and `@happy-dom/global-registrator` peers now ask for `^21.0.4`. Versions 17.0.0 through 21.0.3 compile a `<script type="module">` import alias into code unchecked, so a page loaded into a happy-dom window could run code on the host (GHSA-834v-8h66-3h79). UI tests register one through `akanjs/test/registerDom`; run `bun update happy-dom @happy-dom/global-registrator` in a workspace that pins an older one.
|
|
412
429
|
- e4f7876: A hidden field declared `.optional()` (`field.hidden(String).optional()`) is optional again in a service's `create<Model>` and `create<Model>Many` input, and in the document type `by()` makes of an input model or a scalar. It was typed there as a required, non-null value, though the model's own document already typed it optional, so a create that left it out needed a cast. A hidden field without `.optional()` stays required. Code that read such a field off a scalar's document as always present now handles its absence, as it already did on the model's document.
|
|
413
430
|
- cb0fd5b: Reading the client address from a forwarded header no longer stalls the server on a crafted hop. `IpLiteral.parse` matched a bracketed IPv6 hop with a pattern that backtracked quadratically, so an `X-Forwarded-For` or `X-Real-IP` entry of `[` and a long run of colons kept the event loop busy for about 100 ms per 16 KB of header, on every request that carried it. The bracket is now matched in linear time and the colon checked apart; every address parses as before.
|
|
414
|
-
- 24dcb1e: A lazily loaded chunk the server no longer serves now reloads its page once
|
|
431
|
+
- 24dcb1e: A lazily loaded chunk the server no longer serves now reloads its page once.
|
|
415
432
|
|
|
416
433
|
- **Before:** a chunk loaded through `import()` (`lazy` from `akanjs/webkit`, `React.lazy`, or a dynamic import in a client component) that a deploy had removed failed to fetch, and the page stayed on its error. This happens to a tab left open across a deploy, and during a rolling deploy when the chunk's request reaches a replica of the other build.
|
|
417
|
-
- **Now:** when such a failure reaches the React root or
|
|
418
|
-
- the error
|
|
434
|
+
- **Now:** when such a failure reaches the React root, or the browser reports an `import()` nothing caught as an `unhandledrejection`, the client asks the server for the chunk again with a `HEAD` request. WebKit does not report every uncaught `import()` that way, so there a failure React never sees can still leave the page on its error. Only a 404 reloads the address the tab shows. A network failure, a blocked request or a 5xx leaves the page as before. The check runs only when all of these hold:
|
|
435
|
+
- the error is a fetch failure the client can tie to a chunk under this origin's `/_akan/client/` (see below);
|
|
419
436
|
- the browser is online;
|
|
420
437
|
- the tab is not on the path a reload loaded, whether the reload was this fallback's, the chunk fallback's, the user's or `Reconnect`'s. A refresh or a shallow update keeps the tab on that path; after a page navigation to another path, the check runs again;
|
|
421
438
|
- no navigation to another page is under way, and no other document load either;
|
|
422
439
|
- the error is not one the Flight client's chunk loader already handled.
|
|
440
|
+
- **Which chunk is asked about:**
|
|
441
|
+
- the one the error names. Chromium names the `import()` target. Firefox names one from 115 on: the target in 115, the module that failed to fetch in current versions;
|
|
442
|
+
- otherwise, or when that chunk is served or its reload is already claimed, the `.js` files under `/_akan/client/` whose fetch the page's Resource Timing recorded as failed. This covers two cases:
|
|
443
|
+
- Safari and every iOS browser, from 16.4: WebKit's `Importing a module script failed.` names no chunk. Before 16.4 WebKit records no body size, so nothing is listed and the page stays on its error as before;
|
|
444
|
+
- the chunk Chromium names is not gone, but a chunk it imports is, as when a rolling deploy splits requests across builds.
|
|
445
|
+
- A failed fetch has an empty body and a status outside 2xx. WebKit reports no status, so there it also needs a `responseStart`, which a memory or disk cache hit does not set.
|
|
446
|
+
- Each error asks about at most the four latest, all at once, and waits for a request another error already has out. The first 404 whose reload is not claimed yet reloads, so a chunk a reload did not fix never hides another.
|
|
447
|
+
- A recorded failure the server serves is not asked about again. One that answers 404 stays listed, since its reload can be skipped and WebKit does not fetch a module that failed again. One whose request fails or answers another error status, such as a load balancer's 5xx, stays for three requests.
|
|
448
|
+
- Only WebKit's exact message counts. Its syntax, link, MIME-type and evaluation errors are worded differently and still leave the page alone.
|
|
423
449
|
- **The reload is skipped if anything happened while the request was out:**
|
|
424
450
|
- any client navigation, including a shallow update, a refresh (the token-refresh timer's too) or a back or forward move;
|
|
425
451
|
- a `beforeunload` or `pagehide`, which a document load the router never sees fires (a plain link, a form post, `location.assign`).
|
|
@@ -545,27 +571,43 @@
|
|
|
545
571
|
|
|
546
572
|
- cf5eeff: On the Redis WebSocket adaptor:
|
|
547
573
|
|
|
548
|
-
- **A PUBLISH a Redis ACL refuses (`NOPERM`) is dropped, not retried.** It used to be retried on a timer, and every event queued behind it waited with it, so one refused channel delayed all cross-server events. A refusal is logged as an error that names the family of channels whose events are being dropped (`<prefix>ws:room
|
|
574
|
+
- **A PUBLISH a Redis ACL refuses (`NOPERM`) is dropped, not retried.** It used to be retried on a timer, and every event queued behind it waited with it, so one refused channel delayed all cross-server events. A refusal is logged as an error that names the family of channels whose events are being dropped (`<prefix>ws:room` or `<prefix>ws:change`), at most once a minute per family. Other error replies are still retried.
|
|
549
575
|
- **A shutdown no longer logs the publisher's and subscriber's disconnect warnings.** A link that drops while the server runs still warns, and a dropped publisher now warns once rather than on every failed reconnect attempt.
|
|
550
576
|
|
|
551
|
-
-
|
|
577
|
+
- 6b3b4e4: **A graceful shutdown now lets the cross-server events the Redis WebSocket adaptor is still sending reach Redis, within a second.** The adaptor closed its publisher with ioredis `disconnect()`, which returns while the socket is still writing, and the process exits right after a shutdown, so a backlog of events it had published never reached Redis. Nothing was logged, and the other servers' clients missed those events without being told to resync. It now sends `QUIT`, which Redis answers only after every command ahead of it, and disconnects once that answer is in or the link closes. A link that stalls or is too slow to take the backlog gets one second, shared with the drain of the adaptor's own buffer, which had no limit before. Running out of it logs a warning that events still being sent may be lost.
|
|
578
|
+
- 7f0de74: On the Redis WebSocket adaptor, each room's events and each live-synced model's changes now go out on channels of their own, and a server subscribes only to those of the rooms and models it holds. Both used to go to every server of the app on one channel, `<prefix>ws:broadcast`, which servers no longer publish or listen on.
|
|
552
579
|
|
|
553
580
|
- **A room's events** go out on one of 16,384 channels, picked by a hash of the room id (`<prefix>ws:room:<shard>`). A server subscribes to a shard while it holds a room on it.
|
|
554
581
|
- **A change to a live-synced model** goes out on `<prefix>ws:change:<model>`. A server subscribes to it while it holds a live room for that model.
|
|
555
582
|
- **A subscribe is acknowledged once Redis has confirmed the SUBSCRIBE** for its channel, so an event another server publishes after the ack still arrives. While the subscriber is disconnected, the ack does not wait.
|
|
556
583
|
- **`WebsocketAdaptor.joinRoom`** takes an optional third argument, `{ live: refName }`, for a live room.
|
|
557
|
-
|
|
558
|
-
-
|
|
559
|
-
|
|
560
|
-
- **Servers of this release also publish every room event and live change on `<prefix>ws:broadcast`**, in the format earlier releases read, and listen there for theirs. They skip a copy another server of this release put there, since they heard it on its own channel. Servers of 3.2.0-rc.6, which use only the new channels, hear and are heard on those.
|
|
561
|
-
- **This lasts one release** (#458). Until then Redis still sends every event to every server on `<prefix>ws:broadcast`, plus once more to the servers holding its room, so the traffic saving of the per-room channels arrives with the next release. Deploy this release before that one rather than skipping it.
|
|
562
|
-
- **A Redis ACL** that names `<prefix>ws:broadcast` must allow `<prefix>ws:*` before this release goes out, since its servers publish on both.
|
|
584
|
+
- **A rolling deploy from 3.1, or a 3.2.0 rc before rc.6, loses events between servers.** A server of that release and one of this release do not hear each other's events and changes until every server runs this release, so deploy them all at once, or accept missed events across servers for that window. A deploy from rc.6 or a later rc loses nothing.
|
|
585
|
+
- **A Redis ACL** that names only `<prefix>ws:broadcast` must also allow `<prefix>ws:room:*` and `<prefix>ws:change:*` before this release goes out. Keep `<prefix>ws:broadcast` allowed until no server of an earlier release runs or may be rolled back to: a 3.1 server refused it fails to start, and one of 3.2.0-rc.7 to rc.15 holds back every event behind the copy it is refused. Only then narrow `<prefix>ws:*` to the two.
|
|
563
586
|
|
|
564
587
|
- 1f93507: On the Redis WebSocket adaptor, events buffered while the publisher was disconnected now go out in the order they were sent. Before, an event published while the buffer drained after a reconnect went straight out, ahead of older buffered ones, and the drain started on `connect`, ahead of the commands ioredis resends on `ready`. So another server's subscribers could see a room's events out of order. A message now waits behind a non-empty buffer, and the buffer drains once the publisher is `ready`. A publish that fails goes back into the buffer in the order it was sent, where it used to go to the back. When Redis refuses a publish with an error reply, the buffer is retried on a timer, starting at 200 ms and backing off to 5 s, instead of not until the next reconnect. Shutting down waits for a drain that is still running, unless the publisher drops meanwhile.
|
|
565
588
|
- 5d3cb3e: In production, an error thrown while a page renders no longer reaches the browser as its message. The RSC worker returned the message as the error's digest, and React writes the digest into the Flight payload that the HTML inlines and that client navigations fetch, so a database driver's message, a file path or a value read from a record was on the page. Under `NODE_ENV=production` the digest is now a random 8-character id, and the worker's `[rsc] render failed` log line carries the same `digest=<id>` beside the full error, so the id a page shows finds its log line.
|
|
566
589
|
|
|
567
590
|
Development keeps the message as the digest. Redirects and not-found answers keep their digests and behave as before, and a layout's `.error()` view still gets `AKAN_RENDER_ERROR`. A typed `Err` thrown after the page has started streaming now gets an id as well, rather than its dictionary key; nothing in the framework read the key from the digest.
|
|
568
591
|
|
|
592
|
+
- ad4571f: More server and adaptor failures throw a coded `AkanError` instead of a bare `Error`. Messages are unchanged, and so is every status a caller is answered with. The error-code reference lists the new codes.
|
|
593
|
+
|
|
594
|
+
- `BuilderRpc`, the dev builder channel:
|
|
595
|
+
- `buildFailed` (500): the builder answered that the build failed.
|
|
596
|
+
- `builderUnavailable` (503): no builder answered, either in time or at all. `BuilderRpc.isTimeout` and `isUnavailable` still tell the two cases apart.
|
|
597
|
+
- `rpcDisposed`: `dispose()` cut off a pending request.
|
|
598
|
+
- `artifactMissing` (500): a production page's route is missing from the artifact. The page still answers with the 500 error page.
|
|
599
|
+
- `notInitialized` (500): SSR requires a client module whose chunk has not loaded. The page still answers with the 500 error page.
|
|
600
|
+
- `listFailed` (500): `McpRouter.listFor`, and so the test server's `servedMcpCatalogue`, rejects when a page of its in-process listing answers an error.
|
|
601
|
+
- `jobStalled` (500): `SolidQueue` hands this to `onFailed` for a job whose lease ran out on its last attempt.
|
|
602
|
+
- `databaseLocked` (500): the solid SQLite file stays busy or locked through every retry while `SolidQueue` or `SolidCache` starts. SQLite's own error is kept as `cause`.
|
|
603
|
+
- Some failures are caught where they are thrown. They are coded too, and each still ends as before:
|
|
604
|
+
- `badGateway` (502): the image optimizer's DNS lookup timed out. The image optimizer still answers its own 502.
|
|
605
|
+
- `invalidKey`: the stored MCP Apps signing key is gone.
|
|
606
|
+
- `unencodableValue`: the protobuf compressor's schema refuses a value. It is still logged and encoded as `null`.
|
|
607
|
+
- `invalidStorageKey` (400): a `BlobStorage.deleteData` URL is outside the storage's prefix. It is still logged and answered `false`.
|
|
608
|
+
|
|
609
|
+
**Upgrading.** The solid SQLite open used to reject with SQLite's error itself. Code that matched that error's `code` (`SQLITE_BUSY` or `SQLITE_LOCKED`) now finds it on `error.cause`. You can also branch on `AkanError.is(error, "databaseLocked")`.
|
|
610
|
+
|
|
569
611
|
- 9a2a8c9: The build refuses a `LevelBoundary` or `McpAppRoot` export on an app's root layout: `page/_layout.tsx`, or a grouped or base-path root layout. Akan.js defines both on the root layout it generates and reads neither from an app's layout, so such an export was silently ignored. The error names the export and the file and says why. Remove the export; it never took effect.
|
|
570
612
|
|
|
571
613
|
`akanjs/common` exports `GENERATED_ROOT_LAYOUT_EXPORTS`, the set of those names.
|
|
@@ -601,6 +643,7 @@
|
|
|
601
643
|
|
|
602
644
|
- f8de6a7: A page whose server render streamed an error after its first byte is no longer replayed from the browser's navigation cache. Before, going back to it or following a link to it showed the same "This page could not be loaded." notice (or a `Load.*` section's failure) again without asking the server, and only "Try again" refetched. Now the next visit, a hover prefetch included, asks the server for the page. This covers the page a document loaded with, a page a navigation fetched, and, with `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`, a cached patch. A not-found or redirect raised in the stream still counts as the page's answer and replays as before. A failure that recurs on every visit, such as a `Load.*` read refused for this viewer, now costs a server render on each visit. The server already renders such a page anew each time, since it never caches a render with a refused `Load.*` read. In development, a render error whose message is empty now carries the digest `AKAN_RENDER_ERROR` instead of an empty one.
|
|
603
645
|
- 1ed9f6a: With `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`, a page reached by a patch is replayed from the browser's cache under any `#fragment`, as a page in the full-page cache already is: `/docs/x#a` and `/docs/x#b` now share one cached patch, and a link to another fragment of a page the patch cache would replay is not prefetched. A page that refuses prefetching (`.config({ prefetch: false })`) is no longer asked again after each full navigation: its 204 is kept for the prefetch lifetime under any page on screen, for the same account, as it already was with the flag off.
|
|
646
|
+
- 0c83204: A page cut off by a client that disconnected mid-stream, such as a closed tab, a navigation away or a proxy timeout, is no longer stored in the server's RSC result cache. Before, the truncated render was cached, and the next visitor to that path got a page whose Suspense content never arrived until the entry expired or was invalidated. Now the next request renders the page anew and streams all of it, and a cancel that reaches the RSC worker after its render ended no longer leaves an entry behind that grows the worker's memory for its whole life.
|
|
604
647
|
- b0ccf6f: The browser's RSC client now throws coded errors instead of bare `Error`s, so a caller can branch on `error.code`. A route the server has no page for is `routeNotFound` (404), as a missing WebSocket route already is. A response with no RSC payload is `rscFetchFailed` (502). A patch missing its parts, or a full fallback that answers with a patch, is `invalidRscResponse`, the code `rscClientFetch` already throws for the latter. The redirect marker, which only a log line receives, is `rscRedirectStarted`. Each error keeps its `name` and its message, except the fallback's message, which is now `[rscClient] fallback is a patch`. The error-code reference lists the new codes.
|
|
605
648
|
- 7836476: In development, an edit to any framework module that the browser's RSC client runs now fully reloads the open tab. That is `rscClient.tsx` and the `server/` modules it loads, such as `rscClientCache.ts`, `rscClientPatch.ts`, `rscClientFetch.ts`, `rscNavigationState.ts` and `rscPrefetchCache.ts`. Only `rscClient.tsx` did before, so an edit to one of the others refreshed the page in place and the tab kept running the old client code.
|
|
606
649
|
|
|
@@ -640,6 +683,7 @@
|
|
|
640
683
|
|
|
641
684
|
All three now share one Flight row reader that follows React's row headers. It skips a length-prefixed row by its byte length across any chunk boundary, and it checks only real rows, which keep their sanitizing and redirect handling. Long text is no longer split and pattern-tested line by line. The server-rendered HTML also carries one inline script per Flight row instead of one per line, about 9% less inline-script HTML on a 400 KB payload.
|
|
642
685
|
|
|
686
|
+
- eadb12a: A client navigation decodes its RSC payload faster. The browser's RSC client used to read each navigation's Flight stream three times before decoding it: once for the redirect guard, once to note which chunks the navigation names, and once to watch for a server error. A partial navigation's patch did the same, with its redirect and error check in place of the redirect guard. Each now reads the stream once, with every check on the same row, in the same order. Measured in Bun on payloads of 1.1 and 1.5 MB, a navigation's decode time drops from about 8 and 11.5 ms to about 5 and 7 ms. A page behaves as before.
|
|
643
687
|
- 27440aa: A production build now runs without Docker: `cd dist/apps/<app> && bun main.js` serves the app with no env set. Until now the env the built server needs (the app and repo names, the serve domain, locales, route prefixes, database modes and the rest) existed only as `ENV` lines in the generated Dockerfile. On a host without the image, such as a PaaS or a test harness, the server stopped at boot with `getEnv() cannot run at build time` unless a start script copied every value by hand.
|
|
644
688
|
|
|
645
689
|
**Upgrade note.** Run `akan agent install` and commit what it writes: the `akan-runtime` skill, the `config` path rule and `runtimeRule` now say how to run a build without Docker.
|
|
@@ -788,6 +832,14 @@
|
|
|
788
832
|
|
|
789
833
|
Branch on `AkanError.is(error, "<code>")` rather than on the message. `error.name` is still `"Error"`, and `instanceof Error` still holds.
|
|
790
834
|
|
|
835
|
+
- f923ffb: An `AkanServer` stopped while `init()` was still initializing, or while `listen()` was still opening its log transport, no longer goes on to listen and serve: the start tears down what it has brought up and returns, and `stop()` resolves once the server is stopped, which during `init()` means after the container or web router under way finishes starting, beyond `shutdownTimeoutMs`. A replica whose gateway is gone by the time it reports ready no longer runs its init schedules while it shuts down.
|
|
836
|
+
|
|
837
|
+
Two things follow from a stop waiting on the start under way. A `stop()` awaited from inside a service's or adaptor's init hook never settles, since the hook is the step it waits for: call it without awaiting there. And a replica told to shut down, or orphaned, during `init()` finishes that init and tears down before it exits, where it used to exit at once.
|
|
838
|
+
|
|
839
|
+
- 802bffe: An `AkanServer` whose `init()`, `listen()` or `start({ listen: false })` throws, for example on a missing route seed index or a port already in use, now tears down what it brought up before the error reaches the caller. That means the web router and its RSC worker, the log transport and its control socket, and the container, destroyed once. It ends `stopped`, so calling `start()` again starts it instead of throwing "already running", and the retried server answers each gateway message once.
|
|
840
|
+
|
|
841
|
+
The start failure is logged before the teardown begins, so a slow shutdown no longer hides the cause. A start that fails only after the server was stopped and started again leaves that newer start alone.
|
|
842
|
+
|
|
791
843
|
- 99fda20: A session whose access token expired can be renewed on the server before a page renders, and a websocket no longer outlives the credential it opened with.
|
|
792
844
|
|
|
793
845
|
- **`option.setSessionRefresh(fn)`** runs before a page load or an RSC navigation renders.
|
|
@@ -820,6 +872,16 @@
|
|
|
820
872
|
- **`ServiceOptions.serverMode`** carries a doc comment, so an editor shows the same explanation on hover.
|
|
821
873
|
|
|
822
874
|
- 2bf769f: Internal: the `AkanApp` gateway is composed from one collaborator per concern under `server/gateway/` instead of one 155-member class. Child supervision and restarts, the HTTP and WebSocket relays, rooms, status endpoints, logging and the dev-host channel behave as before, and `AkanApp` and `AkanAppOptions` are unchanged.
|
|
875
|
+
- 6d96075: Internal: `AkanServer` is composed from one collaborator per concern instead of one 91-member class: `server/serverConfig.ts` for its env and option parsing, `server/routing/serverListener.ts` for the HTTP and WebSocket servers, HMR upgrades and local room publishing, `server/routing/builtinRoutes.ts` for the OpenAPI, MCP, devtools and solo routes, `server/lifecycle/parentChannel.ts` for the gateway IPC channel and the orphan exit, and `server/serverMetrics.ts` for metrics reporting. Its start and stop, including a stop during a start and the unwind of a failed one, behave as before, and `AkanServer` and its option types are unchanged.
|
|
876
|
+
|
|
877
|
+
An invalid or colliding route prefix and a missing WebSocket adaptor now throw an `AkanError` coded `invalidConfig`, with the same message as before.
|
|
878
|
+
|
|
879
|
+
- a12577f: Internal: `DatabaseResolver.resolveDatabase` composes each model's adaptor from named helpers in `server/resolver/` (`modelSchema.ts`, `databaseModelInstance.ts`, `modelFacade.ts`, `modelLoaders.ts`, `timedQuery.ts`) instead of one 381-line method. Schemas, indexes, the model facade, loaders, save listeners, sort and paging options and their errors are unchanged, and `DatabaseResolver` keeps the same members.
|
|
880
|
+
- 8e24168: Internal: `FetchClient`'s stateless helpers leave the class for module functions in `fetch/client/signalCatalog.ts` (signal merging, guard and helper facts, argument serializers and return parsers) and `fetch/client/requestScope.ts` (origins, socket URLs, query cache keys, deep copies), and its types move to `fetch/client/fetchClientTypes.ts`. Queries, mutations, rooms, messages and the bridge behave as before, the shared fetch chunk does not grow, and `FetchClient` and its exported types are unchanged.
|
|
881
|
+
- 48b8050: `Agent.Chat`, `Select` and `Data.ListContainer` are split internally into named hooks and sub-components that stay in their original three files. Nothing new is exported, and behaviour, rendered markup and render counts are unchanged.
|
|
882
|
+
- cf12100: Internal: the RSC worker host (`server/rscWorkerHost.ts`) is composed from one collaborator per concern instead of one 80-member class: `rscWorkerProcess.ts` (spawning, exit and restart of the worker process), `rscHostRequests.ts` (pending renders, page prompt calls, queued sends and cancel), `rscHostReloads.ts` (the bundle state a worker boots from and the reload handshake), `rscWorkerRecycler.ts` (rolling recycles and their thresholds) and `rscHostRenderStream.ts` (a worker render as the host's stream). Message order, reloads, recycles, restarts and metrics behave as before, and `rscWorkerHost.ts` exports the same names.
|
|
883
|
+
- 966b5f2: Internal: the RSC render worker (`server/rscWorker.tsx`) is composed from one collaborator per concern instead of one 72-member class: `rscRenderHandler.ts` (a render request end to end), `rscRenderFallbacks.ts` (redirect, not-found and error answers), `rscFlightRenderer.ts` and `rscFlightStream.ts` (the Flight stream and its cancellation), `rscRouteDocument.tsx` and `rscDocumentHead.tsx` (the documents and their head), `rscResultCaches.ts`, `rscRenderStats.ts` and `rscRenderControl.ts`. Rendering, streaming order, error digests, caching and the worker's messages behave as before, and `akanjs/server/rsc-worker` exports the same names.
|
|
884
|
+
- 2728800: Internal: the SQL document store (`SqlDocumentStore`) is composed from one collaborator per concern next to it instead of one 99-member class: `SqlTableSchema` (the table and its indexes), `DocumentRowCodec` (rows to documents and back), `DocumentHydrator` and `StoredRows` (the document prototype and the row each document was read as), `QueryScope` (live-row scoping and joins), `DocumentWriter` (document writes and their hooks) and `QueryWriter` (query-level writes). Its public members, SQL, parameter order and transaction boundaries are unchanged on SQLite and Postgres.
|
|
823
885
|
- 91ccf38: Internal: `makeActions` and `useCsrValues` are composed from one file per action set and hook instead of two monoliths. Store actions, hook order, effects and their dependencies are unchanged.
|
|
824
886
|
- c2af76a: Internal: the web router's route table is built by one collaborator per route family instead of one 437-line method. Routes, their order, headers, caching and error answers are unchanged. The framework map now follows a send through a field that hands out its receiver (`this.#hub()?.broadcast(...)`), so `ARCHITECTURE.md` still names who sends each HMR message.
|
|
825
887
|
- df32c46: On SQLite, work outside an open `this.transaction()` no longer sees it or joins it. A read from another request ran on the one shared connection, inside the transaction, so it returned rows the transaction had not committed, including rows it then rolled back. It now runs on a second, read-only connection to the same WAL file and sees what is committed, as on Postgres, without waiting for the transaction; code inside the transaction still reads its own writes. A write from another request already waited for the open transaction, but when a second transaction began as the first committed, the waiting write could run inside the second one and be rolled back with it after its caller was told it had succeeded. It now runs between the two.
|
|
@@ -883,6 +945,7 @@
|
|
|
883
945
|
- **`akan build` fails when the vendor scan cannot find a route's client entry**, and names the entry. Before, a build that wrote its route bundles somewhere the scan did not look narrowed every vendor entry to nothing. The build passed, and pages threw in the browser.
|
|
884
946
|
- **The vendor scan no longer overflows the stack on large minified chunks.** A function body of about 20,000 statements, which a minifier folds into one comma chain, used to fail `akan build` with `Maximum call stack size exceeded`.
|
|
885
947
|
|
|
948
|
+
- e323d6c: A `WebRouter` whose construction throws now clears the HTML result cache's sweep timer it had started, so a production server that retries its start no longer keeps one more timer per failed attempt. A dev router also removes its builder `message` listener on that path.
|
|
886
949
|
- d9eaacc: A socket that is down keeps at most 100 messages emitted meanwhile, dropping the oldest, and says how many it dropped when it reconnects. Before, the outbox grew without end, so a stream of emits (a cursor, a typing signal) on a tab offline for minutes held every one of them and sent them all at once on reconnect. `configureWs({ outboxLimit })` sets the cap: `0` keeps none and says so once rather than on every reconnect, and a negative limit or `Infinity` keeps every one. Room subscriptions never queue there and are sent again on every open, as before.
|
|
887
950
|
|
|
888
951
|
## 3.1.1
|
package/common/types.ts
CHANGED
|
@@ -23,7 +23,10 @@ export interface FetchPolicy<_Returns = unknown> {
|
|
|
23
23
|
* A mutation ignores it, since one already sent may have run.
|
|
24
24
|
*/
|
|
25
25
|
signal?: AbortSignal;
|
|
26
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* `pubsub` only: called when the room may have missed events — after a resubscribe, at a frame the server dropped
|
|
28
|
+
* for this socket, or once the server's link to the app's other servers returns — so refetch what the room shows.
|
|
29
|
+
*/
|
|
27
30
|
onResync?: () => void;
|
|
28
31
|
/**
|
|
29
32
|
* Tries again when the server is unreachable, restarting (502/503), too slow (504) or limiting (429, after its
|
|
@@ -6,9 +6,12 @@ import { AkanError } from "akanjs/base";
|
|
|
6
6
|
*/
|
|
7
7
|
export class NoDocumentError extends AkanError<"documentNotFound"> {
|
|
8
8
|
readonly error = "base.error.documentNotFound";
|
|
9
|
+
/** The table and id a by-id read missed; a query's miss leaves it unset. */
|
|
10
|
+
readonly lookup?: { readonly refName: string; readonly id: string };
|
|
9
11
|
|
|
10
|
-
constructor(message = "", options?: ErrorOptions) {
|
|
12
|
+
constructor(message = "", options?: ErrorOptions & { lookup?: NoDocumentError["lookup"] }) {
|
|
11
13
|
super("documentNotFound", message, { statusCode: 404, cause: options?.cause });
|
|
14
|
+
this.lookup = options?.lookup;
|
|
12
15
|
}
|
|
13
16
|
|
|
14
17
|
override get forwarded() {
|
|
@@ -91,7 +91,7 @@ export class DocumentQueryEvaluator {
|
|
|
91
91
|
return DocumentQueryEvaluator.unevaluableReason(value as DocumentQuery);
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/** Splits a saved document into the row shape above, mirroring `
|
|
94
|
+
/** Splits a saved document into the row shape above, mirroring `DocumentRowCodec.toRow`. */
|
|
95
95
|
static rowViewOf({ id, createdAt, updatedAt, removedAt, ...payload }: Record<string, unknown>): DocumentRowView {
|
|
96
96
|
return {
|
|
97
97
|
id: id ?? null,
|