akanjs 3.2.0-rc.2 → 3.2.0-rc.21
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 +42 -41
- package/CHANGELOG.md +593 -3
- package/CONTRIBUTING.md +26 -0
- package/base/base.ts +2 -1
- package/client/clientRuntime.ts +1 -0
- package/client/cn.ts +2 -2
- package/client/csrTypes.ts +15 -1
- package/client/frameConfig.ts +5 -2
- package/client/index.ts +249 -26
- package/client/locale.ts +1 -0
- package/client/makePageProto.tsx +33 -82
- package/client/nativeThemeColor.ts +51 -0
- package/client/route/RouteDefinition.ts +24 -7
- package/client/route/RouteGuards.ts +2 -1
- package/client/route/RouteHead.ts +11 -2
- package/client/route/routeArgs.ts +7 -0
- package/client/router.ts +25 -6
- package/client/rscNavigation.ts +3 -3
- package/client/rscRoutePatch.ts +42 -0
- package/client/viewportMeta.ts +34 -4
- package/common/CodeTranscript.ts +1 -1
- package/common/PipelinePlanSchema.ts +2 -2
- package/common/akanGraph.ts +1 -1
- package/common/err.ts +122 -0
- package/common/facetBarrel.ts +38 -0
- package/common/failureCode.ts +18 -0
- package/common/index.ts +9 -0
- package/common/isGuardRefusal.ts +14 -0
- package/common/mcpExposure.ts +17 -4
- package/common/mcpFailure.ts +9 -0
- package/common/pipelinePlan.ts +1 -1
- package/common/restartSchedule.ts +55 -0
- package/common/routeConvention.ts +3 -1
- package/common/types.ts +18 -1
- package/constant/constantRegistry.ts +4 -8
- package/constant/crystalize.ts +1 -2
- package/constant/getDefault.ts +1 -1
- package/constant/immerify.ts +1 -1
- package/constant/index.ts +78 -21
- package/constant/purify.ts +4 -9
- package/constant/serialize.ts +4 -2
- package/constant/types.ts +1 -0
- package/constant/via.ts +1 -2
- package/dictionary/agent.dictionary.ts +4 -0
- package/dictionary/base.dictionary.ts +1 -0
- package/dictionary/locale.ts +1 -1
- package/dictionary/trans.ts +14 -97
- package/document/databaseRegistry.ts +2 -1
- package/document/documentSchema.ts +1 -0
- package/document/filterMeta.ts +4 -1
- package/document/into.ts +2 -1
- package/document/loaderInfo.ts +2 -1
- package/document/noDocumentError.ts +4 -1
- package/document/queryEvaluator.ts +1 -1
- package/document/types.ts +1 -1
- package/fetch/client/fetchClient.ts +87 -270
- package/fetch/client/fetchClientTypes.ts +49 -0
- package/fetch/client/fetchHandle.ts +11 -1
- package/fetch/client/httpClient.ts +14 -2
- package/fetch/client/inflightQueries.ts +17 -0
- package/fetch/client/remoteError.ts +4 -20
- package/fetch/client/requestScope.ts +32 -0
- package/fetch/client/signalCatalog.ts +131 -0
- package/fetch/client/wsClient.ts +11 -0
- package/fetch/index.ts +1 -0
- package/fetch/staleReads.ts +27 -0
- package/fetch/streamedRead.ts +23 -0
- package/package.json +1 -1
- package/server/agentHooks.ts +16 -0
- package/server/akanApp.ts +107 -1272
- package/server/akanOption.ts +17 -4
- package/server/akanServer.ts +167 -675
- package/server/artifact/builderRpc.ts +33 -10
- package/server/artifact/ipcTypes.ts +9 -3
- package/server/artifact/routeSeedIndexStore.ts +4 -2
- package/server/assetHeaders.ts +6 -0
- package/server/console.ts +6 -4
- package/server/decorators.ts +2 -2
- package/server/devtools/README.md +4 -3
- package/server/devtools/devtoolsRouter.ts +9 -5
- package/server/devtools/studio/studioRoute.ts +18 -11
- package/server/di/diLifecycle.ts +24 -35
- package/server/di/predefinedAdaptor.ts +24 -1
- package/server/di/resolveHierarchy.ts +19 -6
- package/server/di/utils.ts +7 -3
- package/server/ed25519Key.ts +31 -15
- package/server/flightRowReader.ts +95 -18
- package/server/gateway/childSupervisor.ts +326 -0
- package/server/gateway/devHostChannel.ts +47 -0
- package/server/gateway/gatewayChildren.ts +135 -0
- package/server/gateway/gatewayConfig.ts +182 -0
- package/server/gateway/gatewayHttpProxy.ts +231 -0
- package/server/gateway/gatewayLogging.ts +111 -0
- package/server/gateway/gatewayRooms.ts +141 -0
- package/server/gateway/gatewayStatus.ts +116 -0
- package/server/gateway/gatewayStatusPage.ts +54 -0
- package/server/gateway/gatewayWebSocketRelay.ts +149 -0
- package/server/head.tsx +4 -19
- package/server/hmr/devHmrController.ts +10 -1
- package/server/htmlResultCache.ts +234 -0
- package/server/imageOptimizer.ts +4 -1
- package/server/index.ts +257 -17
- package/server/lifecycle/parentChannel.ts +78 -0
- package/server/lifecycle/shutdownManager.ts +6 -3
- package/server/lifecycle/startGuard.ts +90 -0
- package/server/logging/logControlSocket.ts +42 -3
- package/server/logging/serverLogging.ts +74 -0
- package/server/machine/machineToken.ts +10 -3
- package/server/mcp/AgentTools.ts +149 -0
- package/server/mcp/AgentToolsAccount.ts +26 -0
- package/server/mcp/McpDispatcher.ts +48 -19
- package/server/mcp/McpPages.ts +21 -6
- package/server/mcp/McpRateLimiter.ts +14 -0
- package/server/mcp/McpRouter.ts +52 -23
- package/server/mcp/McpUiSession.ts +2 -1
- package/server/mcp/index.ts +1 -0
- package/server/nativeFile.ts +30 -11
- package/server/nativeSecret.ts +12 -3
- package/server/oauth/OAuthClientIdMetadata.ts +2 -2
- package/server/ops/opsRoute.ts +5 -1
- package/server/ops/opsToken.ts +3 -1
- package/server/resolver/CascadeRunner.ts +10 -4
- package/server/resolver/database.resolver.ts +10 -417
- package/server/resolver/databaseModelInstance.ts +200 -0
- package/server/resolver/invalidSignal.ts +7 -0
- package/server/resolver/livePause.ts +34 -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 +92 -116
- package/server/resolver/timedQuery.ts +16 -0
- package/server/resolver/websocketOf.ts +23 -0
- package/server/routeElementComposer.tsx +131 -9
- package/server/routeState.ts +5 -1
- package/server/routeTreeBuilder.ts +22 -9
- package/server/routing/apiRouter.ts +44 -25
- package/server/routing/builtinRoutes.ts +194 -0
- package/server/routing/localRooms.ts +34 -0
- package/server/routing/roomReplay.ts +2 -2
- package/server/routing/serverLimits.ts +4 -1
- package/server/routing/serverListener.ts +194 -0
- package/server/rscClient.tsx +210 -227
- package/server/rscClientCache.ts +165 -0
- package/server/rscClientChunks.ts +209 -0
- package/server/rscClientFetch.ts +15 -3
- package/server/rscClientPatch.ts +78 -15
- package/server/rscDocumentHead.tsx +170 -0
- package/server/rscFlightRenderer.ts +83 -0
- package/server/rscFlightStream.ts +257 -0
- package/server/rscHeadPatch.ts +17 -56
- package/server/rscHostReloads.ts +238 -0
- package/server/rscHostRenderStream.ts +297 -0
- package/server/rscHostRequests.ts +158 -0
- package/server/rscHttp.ts +18 -6
- package/server/rscInlineStream.ts +34 -0
- package/server/rscNavigationState.ts +21 -1
- package/server/rscPagePrompts.ts +11 -5
- package/server/rscParkedRedirect.ts +23 -0
- package/server/rscPatchPlanner.ts +220 -0
- package/server/rscPrefetchCache.ts +68 -32
- 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/rscResponse.ts +78 -0
- package/server/rscResultCaches.ts +74 -0
- package/server/rscRouteDocument.tsx +299 -0
- package/server/rscSegmentOutlet.tsx +24 -5
- package/server/rscSegmentOutletReference.ts +14 -12
- package/server/rscWorker.tsx +86 -1392
- package/server/rscWorkerCache.ts +56 -0
- package/server/rscWorkerHost.ts +145 -811
- package/server/rscWorkerProcess.ts +155 -0
- package/server/rscWorkerRecycler.ts +128 -0
- package/server/serverConfig.ts +128 -0
- package/server/serverMetrics.ts +52 -0
- package/server/sitemap.ts +1 -0
- package/server/ssrFromRscRenderer.tsx +20 -20
- package/server/ssrTypes.ts +9 -0
- package/server/webArtifact.ts +86 -0
- package/server/webAssetRoutes.ts +84 -0
- package/server/webCsrSurface.ts +172 -0
- package/server/webDocumentRoute.ts +180 -0
- package/server/webRouteContext.ts +232 -0
- package/server/webRouter.ts +126 -1242
- package/server/webRscRoute.ts +155 -0
- package/server/webSiteFiles.ts +139 -0
- package/server/wellKnownRoutes.ts +73 -0
- package/service/agent.service.ts +59 -5
- package/service/agentAccounts.ts +19 -0
- package/service/agentLoop/agentLoop.ts +387 -0
- package/service/agentLoop/agentLoopTypes.ts +112 -0
- package/service/agentLoop/deltaStream.ts +40 -0
- package/service/agentLoop/loopCompaction.ts +135 -0
- package/service/agentLoop/loopRequest.ts +62 -0
- package/service/agentLoop/loopToolOutput.ts +54 -0
- package/service/agentLoop/loopToolkits.ts +107 -0
- package/service/agentLoop/loopTranscript.ts +102 -0
- package/{signal → service}/agentMeter.ts +83 -15
- package/{signal → service}/agentRelayPolicy.ts +30 -7
- package/service/documentStoreError.ts +16 -0
- package/service/index.ts +7 -0
- package/service/injectError.ts +5 -0
- package/service/injectInfo.ts +30 -18
- package/service/insightQueryError.ts +19 -0
- package/service/ipcTypes.ts +3 -1
- package/service/liveSyncHub.ts +5 -2
- package/service/predefinedAdaptor/agentTools.adaptor.ts +34 -0
- package/service/predefinedAdaptor/anthropicLlm.ts +52 -21
- package/service/predefinedAdaptor/cache.adaptor.ts +3 -2
- package/service/predefinedAdaptor/compress.adaptor.ts +7 -3
- package/service/predefinedAdaptor/database.adaptor.ts +3 -1
- package/service/predefinedAdaptor/documentTransfer.ts +2 -1
- package/service/predefinedAdaptor/index.ts +2 -0
- package/service/predefinedAdaptor/insightQuery.ts +35 -11
- package/service/predefinedAdaptor/llm.adaptor.ts +22 -2
- package/service/predefinedAdaptor/llmSpend.ts +80 -0
- package/service/predefinedAdaptor/openaiDialect.ts +52 -17
- package/service/predefinedAdaptor/openaiLlm.ts +17 -9
- package/service/predefinedAdaptor/role.adaptor.ts +2 -0
- package/service/predefinedAdaptor/searchIndex.ts +5 -1
- package/service/predefinedAdaptor/solidPubsub.adaptor.ts +35 -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/PostgresInsightSession.ts +15 -5
- package/service/predefinedAdaptor/sql/QueryCompiler.ts +29 -13
- package/service/predefinedAdaptor/sql/QueryScope.ts +70 -0
- package/service/predefinedAdaptor/sql/QueryWriter.ts +200 -0
- package/service/predefinedAdaptor/sql/RawDocumentTable.ts +20 -8
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +83 -1124
- package/service/predefinedAdaptor/sql/SqlTableSchema.ts +319 -0
- package/service/predefinedAdaptor/sql/SqliteInsightSession.ts +2 -1
- package/service/predefinedAdaptor/sql/StoredRows.ts +95 -0
- package/service/predefinedAdaptor/sql/UpdateCompiler.ts +6 -2
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +3 -3
- package/service/predefinedAdaptor/sql/driver/postgres.ts +1 -1
- package/service/predefinedAdaptor/sql/fieldValues.ts +74 -0
- package/service/predefinedAdaptor/sql/search/fts5.ts +4 -1
- package/service/predefinedAdaptor/sql/search/postgres.ts +6 -2
- package/service/predefinedAdaptor/sql/values.ts +8 -4
- package/service/predefinedAdaptor/sseData.ts +14 -0
- package/service/predefinedAdaptor/storage.adaptor.ts +9 -4
- package/service/predefinedAdaptor/websocket.adaptor.ts +199 -43
- package/service/serve.ts +3 -2
- package/service/serviceModule.ts +2 -2
- package/service/serviceRegistry.ts +1 -0
- package/signal/SignalFailure.ts +30 -1
- package/signal/agent.signal.ts +30 -9
- package/signal/agentTurnStream.ts +12 -8
- package/signal/byIdRead.ts +18 -0
- package/signal/carriedClientIps.ts +1 -0
- package/signal/endpointErrorContract.ts +20 -2
- package/signal/endpointInfo.ts +6 -5
- package/signal/exception.ts +1 -0
- package/signal/index.ts +314 -30
- package/signal/internalInfo.ts +6 -4
- package/signal/mcp/McpDocument.ts +8 -1
- package/signal/mcp/Msg.ts +23 -10
- package/signal/mcp/index.ts +1 -0
- package/signal/mcp/promptError.ts +9 -0
- package/signal/middleware.ts +12 -3
- package/signal/openapi/openapi.ts +10 -1
- package/signal/resolveFieldContext.ts +34 -0
- package/signal/serializer/fetch.serializer.ts +23 -15
- package/signal/signalContext.ts +24 -57
- package/signal/signalContractError.ts +10 -0
- package/signal/signalDeclarationError.ts +13 -0
- package/signal/signalRegistry.ts +3 -1
- package/signal/slice.ts +24 -20
- package/signal/sliceInfo.ts +12 -9
- package/signal/trace.ts +3 -0
- package/signal/types.ts +35 -6
- package/store/action.ts +44 -1086
- package/store/actionErrorKey.ts +9 -0
- package/store/actionOption.ts +22 -0
- package/store/baseSt.ts +1 -0
- package/store/draftFlush.ts +5 -0
- package/store/draftStore.ts +2 -0
- package/store/formDrafts.ts +115 -0
- package/store/formFieldSetters.ts +229 -0
- package/store/index.ts +125 -17
- package/store/modelActionContext.ts +65 -0
- package/store/modelListPatch.ts +53 -0
- package/store/modelOpenActions.ts +158 -0
- package/store/modelWriteActions.ts +240 -0
- package/store/modelWriteGuard.ts +82 -0
- package/store/openSeq.ts +34 -0
- package/store/rootStore.ts +2 -0
- package/store/sliceListActions.ts +370 -0
- package/store/sliceLiveActions.ts +130 -0
- package/store/stateBuilder.ts +2 -0
- package/store/storeInstance.ts +9 -10
- package/store/uploadPoll.ts +52 -0
- package/store/withSelector.ts +6 -4
- package/types/base/base.d.ts +2 -1
- package/types/client/clientRuntime.d.ts +1 -0
- package/types/client/cn.d.ts +2 -2
- package/types/client/csrTypes.d.ts +15 -1
- package/types/client/frameConfig.d.ts +1 -0
- package/types/client/index.d.ts +25 -26
- package/types/client/locale.d.ts +1 -0
- package/types/client/makePageProto.d.ts +28 -26091
- package/types/client/nativeThemeColor.d.ts +6 -0
- package/types/client/route/RouteDefinition.d.ts +2 -2
- package/types/client/route/RouteHead.d.ts +5 -1
- package/types/client/route/routeArgs.d.ts +6 -0
- package/types/client/router.d.ts +6 -3
- package/types/client/rscNavigation.d.ts +3 -2
- package/types/client/rscRoutePatch.d.ts +22 -0
- package/types/client/viewportMeta.d.ts +3 -1
- package/types/common/CodeTranscript.d.ts +1 -1
- package/types/common/akanGraph.d.ts +1 -1
- package/types/common/err.d.ts +48 -0
- package/types/common/facetBarrel.d.ts +4 -0
- package/types/common/failureCode.d.ts +6 -0
- package/types/common/index.d.ts +8 -2
- package/types/common/isGuardRefusal.d.ts +3 -0
- package/types/common/mcpExposure.d.ts +9 -2
- package/types/common/mcpFailure.d.ts +6 -0
- package/types/common/restartSchedule.d.ts +16 -0
- package/types/common/routeConvention.d.ts +2 -0
- package/types/common/types.d.ts +18 -1
- package/types/constant/constantRegistry.d.ts +3 -1
- package/types/constant/crystalize.d.ts +1 -1
- package/types/constant/getDefault.d.ts +1 -1
- package/types/constant/immerify.d.ts +1 -1
- package/types/constant/index.d.ts +21 -21
- package/types/constant/purify.d.ts +2 -1
- package/types/constant/serialize.d.ts +1 -1
- package/types/constant/types.d.ts +1 -0
- package/types/dictionary/agent.dictionary.d.ts +1 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +9 -9
- package/types/dictionary/locale.d.ts +1 -1
- package/types/dictionary/trans.d.ts +3 -26
- package/types/document/databaseRegistry.d.ts +2 -1
- package/types/document/documentSchema.d.ts +1 -0
- package/types/document/filterMeta.d.ts +4 -1
- package/types/document/into.d.ts +1 -1
- package/types/document/loaderInfo.d.ts +2 -1
- package/types/document/noDocumentError.d.ts +8 -1
- package/types/document/queryEvaluator.d.ts +1 -1
- package/types/document/types.d.ts +1 -1
- package/types/fetch/client/fetchClient.d.ts +6 -36
- package/types/fetch/client/fetchClientTypes.d.ts +40 -0
- package/types/fetch/client/fetchHandle.d.ts +1 -0
- package/types/fetch/client/httpClient.d.ts +2 -0
- package/types/fetch/client/inflightQueries.d.ts +2 -0
- package/types/fetch/client/remoteError.d.ts +0 -4
- package/types/fetch/client/requestScope.d.ts +6 -0
- package/types/fetch/client/signalCatalog.d.ts +25 -0
- package/types/fetch/client/wsClient.d.ts +1 -0
- package/types/fetch/index.d.ts +1 -0
- package/types/fetch/staleReads.d.ts +8 -0
- package/types/fetch/streamedRead.d.ts +8 -0
- package/types/server/agentHooks.d.ts +4 -0
- package/types/server/akanApp.d.ts +2 -20
- package/types/server/akanOption.d.ts +9 -3
- package/types/server/akanServer.d.ts +1 -1
- package/types/server/artifact/builderRpc.d.ts +8 -0
- package/types/server/artifact/ipcTypes.d.ts +8 -0
- package/types/server/assetHeaders.d.ts +1 -0
- package/types/server/console.d.ts +4 -3
- package/types/server/devtools/devtoolsRouter.d.ts +4 -1
- package/types/server/devtools/studio/studioRoute.d.ts +2 -1
- package/types/server/di/predefinedAdaptor.d.ts +1 -0
- package/types/server/ed25519Key.d.ts +1 -0
- package/types/server/flightRowReader.d.ts +3 -1
- package/types/server/gateway/childSupervisor.d.ts +33 -0
- package/types/server/gateway/devHostChannel.d.ts +14 -0
- package/types/server/gateway/gatewayChildren.d.ts +47 -0
- package/types/server/gateway/gatewayConfig.d.ts +82 -0
- package/types/server/gateway/gatewayHttpProxy.d.ts +22 -0
- package/types/server/gateway/gatewayLogging.d.ts +16 -0
- package/types/server/gateway/gatewayRooms.d.ts +25 -0
- package/types/server/gateway/gatewayStatus.d.ts +62 -0
- package/types/server/gateway/gatewayStatusPage.d.ts +9 -0
- package/types/server/gateway/gatewayWebSocketRelay.d.ts +17 -0
- package/types/server/head.d.ts +2 -2
- package/types/server/htmlResultCache.d.ts +51 -0
- package/types/server/index.d.ts +17 -17
- package/types/server/lifecycle/parentChannel.d.ts +13 -0
- package/types/server/lifecycle/startGuard.d.ts +10 -0
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/server/logging/serverLogging.d.ts +12 -0
- package/types/server/mcp/AgentTools.d.ts +31 -0
- package/types/server/mcp/AgentToolsAccount.d.ts +7 -0
- package/types/server/mcp/McpDispatcher.d.ts +10 -1
- package/types/server/mcp/McpPages.d.ts +2 -1
- package/types/server/mcp/McpRateLimiter.d.ts +3 -0
- package/types/server/mcp/index.d.ts +1 -0
- package/types/server/resolver/database.resolver.d.ts +2 -2
- package/types/server/resolver/databaseModelInstance.d.ts +4 -0
- package/types/server/resolver/invalidSignal.d.ts +2 -0
- package/types/server/resolver/livePause.d.ts +5 -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 +2 -2
- package/types/server/resolver/timedQuery.d.ts +8 -0
- package/types/server/resolver/websocketOf.d.ts +2 -0
- package/types/server/routeElementComposer.d.ts +45 -6
- package/types/server/routeState.d.ts +2 -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/rscClient.d.ts +1 -5
- package/types/server/rscClientCache.d.ts +34 -0
- package/types/server/rscClientChunks.d.ts +18 -0
- package/types/server/rscClientFetch.d.ts +1 -1
- package/types/server/rscClientPatch.d.ts +12 -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/rscHeadPatch.d.ts +5 -4
- package/types/server/rscHostReloads.d.ts +54 -0
- package/types/server/rscHostRenderStream.d.ts +53 -0
- package/types/server/rscHostRequests.d.ts +29 -0
- package/types/server/rscHttp.d.ts +4 -2
- package/types/server/rscInlineStream.d.ts +9 -0
- package/types/server/rscNavigationState.d.ts +8 -3
- package/types/server/rscParkedRedirect.d.ts +12 -0
- package/types/server/rscPatchPlanner.d.ts +49 -0
- package/types/server/rscPrefetchCache.d.ts +8 -7
- 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/rscResponse.d.ts +9 -0
- package/types/server/rscResultCaches.d.ts +18 -0
- package/types/server/rscRouteDocument.d.ts +52 -0
- package/types/server/rscSegmentOutlet.d.ts +5 -0
- package/types/server/rscSegmentOutletReference.d.ts +2 -1
- package/types/server/rscWorker.d.ts +1 -3
- package/types/server/rscWorkerCache.d.ts +33 -1
- package/types/server/rscWorkerHost.d.ts +9 -76
- package/types/server/rscWorkerProcess.d.ts +31 -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/server/sitemap.d.ts +1 -0
- package/types/server/ssrFromRscRenderer.d.ts +2 -2
- package/types/server/ssrTypes.d.ts +8 -0
- package/types/server/webArtifact.d.ts +7 -0
- package/types/server/webAssetRoutes.d.ts +11 -0
- package/types/server/webCsrSurface.d.ts +18 -0
- package/types/server/webDocumentRoute.d.ts +19 -0
- package/types/server/webRouteContext.d.ts +45 -0
- package/types/server/webRouter.d.ts +4 -35
- package/types/server/webRscRoute.d.ts +24 -0
- package/types/server/webSiteFiles.d.ts +12 -0
- package/types/server/wellKnownRoutes.d.ts +5 -0
- package/types/service/agent.service.d.ts +13 -4
- package/types/service/agentAccounts.d.ts +8 -0
- package/types/service/agentLoop/agentLoop.d.ts +31 -0
- package/types/service/agentLoop/agentLoopTypes.d.ts +126 -0
- package/types/service/agentLoop/deltaStream.d.ts +3 -0
- package/types/service/agentLoop/loopCompaction.d.ts +11 -0
- package/types/service/agentLoop/loopRequest.d.ts +6 -0
- package/types/service/agentLoop/loopToolOutput.d.ts +7 -0
- package/types/service/agentLoop/loopToolkits.d.ts +14 -0
- package/types/service/agentLoop/loopTranscript.d.ts +12 -0
- package/types/service/agentMeter.d.ts +50 -0
- package/types/service/agentRelayPolicy.d.ts +45 -0
- package/types/service/documentStoreError.d.ts +7 -0
- package/types/service/index.d.ts +7 -0
- package/types/service/injectError.d.ts +4 -0
- package/types/service/injectInfo.d.ts +2 -1
- package/types/service/insightQueryError.d.ts +9 -0
- package/types/service/ipcTypes.d.ts +6 -0
- package/types/service/predefinedAdaptor/agentTools.adaptor.d.ts +31 -0
- package/types/service/predefinedAdaptor/anthropicLlm.d.ts +2 -2
- package/types/service/predefinedAdaptor/index.d.ts +2 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +18 -2
- package/types/service/predefinedAdaptor/llmSpend.d.ts +22 -0
- package/types/service/predefinedAdaptor/openaiDialect.d.ts +2 -1
- package/types/service/predefinedAdaptor/openaiLlm.d.ts +1 -1
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +3 -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 -32
- package/types/service/predefinedAdaptor/sql/SqlTableSchema.d.ts +20 -0
- package/types/service/predefinedAdaptor/sql/StoredRows.d.ts +27 -0
- package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +1 -14
- package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +0 -8
- package/types/service/predefinedAdaptor/sql/fieldValues.d.ts +5 -0
- package/types/service/predefinedAdaptor/sseData.d.ts +5 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +14 -5
- package/types/service/serviceModule.d.ts +1 -1
- package/types/service/serviceRegistry.d.ts +1 -0
- package/types/signal/SignalFailure.d.ts +2 -0
- package/types/signal/agentTurnStream.d.ts +2 -1
- package/types/signal/byIdRead.d.ts +7 -0
- package/types/signal/carriedClientIps.d.ts +4 -0
- package/types/signal/endpointErrorContract.d.ts +3 -0
- package/types/signal/exception.d.ts +1 -0
- package/types/signal/index.d.ts +32 -30
- package/types/signal/mcp/McpDocument.d.ts +2 -0
- package/types/signal/mcp/index.d.ts +1 -0
- package/types/signal/mcp/promptError.d.ts +5 -0
- package/types/signal/resolveFieldContext.d.ts +15 -0
- package/types/signal/serializer/fetch.serializer.d.ts +3 -1
- package/types/signal/signalContext.d.ts +1 -13
- package/types/signal/signalContractError.d.ts +4 -0
- package/types/signal/signalDeclarationError.d.ts +4 -0
- package/types/signal/slice.d.ts +15 -13
- package/types/signal/trace.d.ts +3 -0
- package/types/signal/types.d.ts +33 -6
- package/types/store/action.d.ts +8 -27
- package/types/store/actionErrorKey.d.ts +1 -0
- package/types/store/actionOption.d.ts +24 -0
- package/types/store/baseSt.d.ts +2 -295
- package/types/store/draftFlush.d.ts +4 -0
- package/types/store/formDrafts.d.ts +21 -0
- package/types/store/formFieldSetters.d.ts +80 -0
- package/types/store/index.d.ts +17 -16
- package/types/store/modelActionContext.d.ts +189 -0
- package/types/store/modelListPatch.d.ts +34 -0
- package/types/store/modelOpenActions.d.ts +12 -0
- package/types/store/modelWriteActions.d.ts +16 -0
- package/types/store/modelWriteGuard.d.ts +42 -0
- package/types/store/openSeq.d.ts +17 -0
- package/types/store/rootStore.d.ts +6 -0
- package/types/store/sliceListActions.d.ts +295 -0
- package/types/store/sliceLiveActions.d.ts +6 -0
- package/types/store/stateBuilder.d.ts +2 -0
- package/types/store/uploadPoll.d.ts +16 -0
- package/types/store/withSelector.d.ts +1 -1
- package/types/ui/Agent/Chat.d.ts +5 -2
- package/types/ui/Agent/ChatHeader.d.ts +13 -0
- package/types/ui/Agent/ChatPendingCards.d.ts +23 -0
- package/types/ui/Field/Choice.d.ts +2 -1
- package/types/ui/Field/index.d.ts +1 -1
- package/types/ui/Link/inputModality.d.ts +5 -0
- package/types/ui/Link/viewportPrefetch.d.ts +4 -0
- package/types/ui/Load/Edit_Client.d.ts +2 -0
- package/types/ui/Load/Pagination.d.ts +4 -1
- package/types/ui/Load/Stream.d.ts +7 -1
- package/types/ui/Load/StreamBoundary.d.ts +20 -0
- package/types/ui/Load/Units.d.ts +2 -0
- package/types/ui/Load/View.d.ts +2 -0
- package/types/ui/Reference/origin.d.ts +1 -0
- package/types/ui/index.d.ts +1 -1
- package/types/ui/overlayLayer.d.ts +6 -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/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +4 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/relaunch.d.ts +1 -0
- package/types/vendor/@akanjs/native/plugins/appearance/src/index.d.ts +9 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +18 -11
- package/types/vendor/use-agentic/AgentClientTools.d.ts +19 -0
- package/types/vendor/use-agentic/failureCode.d.ts +4 -0
- package/types/vendor/use-agentic/index.d.ts +1 -0
- package/types/vendor/use-agentic/types.d.ts +11 -0
- package/types/webkit/CsrGuards.d.ts +2 -0
- package/types/webkit/RouteLevelBoundary.d.ts +17 -0
- package/types/webkit/nativeCore.d.ts +1 -0
- package/types/webkit/nativePurchase.d.ts +2 -1
- package/types/webkit/useCsrKeyboard.d.ts +19 -0
- package/types/webkit/useCsrLocationState.d.ts +21 -0
- package/types/webkit/useCsrNavigation.d.ts +25 -0
- package/types/webkit/useCsrRefs.d.ts +33 -0
- package/types/webkit/useCsrRenderTrace.d.ts +13 -0
- package/types/webkit/useCsrStackLifecycle.d.ts +12 -0
- package/types/webkit/useCsrTransitions.d.ts +2 -0
- package/types/webkit/useFrameRuntime.d.ts +1 -0
- package/types/webkit/useGeoLocation.d.ts +1 -1
- package/types/webkit/useHistory.d.ts +2 -3
- package/types/webkit/usePurchase.d.ts +1 -1
- package/types/webkit/useResolvedFrame.d.ts +38 -0
- package/types/webkit/useSyncNavigation.d.ts +22 -0
- package/types/webkit/useTransitionStore.d.ts +1 -0
- package/ui/Agent/Chat.tsx +392 -235
- package/ui/Agent/ChatHeader.tsx +59 -0
- package/ui/Agent/ChatPendingCards.tsx +49 -0
- package/ui/Agent/fetchRunner.ts +8 -1
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Button.tsx +1 -0
- package/ui/Data/Item.tsx +2 -2
- package/ui/Data/ListContainer.tsx +348 -181
- package/ui/Data/useViewModal.ts +10 -4
- package/ui/Dialog/LegacyModal.tsx +1 -1
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/Field/Choice.tsx +3 -1
- package/ui/Link/inputModality.ts +21 -0
- package/ui/Link/prefetchIntent.ts +7 -25
- package/ui/Link/viewportPrefetch.ts +30 -0
- package/ui/Load/Edit_Client.tsx +7 -1
- package/ui/Load/Pagination.tsx +10 -2
- package/ui/Load/Stream.tsx +24 -4
- package/ui/Load/StreamBoundary.tsx +65 -0
- package/ui/Load/Units.tsx +3 -0
- package/ui/Load/View.tsx +5 -1
- package/ui/Model/EditModal.tsx +2 -1
- package/ui/Popconfirm.tsx +1 -1
- package/ui/Reference/origin.ts +1 -0
- package/ui/Select.tsx +43 -51
- package/ui/Signal/RestApi.tsx +3 -2
- package/ui/System/Client.tsx +32 -8
- package/ui/index.ts +4 -0
- package/ui/overlayLayer.ts +22 -1
- package/vendor/@akanjs/native/CHANGELOG.md +7 -1
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +27 -12
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativePlugin.kt +4 -0
- package/vendor/@akanjs/native/native/desktop/src/external.rs +213 -111
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +12 -4
- package/vendor/@akanjs/native/native/desktop/src/linux/external.rs +509 -0
- package/vendor/@akanjs/native/native/desktop/src/linux/mod.rs +1 -0
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeViewController.swift +6 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/native-plugins.ts +5 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +25 -1
- package/vendor/@akanjs/native/packages/desktop/src/deeplinks.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/host.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/relaunch.ts +8 -3
- package/vendor/@akanjs/native/plugins/app/src/desktop.ts +2 -2
- package/vendor/@akanjs/native/plugins/appearance/android/AppearancePlugin.kt +13 -0
- package/vendor/@akanjs/native/plugins/appearance/ios/AppearancePlugin.swift +27 -0
- package/vendor/@akanjs/native/plugins/appearance/native-plugin.json +2 -2
- package/vendor/@akanjs/native/plugins/appearance/src/index.ts +8 -1
- package/vendor/@akanjs/native/plugins/autostart/src/desktop.ts +2 -1
- package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +4 -1
- package/vendor/@akanjs/native/plugins/external-view/src/index.ts +18 -11
- package/vendor/use-agentic/AgentClientTools.ts +33 -0
- package/vendor/use-agentic/AgentSession.ts +11 -11
- package/vendor/use-agentic/CHANGELOG.md +46 -1
- package/vendor/use-agentic/Compaction.ts +2 -1
- package/vendor/use-agentic/ToolRunner.ts +6 -3
- package/vendor/use-agentic/Transcript.ts +6 -3
- package/vendor/use-agentic/WIRE.md +29 -7
- package/vendor/use-agentic/failureCode.ts +44 -0
- package/vendor/use-agentic/httpRunner.ts +15 -4
- package/vendor/use-agentic/index.ts +1 -0
- package/vendor/use-agentic/types.ts +11 -0
- package/webkit/CsrGuards.ts +7 -2
- package/webkit/McpAppAgent.ts +8 -3
- package/webkit/McpAppFetchBridge.ts +11 -5
- package/webkit/RouteLevelBoundary.tsx +37 -0
- package/webkit/nativeCore.ts +1 -0
- package/webkit/nativePurchase.ts +6 -3
- package/webkit/useCamera.tsx +22 -21
- package/webkit/useCsrKeyboard.ts +155 -0
- package/webkit/useCsrLocationState.ts +58 -0
- package/webkit/useCsrNavigation.ts +302 -0
- package/webkit/useCsrRefs.ts +52 -0
- package/webkit/useCsrRenderTrace.ts +68 -0
- package/webkit/useCsrStackLifecycle.ts +120 -0
- package/webkit/useCsrTransitions.ts +552 -0
- package/webkit/useCsrValues.ts +69 -1234
- package/webkit/useGeoLocation.tsx +4 -1
- package/webkit/useHistory.ts +2 -2
- package/webkit/useLocation.ts +3 -2
- package/webkit/usePurchase.tsx +4 -2
- package/webkit/useResolvedFrame.ts +116 -0
- package/webkit/useSyncNavigation.ts +109 -0
- package/webkit/useTransitionStore.ts +13 -0
- package/types/signal/agentMeter.d.ts +0 -27
- package/types/signal/agentRelayPolicy.d.ts +0 -25
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,245 @@
|
|
|
2
2
|
|
|
3
3
|
## 3.2.0
|
|
4
4
|
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- bd198af: A turn its caller stops is billed at what the provider plausibly charged, never at zero.
|
|
8
|
+
|
|
9
|
+
- A streamed turn whose reader leaves stops its provider call, and a stream cut short carries no counts of the provider's own: an OpenAI-compatible stream sends them only in its last chunk, and an Anthropic one only the prompt. Its usage report keeps every count the provider did send, estimates the rest from the request and the text and tool arguments streamed, and says so with `estimated: true` on `AgentUsageReport` and `LlmSpent`. The estimate takes three UTF-8 bytes a token and 1,600 tokens a picture, which errs high.
|
|
10
|
+
- A plain turn's answer shows nothing before its end to estimate from, so its provider call runs on after the client leaves. The client still gets a 499 at once, and the turn is reported `aborted` with the provider's own counts when the call ends. Until then it holds the caller's next turn, as any turn not yet reported does.
|
|
11
|
+
- `AgentRelayPolicy.apply` takes the old `{ account, ip }` context again and fills in a fresh `id` and empty `headers`. `AgentRequestContext` is that old shape again, and stays deprecated.
|
|
12
|
+
|
|
13
|
+
**Upgrading.** A usage hook receives failed and aborted turns. Before, a streamed turn whose reader left ran to its end and was billed as finished; it now stops early and is billed at its estimate. To bill as before, bill every report except `outcome === "failed"`. Billing only `ok` would leave a stopped turn unbilled while the provider charged for it. Read `estimated` to treat estimated counts differently.
|
|
14
|
+
|
|
15
|
+
- ba81635: A modal opened from inside the floating `Agent.Chat` now stacks above the panel, and the panel's header takes a node for its title and names its parts.
|
|
16
|
+
|
|
17
|
+
- **Overlays opened from the floating panel stack above it.** A `Modal`, `BottomSheet`, `Popconfirm`, `Dropdown`, `Select` or `Tooltip` rendered anywhere inside the panel, the `header` slot included, portals into a layer just above the panel (`overlayZ.agentPanelOverlay`, 160). It used to land under the panel, whose z-index (150) tops a page's modals (120). One the page opens still stays under the panel. An `inline` chat hands down whichever portal it sits in, as before, so a modal around it still hosts what it opens. While the turn waits on an approval, a tool card or a question, a modal, sheet or popconfirm the panel opened sinks under the panel so the answer stays reachable, and comes back once answered; what a card opens stays above.
|
|
18
|
+
- **`title` takes a `ReactNode`**, so a mark can go before the name. A new `label` names the panel for screen readers when `title` is not plain text; without either, the name is `l("base.agent")`, and a string `title` names the panel as before.
|
|
19
|
+
- **The header's parts carry `data-slot` hooks**: `agent-header` on the bar, `agent-title` on the title and `agent-running` on the dot shown while a turn runs. Restyle one through them, for example `panelClassName="[&_[data-slot=agent-running]]:bg-accent"`, rather than through the markup's shape.
|
|
20
|
+
- **The header rule is `border-border`**, as other framework surfaces draw their rules, instead of `border-foreground/5`.
|
|
21
|
+
|
|
22
|
+
**Upgrading.** An `AgentChat` override that types `title` as `string` must take `ReactNode`. A modal an app mounted beside the Chat and opened from the panel's `header` still opens under the panel; mount it inside `header` to bring it above.
|
|
23
|
+
|
|
24
|
+
- dcddea0: `agentService.loop` can now call the tools of a screen the member has open, without running them on the server. The run parks each such call, the way an approval parks one, until the page answers it.
|
|
25
|
+
|
|
26
|
+
- **Server.** `clientTools` takes the definitions the open page sent over the app's own transport. They are listed beside the endpoint tools.
|
|
27
|
+
- They are client input. Each definition is rebuilt from `name`, `description`, `parameters`, `readOnly` and `needsConfirm`. A name an endpoint tool holds is dropped, in a closed toolkit too, and so is `openToolkit`.
|
|
28
|
+
- `approve` is still asked about each call. With no approver, a definition that is not `readOnly` counts as a write, and a `needsConfirm` one is refused.
|
|
29
|
+
- An allowed call ends the run as `awaiting`, with `client: true` on the event. Calls written before it in the same batch have already run; calls written after it wait for the resume.
|
|
30
|
+
- The run never waits on a socket. The app delivers the call to the page, appends the page's result to the stored messages (or its own error when no page answers), and resumes. A resume without that result parks the call again. A resume without `clientTools` answers it as an unknown tool.
|
|
31
|
+
- **Browser.** `AgentClientTools` is new in `use-agentic` and re-exported from `akanjs/ui`, along with the `ToolRunnerHost` and `ToolApprovalRequest` types.
|
|
32
|
+
- `new AgentClientTools(surface?, host?).list()` gives the open screen's tools in the shape `clientTools` takes, each with `readOnly: false`.
|
|
33
|
+
- `run(call)` answers a parked call through the same `ToolRunner` as the in-page chat. A `confirm` still asks through `host.approve` and is refused without one, a card tool needs `host.card`, and the answer is clipped and fenced as the chat's would be.
|
|
34
|
+
|
|
35
|
+
Both are new and optional, so no upgrade step is needed.
|
|
36
|
+
|
|
37
|
+
- 2da2adc: `agentService.loop` takes `toolkits`, so a run over a large catalogue no longer sends every tool definition every round.
|
|
38
|
+
|
|
39
|
+
- **Shape.** `toolkits: { calendar: { description: "Read and edit the org calendar", tools: ["eventListInOrg", "updateEvent"] } }` groups names of `allow`. A tool in no toolkit is the core and is listed every round. `allow` still caps every toolkit.
|
|
40
|
+
- **Opening.** With toolkits set, the run lists one more tool, `openToolkit({ name })`. Its description names each toolkit that has a tool the account may see, with its `description`. The call is answered inside the loop with `{ opened, tools }`, and those tools are listed from the next round on. It never reaches `approve` or `untrusted`, and it does not count toward `budget.toolCalls`.
|
|
41
|
+
- **Refusals.** A call to a tool whose toolkit is closed is answered with an error that names the toolkit to open, with code `toolkitClosed`. An unknown toolkit name gets code `unknownToolkit`. A tool outside `allow` is still an unknown tool.
|
|
42
|
+
- **Resume and compaction.** A resumed run reopens every toolkit a stored `openToolkit` call opened without an error. A compaction summary now carries `toolkits`, which is new and optional on `AgentWireMessage`. Store messages whole, as you already do for `tainted`.
|
|
43
|
+
- **Validation.** A malformed `toolkits`, or an `allow` that names a tool `openToolkit` while toolkits are set, is an `error` before any model call.
|
|
44
|
+
|
|
45
|
+
`toolkits` is optional and changes nothing for a run without it, so no upgrade step is needed.
|
|
46
|
+
|
|
47
|
+
- e9a2c7f: `this.agentService.loop(request)` runs a model over the `/mcp` tool catalogue in-process until it answers. It needs no browser, so a queued task, a scheduled run or a reply to a mention can use it.
|
|
48
|
+
|
|
49
|
+
- **Events.** It returns an async iterable of `text`, `toolCall`, `toolResult`, `usage`, `compacted` and `awaiting` events. The stream ends with exactly one `done { stop, rounds }` or `error`. `stop` is one of `end`, `maxRounds`, `budget`, `aborted`, `length`, `quota`, `unauthorized` or `awaiting`. The loop waits for the consumer at every event.
|
|
50
|
+
- **Accounts.** A request carries either `account`, a snapshot the server resolved, or `principal`, a stored id. A new `option.setAgentAccountResolver((principal) => account | null)` resolves the principal at the start and before every round. If it resolves to `null`, the run ends as `"unauthorized"`, as does a missing or falsy `account`: there is no anonymous run. The model is offered `allow` ∩ what the account sees on `/mcp`, and a call to a name that round did not list is answered as an unknown tool, neither asked about nor run. A request with no `allow` array is an `error`.
|
|
51
|
+
- **Approval and taint.**
|
|
52
|
+
- `untrusted(result)` marks a result as untrusted. Every later call reaches `approve(call, { tainted, tool })` with `tainted` set. `approve` returns `"allow"`, `"defer"` or `{ deny }`.
|
|
53
|
+
- Without `approve`, a `needsConfirm` tool is refused, and so is every write once the run is tainted. `AgentToolsRole`'s `listAs` now marks a mutation MCP calls destructive as `needsConfirm`. `purge`, `destroy`, `erase`, `wipe`, `drop`, `cancel`, `bulkRemove` and `bulkDelete` keys now count alongside `remove` and `delete`, which also changes those tools' `destructiveHint` on `/mcp`, and a new `destructive` endpoint option overrides the key.
|
|
54
|
+
- `"defer"` holds the whole batch, emits `awaiting`, and ends the run.
|
|
55
|
+
- **Resume.**
|
|
56
|
+
- `onMessage` is awaited for each message the run appends.
|
|
57
|
+
- Calling `loop` again with the stored messages asks `approve` again about any trailing calls nothing answered, and rebuilds the taint from the stored results.
|
|
58
|
+
- `compact { at, keep }` summarizes the head of the transcript. The `compacted` event names how many messages the summary replaced.
|
|
59
|
+
- A summary or tool message now carries `tainted`, new and optional on `AgentWireMessage`, so a resumed transcript stays tainted. Store each whole. A summary with no marker counts as tainted to a run with `untrusted`, as what it replaced cannot be judged.
|
|
60
|
+
- A batch's results reach `onMessage` even when the consumer stops reading or a later call throws, so a resume runs only calls that never started.
|
|
61
|
+
- **Metering.**
|
|
62
|
+
- Each model call is its own turn for the request policy, the quota and the usage hook. That includes compactions.
|
|
63
|
+
- `AgentTurnContext` gains `loop { id, round }` and `meta`, which is copied from the request.
|
|
64
|
+
- A loop turn has empty headers and a `null` ip. The relay's default size caps do not apply to loop rounds.
|
|
65
|
+
- **Limits.**
|
|
66
|
+
- The run is bounded by `maxRounds` (default 12), `budget { tokens, toolCalls, wallMs }` and `signal`. A limit that is not a valid number is an `error` before any model call.
|
|
67
|
+
- `wallMs` and `signal` also end a run waiting on a tool or on `approve`. `callAs` cannot cancel a call, so the run stops waiting and answers it with an error saying it may still finish. A resume does not run it again, and the endpoint runs on with its outcome unreported.
|
|
68
|
+
- There is no preamble unless `preamble` gives one. With no `instructions` either, a short neutral prompt stands in, as each adaptor's own fallback is about a screen.
|
|
69
|
+
- A tool result is capped at 20,000 characters, as the browser caps it. `untrusted` sees it before the cap.
|
|
70
|
+
- **Moved.** `AgentMeter` and `AgentRelayPolicy` now live in `akanjs/service`, and `akanjs/signal` still re-exports them.
|
|
71
|
+
|
|
72
|
+
- **Streams.** An error frame inside a provider's stream now fails the turn instead of reading as a finished answer. A stream that ends with no terminal event, or with tool arguments that do not parse, now stops as `length`, so those calls do not run with empty arguments and a half answer is not reported as finished. Parallel calls from a gateway that omits or reuses `index` now stay separate. This also applies to the in-page chat.
|
|
73
|
+
|
|
74
|
+
The `AgentTurnContext` fields are optional and the moved classes are still exported from `akanjs/signal`, so no upgrade step is needed.
|
|
75
|
+
|
|
76
|
+
- 6ffb8ef: `mcp: "agent"` keeps an entry off `/mcp` and leaves it to the in-process agent. `AgentToolsRole`'s `listAs` and `callAs`, and so `agentService.loop`, still list and run it. `/mcp` neither lists nor runs it, and `listingCost` leaves it out. An app whose `/mcp` listing is near its size budget can now give a server agent more tools without growing that listing.
|
|
77
|
+
|
|
78
|
+
- **Where it goes.** It goes wherever `mcp: false` goes: an endpoint, a slice's `init()`, the bare `slice()` value, or one key of its map (`mcp: { cru: "agent" }`). It is curation, not authorization. Guards, person-only guards (`static agents = false`), `readOnly` and `setMcp({ excludeSignals, excludeEndpoints })` still apply to both catalogues, and HTTP is unchanged.
|
|
79
|
+
- **Lib slices.** An app slice that declares no `mcp` map now keeps the narrowest value its lib slices set: `false`, then `"agent"`, then listed.
|
|
80
|
+
- **MCP Apps.** A rendered view may still call an `mcp: "agent"` entry, as it may call an `mcp: false` one.
|
|
81
|
+
- **Types.** `McpShelf` (`boolean | "agent"`) and `narrowestMcpShelf` are new in `akanjs/common`. `SerializedSignalShelf` is new in `akanjs/signal`. `McpDocumentOptions` and `McpExposureOption` gain `agent`.
|
|
82
|
+
|
|
83
|
+
Upgrade: code that reads `SliceCls.mcp`, a serialized endpoint's `mcp` or a serialized signal's `mcp` map as a boolean must now compare it with `false` or `true`. `"agent"` is truthy, and it means "not on `/mcp`". Code that only declares `mcp: false` or `mcp: true` needs no change.
|
|
84
|
+
|
|
85
|
+
- eb88032: A service can now run the `/mcp` tool catalogue in-process, as a given account, with `plug(AgentToolsRole)`.
|
|
86
|
+
|
|
87
|
+
- **`listAs(account, { allow })`** returns the tools that account may see on `/mcp`, with the same names, descriptions, input schemas and guard filtering. Each tool also carries `readOnly`. `allow` narrows the list by tool name and never widens it.
|
|
88
|
+
- **`callAs(account, call)`** runs one call as the account and returns an `AgentWireToolResult`. The call goes through the endpoint's guards, middlewares, `mcp: false`, `Person` refusals, masking and rate limits, with `origin` `"mcp"`. A refusal or a failure comes back as the result's `error` and `code`, with the same text and code `/mcp` sends. An image result comes back as attachments.
|
|
89
|
+
- **The account is trusted.** It is put on the call after the global middleware chain, so pass one the server resolved, never client input. A `machine` field on it is removed, since only a verified machine token may set one. `authorization`, `cookie` and `origin` are dropped from the headers a call forwards. `ip` sets what `getClientIp()` reads; without it, ip-scoped rate limits share one budget.
|
|
90
|
+
- The catalogue follows `option.setMcp`'s `readOnly`, `excludeSignals`, `excludeEndpoints` and `language`. It is available on every server, batch servers included, even when `/mcp` is off, and an adaptor may plug the role as a service does.
|
|
91
|
+
- **Endpoint tools only.** A page's `page().app()` tools are listed on `/mcp` but left out here, and `callAs` answers one as `Unknown tool`.
|
|
92
|
+
- **Not during boot.** Until the server has built its endpoints, `listAs` and `callAs` throw `InjectError` with code `notInitialized`, so call them from a request, a job or a schedule rather than an `onInit`.
|
|
93
|
+
|
|
94
|
+
- 31f7039: The agent relay's hooks share one turn, and every turn the quota passes is billed, including one that fails or whose caller goes away.
|
|
95
|
+
|
|
96
|
+
- **One turn from the policy to the usage report.** `setAgentRequestPolicy`, `setAgentQuota` and `setAgentUsage` receive the same `AgentTurnContext`: `{ id, headers, account, ip }`. `id` is new for every turn, so an app can match a quota hold with the usage report that settles it, and `headers` lets it read an org header to pick the account to bill, once it has checked that the caller belongs to that org. The quota check also carries the `request` the policy returned. `AgentRequestContext` is deprecated.
|
|
97
|
+
- **Usage for every turn the quota passed.** The usage report carries an `outcome`.
|
|
98
|
+
- `ok`: the turn finished.
|
|
99
|
+
- `failed`: the provider or the network ended it. The report holds what the provider spent before then, such as the prompt of an Anthropic stream that broke after `message_start`, and the model.
|
|
100
|
+
- `aborted`: the caller went away first.
|
|
101
|
+
- A turn that spent nothing, such as one the provider refused, is reported with zero usage. Before, a failed turn and a turn without counts were not reported at all.
|
|
102
|
+
- A failed or aborted turn holds the caller's next turn until its report settles, as a finished one does.
|
|
103
|
+
- **A streamed turn whose reader goes away stops the provider call**, so the turn stops spending tokens on an answer nobody will read. `LlmAdaptor.chat` takes an optional third argument, `signal`, which the relay sends with `onDelta`, and both built-in adaptors pass it to `fetch`. A plain turn whose client left answers 499 rather than logging a server error.
|
|
104
|
+
- **Cache writes reported separately.** `LlmUsage.cacheWriteTokens` is the part of `inputTokens` the provider wrote to its cache, which Anthropic bills above its input rate. `inputTokens` still counts the whole prompt.
|
|
105
|
+
- **`AgentService.runTurn(request, { onDelta, preamble, signal })`.** `preamble` replaces the in-page preamble, and `false` sends none, for a turn with no screen behind it. Passing `onDelta` alone as the second argument still works.
|
|
106
|
+
|
|
107
|
+
- 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.
|
|
108
|
+
|
|
109
|
+
- 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.
|
|
110
|
+
- `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.
|
|
111
|
+
- 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.
|
|
112
|
+
|
|
113
|
+
- 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.
|
|
114
|
+
|
|
115
|
+
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:
|
|
116
|
+
|
|
117
|
+
- a second document an overriding `get<Model>` or a resource guard loads, such as a removed owner;
|
|
118
|
+
- a query miss (`pick`, `pickOne`);
|
|
119
|
+
- a missing document in a generated `update<Model>` or `remove<Model>`, or in a custom endpoint.
|
|
120
|
+
|
|
121
|
+
`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.
|
|
122
|
+
|
|
123
|
+
- 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")`.
|
|
124
|
+
|
|
125
|
+
| Class | Codes | Status |
|
|
126
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------- |
|
|
127
|
+
| `SignalDeclarationError` (`akanjs/signal`) | `handlerAlreadySet`, `nullableLastArg`, `liveAlreadySet`, `invalidArgType`, `invalidErrors`, `baseMismatch`, `missingModel`, `missingSlice` | 500 |
|
|
128
|
+
| `SignalContractError` (`akanjs/signal`) | `undefinedReturn`, `bytesThroughAny`, `wrongTransport`, `notRegistered`, `noHandler` | 500 |
|
|
129
|
+
| `PromptError` (`akanjs/signal`) | `invalidPrompt`, `unmaskedResource` | 500 |
|
|
130
|
+
| | `inlineFailed` | 502 |
|
|
131
|
+
| `InjectError` (`akanjs/service`) | `notRegistered`, `notInitialized`, `invalidInject` | 500 |
|
|
132
|
+
| `DocumentStoreError` (`akanjs/service`) | `invalidQuery`, `invalidSchema`, `invalidDocument`, `tableMissing`, `searchUnavailable`, `searchMisconfigured` | 500 |
|
|
133
|
+
| | `unstorableValue` | 400 |
|
|
134
|
+
| `InsightQueryError` (`akanjs/service`) | `invalidInsightQuery` | 400, forwarded |
|
|
135
|
+
| | `insightTimeout` | 504, forwarded |
|
|
136
|
+
| | `insightUnavailable` | 500 |
|
|
137
|
+
| `AkanError` | `invalidStorageKey` | 400 |
|
|
138
|
+
| | `storageNotShared`, `liveRoomTaken`, `unroutableLiveQuery`, `missingFilterQuery`, `compressorNotInitialized`, `redisUriMissing`, `transferUnsupported` | 500 |
|
|
139
|
+
|
|
140
|
+
The request path answers every one of these except the forwarded ones as `SignalFailure` already does for an `AkanError`. The response carries the status, the status's reason and the code. The message is left out in a production build, since it can name a table, a field, a role or a signed URL. A state that configuration must fix answers 500, and so does a broken declaration. Examples are text search switched off, no insight connection, and local files in a multi-instance deployment.
|
|
141
|
+
|
|
142
|
+
A refused insight statement is forwarded to its author as a fixed sentence or with the author's own keyword or column. When Postgres refuses the role (42501), the sentence carries none of the driver's text. That text stays on the error's `cause`, and the `Logging` middleware's line prints it. A statement Postgres cancels on its `statement_timeout` (57014) answers `insightTimeout`, like the timeout `InsightQuery` races.
|
|
143
|
+
|
|
144
|
+
**Upgrade.** Most of these used to answer `500 Internal Server Error` with no code. Check any caller that branches on the status:
|
|
145
|
+
|
|
146
|
+
- **400**: a string holding U+0000 that the store refuses to save, and a storage key outside the storage root.
|
|
147
|
+
- **502**: a prompt that fails to inline a file.
|
|
148
|
+
- **`InsightQuery`**: a refused statement now reaches its author as a 400 with its message, and a timeout as a 504.
|
|
149
|
+
- **No retry**: `HttpClient` does not retry these 502s and 504s. A body carrying a code is the server's own answer, not a gateway's.
|
|
150
|
+
- **Logging**: `SignalContext` writes its crash entry, with the stack, only from 500 up. So a 400 above gets the `Logging` middleware's one error line, and that line now names the error's `cause`.
|
|
151
|
+
|
|
152
|
+
**A 429 that is not forwarded** is now treated like the rate limit's own:
|
|
153
|
+
|
|
154
|
+
- `SignalFailure` sends its `Retry-After` from `data.seconds`, a finite number only. The new `SignalFailure.headersOf(error, statusCode)` builds the headers for both paths.
|
|
155
|
+
- The `Logging` middleware keeps it at debug level.
|
|
156
|
+
- `HttpClient` restores it under `base.error.tooManyRequests`, with the code it carried and the wait its `Retry-After` names. So it is retried and worded as a forwarded one is. One with no `Retry-After` to read, because none was sent or a cross-origin caller is not exposed to it, stays the refusal it was and is not retried.
|
|
157
|
+
|
|
158
|
+
**`Exception.<Status>.is(error)` type-checks.** `StatusException` now declares `is`, so `Exception.BadRequest.is(error)` narrows `error` to an `Exception` and checks its own class.
|
|
159
|
+
|
|
160
|
+
- d79a206: A call a page makes while it renders on the server can leave the page in the route result cache.
|
|
161
|
+
|
|
162
|
+
A `fetch.*` call made during a server render forwards the visitor's session and address, so it reads the page request's headers and cookies. That marks the render dynamic, and the HTML and RSC result caches never store it, even for an anonymous visitor. A page whose only server data is an answer that is the same for everyone was therefore rendered on every request.
|
|
163
|
+
|
|
164
|
+
`{ forwardVisitor: false }` in a call's options sends it without the visitor's session or address, so it answers as it would to a stranger and the render can stay cacheable: `fetch.featureFlags({ forwardVisitor: false })`. Another call in the same render that forwards the visitor still keeps the page out of the cache. An explicit `token` and the `jwt` and `clientIp` a cloned client was given are still sent, and a call made in a browser, or aimed at another origin, is unchanged.
|
|
165
|
+
|
|
166
|
+
Use it only for an endpoint that answers every caller alike, such as a `Public` query that takes no `.with()` argument, and give that endpoint `rateLimit: false` (or exempt it in `option.setRateLimit`) rather than an address budget. Every such call reaches the server from the render's own loopback address, so every visitor's render then shares one budget under that address. Anyone can force a render: a signed-in request or any cookie other than `theme` bypasses the cache, and a new query parameter misses it. Under an address budget, one client forcing renders can spend it, so the call answers 429 for everyone, and the page's fallback for that failure is cached and served to every visitor until the entry expires.
|
|
167
|
+
|
|
168
|
+
**Upgrading.** Nothing changes unless a call passes `forwardVisitor: false`.
|
|
169
|
+
|
|
170
|
+
- d9f5ad5: Behind the gateway, a WebSocket subscribe is now acknowledged once the gateway routes the room to the replica that holds it. The gateway used to learn of the room in a message the replica sent without waiting, so an event or a live-list write handled by another replica right after the ack could reach the gateway first and be dropped.
|
|
171
|
+
|
|
172
|
+
- `SolidPubSub.joinRoom` sends its `pubsub.subscribe` with an `ack` number and resolves when the gateway answers `pubsub.subscribed`. A replica's messages reach the gateway in order, so the answer also covers the live models it reported before the subscribe.
|
|
173
|
+
- The wait ends after 3 s if the gateway does not answer, and at once on shutdown. A server that is not a gateway child (no `AKAN_CHILD_SOCKET`) does not wait: a solo server, a desktop one included.
|
|
174
|
+
|
|
175
|
+
No upgrade step is needed: `AkanIpcMessage` only gains the `pubsub.subscribed` message and an optional `ack` on `pubsub.subscribe`, and `SolidPubSub` an injected `behindGateway` flag it reads from the env.
|
|
176
|
+
|
|
177
|
+
- f314eba: A route guard gets a second argument, `{ path }`: the requested in-app path with its search, in the form `router.push` takes, on the server and in CSR (`undefined` while MCP lists a screen). `signedIn({ path })` from `@libs/shared/webkit` adds `?redirect=<path>` to the sign-in URL, and `signedIn("/login")` still works. Use `path` to build a redirect target only. It must never decide admission: CSR asks a guard again only when the route or an argument it declared changes.
|
|
178
|
+
- d6b3619: Every `Err` is now one class, `Err` from `akanjs/common`. That covers the one an app's or lib's `lib/dict` builds, the one `useClient` returns, `akanjs/dictionary`'s own, and an error restored off the wire. Each is that class typed with its own dictionary's keys, so `Err.is` and the status classes behave the same in the browser and on the server. `instanceof Err` holds within one copy of the module. A page bundle and the framework each carry one, so check across them with `Err.is`.
|
|
179
|
+
|
|
180
|
+
- **`Err` is an `AkanError`.** `AkanError.is(err)` is true for every `Err`, and `err.forwarded` is true unless it was restored with a `code`, so the request path still sends its `toJSON()` as it is.
|
|
181
|
+
- **A restored failure that carries a `code` is not `forwarded`.** Such a failure is one its origin server generalized, such as `{ "error": "Forbidden", "code": "fileGrantRefused", "statusCode": 403 }`. The request path generalizes it again, to the same body, and a guard or an auth challenge does not read it as a refusal of its own.
|
|
182
|
+
- **`err.code` is always set.** It is the code a generalized failure's payload carried, or else the code of its status (`notFound`, `conflict`, `badRequest`), so `AkanError.is(err, "notFound")` matches an `Err.NotFound`. `toJSON()` still sends `code` only when the payload carried one, so the wire does not change. `{ ...err }` does change, on the server and the client alike: its `code` was usually `undefined`, and now holds that status code.
|
|
183
|
+
- **A status class tells its own status apart.** `Err.NotFound.is(error)` also requires a `statusCode` of 404, so `Err.NotFound.is(new Err.Conflict(key))` is false; `Err.is` still takes any status. `Err.NotFound.fromJSON(payload)` builds an `Err.NotFound`.
|
|
184
|
+
- **Status classes on a dictionary's `Err` are typed as the full constructor:** `Err.BadRequest`, `Err.Unauthorized`, `Err.Forbidden`, `Err.NotFound` and `Err.Conflict`. So `Err.NotFound.is(...)` and `Err.NotFound.fromJSON(...)` type-check on the server too.
|
|
185
|
+
- **A restore with no error constructor gives an `Err`.** That applies to an HTTP, WebSocket or MCP App bridge restore. It used to give a plain `Error` with the payload's fields copied onto it, so a field the wire does not declare is no longer on the error.
|
|
186
|
+
- **On the client, `String(err)` appends the error's `data`**, as it already did on the server, with secret-named keys masked.
|
|
187
|
+
- **The type exports moved.** `ErrConstructor`, `ErrPayload` and `ErrRestoreOption` come from `akanjs/common`, `akanjs/dictionary` re-exports all three, and `akanjs/client` re-exports `ErrPayload`. `ErrInstance`, `PageErrInstance` and `PageErrConstructor` keep their shapes and are deprecated.
|
|
188
|
+
- **The API explorer shows a failed call's wire body**, the error's `toJSON()`, instead of the error object's own fields.
|
|
189
|
+
- **A new lint rule, `no-import-common-err`, refuses a value import of `Err` from `akanjs/common` in `apps/` and `libs/`.** That class takes any string, so only the `Err` from `lib/dict` or a client entrypoint checks a key against the dictionary. `import type` stays legal.
|
|
190
|
+
|
|
191
|
+
Upgrade:
|
|
192
|
+
|
|
193
|
+
- Replace the types `ErrInstance` and `PageErrInstance` with `Err` from `akanjs/common` (through `import type`), and `PageErrConstructor` with `ErrConstructor`.
|
|
194
|
+
- Code that read `err.code === undefined` to tell whether a restored failure carried a code should read `"code" in err.toJSON()` instead.
|
|
195
|
+
- Code that relied on `Err.NotFound.is(...)` accepting an error of another status should call `Err.is(...)`.
|
|
196
|
+
- A test that replaces `akanjs/base` with `mock.module("akanjs/base", …)` while the real `akanjs/common` loads must include `AkanError` in the mock.
|
|
197
|
+
- Nothing else changes for code that throws and checks `Err` through `lib/dict` or `useClient`.
|
|
198
|
+
|
|
199
|
+
- 465ccb9: The `Err` that `makePageProto` returns has a named type, `ErrConstructor` from `akanjs/common` (see the one-`Err` entry; `PageErrConstructor` and `PageErrInstance` remain as deprecated names), so the declaration every app's `useClient` emits no longer spells out the class shape for `Err` and each of its status classes. `akanjs/client`'s declaration of `makePageProto` drops from about 24,000 lines to about 30.
|
|
200
|
+
|
|
201
|
+
`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`.
|
|
202
|
+
|
|
203
|
+
- 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.
|
|
204
|
+
|
|
205
|
+
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.
|
|
206
|
+
|
|
207
|
+
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"`.
|
|
208
|
+
|
|
209
|
+
- 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.
|
|
210
|
+
|
|
211
|
+
- **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.
|
|
212
|
+
- **iOS and Android shells pick status bar icons that read on the color in effect**, from the variable or from `themeColor`: dark icons on a light color (relative luminance over 0.5), light ones on a dark color. The page still draws under the bar, so the bar gets no background of its own. `appearance.setThemeColor({ color })` carries the color, so add `"appearance"` to `native.plugins` for it. An app without the plugin keeps its status bar as before.
|
|
213
|
+
- **An app that names `appearance` needs new phone binaries.** The plugin gains a method, so the native API a phone's web updates are keyed by changes for that app: a binary built before it gets no web update built after it. An app that does not name `appearance` keeps its key.
|
|
214
|
+
|
|
215
|
+
- 3d1d448: `Field.Switch` takes a `variant` prop, and its on position is now `primary`, as it is on `Switch`.
|
|
216
|
+
|
|
217
|
+
- **A `Field.Switch` without `variant` changes color:** the on position was `accent` and is now `primary`. Pass `variant="accent"` to keep the old look, or `"success"`.
|
|
218
|
+
- **Two `Data.Item` status tags change color:** `break` was an `accent` outline and is a neutral `muted-foreground` outline, so it no longer reads like `running`. `inProgress` was an `accent` fill and is an `info` fill.
|
|
219
|
+
|
|
220
|
+
- 3b7247e: A failed tool call now names a code a client or a model can branch on, beside the text it already sent, which is unchanged. No upgrade step is needed: `AgentWireToolResult` and `use-agentic`'s `ToolCallResult` only gain an optional `code`, and `akanjs/common` adds `MCP_FAILURE_META`, `McpFailure` and `FailureCode`.
|
|
221
|
+
|
|
222
|
+
Every code is a bounded token, a dictionary key (`<module>.error.<key>`) or one camelCase identifier, never prose, so no text can pass for one.
|
|
223
|
+
|
|
224
|
+
- **An app's `/mcp`:**
|
|
225
|
+
- 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:
|
|
226
|
+
- a domain `Err` by its dictionary key, such as `base.error.documentNotFound`;
|
|
227
|
+
- an `AkanError` by its code, such as `invalidArgument` for an argument the call got wrong;
|
|
228
|
+
- a guard's 401 or 403 by its status alone (`unauthorized`, `forbidden`);
|
|
229
|
+
- 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.
|
|
230
|
+
- A JSON-RPC error carries `data.code`, which tells apart what `-32602` covers:
|
|
231
|
+
- `unknownTool`, `unknownPrompt` (an unlisted page prompt included) and `unknownResource`;
|
|
232
|
+
- `invalidArgument` for bad arguments or a missing tool name, prompt name or resource uri;
|
|
233
|
+
- a refused screen's `forbidden` or `notFound`.
|
|
234
|
+
A rate-limited call names `tooManyRequests` and the catch-all names `internalError`.
|
|
235
|
+
- An MCP Apps view's call that fails without a domain `Err` restores as an error with that status and code, where it used to be a plain `Error`. A tool the view itself serves to the host names its code in the same `_meta` entry, without a `statusCode`.
|
|
236
|
+
- **`akan mcp`:** a tool error carries the same `_meta["akanjs/failure"]`, with one of these codes:
|
|
237
|
+
- `unknownTool` for a name no mode lists;
|
|
238
|
+
- `toolUnavailable` for a tool outside the server's mode;
|
|
239
|
+
- `invalidArgument` for a missing argument, an unknown guideline name, or a workflow path outside `.akan/workflows/`;
|
|
240
|
+
- `toolFailed` for anything else, with `statusCode` 500. A coded `AkanError` keeps its own code.
|
|
241
|
+
- **The code agent:** an MCP server's tool result keeps the code it named, from `_meta["akanjs/failure"]` or a JSON-RPC error's `data.code`, in the call's `details`.
|
|
242
|
+
- **The in-page agent:** a `toolResults` entry whose tool threw carries `code` beside `error` (see `use-agentic`'s WIRE.md): a dictionary `Err`'s key, else the thrown error's own `code`. A `taint: "source"` tool's result carries none, since its code would travel outside the page-content fence. The bundled Anthropic and OpenAI adaptors send `code` to the model inside the tool result, beside `error`.
|
|
243
|
+
|
|
5
244
|
### Patch Changes
|
|
6
245
|
|
|
7
246
|
- bc792ab: What a coding agent needs to build its first app is now written where it looks, and two messages say what to do next.
|
|
@@ -23,7 +262,7 @@
|
|
|
23
262
|
- **A failure the request path generalizes keeps its code and status.** An `AkanError` that is neither an `Exception` nor a missing document used to be answered as a plain `500 Internal Server Error`. It is now answered with its own status, the status's reason as `error` and its `code`, for example `{ "error": "Service Unavailable", "code": "queueFull", "statusCode": 503 }`. Its message still stays home in a production build, and a status outside 400–599 still answers 500. Anything that is not an `AkanError` is answered as before.
|
|
24
263
|
- **The code survives a restore.** A repeated idempotent mutation replays the first run's status and code, and a restored remote failure or client `Err` keeps `code` and writes it back out in `toJSON()`. `HttpClient` reads a 408, 413, 429 or 5xx body that carries a `code` as the server's own answer, so it restores it with its code and does not retry it, as it already did for a dictionary key.
|
|
25
264
|
- **MCP answers it the same way.** A tool call that fails with such an error under 500 reads `<reason>: <code>` (`Conflict: titleTaken`) instead of `The server failed to complete this request.`, and is not logged as a crash. Its message stays home here too.
|
|
26
|
-
- **`AkanError.is(error)` recognises an error from another copy of the module**, as a server bundle and main.js each carry one, so the redaction holds for those too. A subclass's `is` still checks `instanceof
|
|
265
|
+
- **`AkanError.is(error)` recognises an error from another copy of the module**, as a server bundle and main.js each carry one, so the redaction holds for those too. A subclass's `is` still checks `instanceof`, except a dictionary `Err`'s, which reads the error's key and, on a status class, its `statusCode`, so a restored remote one passes too.
|
|
27
266
|
|
|
28
267
|
- a707354: Akan Studio maps the framework itself, and `pkgs/akanjs/ARCHITECTURE.md` keeps its tables from the source.
|
|
29
268
|
|
|
@@ -32,6 +271,17 @@
|
|
|
32
271
|
- **`pkgs/akanjs/ARCHITECTURE.md`** pairs a hand-kept walk through the processes and a request with a generated part between markers. `akan sync-architecture` regenerates that part, and a devkit test fails when it is stale, when a channel is gone, when two facets load values from each other, when a message lacks a recognised sender or handler outside a short list whose other end lies beyond the framework source, or when the hand-kept part names a class the source no longer has.
|
|
33
272
|
- **`AkanIpcMessage` no longer lists `backend-ready`.** The gateway sends it to the dev host, which reads it as a `BuilderMessage`, where it stays; no gateway or child ever handled it.
|
|
34
273
|
|
|
274
|
+
- 4d61170: The Akan Graph follows an app's adaptor wiring further. `applyAdaptor(LlmAdaptorRole, ChatCompletionsLlm)` in an app's or lib's `option.ts` draws a `binds` edge from the role, `adaptor::LlmAdaptorRole`, to the implementation it binds, labelled with the app or lib and located at the call, so a method that calls a plugged role reaches the class that answers it. `get_graph` scoped to an app keeps that app's own bindings, and a lib's binding of a role the app does not bind itself; scoped to a lib or a module it keeps every binding of a role it reaches. A Change Map carries every binding of a role it shows, changed or not, so the binding an app runs stays in view; a binding the app removed no longer hides the lib binding it now runs; and Studio's Change Map for one app keeps only the bindings that app runs. An app service holds the fields its module's lib services plug (`...user.services`), so `this.notifier.getMemo()` in an app method links to the `Notifier` a lib's `MemoService` plugs, where it linked to the `memo` model; a service whose own builder declares the field (`notifier: use<…>()`) inherits nothing. A plug imported from a package outside the workspace, `plug(Stripe)` from `stripe-sdk`, or through a lib's re-export of it (`export { Stripe }`, `export { default as Stripe }`, or `export * from "stripe-sdk"` where the lib declares no `Stripe` itself), is `adaptor:stripe-sdk:Stripe` with the package in `detail`, where it linked to a same-name adaptor the app declares or to an unlocated `adaptor:libs/util:Stripe`. Two adaptors with the same class name in one app or lib are two nodes, each with its own location, digest and `plugs`, and a plug reaches the one its import names. A job's `detail` lists only the options its kind honours: `once` on an `initialize` job, `unlocked` on an `interval` job (`Bun.cron` never overlaps a cron job, so `lock: false` changes nothing there); `cron("0 * * * *" as const)` reads `0 * * * *`.
|
|
275
|
+
|
|
276
|
+
Ids and details that change for a saved graph or a Change Map base:
|
|
277
|
+
|
|
278
|
+
- While two adaptors of one owner share a class name, each is keyed by its file, `adaptor:apps/demo:srvkit/clockB.ts#Clock`; an adaptor whose name no other adaptor of its owner shares keeps `adaptor:<owner>:<Name>`. The Change Map treats the two forms of one declaration as one node, so a second same-name adaptor shows as one added node, not a removal of the first.
|
|
279
|
+
- A plug from a non-workspace package is `adaptor:<package>:<Name>` with the package as `detail`, where it was `adaptor::<Name>` or a workspace adaptor of that name.
|
|
280
|
+
- A job's `detail` drops `once` and `unlocked` where the runtime ignores them, and `as const` from a cron expression.
|
|
281
|
+
|
|
282
|
+
- **`binds`** joins `AkanGraphEdgeKind` in `akanjs/common`.
|
|
283
|
+
- **`FileFacts.adaptorBindings`** in `@akanjs/language`: each `applyAdaptor(role, adaptor)` call a file makes; `AkanIndex.setFile` also reads non-test files whose text mentions `applyAdaptor`. **`ServiceClassFact.fields`**: the names a service's builder declares.
|
|
284
|
+
|
|
35
285
|
- c723713: The Akan Graph keys a guard function by the file that declares it, locates more of a workspace's guards, and stops counting things that are not guards.
|
|
36
286
|
|
|
37
287
|
A guard function a route or layout imports is keyed by its file, as one the page declares already was: `guard:libs/shared:webkit/signedIn.ts#signedIn`. A `canEdit` in `webkit/` and one in `common/` are two nodes, each at its own declaration, and an edit to either marks only that one changed in the Change Map. A guard called through a namespace import (`auth.signedIn()`), or imported under a name a file re-exports (`export { signedIn as hasSession } from "./auth"`), reaches its declaration. A function the guard declares, or a parameter it binds, shadows an import of the same name only inside its own scope, so `[1].forEach((signedIn) => …)` no longer hides a real `signedIn()` beside it. A guard declared after another declarator (`export const ready = true, signedIn = …`) is found, and an overloaded guard's digest covers every signature. Only a file whose text declares or re-exports the name is parsed, so a guard that calls `usePage()` from the generated client no longer parses every page that names it.
|
|
@@ -74,6 +324,21 @@
|
|
|
74
324
|
- **`internal`, `adaptor` and `plugs`** join `AkanGraphNodeKind` and `AkanGraphEdgeKind` in `akanjs/common`.
|
|
75
325
|
- **`FileFacts.internals` and `FileFacts.adaptors`** in `@akanjs/language`, with `ServiceClassFact.plugs`; `AkanIndex.setFile` also reads non-test files that call `adapt` or `dangerouslyAdapt`.
|
|
76
326
|
|
|
327
|
+
- 882e976: The Akan Graph takes a lib's named re-export of a package class only along the chain it walks from the plug's import path, the same chain its `export *` walk follows. The forms it reads are `export { Stripe } from "stripe-sdk"`, `export { default as PayPal } from "paypal-sdk"` and `import { TossClient } from "toss-sdk"; export { TossClient as Toss }`. A plug `Stripe` imported from `@libs/shared/srvkit` follows that folder's index and the modules the index exports. It also follows a relative named re-export (`export { Wise } from "./vendors/wise"`) and an `export *` into another folder or lib (`export * from "../common/square"`, `export * from "@libs/util/srvkit"`). A re-export the chain does not reach no longer claims the plug. Examples are `libs/shared/webkit/stray.ts`, a file in a subfolder whose committed index does not export it, and `srvkit/stripe.helper.ts`, which the generated barrel skips.
|
|
328
|
+
|
|
329
|
+
A facet folder (`ui`, `webkit`, `srvkit`, `common`, `plugin`) with no index on disk is read as the barrel `akan sync` writes. The generated barrels are gitignored, so this is every facet in a Change Map. As a result, a plug gets the same id in the graph view and in the Change Map, with or without `akan sync`. The folder scans that stood in for a missing barrel are gone. The barrel rule (which files and folders, the naming rule, and Biome's sort order) now lives in `akanjs/common` as `facetBarrelOf`, `facetBarrelNamesOf`, `compareExportNames` and `barrelFacetDirs`. The facet index template, the dev server's index sync and the graph all share it, and `akan sync` writes the same bytes as before.
|
|
330
|
+
|
|
331
|
+
A package `export *` on the chain is refused only for a name that a module along the chain declares. A declaration elsewhere in the imported lib no longer blocks it. Two re-exports that name the same package through different paths (`"stripe-sdk"`, `"stripe-sdk/server"`) are one adaptor. Guards still find a named re-export anywhere in the lib, as before. A guard reached through an `export *` reads a missing facet barrel the same way, so the Change Map locates `guard:libs/util:Admin` behind `libs/shared/srvkit/util.ts: export * from "@libs/util/srvkit"` as the graph view does.
|
|
332
|
+
|
|
333
|
+
Ids that change for a saved graph or a Change Map base:
|
|
334
|
+
|
|
335
|
+
- In a Change Map, a guard reached through an `export *` in a facet folder with no index is the guard the graph view links, where it was the unlocated `guard:<lib>:<Name>`.
|
|
336
|
+
- A plug whose name the lib re-exports from a package only off the import's chain is the unlocated `adaptor:<lib>:<Name>`, where it was `adaptor:<that package>:<Name>`.
|
|
337
|
+
- A plug reached through a relative named re-export, or through an `export *` into another lib, is `adaptor:<package>:<Name>` where it could be the unlocated `adaptor:<lib>:<Name>`.
|
|
338
|
+
- A plug whose name two modules along the chain re-export from different packages is the unlocated `adaptor:<lib>:<Name>`, as TypeScript drops a name two `export *` share, where it was the first file's package.
|
|
339
|
+
- A plug a chain's sole package `export *` reaches is `adaptor:<package>:<Name>` even when the lib declares `<Name>` off the chain, where it was the unlocated `adaptor:<lib>:<Name>`.
|
|
340
|
+
- An owner can have several same-name adaptors. With no index in the import's facet folder, a plug of one of them follows the generated barrel. It used to take the first adaptor under the folder. Through an import path that is neither a module nor a facet folder, the plug is the unlocated `adaptor:<owner>:<Name>`, where it was the first adaptor.
|
|
341
|
+
|
|
77
342
|
- bb40785: The Akan Graph maps `page/`. Each route file is a `route` node named by its URL pattern after the locale (`route:apps/demo:/memo/:memoId`, groups dropped as the router drops them), and each `_layout.tsx` is a `layout` node keyed by its folder (`layout:apps/demo:/(app)`, `root` for a `rootLayout()`). A `wraps` edge runs from each layout to the routes and layouts directly inside it, located at the wrapped file. A route or layout whose default export runs `.guard()` reads `guard` and links each function its guard calls that the file imports or declares: `.guard(() => signedIn())` reaches `signedIn` in `@libs/shared/webkit`, with its location and the comment above it, and a function declared in the page itself is keyed by that file (`guard:apps/demo:page/pin.tsx#isOwn`). A call to anything else (`Boolean`, akanjs's `redirect`, a package's `dayjs`) is looked through, a helper handed to a guard (`isOwn(isId(id))`) is not a guard, and an imported guard is looked up under its import path first. A layout's guard gates every route it wraps; the routes themselves do not repeat it, so a guard added to a layout marks only that layout changed in the Change Map. A route's default export, or the const it names (`const route = page()…; export default route`), is the route node itself, so the slices and actions a page uses hang off its URL. `_overrides.tsx` and the git-ignored `page/(libs)/` links are left out; a lib's own pages are its routes. A route's digest covers its whole file, so the Change Map marks an edited page changed instead of listing it as unmapped.
|
|
78
343
|
|
|
79
344
|
An unscoped `get_graph` still answers a graph of up to 600 nodes whole. Past that, it first drops the routes and layouts that neither changed nor use a change, and the route-only guards they leave unlinked, before it asks for a scope; an `app` or `module` scope brings them back. Studio's first column reads "Pages & components".
|
|
@@ -152,19 +417,38 @@
|
|
|
152
417
|
- It sits behind the same gate as the other `/_akan` devtools routes, and `akan tunnel` / `akan start --share` refuse it.
|
|
153
418
|
|
|
154
419
|
- 96f9ff6: A `Binary` argument reaches `exec` typed as `Uint8Array<ArrayBuffer>`, so it can go straight to a service or a `fetch` body. Before, it was a copy of `Uint8Array` with every method stripped. A `Binary` return still takes any `Uint8Array`.
|
|
420
|
+
- af7c411: The five child-process restart loops now share one restart schedule, `RestartSchedule` from `akanjs/common`: the gateway's replicas, the RSC worker, the incremental builder, and `akan start`'s backend and builder recovery. It counts failed restarts, waits before the next one and cancels a pending one on stop. Each loop keeps its own delays (200ms–30s for the RSC worker, 2s–60s for `akan start`'s builder recovery, 1s–30s for the rest), its own give-up rule and its own log lines.
|
|
421
|
+
|
|
422
|
+
Two stop races in those loops are fixed:
|
|
423
|
+
|
|
424
|
+
- A replica whose restart timer had fired no longer respawns after the gateway stops.
|
|
425
|
+
- A builder `akan start` was still creating or booting when it stopped is now stopped too, instead of being started or retried after its ready timeout.
|
|
426
|
+
|
|
427
|
+
In `@akanjs/devkit`, `shouldAbandonBackendRecovery` is replaced by `backendRecoveryPolicy`, which gives up after five failed backend restarts as before.
|
|
428
|
+
|
|
429
|
+
- 6d449b1: A page that imports anything from `akanjs/common` no longer ships the pipeline plan parser to the browser, so every page loads about 4.8 KB less JS, brotli.
|
|
430
|
+
|
|
431
|
+
- **Before:** `PipelinePlanSchema` builds two key lists with `Object.keys` in static fields, and `pipelinePlan.ts` builds `pipelineActionNames` the same way. The bundler counted those calls as side effects, so it kept `PipelinePlanSchema`, `PipelinePattern`, `PipelineNames`, `PipelineValueReader` and the plan vocabulary in every client bundle, though only the build tooling and the pipeline executor read them.
|
|
432
|
+
- **Now:** those three calls are marked `@__PURE__`, so a client bundle drops the pipeline code it never uses. The parser, `pipelineActionNames` and every other export behave as before.
|
|
433
|
+
|
|
155
434
|
- 1ebc57a: The `Err` an app imports in client code now has `Err.is(error, ...keys)`, as the `Err` from the app's dictionary (the one services throw) already did. It was missing on the client one, so client code that checked a caught error with it failed to typecheck, or threw a `TypeError` when typed loosely. `Err.is` is true for an `Err`, or for any error carrying a string `error` key, so one restored from a failed `fetch` call passes too; naming keys accepts only those and narrows the error's type to them. Both `Err` classes now run the same check.
|
|
156
|
-
- c3b5b3c:
|
|
435
|
+
- c3b5b3c: The framework no longer puts `@akanjs/native/core` on a web page. `isNativeApp()` and the other host checks read the platform the shell writes before the bundle runs, and a native shell still starts core with the page. A file that imports `akanjs/client/native` statically still brings core to every page that reaches it. On the minimal app this takes 15 KB raw (5.6 KB brotli) off the vendor floor and 20 KB raw (6.6 KB brotli) off every route entry. `akan build` also resolves the `production` export condition for the browser, SSR-client, CSR and MCP App view bundles, so a package such as Lexical ships its production build alone. On the minimal app the Agent editor chunk drops from 91 KB to 63 KB brotli. `akan start` is unchanged.
|
|
157
436
|
- 6d5b544: A database service now has `create<Model>Many(rows)`. It creates the rows on the same path as `create<Model>`: `_preCreate` and `_postCreate`, the document's save and create hooks, and the live and pubsub events each row's commit fires. Every row's `_preCreate` and document pre hooks run first, so a check there that queries the table does not see the batch's own rows. The rows are then written in one transaction, joining the caller's when one is open, with one multi-row INSERT per 500 rows instead of one statement per row; if the database refuses one row, none is written. Every row's `_postCreate` runs once the transaction commits, as `create<Model>`'s runs once its row is stored, so a `_postCreate` that throws leaves the rows written. A service that already declares a method of that name, itself or in a lib service it extends, keeps its own at runtime, but its signature no longer typechecks against the generated one: rename it.
|
|
158
437
|
|
|
159
438
|
A store can list actions in `static silent = ["refreshToken"] satisfies (keyof UserStore)[]`. When a silent action fails, it shows no toast and logs at verbose instead of error. It still rejects with the original error, so a background write such as a token refresh is awaited by its caller, which handles the failure. Generated actions can be listed, and a store built on a lib store keeps the lib's silent actions. A name in `static silent` that is not an action of the store is reported when the store registers.
|
|
160
439
|
|
|
161
440
|
`akan lint`'s `akan.service.call-in-loop` fix and the agent guidelines name `create<Model>Many` as the way to write a set once.
|
|
162
441
|
|
|
442
|
+
- 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.
|
|
443
|
+
- 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.
|
|
444
|
+
- 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.
|
|
163
445
|
- 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`.
|
|
164
446
|
|
|
165
447
|
`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.
|
|
166
448
|
|
|
167
449
|
- 9f30e93: A dev page no longer loses its styles after a stylesheet change arrives together with a pages rebuild. The most common case was the first save after `akan start` released its builder for being idle: the waking builder announces a new pages bundle and a new stylesheet at once, and the SSR worker that had started importing the bundle put the old stylesheet back when the import finished. Pages kept linking that stylesheet, whose file the dev server had already deleted, so they rendered unstyled with a 404 until `akan start` was restarted. The same update also reaches an SSR worker that is still booting after a recycle, which used to keep the stylesheet it was started with.
|
|
450
|
+
- ad09fac: Exports that nothing in akanjs, its tests or a consumer workspace uses are now marked. Thirteen that no code calls at all are `@deprecated` and leave in a later minor: `MAX_INT` (write `2 ** 31 - 1`), `isFilterModel` (`getFilterMeta(ref, { allowEmpty: true }) !== undefined`), `setFilterInfoByKey` (declare the query with `from(model, (filter) => …)`), `getDefaultSchemaOptions` (`new DocumentSchema()`), `runWithTrace` (`runTraced`, only where the caller owns the trace, since it finalizes it), `traceDbQuery` (`getCurrentTrace()?.countDbQuery(ms)`), `isSitemapPath` (`getSitemapBasePath(pathname, basePaths, headerBasePath) !== undefined`), `useRscNavigation` (`navigateRsc`, `clearRscNavigationCache`, `isRscNavigationFromCache`), `getSearchParam` and `getBaseSearchParam` (read `searchParams[key]`, taking the first value of an array), `dictionaryContext`, `groupByOwner` and `ServiceRegistry`. Eleven that only their own file uses, such as the console helpers in `akanjs/server` and `getClientRuntime` in `akanjs/client`, are `@internal`: they are not meant for use outside akanjs and may stop being exported in a later minor.
|
|
451
|
+
- ae045d8: No non-test file in an `akanjs` facet imports its own facet's barrel any more; each imports the sibling file that declares what it uses. Four value imports in `constant/` went through its barrel, so loading one of those files loaded the whole facet first. `ResolveFieldContext` moved to `signal/resolveFieldContext.ts`, and `akanjs/signal` still exports it. Every public import is unchanged.
|
|
168
452
|
- d9eaacc: A query takes `signal` in its `FetchPolicy`, joined with its deadline: an abort rejects the call with the signal's reason, stops the request, and ends the retries, including one waiting between tries. A signal already aborted sends nothing, over HTTP, inside a server render or through an MCP App view's host. A signal from `AbortSignal.timeout` rejects with the slow-server error (`base.error.gatewayTimeout`, 408), as the query's own deadline does. A mutation ignores it, since one already sent may have run. In an MCP App view an abort, or the query's own deadline running out, also asks the host to cancel the call it relayed (`notifications/cancelled`); a mutation that runs out of time is only given up on. A custom `FetchBridge` receives the signal as `signal`.
|
|
169
453
|
|
|
170
454
|
A slice's list loads (`init`, `refresh`, `setPage`, `setLimit`, `setSort`, `setQueryArgs`, `loadMore`) abort the request a newer load of the same slice supersedes, instead of letting it run to the end and dropping its answer. The superseded load writes nothing and shows no error, and so does one aborted by a `signal` its caller passed, which resolves; `init` still applies its `default` at once unless the signal was already aborted, and an `init` aborted mid-flight, or one with nothing to change, leaves a loaded-more list whole, so the next refresh still reloads every row shown. A caller's `AbortSignal.timeout` is the exception: the load rejects with the slow-server error and shows it, as a query does. A store action that rejects with the abort of a signal it was given no longer shows an error toast, whatever reason that signal was aborted with, except an app or server error (one with a dictionary key or a status) and a timeout, which still show.
|
|
@@ -173,10 +457,73 @@
|
|
|
173
457
|
|
|
174
458
|
`FetchPolicy.cache` and `FetchPolicy.partial` are deprecated. Nothing has read them since v2 dropped GraphQL; an endpoint reuses its answer with its own `query(T, { cache })`. `FetchPolicy.onError` is deprecated too, since nothing calls it: catch the call's rejection instead.
|
|
175
459
|
|
|
460
|
+
- 0e5db0a: A server-rendered page is smaller, renders faster, and its browser decodes its RSC payload faster. The server used to put every Flight row of the page's payload in its own inline `<script>`. That added up to 4,000 scripts on a 1.1 MB payload, and the HTML of the minimal app's pages on its dev server carried 150 to 400 of them. Each chunk of the payload the server receives now goes out as one script, with its rows unchanged. A typed-array or `ArrayBuffer` row still goes out as a script of its own, so only that row is base64-encoded. On the dev server, the minimal app's pages now carry 1 or 2 scripts each, and their HTML is 5.7–8.1% smaller. Measured in Bun with a 1.1 MB payload:
|
|
461
|
+
|
|
462
|
+
- the server's work from rendering through to the last byte drops by about 15%;
|
|
463
|
+
- in 16 KB chunks, the server-side decode of the payload drops by about 25%, and by less in 1 KB chunks;
|
|
464
|
+
- in 16 KB chunks, the browser's decode of the page's payload drops by about 40%, and by less in 1 KB chunks.
|
|
465
|
+
|
|
466
|
+
The bytes React decodes are unchanged, and so is when a row reaches the page. The first HTML byte leaves as early as before, or earlier.
|
|
467
|
+
|
|
468
|
+
`AKAN_MAX_PENDING_INLINE_RSC_SCRIPTS` is replaced by `AKAN_MAX_PENDING_INLINE_RSC_BYTES` (default 16 KB). It caps how many bytes of the payload the server reads ahead and holds, unencoded, while the page's HTML is still streaming, though a single chunk larger than the cap is still read and held whole. The old variable counted scripts, and it is no longer read.
|
|
469
|
+
|
|
176
470
|
- c334caf: A root layout's fonts now preload one face per family instead of every face. By default that is the regular face: 400 normal, or the weight a browser draws regular text with when the family has no 400 (500, then lighter, then heavier). Every other weight still has its `@font-face` rule, with `font-display: swap`, and loads when text first uses it. A path set to `preload: true` is preloaded as well, and `preload: false` still never is. The app template's home page declares nine Pretendard weights and preloaded all of them, 166 KB; it now preloads one, 18 KB, and fetches the three other weights it shows when it draws them. To keep a weight the first screen shows preloaded, set `preload: true` on its path; the akanjs.com layout now does that for 700 and 900.
|
|
471
|
+
- 170be15: A form field setter now costs about one copy of the state, like any other store write. `set<Field>On<Model>`, `add<Field>On<Model>`, `sub<Field>On<Model>`, `writeOn<Model>` and the file upload setters used to hand `set` an updater, which ran immer over the whole state and then compared every key. A keystroke cost 284 µs at 1,740 keys and 600 µs at 3,480. They now produce the new form alone and write it as a patch: 42 µs at 1,740 keys and 79 µs at 3,480, against 37 µs and 74 µs for a bare copy of the state.
|
|
472
|
+
|
|
473
|
+
- **`merge<Model>` marks the open model loading under its own key.** It wrote a literal `modelLoading` key, so `<model>Loading` never showed the merge in flight and the state gained a stray key. The view modal now shows its loading state during a merge.
|
|
474
|
+
- **A failed model action ends the loading it started.** When `create<Model>`, `create<Model>InForm`, `update<Model>`, `update<Model>InForm`, `merge<Model>` or `view<Model>` fails, `<model>Loading` goes back to `false`; when `edit<Model>` fails, `<model>FormLoading` does. That also holds when the request succeeds but the write after it throws. Before, the flag stayed set and the view or edit modal stayed under its loading overlay.
|
|
475
|
+
- **A loading flag is cleared only by the action that set it last.** An action that another one overtook leaves the flag alone, even when both are on the same record. Before, a merge or update landing during a `view<Model>` of the same record showed that view as loaded early.
|
|
476
|
+
- **A model action no longer takes over what `view<Model>`, `edit<Model>` or `new<Model>` opened during its request.** A `Load.View` hydrating a record, an edit modal filling its form from a page payload, and a list's view modal coming back after an edit opened from it closes or fails to load count as opens too; an app's own `st.set` of those keys does not.
|
|
477
|
+
- `merge<Model>`, `update<Model>` and `update<Model>InForm` write the answer as the open model only while that record is still open.
|
|
478
|
+
- Creates and updates leave the modal alone.
|
|
479
|
+
- `update<Model>InForm` and `create<Model>InForm` leave the form to an `edit<Model>`, a `new<Model>` or an edit modal's payload fill opened meanwhile. A `view<Model>` or a `Load.View` does not take the form, so the saved form is still reset and its draft dropped.
|
|
480
|
+
- A `view<Model>` or `edit<Model>` overtaken by a later one no longer lands its record over the later one.
|
|
481
|
+
- Before, a view of another record was replaced or closed when the write landed, an edit opened during a save lost its form or closed, and when an edit opened from a list's view was closed while saving, or failed to load while another write was in flight, the view came back only for that write to close it.
|
|
482
|
+
- **A form opened under the same draft scope while `create<Model>InForm` or `update<Model>InForm` waits for the server opens without that draft**, so a second new form is not refilled with what the first is creating. The draft stays in storage until the request succeeds, so a reload during the save still restores it, and it is kept when the request fails. On success it is deleted only while it still holds the saved form, so a draft that a form opened meanwhile wrote is kept. A form holding an `undefined` value now compares equal to its stored draft, which drops that value; before, the saved form's own draft was kept and refilled the next new form. A draft discarded or reset during the save stays gone when the save fails. A draft write still pending when the save starts is written first.
|
|
483
|
+
- **A failed `view<Model>` or `edit<Model>` that is still the latest open closes its modal**, unless the modal already shows that record, as when a page payload seeded it. Before, the modal stayed open over the previous record.
|
|
484
|
+
|
|
177
485
|
- 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.
|
|
178
486
|
- 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.
|
|
179
487
|
- 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.
|
|
488
|
+
- 24dcb1e: A lazily loaded chunk the server no longer serves now reloads its page once.
|
|
489
|
+
|
|
490
|
+
- **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.
|
|
491
|
+
- **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:
|
|
492
|
+
- the error is a fetch failure the client can tie to a chunk under this origin's `/_akan/client/` (see below);
|
|
493
|
+
- the browser is online;
|
|
494
|
+
- 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;
|
|
495
|
+
- no navigation to another page is under way, and no other document load either;
|
|
496
|
+
- the error is not one the Flight client's chunk loader already handled.
|
|
497
|
+
- **Which chunk is asked about:**
|
|
498
|
+
- 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;
|
|
499
|
+
- 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:
|
|
500
|
+
- 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;
|
|
501
|
+
- the chunk Chromium names is not gone, but a chunk it imports is, as when a rolling deploy splits requests across builds.
|
|
502
|
+
- 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.
|
|
503
|
+
- 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.
|
|
504
|
+
- 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.
|
|
505
|
+
- Only WebKit's exact message counts. Its syntax, link, MIME-type and evaluation errors are worded differently and still leave the page alone.
|
|
506
|
+
- **A request the server has not answered after 10 seconds is given up** and counts as failed, like a network failure: it does not reload, and the next error asks again instead of waiting on it.
|
|
507
|
+
- **The reload is skipped if anything happened while the request was out:**
|
|
508
|
+
- any client navigation, including a shallow update, a refresh (the token-refresh timer's too) or a back or forward move;
|
|
509
|
+
- a `beforeunload` or `pagehide`, which a document load the router never sees fires (a plain link, a form post, `location.assign`).
|
|
510
|
+
- **Unlike a link failure, this covers the document's own page too,** since a deploy removes the chunks of the build the tab was opened on.
|
|
511
|
+
- **At most one reload per chain of loads.** The reloaded document never reloads from here while it stays on that path, so chunks that keep answering 404 there show their error after one reload, however many there are and whether or not the tab's storage holds. A further reload needs a page navigation to another path. Each chunk is also recorded in the per-tab list the chunk fallback uses.
|
|
512
|
+
- This applies to `akan build` output only.
|
|
513
|
+
|
|
514
|
+
- 256b6e3: A lazily loaded chunk that fails to link during a rolling deploy now reloads its page as a document.
|
|
515
|
+
|
|
516
|
+
- **Before:** the chunk fallback covered only the chunks the Flight client loads. A chunk loaded through `import()` (`lazy` from `akanjs/webkit`, `React.lazy`, or a dynamic import in a client component) on a page from another build could fail to link against the document's import map. With no error boundary above it, the page went blank; with one, it showed that boundary's fallback. Nothing loaded the page again.
|
|
517
|
+
- **Now:** when a module link or resolve error reaches the React root (caught by an error boundary or not) or rejects an `import()` that nothing catches, the tab reloads the address it shows. It does so only when all of these hold:
|
|
518
|
+
- the page on screen was rendered from a client navigation's or refresh's response, not by the document itself;
|
|
519
|
+
- no navigation to another page is under way;
|
|
520
|
+
- the browser is online;
|
|
521
|
+
- no other document load is under way;
|
|
522
|
+
- the error is not one the Flight client's chunk loader already handled.
|
|
523
|
+
- **At most one reload per error per tab,** whichever page it shows up on, in the same per-tab list the chunk fallback uses.
|
|
524
|
+
- **An `import()` of your own that always fails to link** (a bare specifier missing from the import map, or a CDN module that lacks a name it is asked for) therefore costs one reload per distinct error per tab, the first time it happens on a page a client navigation rendered. After that it shows as it did before.
|
|
525
|
+
- This applies to `akan build` output only. There, React's own reporting is kept: a caught error is still logged, and an uncaught one is still reported, through a window `error` event where the browser has no `reportError`. `akan start` passes nothing new to the root.
|
|
526
|
+
|
|
180
527
|
- c48d780: The `shared` and `util` libraries that `akan install-library` copies are refreshed. Apps that use them should check these changes:
|
|
181
528
|
|
|
182
529
|
- Sign-up and sign-in steps run in a new `_sign` service. `generatePrepareUserWithAccountId`, `startPhoneSign` and `signinWithPhoneCode` are now one endpoint each, replacing store actions that chained several calls. `activateUserWithAgreePolicies` writes the agreed policies together with the activation. `leaveSelf` and `leaveAndSignoutSelf` take the leave survey with the deletion.
|
|
@@ -227,6 +574,13 @@
|
|
|
227
574
|
- **Native and CSR boots keep their locale paths.** Their routes match on the `/:lang` segment, so a `?csr=true` request without one is redirected to the default locale's prefixed path. An Android app link limited to a basePath lists the default locale's unprefixed path as well as its prefixed one, so links from before the switch still open the app.
|
|
228
575
|
- `akan preview` keeps an unprefixed path unprefixed under `"as-needed"`, except with `--csr`. The value reaches bundles as `AKAN_PUBLIC_LOCALE_PREFIX`, and the image env carries it when it is `"as-needed"`. `LocalePath` (`akanjs/common`) and a fourth `localePrefix` argument to `getPathInfo` build the same URLs in app code.
|
|
229
576
|
|
|
577
|
+
- dfc3564: A server stopped while its log control socket was still starting no longer leaves that socket listening. `akan logs` then found a socket nothing owned, and it kept serving a closed log hub until the process exited. Starts and stops on one control socket path now take turns, so a start whose log hub was closed meanwhile binds nothing or closes what it bound before a restart's open looks, and the restarted server gets its own socket. A socket that fails after binding is closed before the error surfaces. Stopping a control socket that never bound no longer unlinks the live socket of another server in the same runtime folder.
|
|
578
|
+
- 24dcb1e: A missing file under `/_akan/client/`, `/_akan/styles/`, `/_akan/fonts/` or `/_akan/dict/` now answers its 404 with `Cache-Control: no-store` and the asset security headers.
|
|
579
|
+
|
|
580
|
+
- **Before:** the 404 named no cache policy. A CDN in front of the app may cache such a 404 (Cloudflare keeps one on a `.js` path for 3 minutes), so during a rolling deploy one replica's 404 for a chunk was served for the replicas that have it.
|
|
581
|
+
- **Now:** both the app server and the gateway send `no-store`, so a CDN that honours it asks the origin again. CloudFront may still keep an error response for its error caching minimum TTL (10 seconds by default); lower that on the distribution if it matters.
|
|
582
|
+
|
|
583
|
+
- d12f556: `akanjs/signal`, `akanjs/client`, `akanjs/server`, `akanjs/constant` and `akanjs/store` now list every export by name instead of re-exporting whole files with `export *`. They export exactly the names they did before. A new export in one of those facets' files is no longer exported from `akanjs/<facet>` until its facet's `index.ts` names it. Files under `server/` and `client/native/` stay importable by their own subpath, as before.
|
|
230
584
|
- 9b5bcee: Every SSR page now loads 72K less framework JavaScript (22K less after Brotli).
|
|
231
585
|
|
|
232
586
|
- **`akan build` narrows the vendor entries to the names the page code imports.** The `akanjs/*` and `tailwind-merge` entries in the page's import map used to re-export a whole facet. Each one now exports only the names the built route bundles import, lazy chunks included. On the minimal app, the framework floor, meaning the runtime plus the vendor entries every page loads, drops from 630.2K raw / 189.4K br to 558.4K raw / 167.4K br. `akan start` keeps whole facets, so a newly saved import never misses a name.
|
|
@@ -243,6 +597,7 @@
|
|
|
243
597
|
- Its `noindex` is one `robots` meta that keeps the other directives a layout's `robots` meta gives, such as `nofollow`.
|
|
244
598
|
- Under a `.loading()` the head is out before the view renders, so its tags stay in the view, as before.
|
|
245
599
|
|
|
600
|
+
- 6cdfb73: `/openapi.json` now lists the 404 `base.error.documentNotFound` that a generated `<model>`, `light<Model>`, `update<Model>` or `remove<Model>` can answer when its id names no live document, in the same `AkanError` shape as a declared error. A caller that a resource guard such as `Can<Verb><Model>` refuses still gets the guard's 403, since the guard fails closed when its own load misses. A document with such an endpoint now carries the `AkanError` component. `create<Model>`, the slice reads and custom endpoints are unchanged. Only OpenAPI changes: the MCP `tools/list`, the in-page agent's tools and the server's `errors` checks read none of it, so a tool's description gains no line and `base.error.*` is still never declared in an endpoint's `errors`. The answer itself is unchanged, and so is the level each miss is logged at.
|
|
246
601
|
- b24fef3: An app that draws no Akan UI component now builds and runs without the UI's optional peers. Before, `akan build` failed with `Could not resolve: "react-icons/ai"` or `"react-spring"` in an app that imported nothing from `akanjs/ui`: the System UI every root layout mounts drew react-icons glyphs and reached the model, list and dialog components through the `Load` and `Button` modules, and the CSR build, on by default, bundled the whole `akanjs/ui` barrel.
|
|
247
602
|
|
|
248
603
|
**Upgrade note.** A workspace can drop `react-spring`, `@react-spring/web`, `@use-gesture/react`, `react-refresh`, `scheduler` and `tailwind-scrollbar` from its `package.json`, unless its own code imports them. `akanjs` now depends on `@react-spring/web`, `@use-gesture/react`, `react-refresh`, `scheduler` and `tailwind-scrollbar` itself, because the System UI, the dev runtime and `akanjs/ui/styles.css` always use them, and nothing uses `react-spring` any more. New workspaces no longer list them. A workspace whose own code keeps `react-spring` or `@react-spring/web` must move it to major 10: an older one installs a second copy under `akanjs`, and a spring value the app makes no longer typechecks on an `animated.*` element from `akanjs/ui`.
|
|
@@ -254,28 +609,143 @@
|
|
|
254
609
|
- **The CSR build and its MCP App views** rewrite `akanjs/ui` imports to the components a file names, as the SSR route builds already did, so a page that imports `Link` no longer bundles every component.
|
|
255
610
|
- **Animations use `@react-spring/web`** instead of the `react-spring` umbrella package, which also installed the native, three.js, konva and zdog renderers.
|
|
256
611
|
|
|
612
|
+
- 513e48d: A page whose render has a side effect, such as counting a view, can now refuse every Link prefetch itself with `.config({ prefetch: false })`; on a `_layout` it covers every page below, and a page there can opt back in with `prefetch: true`. The server runs the route's guards and then answers such a prefetch with an empty 204, rendering nothing, cached or not: a guard's redirect still answers as a redirect, and a refusal as it would for the click, so a prefetch tells a visitor no more than a click about the paths behind a guard. The browser keeps that answer as nothing for the prefetch lifetime, so hovering the link again asks no more, and the click renders the page as usual.
|
|
613
|
+
|
|
614
|
+
A page prefetched before this tab's own write is no longer shown as current: a mutation, a file upload, a socket message sent or a changed credential drops every prefetched page, as it already ended in-flight query sharing. Only this tab's own writes through `fetch` count: a write from another tab or device, or a server push, leaves a prefetched page as it is for the rest of its 15-second lifetime, and a socket message drops them as it is sent, not once the server has acted on it. A write that changes nothing a page reads, such as a typing notice, passes `{ keepsReads: true }` to keep both its in-flight queries and its prefetched pages.
|
|
615
|
+
|
|
616
|
+
In production, an RSC navigation's answer no longer carries the headers that explain a render to its developer (`X-Akan-Rsc-Route`, `-Pathname`, `-Nav-Id`, `-Cache`, `-Cache-Reason`, `-Cache-Key`, `-Partial-Reason`, `-Partial-Common-Prefix`, and `X-Akan-Rsc-Partial` other than a patch's): a missing path carried them where one a guard refused did not, telling a visitor which paths exist behind the guard. `akan start` still sends them.
|
|
617
|
+
|
|
618
|
+
Link prefetch fixes:
|
|
619
|
+
|
|
620
|
+
- A link's focus prefetches it after a key press, and until the first pointer press on the page, so focus moved by a screen reader's cursor, switch access or voice control still does; the focus a mouse press, a tap or a pen tap gives a link does not, until the next key press.
|
|
621
|
+
- A late redirect from the page on screen, raised while another navigation loads, now runs once that navigation ends keeping the page (a bare 404 refusal, a refresh that finds no page, or a shallow update or a Back between the page's shallow entries that cancels it) instead of being dropped; a navigation that replaces the page still drops it.
|
|
622
|
+
- A page the navigation cache holds under another `#fragment` is neither prefetched again nor fetched on the click: the fragment never reaches the server, so the cached payload serves it.
|
|
623
|
+
- When more `prefetch="viewport"` links come into view than the queue holds, the first to show are kept, as a page lists its links top down, instead of the last. A link stays watched: one still queued is withdrawn as it leaves the view, and asks again when it comes back.
|
|
624
|
+
- `router.prefetch(href)` returns a call that withdraws the request while it still waits.
|
|
625
|
+
|
|
257
626
|
- 5cd1fc3: Disposing a pubsub subscription or a message listener now removes that subscription's own listener. When one handler function served two subscriptions, such as two rooms or a re-subscribe before the previous cleanup ran, disposing the first one removed nothing: the first room stayed subscribed on the server and kept calling the handler after unmount. Each dispose now removes exactly one listener, and a room is unsubscribed on the socket once its last listener leaves.
|
|
258
627
|
- f47cc82: A server now answers `/_akan/app/ready`, a readiness route that returns 503 while it cannot serve and 200 once it can. A gateway is ready while at least one replica that takes traffic is ready, and a gateway that runs only batch replicas once one of them is; it turns unready again when the last one exits or stops answering. A solo server, the desktop server included, is ready once it runs and its RSC worker can render, so it answers 503 while the pages bundle loads at boot and while the worker restarts; a server with no pages waits for nothing else. The route follows the access rules of `/_akan/app/health`: a caller without `AKAN_STATUS_TOKEN` or `AKAN_LOG_STREAM_TOKEN` gets `{ "status": "ready" }` or `{ "status": "unavailable" }` alone, and the token holder also gets each replica's state. `/_akan/app/health` is unchanged and stays the liveness check, answering 200 while the process is up.
|
|
259
628
|
|
|
260
629
|
The `infra/app` chart's readiness probe calls a new `readinessPath` value, `/_akan/app/health` unless set, because an image built with an earlier akanjs answers `/_akan/app/ready` with 404 and its pod would never become Ready. Set `readinessPath: /_akan/app/ready` once every image the chart deploys carries this release. The repository's own values set it, since its pipeline builds the image from the same commit as the chart. The startup and liveness probes stay on `/_akan/app/health`.
|
|
261
630
|
|
|
631
|
+
- cf5eeff: On the Redis WebSocket adaptor:
|
|
632
|
+
|
|
633
|
+
- **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.
|
|
634
|
+
- **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.
|
|
635
|
+
|
|
636
|
+
- 228b6d7: A server shutting down no longer tells its `pubsub` rooms to resync, or resubscribes to Redis, when the Redis WebSocket adaptor's subscriber reconnects just as the shutdown begins. Its clients used to get `resync` frames, and run `onResync`, for up to a second before the server closed their sockets.
|
|
637
|
+
- 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.
|
|
638
|
+
- 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.
|
|
639
|
+
|
|
640
|
+
- **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.
|
|
641
|
+
- **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.
|
|
642
|
+
- **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.
|
|
643
|
+
- **`WebsocketAdaptor.joinRoom`** takes an optional third argument, `{ live: refName }`, for a live room.
|
|
644
|
+
- **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.
|
|
645
|
+
- **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.
|
|
646
|
+
|
|
262
647
|
- 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.
|
|
263
648
|
- 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.
|
|
264
649
|
|
|
265
650
|
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.
|
|
266
651
|
|
|
652
|
+
- 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.
|
|
653
|
+
|
|
654
|
+
- `BuilderRpc`, the dev builder channel:
|
|
655
|
+
- `buildFailed` (500): the builder answered that the build failed.
|
|
656
|
+
- `builderUnavailable` (503): no builder answered, either in time or at all. `BuilderRpc.isTimeout` and `isUnavailable` still tell the two cases apart.
|
|
657
|
+
- `rpcDisposed`: `dispose()` cut off a pending request.
|
|
658
|
+
- `artifactMissing` (500): a production page's route is missing from the artifact. The page still answers with the 500 error page.
|
|
659
|
+
- `notInitialized` (500): SSR requires a client module whose chunk has not loaded. The page still answers with the 500 error page.
|
|
660
|
+
- `listFailed` (500): `McpRouter.listFor`, and so the test server's `servedMcpCatalogue`, rejects when a page of its in-process listing answers an error.
|
|
661
|
+
- `jobStalled` (500): `SolidQueue` hands this to `onFailed` for a job whose lease ran out on its last attempt.
|
|
662
|
+
- `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`.
|
|
663
|
+
- Some failures are caught where they are thrown. They are coded too, and each still ends as before:
|
|
664
|
+
- `badGateway` (502): the image optimizer's DNS lookup timed out. The image optimizer still answers its own 502.
|
|
665
|
+
- `invalidKey`: the stored MCP Apps signing key is gone.
|
|
666
|
+
- `unencodableValue`: the protobuf compressor's schema refuses a value. It is still logged and encoded as `null`.
|
|
667
|
+
- `invalidStorageKey` (400): a `BlobStorage.deleteData` URL is outside the storage's prefix. It is still logged and answered `false`.
|
|
668
|
+
|
|
669
|
+
**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")`.
|
|
670
|
+
|
|
671
|
+
- 5757156: During a server render, a `fetch.*` query shares a request only with calls that end up with the same `timeout` and `retry`: the call's own, or else its endpoint's timeout and its client's (`clone({ retry })`, `setTimeout`). Before, the render shared one request between every call with the same endpoint, arguments and credential, from any client, so the first call's deadline and retry policy applied to all of them. A page's `fetch.isMemoOpen({ timeout: 3_000 })` after a layout's `fetch.isMemoOpen()` waited as long as the layout's call did, up to the client's 30 s default, and a page's `fetch.clone({ retry: { attempts: 4 } })` call ran without retries. Calls that pass no options still share one request per render, as before. The browser's in-flight sharing keys the same way, so a call naming `retry: false` (the default) now joins one that names none.
|
|
672
|
+
- 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.
|
|
673
|
+
|
|
674
|
+
`akanjs/common` exports `GENERATED_ROOT_LAYOUT_EXPORTS`, the set of those names.
|
|
675
|
+
|
|
267
676
|
- 9a9e1fa: A server page from `akan build` now preloads its client modules from `<head>`, so a cold load stops waiting on chains of imports.
|
|
268
677
|
|
|
269
678
|
- **What is preloaded:** the rsc client and the chunks it imports, the chunks every client reference row (`I` row) in the shell's flight names, and the importmap vendors those chunks import, each with its own chunks. A client URL that only the page's own text carries is never preloaded. Before, only the rsc client and the locale dictionary were preloaded. The browser found the rest one import level at a time, after the document finished.
|
|
270
|
-
- **Measured on `apps/minimal`:** `/en/explore` preloads
|
|
679
|
+
- **Measured on `apps/minimal`:** `/en/explore` preloads 64 modules and its flight names 37 client chunks, all of them preloaded. `/en/lab/buttons` preloads 165 for 137. Preloading every client component each route's page and layouts import would have meant 274 modules for `/en/explore`, so the preloads follow the flight instead.
|
|
271
680
|
- **A boundary that resolves after the shell** still loads its chunks when its flight rows arrive. `akan start` preloads nothing new, because a dev page loads its client code from the SSR dev registry.
|
|
272
681
|
- `routes-manifest.json` carries the preload table as `modulePreloads`: the runtime chunks, each vendor's chunks, and the vendors each browser chunk imports.
|
|
273
682
|
|
|
683
|
+
- af133d7: A route level whose server render fails after the page has started streaming now draws a notice ("This page could not be loaded.") with a "Try again" button in its own place, and the layouts above it stay. Before, the browser rethrew the error with no error boundary above it, so React unmounted the whole page (production error #441, a blank screen). That covered a page or layout below a `.loading()` that throws, and a fetch handle field that reaches no `Load.*` when the server refuses it: awaited in a component below the page, rendered as a child, or `use()`-d by a client component outside `Load.*`.
|
|
684
|
+
|
|
685
|
+
- The generated root layout exports `LevelBoundary`, and server rendering puts it around every route level below that root layout, inside the level's Suspense. The notice is the one a failed level already draws in a CSR app. "Try again" calls `router.refresh()`, and the page's next payload renders the level again.
|
|
686
|
+
- The root layout's own level and any `_overrides` level above it get no boundary: the root layout renders `System.Provider`, which starts the router, so a notice at or above it would have no router to retry with. The generated root layout bounds its own content inside `System.Provider` instead.
|
|
687
|
+
- A not-found or redirect raised below the route after the page started streaming renders nothing in that level's place, as the host answers it.
|
|
688
|
+
- An error that fails a level before the first byte has left still gets the nearest layout's `.error()` and its status, since React's server renderer runs no error boundary. The page's markup is the same as before. Its inline payload gains the boundary's client reference and one wrapper per level, and its head gains a modulepreload for the boundary.
|
|
689
|
+
- **Propagation change:** an error the server streamed now stops at the nearest route level. An error boundary an app put above a layout's `children` no longer sees it. An error thrown while the browser renders a client component carries no digest and propagates as before, so render bugs still surface.
|
|
690
|
+
- **Reporting change:** React now logs a streamed error it caught with `console.error` instead of `reportError`. Window `error` listeners, error trackers that hook them, and the dev HMR client's report no longer see it, and an app has no hook to change the notice. One case still reaches them on a first document load: if the level suspends when React retries it in the browser, for example on a client chunk still loading, React also passes its own recoverable error to `reportError` (#419 in production), not the original error. The server still logs each error, and `akan preview` still reports the page as FAIL.
|
|
691
|
+
- `akanjs/client` exports `isRouteControl(error)`, true for the not-found and redirect digests that both `Load.*` and the route level draw nothing for.
|
|
692
|
+
- What still differs from a refusal before the first byte: such a field takes the notice in place of its whole level, not the layout's `.error()`, and the page answers 200. Hand it to a `Load.*` to keep the rest of the level, or await the handle for `.error()`.
|
|
693
|
+
|
|
694
|
+
- 463fd1e: The route tree, the RSC worker and the dev builder channel now throw coded `AkanError`s. Messages are unchanged, and each stays a 500.
|
|
695
|
+
|
|
696
|
+
- `invalidRoute`: a page module breaks the route conventions (an unsupported export, no default export, both `head` and `generateHead`), or the pages have no root route.
|
|
697
|
+
- `invalidArtifact`: the pages bundle the RSC worker imports exports no `pages`.
|
|
698
|
+
- `ipcRequired`: the RSC worker or the builder channel runs without the IPC channel its parent process opens.
|
|
699
|
+
- `rpcDisposed`: a build request reaches a builder channel that was disposed.
|
|
700
|
+
- `invalidRscResponse`: a full-page fallback answers with a patch.
|
|
701
|
+
- `clientComponentOnServer`: a client-only segment outlet is called on the server.
|
|
702
|
+
- `invalidConfig`: a `transformEnv` callback returns something other than the env object.
|
|
703
|
+
- `notRegistered`: no WebSocket adaptor is registered.
|
|
704
|
+
|
|
705
|
+
- 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.
|
|
706
|
+
- 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.
|
|
707
|
+
- 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.
|
|
708
|
+
- 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.
|
|
709
|
+
- 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.
|
|
710
|
+
|
|
711
|
+
The RSC client's caches move from `rscClient.tsx` into `rscClientCache.ts`, and its patch commit into `rscClientPatch.ts`, with no change in behaviour.
|
|
712
|
+
|
|
713
|
+
- 9055634: Partial RSC commit can now patch a real page, and it patches cleanly. It is still off by default behind `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`. With the flag on:
|
|
714
|
+
|
|
715
|
+
- **Which pages render their head through `AkanRouteHead`.** Every page whose head is plain `title`, `meta` and `link` tags now renders it through a client component instead of plain head tags. That way any page can be the one a patch starts from. Patches still only land on pages that set `.config({ rscPatchHeadSafe: true })`.
|
|
716
|
+
- **A plain `.head()` is its own head snapshot.** A page no longer needs a hand-written snapshot. A head with anything else, such as a script or a component, keeps the full render.
|
|
717
|
+
- **React renders the head.** The old patch swapped `<head>` nodes behind React's back. That left a stale or broken head after the next full navigation or a back navigation.
|
|
718
|
+
- **A patch carries only the page's part of the head.** The layouts' part stays on the client, under the layouts the patch keeps. The page's part travels in the `X-Akan-Rsc-Patch-Head-Snapshot` header, which is now capped at 2 KB encoded, down from 12 KB. A larger page head renders whole, and the server logs that once per route.
|
|
719
|
+
- The cap leaves room under nginx's default 4 KB `proxy_buffer_size`, but it doesn't guarantee a fit: router state, trace headers and `Set-Cookie` share that buffer.
|
|
720
|
+
- The docs pages' part is about 1.1 KB, against about 5.7 KB for their whole head.
|
|
721
|
+
- **The layouts a patch keeps follow the new page.** `usePathCtx()` under an SSR page gives the patched page's path, pathname and query, so a menu's active item and a pager move with it.
|
|
722
|
+
- **A full commit after a patch goes straight to the new page's head, path and body.** It no longer shows the last full page for a frame first.
|
|
723
|
+
- **A patch falls back to a full render when the kept layouts would be wrong:**
|
|
724
|
+
- another route group's layout sits at the same URL prefix (`(guest)/account/login` to `(member)/account/settings`);
|
|
725
|
+
- the layouts' head would be different for the target, for example a layout `.head()` that reads a search arg. The router state carries a key of the layouts head its page rendered (`headKey`), and the server compares it with the target's. The key changes together with the rest of the router state, so a navigation started while the previous page is still committing sends that page's key;
|
|
726
|
+
- a route param differs (`/en` to `/ko`);
|
|
727
|
+
- a frame setting differs, such as `transition`;
|
|
728
|
+
- the page navigated from has no patchable head;
|
|
729
|
+
- its frame cannot be resolved.
|
|
730
|
+
- **A client built without the flag no longer asks for patches it cannot apply.** Before, a server running with the flag answered such a client with patches, and every sibling navigation made a second request. Such a client leaves the head key out of the router state it sends.
|
|
731
|
+
- **A refused head-safe patch runs each `.head()` once.** When a patch is refused after its head resolved, the full render reuses that head. Before, it ran every `.head()` a second time.
|
|
732
|
+
- **`@akanjs/devkit`: the SSR runtime manifest keeps every client export of the segment outlet module.** Before, it kept only one.
|
|
733
|
+
|
|
274
734
|
- 3537448: A navigation that a newer one overtakes before its page commits now cuts its `/__rsc` request once the response headers are in, so the server stops streaming it and the browser stops reading it. Before, it ran to the end and was only kept from committing. The cut waits for the headers because a session refresh may answer with a rotated single-use refresh token in `Set-Cookie`, and a request aborted before it lands leaves the browser holding the spent token. A refresh, a shallow push and a move back or forward overtake it the same way. A page that has already committed is never cut, so the Suspense content it still streams keeps arriving while the next navigation loads.
|
|
735
|
+
- a373d51: With partial RSC commit on (`AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`), a page reached by a patch is now replayed from the browser's cache on a revisit, even after a full navigation in between. Before, every full navigation dropped every cached patch, so a section change made every page of the section before it a network fetch again.
|
|
736
|
+
|
|
737
|
+
- **A cached patch remembers the full render it went under.** It is replayed only while that same render is on screen, which is the case when a navigation brings that page back from the full-page cache, a not-found view in between included.
|
|
738
|
+
- **It is never laid under other layouts.** A patch is refetched, never replayed, under another route group's layouts or another locale's at the same URL prefix. The same goes for a new render of the page it went under, once that page has left the full-page cache.
|
|
739
|
+
- **The cache stays bounded at 32 entries.** A patch whose full render can no longer come back is dropped. `clearRscNavigationCache()`, `refreshRsc()`, an HMR refresh and an account change still drop every cached patch.
|
|
740
|
+
- **The default is unchanged.** Partial commit is still off unless the flag is set.
|
|
741
|
+
|
|
742
|
+
- 99e3fd8: With `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`, a partial navigation whose page redirects or fails in a later chunk of its stream than the first row no longer leaves the patch on screen. Before, the patch was laid and kept: the browser stayed on the page that redirected with the patched part blank, or kept the patch with the error in it. Now a redirect, error or not-found row that arrives before the patch is laid fetches the page whole instead. One that arrives after it, while the patched page is still on screen and no other page is loading, reloads the whole page in place, which follows the redirect or shows the page's error; such a reload, like any refresh, drops the browser's navigation cache. React's dev-only error rows with an empty digest no longer count as errors for a patch. A patch whose stream carried a redirect is no longer replayed from the navigation cache, and a partial navigation waits one browser task after its first row before it is laid.
|
|
743
|
+
- c723e7a: With `AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`, a Link prefetch now carries the router state, so a prefetched sibling page comes back as a patch. A prefetched patch is used only under the full commit it was requested from, and a link the patch cache would replay is no longer prefetched.
|
|
275
744
|
- 6c3a303: A page that renders a string of 1024 characters or more, such as a post body or a long comment, now renders and hydrates whatever its lines say. React sends such a string, and every typed array or `ArrayBuffer`, as a length-prefixed Flight row whose raw bytes may hold newlines. The SSR sanitizer, the client navigation redirect guard and the partial-navigation patch check all split the stream on every newline, so they read lines inside the text as rows of their own. A line shaped like a debug row was dropped and a line shaped like a redirect row was rewritten, which broke the render. On a client navigation the guard could act on such a line as a redirect, and a partial navigation fell back to a full one.
|
|
276
745
|
|
|
277
746
|
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.
|
|
278
747
|
|
|
748
|
+
- 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.
|
|
279
749
|
- 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.
|
|
280
750
|
|
|
281
751
|
**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.
|
|
@@ -395,6 +865,67 @@
|
|
|
395
865
|
- **Links in agent markdown.** `isSafeHref` drops tabs, newlines and leading control characters and spaces before it reads the scheme, as a browser does, so a disguised `javascript:` link is refused.
|
|
396
866
|
- **CSV export keeps formulas as text.** A text cell that starts with `=`, `+`, `-`, `@`, a tab or a carriage return gets a leading `'`. Numbers are written unchanged.
|
|
397
867
|
|
|
868
|
+
- ce35811: `AkanServer`, the DI container, the RSC worker host and `AkanApp` now fail with 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.
|
|
869
|
+
|
|
870
|
+
- `AkanServer`:
|
|
871
|
+
- `alreadyInitialized` (500): a `set*` config call, or a second `init()`, once `init()` has run.
|
|
872
|
+
- `notInitialized` (500): `listen()` before `init()`, or `get`/`getService`/`getSignal`/`getAdaptor` before the server is initialized.
|
|
873
|
+
- `shutdownTimeout` (500): `stop()` when the teardown outlasts `setShutdownTimeout`.
|
|
874
|
+
- The DI container:
|
|
875
|
+
- `InjectError` `notRegistered` / `notInitialized` (500): a lookup, a plug or memory inject, or the scheduler, with nothing registered or initialized under that name.
|
|
876
|
+
- `invalidConfig` (500): `modules`, `disableModules` or `disableLibs` names an unknown module or lib, an `@<operationMode>` selector matches no module, or the build does not carry the database mode's drivers.
|
|
877
|
+
- `circularDependency` (500): services or adaptors inject each other in a cycle.
|
|
878
|
+
- `duplicateRegistration` (500): two owners claim one adaptor, use, job, fetch handler or socket key.
|
|
879
|
+
- `stageFailed` (500): tasks of a boot stage failed. Its `errors` holds each task's own error.
|
|
880
|
+
- The RSC worker host:
|
|
881
|
+
- `rscWorkerFailed` (500): the worker answered a render, a page prompt or manifest call, its boot or a reload with an error, or exited while it imported the pages bundle. A failed reload still carries `adopted` and `failed`.
|
|
882
|
+
- `rscWorkerStopped` (500): a render, a call or a reload the worker could not answer because it was stopped, exited, or could not be sent the request. A failed reload still carries `adopted` and `failed`.
|
|
883
|
+
- `renderAborted` (499): the request aborted with a reason that is not an `Error`. It is still named `AbortError`, so the page still answers 499.
|
|
884
|
+
- `rscQueueOverflow` (500): the host's chunk queue for a render passed its cap.
|
|
885
|
+
- `invalidRscResponse` (500): the worker sent a redirect or a not-found after the stream started.
|
|
886
|
+
- `AkanApp`:
|
|
887
|
+
- `invalidConfig` (500): a desktop app's server asked for a gateway and replicas.
|
|
888
|
+
- `invalidArtifact` (500): the solo server module exports neither `server` nor `app` with `start()`.
|
|
889
|
+
|
|
890
|
+
**Upgrading.** A failed DI boot stage used to throw an `AggregateError`. It is now an `AkanError` coded `stageFailed`, so `instanceof AggregateError` no longer matches it. Its `errors` still lists each task's error, and you can branch on `AkanError.is(error, "stageFailed")`.
|
|
891
|
+
|
|
892
|
+
- 463fd1e: The server's own failures now carry an `AkanError` code, and those a caller causes answer with the status that fits instead of a 500. Messages are unchanged. Outside development, the caller still sees only the status reason and the code, never the message.
|
|
893
|
+
|
|
894
|
+
- A WebSocket frame that is not a string, is not JSON, is not an object (`null` included), or names no `key` answers `400 invalidMessage`. A `key` with no route answers `404 routeNotFound` and logs a warning. Only a failure of 500 or above is logged as an error.
|
|
895
|
+
- A request body over the server's limit was already answered 413. Its failure is now `payloadTooLarge` with status 413, so it is no longer logged as a 500.
|
|
896
|
+
- Subscribing to a live room while one of its `pauseOn` arguments carries a value answers `409 livePaused`.
|
|
897
|
+
- `NativeFile.resolve`/`resolveIn` reject with these codes:
|
|
898
|
+
- `403 fileGrantRefused`: the grant is unknown or for another use, points outside the folder, follows a link to nothing, names a path that cannot be followed, carries a bad signature, or is a dev grant used off `local`. Each refusal logs a warning that names the path and the use, never the grant.
|
|
899
|
+
- `400 invalidFileGrant`: the grant is malformed.
|
|
900
|
+
- `503 fileGrantUnavailable`: the desktop app did not answer in time.
|
|
901
|
+
- `NativeSecret` rejects with these codes:
|
|
902
|
+
- `503 secretStoreUnavailable`: the desktop app did not answer in time.
|
|
903
|
+
- `secretRefused`: the app refused.
|
|
904
|
+
- `500 desktopAppRequired`: `NativeFile` or `NativeSecret` is used by a server no desktop app carries.
|
|
905
|
+
- A 401 or 403 counts as a guard's refusal unless it is known to be one the server kept: `isGuardRefusal(error)`, new in `akanjs/common`, is false only for an `AkanError` the server does not forward, or a restored copy whose JSON names a `code`, which only a generalized answer carries. Any other 401/403, a plain `Object.assign(new Error(), { statusCode: 403 })` included, still counts, so a page hides it as not-found as before. MCP, page guards and `.prompt()` pages all use it:
|
|
906
|
+
- MCP asks for a credential only on a guard refusal whose 401/403 it can read as a status, as before. A vendor SDK error that only carries `statusCode: 403` is still answered as the crash HTTP answers it. MCP answers a coded 403 it keeps as `Forbidden: <code>`, as HTTP does, names it by that code in `_meta["akanjs/failure"]`, and hands an MCP App view that failure's status and code, as a browser would receive them. A view rebuilds a guard refusal from its status alone, without copying the `forbidden` code from `_meta["akanjs/failure"]`, so it still reads as a guard refusal.
|
|
907
|
+
- A page guard reads a 403 as not-found unless the server kept it, and rethrows a kept one as it is.
|
|
908
|
+
- A `.prompt()` page whose query is refused by a guard's 401/403 still answers as the caller refused. A kept 403 now answers as the page failing, with no credential challenge.
|
|
909
|
+
- Boot and configuration failures are coded but stay 500:
|
|
910
|
+
- `invalidSignal`, `routeConflict` and `unguardedEndpoint` for signal declarations
|
|
911
|
+
- `invalidCascade` for cascade fields
|
|
912
|
+
- `invalidKey` for an Ed25519 key, or the ops key, that cannot be read. A key that fails to parse keeps the parser's error as `cause`.
|
|
913
|
+
- `invalidConfig` for `MachineToken.issue`, an ops key that is also the machine token key, and `@Transaction` with no transactional database
|
|
914
|
+
- `invalidIdentity` for `MachineToken.issue`
|
|
915
|
+
- `artifactMissing` and `invalidArtifact` for the route seed index
|
|
916
|
+
- `consoleDisabled`
|
|
917
|
+
- `notRegistered` and `notInitialized`
|
|
918
|
+
|
|
919
|
+
Branch on `AkanError.is(error, "<code>")` rather than on the message. `error.name` is still `"Error"`, and `instanceof Error` still holds.
|
|
920
|
+
|
|
921
|
+
- 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.
|
|
922
|
+
|
|
923
|
+
Two things follow from a stop waiting on the start under way. A `stop()` called from inside a service's or adaptor's init hook cannot wait for the init it is part of, so it resolves at once: the rest of the init still runs, and the start then tears down and returns with the server stopped. That includes a callback the hook registered, such as a timer or a socket's `error` handler, when it fires before the init ends, so a `process.exit()` placed right after that `stop()` runs before the teardown. 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.
|
|
924
|
+
|
|
925
|
+
- 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.
|
|
926
|
+
|
|
927
|
+
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.
|
|
928
|
+
|
|
398
929
|
- 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.
|
|
399
930
|
|
|
400
931
|
- **`option.setSessionRefresh(fn)`** runs before a page load or an RSC navigation renders.
|
|
@@ -412,12 +943,33 @@
|
|
|
412
943
|
- It first awaits `onCredentialExpired`, set through `configure`, for up to `WsClient.renewTimeoutMs` (10 s). Renew the session cookie there, or call `setJwt`.
|
|
413
944
|
- The new handshake then carries the current credential, and every room is resubscribed under it.
|
|
414
945
|
|
|
946
|
+
- db5b284: An app using the `shared` and `util` libraries no longer loads `@akanjs/native/core` on its web pages. Their stores imported `akanjs/client/native` for `isNativeShell()` and for the push installation id. That put core and every native plugin wrapper on every page. Native SSO and `usePushNotification` now load the plugin they call on first use inside a shell. The `useCamera`, `useGeoLocation` and `usePurchase` hooks in `akanjs/webkit`, which `shared`'s `Field` and `User.Template` reach, import their plugin and the few core exports they use dynamically, when first called; inside a shell `useCamera` still reads the camera permission at mount. On the minimal app with `shared` merged into its store:
|
|
947
|
+
|
|
948
|
+
- a Link route drops from 148.7 KB raw (38.5 KB brotli) to 101.5 KB raw (23.3 KB brotli);
|
|
949
|
+
- a route drawing `Field` drops from 416.6 KB (113.8 KB brotli) to 370.2 KB (99.8 KB brotli);
|
|
950
|
+
- a route drawing `User.Template` drops from 526.8 KB (140.2 KB brotli) to 481.2 KB (126.3 KB brotli).
|
|
951
|
+
|
|
952
|
+
The runtime guideline and the `no-web-only-api-outside-webkit` message now name `akanjs/client` for `isNativeApp()`, and the native subpaths for push and haptics.
|
|
953
|
+
|
|
415
954
|
- 5e08722: A coding agent now finds the imports and signatures a first app needs in its skills, instead of reading the akanjs sources.
|
|
416
955
|
|
|
417
956
|
- **The `akan-service` and `akan-page` recipes** start each file with its import lines, and the `akan-service` rules say what `serverMode: "batch"` does: the module, endpoints included, mounts only in a `batch` or `all` process, so a page-facing service leaves it off.
|
|
418
957
|
- **A new `akanApi` guideline** lists every import path and the exact signatures of the route stages, `router`, `Link`, `serve`, `adapt`, the endpoint builders, `SignalOption`, `serviceDictionary`, and the keys of `akan.config.ts` with the `web` and `i18n` shapes. It is generated from the akanjs types of the same release, and a test fails when the two drift apart. `akan agent install` ships it as a reference of both skills, and `get_guideline` / `akan guideline show akanApi` print it.
|
|
419
958
|
- **`ServiceOptions.serverMode`** carries a doc comment, so an editor shows the same explanation on hover.
|
|
420
959
|
|
|
960
|
+
- 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.
|
|
961
|
+
- 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.
|
|
962
|
+
|
|
963
|
+
An invalid or colliding route prefix and a missing WebSocket adaptor now throw an `AkanError` coded `invalidConfig`, with the same message as before.
|
|
964
|
+
|
|
965
|
+
- 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.
|
|
966
|
+
- 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.
|
|
967
|
+
- 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.
|
|
968
|
+
- 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.
|
|
969
|
+
- 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.
|
|
970
|
+
- 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.
|
|
971
|
+
- 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.
|
|
972
|
+
- 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.
|
|
421
973
|
- 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.
|
|
422
974
|
|
|
423
975
|
An in-memory database (`:memory:`, the `TestServer` default) and a journal mode other than WAL keep one connection: a second connection cannot read the same in-memory data, and outside WAL it would wait on the writer's lock and stall the event loop. There, writes from other requests still wait for the transaction and are never rolled back with it, but reads still see its uncommitted rows. Code that read another request's uncommitted write now sees the committed state instead.
|
|
@@ -429,6 +981,8 @@
|
|
|
429
981
|
- **`ssr: "block"` writes every boundary in place,** so a blocking page never shows its `.loading()` fallback.
|
|
430
982
|
- **Fragments land on their target.** A document opened at a fragment scrolls to the target when React reveals it, if the target was not on the page yet and the visitor has not scrolled; a reload or a back/forward visit keeps the offset the browser restored. A client navigation to another page's fragment lands on the target instead of the top.
|
|
431
983
|
|
|
984
|
+
- a5c476a: A gateway stopped while `AkanApp.start()` was still preparing its runtime folder, logs or ops route no longer spawns replicas or listens afterwards, and its `start()` now returns instead of waiting for a stop that has already happened. A server without a gateway stopped while `AkanServer.start({ listen: false })` was opening its log control socket no longer runs its init schedules afterwards.
|
|
985
|
+
- 76705dd: `StoreRegistry.build` now reads a root store's state, actions and slices from the merged type rather than inferring them back out of it. That inference grew quadratically with the number of stores. In an app merging about 70 stores, `build` took most of the typecheck, and adding a few more stores failed it with TS2589 ("Type instantiation is excessively deep"). With this change the typecheck cost grows linearly with the store count, and the `st` type is unchanged.
|
|
432
986
|
- 206bb69: A store write now costs about one copy of the state, whatever else the root holds. Before, every `set` copied the state twice, compared every key, re-read every `search()` value, and walked every persisted key and every model form. That came to 173 µs at 1,740 keys and 364 µs at 3,480. Now `set` works out the changed keys from the patch and copies the state once. It then recomputes only the `search()` values (when `searchParams` changed) and the `computed()` values whose dependencies changed, and syncs only the persisted keys and form drafts the write touched. That is 38 µs at 1,740 keys and 78 µs at 3,480, the cost of the copy itself.
|
|
433
987
|
|
|
434
988
|
- **One `set` per model write.** `update<Model>`, `update<Model>InForm`, `merge<Model>`, `set<Model>`, `remove<Model>`, `create<Model>` and `create<Model>InForm` now write the model, every slice list that holds the row, and the stale stamps in one `set`. Before, they called `set` once per slice, plus once more. An update at 1,640 keys went from 488 µs to 47 µs.
|
|
@@ -436,12 +990,48 @@
|
|
|
436
990
|
- **A write leaves untouched `search()` values as they were.** An array `search()` value used to be parsed again on every write, as a new array, so a component reading it rendered again on writes it did not read.
|
|
437
991
|
- **`set` with a `search()` or `computed()` key** now throws before it writes anything. Before, the state was already replaced when it threw.
|
|
438
992
|
|
|
993
|
+
- 170be15: A store's generated writes and loads that take `onError` (`create<Model>InForm`, `update<Model>InForm`, `create<Model>`, `update<Model>`, `merge<Model>`, `remove<Model>`, `submit<Model>`, `edit<Model>`, `view<Model>`) now call it with the failed request's dictionary key before they reject, as a `Button`'s `onError` takes it. Before, they handed it to the fetch call, which never called it, and `merge<Model>` took no `onError` at all. The rejection and its error toast are unchanged. An abort calls nothing, and neither does a failure in the store's own write after the server took the request, since the request did not fail.
|
|
994
|
+
|
|
995
|
+
- **A `Button` keeps the error its `onError` reported.** When the `onClick` promise then rejected, the button went back to idle and dropped the error line under it, so an edit modal's submit or a remove showed only the toast. Now the error line stays until the next click.
|
|
996
|
+
|
|
997
|
+
- cfe50cb: A `Load.Stream` whose promise rejects now renders a short notice ("This could not be loaded.") with a "Try again" button in its own place, and the rest of the page stays. Before, a rejection that reached the browser after the page had started streaming was rethrown outside any error boundary, so React unmounted the whole page (production error #441, a blank screen). `Load.Units`, `Load.View`, `Load.Edit` and `Load.Pagination` stream through it, so a list whose `init` the server refuses, such as a role-guarded slice or an expired session, keeps its page around it.
|
|
998
|
+
|
|
999
|
+
- "Try again" calls `router.refresh()`. A new promise after a failure clears the notice, so a refresh that loads renders the value.
|
|
1000
|
+
- Outside production the notice also shows the error's message.
|
|
1001
|
+
- `Load.Stream`, `Load.Units`, `Load.View`, `Load.Edit` and `Load.Pagination` take `error`: a node to render instead of the notice, or, where they render on the client, `(error, retry) => ReactNode`. `Load.Pagination` renders nothing by default, since the list sharing its `init` shows the notice.
|
|
1002
|
+
- A not-found or redirect raised below the route after the page started streaming renders nothing in its place, as the host answers it.
|
|
1003
|
+
- **Propagation change:** a rejection now stops at its `Load.*`. An error boundary an app put above one no longer sees it; pass `error` to replace the notice.
|
|
1004
|
+
- A field of a fetch handle that a page hands to a `Load.*` unawaited (`const { memoInitInPublic } = fetch.initMemoInPublic()`) no longer turns the page into the nearest layout's `.error()` or the 500 page when it is refused before the first byte has left. The page answers 200 and the browser draws the notice in that section. Such a render is never stored in the RSC or HTML result cache, so the next visitor and "Try again" render it anew.
|
|
1005
|
+
- A page or layout body that awaits the field, or a layout's `.notFound()` view that does, still gets its `.error()`. So does an awaited handle (`await fetch.initMemoInPublic()`) and any promise that is not a handle's field.
|
|
1006
|
+
- **Limit:** the server cannot see where a field ends up, so a refused field is excused wherever it goes. One that reaches no `Load.*` used to take `.error()` or the 500 page when it was refused before the first byte. Now the page answers 200 and its route level draws the notice in place of its content, as it does when the refusal comes later. That covers a server component below the page awaiting the field, the field rendered as a child, and a client component `use()`-ing it outside `Load.*`. Hand a field only to a `Load.*`, directly or through a Zone, or await the handle.
|
|
1007
|
+
|
|
1008
|
+
- 94d3673: Akan Studio lands on the Runtime view when `akan start`'s builder is stopped, not only when there is none or it never answers.
|
|
1009
|
+
|
|
1010
|
+
- **The dev host marks a reply no builder answered.** A builder request the dev host answers itself carries `kind: "unavailable"`: the builder is stopped, not started yet, failed to start, or exited or was stopped before answering. A failure the builder reports, such as a broken build, carries no kind and reads as before.
|
|
1011
|
+
- **`BuilderRpc.isUnavailable(error)`** tells such a failure apart, as `BuilderRpc.isTimeout` does for a request that times out. A bare, empty or unknown `/_akan/studio` view then lands on Runtime, and a view asked for by name still answers 503 with the reason.
|
|
1012
|
+
- **Mixed versions keep working.** A server reading a reply from an older dev host, with no kind, answers 503 as before, and an older server ignores the new field.
|
|
1013
|
+
|
|
1014
|
+
- e4c7e5c: Akan Studio lands on the Runtime view in two more cases where no dev builder can draw the others, and says the right thing when web is off.
|
|
1015
|
+
|
|
1016
|
+
- **An empty or unknown `view`** (`/_akan/studio?view=`, `?view=bogus`) lands on Runtime when the server has no dev builder, as a bare `/_akan/studio` already did. It used to answer the ERD's 503.
|
|
1017
|
+
- **A builder that never answers.** When the builder RPC times out, a bare `/_akan/studio` lands on Runtime instead of answering 503. A view asked for by name still answers 503 inside Studio's nav with the timeout, and a failed build still shows its error without landing.
|
|
1018
|
+
- **Web off.** On a server that serves the API only (`AKAN_SSR=false` or `setWeb(false)`), a builder view says the builder is reached only with the web surface on, instead of telling you to open it under `akan start`, which does not change that.
|
|
1019
|
+
|
|
439
1020
|
- 6291fec: Akan Studio opens without a dev builder, and names every job in full.
|
|
440
1021
|
|
|
441
1022
|
- **`/_akan/studio` with no dev builder** lands on the Runtime view, which reads the running server, instead of answering 503 with nothing to click. A view that needs the builder (ERD, Signals, Changes, Framework) still answers 503, now inside Studio's header and nav, saying to open it under `akan start` and that Runtime needs no builder. A failed build shows its error the same way.
|
|
442
1023
|
- **Each job row** carries its full name and schedule as a tooltip (`cron syncAccountBalances · 0 * * * *`), with the skip reason below it for a job this server does not run, so two long names clipped alike can be told apart.
|
|
443
1024
|
|
|
444
1025
|
- 0c480c6: The signal-test harness clears the env cache once it has set the test port, so a fetch client built after setup reaches the test server even when a module read `getEnv()` before the harness ran.
|
|
1026
|
+
- e4c3009: In the `util` library that `akan install-library` copies, `security` and `security.jwtSecret` are now optional in `ModulesOptions`. A fresh clone of an app on `util` typechecks and builds with the empty env files `akan sync` writes. Before, `akan typecheck`, `akan build` and `akan verify` failed with TS2322 (`Property 'security' is missing`) until someone wrote real env files. The runtime already worked without both keys: a local server derives the JWT secret, and outside `local` the server still refuses to boot with `util.error.jwtSecretRequired` unless `JWT_SECRET` or `security.jwtSecret` is set.
|
|
1027
|
+
- 0d7294c: Narrowed vendor entries hold up during a rolling deploy and on very large builds.
|
|
1028
|
+
|
|
1029
|
+
- **A route chunk that fails to load during a rolling deploy now loads its page as a document.** A document from the new build can get a page from a replica the deploy has not reached yet, and that page's chunks can import a name the document's narrowed vendor entries lack. Before, the page broke, and React's Flight client kept the failed load, so retrying in the tab failed the same way. Now, if a navigation to another page has not committed, the tab loads its target as a document, which brings a matching import map. If the page is already on screen (a refresh of it counts), the tab reloads it at its current address, fragment and any later query-only change included, and only when the error is a module link or resolve error and the browser is online. A network, ad-blocker or evaluation error leaves the page in place. Only chunks that the latest page navigation's response imports count. The document's own chunks, an overtaken navigation's and a replaced response's do not trigger it. The exception is a refresh of the same page that imports a chunk the document is still loading, which takes that chunk over. Each chunk starts at most one document load per tab, so a chunk that always fails shows its error instead of reloading in a loop. While one document load is under way, another failure does not start a second; the page's next navigation, or its return from the back-forward cache, ends that wait. This applies to `akan build` output only.
|
|
1030
|
+
- **A document fallback to the address the tab already shows now reloads it.** A failed refresh, or a back or forward move to a URL with a `#fragment`, fell back with `location.replace` to that same URL, which only scrolls to the fragment and loads nothing. It now calls `location.reload()`.
|
|
1031
|
+
- **`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.
|
|
1032
|
+
- **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`.
|
|
1033
|
+
|
|
1034
|
+
- 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.
|
|
445
1035
|
- 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.
|
|
446
1036
|
|
|
447
1037
|
## 3.1.1
|