akanjs 3.3.0-rc.4 → 3.3.0-rc.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +615 -0
- package/CONTRIBUTING.md +2 -2
- package/base/utils.ts +2 -0
- package/client/appOpenedTab.ts +12 -0
- package/client/clientRuntime.ts +3 -10
- package/client/cn.ts +4 -4
- package/client/cookie.ts +15 -6
- package/client/csrTypes.ts +15 -0
- package/client/device.ts +31 -2
- package/client/dictionaryAsset.ts +103 -25
- package/client/dictionaryGroups.ts +113 -0
- package/client/dictionaryModule.ts +23 -0
- package/client/dictionaryPart.ts +113 -0
- package/client/frameConfig.ts +27 -6
- package/client/index.ts +13 -6
- package/client/keyboardRide.ts +396 -0
- package/client/makePageProto.tsx +22 -2
- package/client/nativeBoot.ts +3 -0
- package/client/nativeErrorReport.ts +55 -0
- package/client/reportText.ts +27 -0
- package/client/router.ts +6 -3
- package/client/rscClientErrorSender.ts +85 -0
- package/client/rscNavigation.ts +0 -7
- package/client/scriptPolicy.ts +14 -0
- package/client/sharedContext.ts +3 -1
- package/client/sharedContextKey.ts +2 -0
- package/client/translator.ts +7 -1
- package/client/translatorState.ts +18 -1
- package/common/CodeTranscript.ts +4 -2
- package/common/Logger.ts +4 -1
- package/common/TraceContext.ts +97 -0
- package/common/TrustedProxy.ts +10 -0
- package/common/codeAgentProfile.ts +1 -1
- package/common/codeAgentWire.ts +7 -2
- package/common/index.ts +1 -0
- package/common/inlineToken.ts +26 -0
- package/common/logContext.ts +1 -0
- package/common/sessionTokenContract.ts +7 -0
- package/common/websocketContract.ts +2 -1
- package/constant/constantRegistry.ts +36 -33
- package/constant/index.ts +0 -1
- package/constant/inputParser.ts +7 -0
- package/constant/types.ts +0 -2
- package/document/documentSchema.ts +0 -3
- package/document/filterMeta.ts +3 -16
- package/fetch/client/fetchClient.ts +28 -57
- package/fetch/client/httpClient.ts +22 -12
- package/fetch/client/modelRuntimes.ts +89 -0
- package/fetch/client/sliceInitHandle.ts +5 -3
- package/fetch/client/wsClient.ts +10 -6
- package/fetch/fetchType/appliedReturn.type.ts +4 -2
- package/fetch/requestStorage.ts +30 -0
- package/index.ts +14 -0
- package/package.json +267 -57
- package/server/SSR_MEMORY_DIAGNOSIS.md +88 -1
- package/server/admissionQueue.ts +107 -0
- package/server/akanApp.ts +39 -14
- package/server/akanAppHeaders.ts +20 -6
- package/server/akanOption.ts +28 -0
- package/server/akanServer.ts +13 -1
- package/server/appWorker.ts +177 -0
- package/server/appWorkerError.ts +5 -0
- package/server/appWorkerPath.ts +22 -0
- package/server/artifact/builderRpc.ts +1 -0
- package/server/artifact/ipcTypes.ts +4 -0
- package/server/artifact/routeClientCache.ts +4 -0
- package/server/assetHeaders.ts +8 -3
- package/server/cachePolicy.ts +2 -1
- package/server/clientErrorReport.ts +248 -0
- package/server/clientReportId.ts +54 -0
- package/server/console.ts +5 -12
- package/server/devtools/README.md +15 -3
- package/server/devtools/devtoolsAccess.ts +119 -0
- package/server/devtools/devtoolsRouter.ts +30 -26
- package/server/devtools/devtoolsUnlockPage.ts +38 -0
- package/server/devtools/signalSerializer.ts +18 -1
- package/server/devtools/studio/studioDocument.tsx +3 -1
- package/server/devtools/studio/studioRoute.ts +4 -1
- package/server/devtools/types.ts +6 -0
- package/server/flightSanitizeRecorded.fixture.json +36 -34
- package/server/forwardedError.ts +43 -0
- package/server/gateway/gatewayChildren.ts +3 -0
- package/server/gateway/gatewayConfig.ts +5 -0
- package/server/gateway/gatewayHttpProxy.ts +10 -2
- package/server/gateway/gatewayStatus.ts +21 -1
- package/server/gateway/gatewayStatusPage.ts +18 -11
- package/server/headSplice.ts +73 -0
- package/server/hmr/clientReport.ts +9 -9
- package/server/hmr/clientScript.ts +4 -1
- package/server/hmr/csrDevShell.ts +7 -4
- package/server/hmr/devArtifactPruner.ts +7 -1
- package/server/hmr/wsHub.ts +1 -0
- package/server/htmlResultCache.ts +81 -14
- package/server/imageOptimizer.ts +44 -12
- package/server/index.ts +4 -4
- package/server/lifecycle/secretEnv.ts +98 -0
- package/server/lifecycle/shutdownManager.ts +6 -0
- package/server/logging/logForwarder.ts +2 -2
- package/server/logging/logQuery.ts +9 -1
- package/server/mcp/McpDispatcher.ts +13 -10
- package/server/mcp/McpRouter.ts +2 -0
- package/server/metrics/metricAggregate.ts +27 -0
- package/server/metrics/metricExposition.ts +92 -0
- package/server/metrics/metricMerge.ts +81 -0
- package/server/metrics/metricRegistry.ts +271 -0
- package/server/metrics/pubsubGauges.ts +27 -0
- package/server/metrics/requestMetrics.ts +110 -0
- package/server/metrics/runtimeFamilies.ts +61 -0
- package/server/metrics/slowStatementLog.ts +63 -0
- package/server/metrics/statementMetrics.ts +259 -0
- package/server/metrics/statementPlanCheck.ts +141 -0
- package/server/metrics/statementReport.ts +105 -0
- package/server/migration/migrationRunner.ts +13 -10
- package/server/oauth/OAuthErrors.ts +5 -1
- package/server/ops/statusAccess.ts +23 -3
- package/server/otlp/otlpBatcher.ts +221 -0
- package/server/otlp/otlpConfig.ts +185 -0
- package/server/otlp/otlpEncode.ts +114 -0
- package/server/otlp/otlpExporter.ts +98 -0
- package/server/otlp/otlpSampler.ts +50 -0
- package/server/pageFailure.ts +33 -0
- package/server/processMetricsCollector.ts +1 -0
- package/server/renderBusyResponse.ts +97 -0
- package/server/resolver/databaseModelInstance.ts +21 -19
- package/server/resolver/httpEndpointHandler.ts +43 -0
- package/server/resolver/jobTrace.ts +18 -0
- package/server/resolver/modelFacade.ts +24 -18
- package/server/resolver/modelLoaders.ts +10 -3
- package/server/resolver/signal.resolver.ts +28 -31
- package/server/resolver/timedQuery.ts +8 -4
- package/server/routeCacheQuery.ts +58 -0
- package/server/routeCacheTally.ts +65 -0
- package/server/routeElementComposer.tsx +16 -0
- package/server/routeTreeBuilder.ts +6 -0
- package/server/routing/apiRouter.ts +40 -12
- package/server/routing/appWsData.ts +4 -0
- package/server/routing/builtinRoutes.ts +4 -1
- package/server/routing/devRoutes.ts +50 -0
- package/server/routing/devSurfacePolicy.ts +40 -0
- package/server/routing/devSurfaces.ts +101 -0
- package/server/routing/hostAllowlist.ts +2 -0
- package/server/routing/roomReplay.ts +4 -0
- package/server/routing/serverListener.ts +17 -0
- package/server/routing/soloAppRoutes.ts +14 -1
- package/server/rscClient.tsx +20 -1
- package/server/rscClientChunks.ts +8 -1
- package/server/rscClientErrors.ts +28 -0
- package/server/rscFirstRenderMemory.ts +49 -0
- package/server/rscFlightRenderer.ts +21 -4
- package/server/rscFlightStream.ts +2 -2
- package/server/rscHostRenderStream.ts +5 -3
- package/server/rscHostRequests.ts +17 -3
- package/server/rscRenderAdmission.ts +130 -0
- package/server/rscRenderControl.ts +2 -1
- package/server/rscRenderHandler.ts +112 -31
- package/server/rscRenderLevels.ts +40 -0
- package/server/rscRenderRefusal.ts +23 -0
- package/server/rscRenderStats.ts +3 -0
- package/server/rscResultCaches.ts +20 -2
- package/server/rscWorker.tsx +25 -5
- package/server/rscWorkerCache.ts +2 -0
- package/server/rscWorkerHost.ts +35 -4
- package/server/rscWorkerProcess.ts +12 -0
- package/server/rscWorkerRecycler.ts +3 -3
- package/server/scriptPolicy.ts +128 -0
- package/server/selfExec.ts +13 -1
- package/server/serverConfig.ts +11 -0
- package/server/serverMetrics.ts +39 -1
- package/server/sitemap.ts +0 -5
- package/server/ssrFromRscRenderer.tsx +29 -201
- package/server/ssrInlineScripts.ts +196 -0
- package/server/ssrTypes.ts +15 -2
- package/server/systemPageDocument.tsx +6 -2
- package/server/systemPages.tsx +9 -4
- package/server/types.tsx +10 -0
- package/server/vendor/akanjs-client.ts +1 -0
- package/server/webArtifact.ts +16 -5
- package/server/webCsrSurface.ts +55 -21
- package/server/webDocumentRoute.ts +53 -23
- package/server/webRouteContext.ts +38 -10
- package/server/webRouter.ts +19 -12
- package/server/webRscRoute.ts +20 -16
- package/service/agent.service.ts +34 -8
- package/service/agentLoop/agentLoop.ts +35 -24
- package/service/agentLoop/agentLoopTypes.ts +16 -7
- package/service/agentLoop/loopCompaction.ts +1 -1
- package/service/agentLoop/loopContext.ts +33 -0
- package/service/agentLoop/loopToolkits.ts +17 -8
- package/service/index.ts +0 -1
- package/service/ipcTypes.ts +56 -0
- package/service/mentionToken.ts +44 -0
- package/service/predefinedAdaptor/anthropicLlm.ts +18 -17
- package/service/predefinedAdaptor/database.adaptor.ts +43 -9
- package/service/predefinedAdaptor/directoryNotWritableError.ts +30 -0
- package/service/predefinedAdaptor/index.ts +1 -0
- package/service/predefinedAdaptor/llm.adaptor.ts +9 -3
- package/service/predefinedAdaptor/llmContext.ts +26 -0
- package/service/predefinedAdaptor/llmFence.ts +55 -0
- package/service/predefinedAdaptor/openaiDialect.ts +45 -18
- package/service/predefinedAdaptor/solidSqlite.ts +2 -0
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +49 -11
- package/service/predefinedAdaptor/sql/driver/postgres.ts +47 -10
- package/service/predefinedAdaptor/sql/statementFingerprint.ts +117 -0
- package/service/predefinedAdaptor/sql/statementPlans.ts +71 -0
- package/service/predefinedAdaptor/sql/statementProbe.ts +110 -0
- package/service/predefinedAdaptor/sql/statementScrub.ts +149 -0
- package/service/predefinedAdaptor/storage.adaptor.ts +5 -0
- package/service/predefinedAdaptor/websocket.adaptor.ts +6 -0
- package/signal/CrossSiteGuard.ts +5 -0
- package/signal/SignalFailure.ts +24 -2
- package/signal/browserError.ts +28 -0
- package/signal/errorReporting.ts +168 -0
- package/signal/httpPeer.ts +9 -0
- package/signal/index.ts +2 -3
- package/signal/openapi/openapi.ts +4 -0
- package/signal/requestTrace.ts +124 -0
- package/signal/roomKey.ts +3 -6
- package/signal/signalContext.ts +15 -22
- package/signal/spanExport.ts +137 -0
- package/signal/trace.ts +168 -37
- package/store/actionErrorMessage.ts +15 -1
- package/store/agent/AgentBridge.ts +6 -2
- package/store/agent/AgentContext.ts +121 -14
- package/store/agent/AgentInline.ts +122 -0
- package/store/agent/StoreSurfaceSource.ts +27 -9
- package/store/agentic/formFields.ts +7 -2
- package/store/agentic/useFieldTool.ts +2 -1
- package/store/baseSt.ts +0 -6
- package/store/formUploadOf.ts +6 -3
- package/store/index.ts +1 -3
- package/store/sliceLiveActions.ts +4 -3
- package/store/stateBuilder.ts +1 -6
- package/store/storeFacade.ts +50 -0
- package/store/storeInstance.ts +92 -72
- package/test/signalTestRuntime.ts +5 -1
- package/types/base/utils.d.ts +1 -0
- package/types/client/appOpenedTab.d.ts +1 -0
- package/types/client/clientRuntime.d.ts +4 -2
- package/types/client/cn.d.ts +0 -4
- package/types/client/cookie.d.ts +4 -3
- package/types/client/csrTypes.d.ts +18 -0
- package/types/client/device.d.ts +5 -0
- package/types/client/dictionaryAsset.d.ts +4 -1
- package/types/client/dictionaryGroups.d.ts +7 -0
- package/types/client/dictionaryModule.d.ts +10 -0
- package/types/client/dictionaryPart.d.ts +13 -0
- package/types/client/frameConfig.d.ts +1 -3
- package/types/client/index.d.ts +7 -7
- package/types/client/keyboardRide.d.ts +20 -0
- package/types/client/makePageProto.d.ts +1 -1
- package/types/client/nativeErrorReport.d.ts +10 -0
- package/types/client/reportText.d.ts +4 -0
- package/types/client/rscClientErrorSender.d.ts +12 -0
- package/types/client/rscNavigation.d.ts +0 -10
- package/types/client/scriptPolicy.d.ts +4 -0
- package/types/client/sharedContextKey.d.ts +2 -0
- package/types/client/translator.d.ts +1 -0
- package/types/client/translatorState.d.ts +9 -1
- package/types/common/CodeTranscript.d.ts +1 -0
- package/types/common/Logger.d.ts +2 -0
- package/types/common/TraceContext.d.ts +28 -0
- package/types/common/TrustedProxy.d.ts +1 -0
- package/types/common/codeAgentWire.d.ts +10 -2
- package/types/common/index.d.ts +1 -0
- package/types/common/inlineToken.d.ts +5 -0
- package/types/common/logContext.d.ts +1 -0
- package/types/common/sessionTokenContract.d.ts +6 -0
- package/types/constant/index.d.ts +1 -1
- package/types/constant/types.d.ts +0 -2
- package/types/document/documentSchema.d.ts +0 -2
- package/types/document/filterMeta.d.ts +0 -13
- package/types/fetch/client/fetchClient.d.ts +4 -4
- package/types/fetch/client/httpClient.d.ts +2 -5
- package/types/fetch/client/modelRuntimes.d.ts +17 -0
- package/types/fetch/client/wsClient.d.ts +3 -3
- package/types/fetch/fetchType/appliedReturn.type.d.ts +4 -0
- package/types/fetch/requestStorage.d.ts +9 -0
- package/types/index.d.ts +17 -0
- package/types/server/admissionQueue.d.ts +26 -0
- package/types/server/akanAppHeaders.d.ts +3 -1
- package/types/server/akanOption.d.ts +16 -1
- package/types/server/appWorker.d.ts +40 -0
- package/types/server/appWorkerError.d.ts +4 -0
- package/types/server/appWorkerPath.d.ts +9 -0
- package/types/server/artifact/ipcTypes.d.ts +4 -0
- package/types/server/artifact/routeClientCache.d.ts +1 -0
- package/types/server/assetHeaders.d.ts +5 -3
- package/types/server/cachePolicy.d.ts +2 -0
- package/types/server/clientErrorReport.d.ts +27 -0
- package/types/server/clientReportId.d.ts +9 -0
- package/types/server/console.d.ts +0 -7
- package/types/server/devtools/devtoolsAccess.d.ts +12 -0
- package/types/server/devtools/devtoolsRouter.d.ts +0 -1
- package/types/server/devtools/devtoolsUnlockPage.d.ts +11 -0
- package/types/server/devtools/signalSerializer.d.ts +3 -1
- package/types/server/devtools/studio/studioDocument.d.ts +1 -0
- package/types/server/devtools/types.d.ts +5 -0
- package/types/server/forwardedError.d.ts +13 -0
- package/types/server/gateway/gatewayChildren.d.ts +2 -0
- package/types/server/gateway/gatewayConfig.d.ts +1 -0
- package/types/server/gateway/gatewayHttpProxy.d.ts +1 -0
- package/types/server/gateway/gatewayStatus.d.ts +2 -0
- package/types/server/headSplice.d.ts +11 -0
- package/types/server/hmr/clientReport.d.ts +2 -0
- package/types/server/hmr/csrDevShell.d.ts +3 -1
- package/types/server/hmr/wsHub.d.ts +1 -0
- package/types/server/htmlResultCache.d.ts +13 -3
- package/types/server/index.d.ts +6 -3
- package/types/server/lifecycle/secretEnv.d.ts +23 -0
- package/types/server/logging/logForwarder.d.ts +1 -0
- package/types/server/logging/logStdoutWriter.d.ts +1 -0
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/server/metrics/metricAggregate.d.ts +6 -0
- package/types/server/metrics/metricExposition.d.ts +8 -0
- package/types/server/metrics/metricMerge.d.ts +9 -0
- package/types/server/metrics/metricRegistry.d.ts +76 -0
- package/types/server/metrics/pubsubGauges.d.ts +6 -0
- package/types/server/metrics/requestMetrics.d.ts +22 -0
- package/types/server/metrics/runtimeFamilies.d.ts +9 -0
- package/types/server/metrics/slowStatementLog.d.ts +18 -0
- package/types/server/metrics/statementMetrics.d.ts +45 -0
- package/types/server/metrics/statementPlanCheck.d.ts +16 -0
- package/types/server/metrics/statementReport.d.ts +28 -0
- package/types/server/ops/statusAccess.d.ts +7 -1
- package/types/server/otlp/otlpBatcher.d.ts +18 -0
- package/types/server/otlp/otlpConfig.d.ts +25 -0
- package/types/server/otlp/otlpEncode.d.ts +13 -0
- package/types/server/otlp/otlpExporter.d.ts +18 -0
- package/types/server/otlp/otlpSampler.d.ts +10 -0
- package/types/server/pageFailure.d.ts +14 -0
- package/types/server/renderBusyResponse.d.ts +9 -0
- package/types/server/resolver/httpEndpointHandler.d.ts +14 -0
- package/types/server/resolver/jobTrace.d.ts +5 -0
- package/types/server/resolver/modelLoaders.d.ts +3 -0
- package/types/server/resolver/timedQuery.d.ts +2 -1
- package/types/server/routeCacheQuery.d.ts +11 -0
- package/types/server/routeCacheTally.d.ts +23 -0
- package/types/server/routeElementComposer.d.ts +2 -0
- package/types/server/routing/apiRouter.d.ts +1 -0
- package/types/server/routing/appWsData.d.ts +3 -0
- package/types/server/routing/devRoutes.d.ts +9 -0
- package/types/server/routing/devSurfacePolicy.d.ts +12 -0
- package/types/server/routing/devSurfaces.d.ts +18 -0
- package/types/server/routing/hostAllowlist.d.ts +1 -0
- package/types/server/routing/roomReplay.d.ts +1 -0
- package/types/server/routing/serverListener.d.ts +3 -0
- package/types/server/routing/soloAppRoutes.d.ts +3 -1
- package/types/server/rscClient.d.ts +1 -0
- package/types/server/rscClientChunks.d.ts +3 -1
- package/types/server/rscClientErrors.d.ts +3 -0
- package/types/server/rscFirstRenderMemory.d.ts +16 -0
- package/types/server/rscFlightStream.d.ts +1 -1
- package/types/server/rscHostRenderStream.d.ts +2 -1
- package/types/server/rscRenderAdmission.d.ts +14 -0
- package/types/server/rscRenderControl.d.ts +2 -1
- package/types/server/rscRenderHandler.d.ts +5 -2
- package/types/server/rscRenderLevels.d.ts +8 -0
- package/types/server/rscRenderRefusal.d.ts +9 -0
- package/types/server/rscRenderStats.d.ts +2 -0
- package/types/server/rscResultCaches.d.ts +8 -1
- package/types/server/rscWorkerCache.d.ts +2 -0
- package/types/server/rscWorkerHost.d.ts +2 -1
- package/types/server/rscWorkerProcess.d.ts +1 -0
- package/types/server/rscWorkerRecycler.d.ts +1 -1
- package/types/server/scriptPolicy.d.ts +31 -0
- package/types/server/selfExec.d.ts +1 -0
- package/types/server/serverConfig.d.ts +1 -0
- package/types/server/serverMetrics.d.ts +4 -1
- package/types/server/sitemap.d.ts +0 -2
- package/types/server/ssrFromRscRenderer.d.ts +2 -6
- package/types/server/ssrInlineScripts.d.ts +40 -0
- package/types/server/ssrTypes.d.ts +14 -2
- package/types/server/systemPageDocument.d.ts +3 -1
- package/types/server/systemPages.d.ts +2 -1
- package/types/server/types.d.ts +22 -0
- package/types/server/vendor/akanjs-client.d.ts +1 -0
- package/types/server/webRouteContext.d.ts +8 -5
- package/types/server/webRouter.d.ts +2 -1
- package/types/service/agent.service.d.ts +3 -0
- package/types/service/agentLoop/agentLoopTypes.d.ts +16 -7
- package/types/service/agentLoop/loopContext.d.ts +13 -0
- package/types/service/agentLoop/loopToolkits.d.ts +1 -0
- package/types/service/index.d.ts +0 -1
- package/types/service/ipcTypes.d.ts +60 -0
- package/types/service/mentionToken.d.ts +13 -0
- package/types/service/predefinedAdaptor/anthropicLlm.d.ts +3 -3
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/directoryNotWritableError.d.ts +6 -0
- package/types/service/predefinedAdaptor/index.d.ts +1 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +9 -3
- package/types/service/predefinedAdaptor/llmContext.d.ts +11 -0
- package/types/service/predefinedAdaptor/llmFence.d.ts +15 -0
- package/types/service/predefinedAdaptor/openaiDialect.d.ts +3 -3
- package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +3 -1
- package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +3 -1
- package/types/service/predefinedAdaptor/sql/statementFingerprint.d.ts +21 -0
- package/types/service/predefinedAdaptor/sql/statementPlans.d.ts +17 -0
- package/types/service/predefinedAdaptor/sql/statementProbe.d.ts +37 -0
- package/types/service/predefinedAdaptor/sql/statementScrub.d.ts +5 -0
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +1 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +3 -0
- package/types/signal/CrossSiteGuard.d.ts +1 -0
- package/types/signal/SignalFailure.d.ts +2 -0
- package/types/signal/browserError.d.ts +20 -0
- package/types/signal/errorReporting.d.ts +27 -0
- package/types/signal/httpPeer.d.ts +5 -0
- package/types/signal/index.d.ts +3 -1
- package/types/signal/requestTrace.d.ts +33 -0
- package/types/signal/signalContext.d.ts +2 -1
- package/types/signal/spanExport.d.ts +47 -0
- package/types/signal/trace.d.ts +33 -12
- package/types/store/actionErrorMessage.d.ts +1 -0
- package/types/store/agent/AgentBridge.d.ts +1 -0
- package/types/store/agent/AgentContext.d.ts +8 -2
- package/types/store/agent/AgentInline.d.ts +21 -0
- package/types/store/agent/StoreSurfaceSource.d.ts +1 -1
- package/types/store/baseSt.d.ts +0 -2
- package/types/store/index.d.ts +2 -2
- package/types/store/stateBuilder.d.ts +0 -4
- package/types/store/storeFacade.d.ts +9 -0
- package/types/ui/Constant/schemaDoc.d.ts +1 -0
- package/types/ui/Data/Dashboard.d.ts +1 -0
- package/types/ui/Data/ListContainer.d.ts +1 -0
- package/types/ui/Data/QueryMaker.d.ts +1 -0
- package/types/ui/Data/RefPicker.d.ts +1 -0
- package/types/ui/Dialog/LazyLegacyModal.d.ts +1 -0
- package/types/ui/DismissDragGesture.d.ts +9 -0
- package/types/ui/Field/Text.d.ts +2 -2
- package/types/ui/Field/lightRefCache.d.ts +2 -1
- package/types/ui/Field/useRelationWindow.d.ts +2 -1
- package/types/ui/Link/Action.d.ts +2 -1
- package/types/ui/Load/StreamDeferred.d.ts +11 -0
- package/types/ui/Load/sliceClaim.d.ts +4 -3
- package/types/ui/Model/resetModels.d.ts +1 -0
- package/types/ui/Reference/origin.d.ts +0 -2
- package/types/ui/Signal/Arg.d.ts +1 -0
- package/types/ui/Signal/Doc.d.ts +1 -0
- package/types/ui/Signal/Endpoint.d.ts +1 -0
- package/types/ui/Signal/RestApi.d.ts +1 -0
- package/types/ui/Signal/WebSocket.d.ts +1 -0
- package/types/ui/Signal/endpointEntries.d.ts +1 -0
- package/types/ui/Signal/makeExample.d.ts +1 -0
- package/types/ui/Signal/useApiDescriptions.d.ts +1 -0
- package/types/ui/System/Common.d.ts +1 -1
- package/types/ui/System/isSamePathValue.d.ts +2 -0
- package/types/ui/modelRuntime.d.ts +1 -0
- package/types/ui/useDismissDrag.d.ts +10 -3
- package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +5 -0
- package/types/vendor/@akanjs/native/packages/core/src/boot.d.ts +2 -2
- package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +20 -8
- package/types/vendor/@akanjs/native/plugins/keyboard/src/index.d.ts +3 -2
- package/types/vendor/use-agentic/ToolRunner.d.ts +2 -1
- package/types/vendor/use-agentic/types.d.ts +10 -0
- package/types/webkit/CsrStack.d.ts +2 -1
- package/types/webkit/csrPageReadiness.d.ts +18 -0
- package/types/webkit/csrSlide.d.ts +30 -0
- package/types/webkit/isDragLift.d.ts +5 -0
- package/types/webkit/nativeNavigation.d.ts +4 -2
- package/types/webkit/nativeSplash.d.ts +6 -0
- package/types/webkit/openSurfaces.d.ts +13 -0
- package/types/webkit/scrollerTakesDrag.d.ts +3 -0
- package/types/webkit/useCsrNavigation.d.ts +1 -1
- package/types/webkit/useEscapeKey.d.ts +7 -2
- package/types/webkit/useFrameRuntime.d.ts +3 -2
- package/types/webkit/usePageLocation.d.ts +3 -1
- package/types/webkit/useVisualViewportFrame.d.ts +2 -2
- package/ui/Agent/Chat.tsx +65 -46
- package/ui/Agent/agentSessionOf.ts +2 -1
- package/ui/Agent/fetchRunner.ts +5 -1
- package/ui/Agent/useKeyboardFrame.ts +4 -2
- package/ui/BottomSheet.tsx +3 -7
- package/ui/Constant/schemaDoc.ts +1 -0
- package/ui/Data/Dashboard.tsx +1 -0
- package/ui/Data/ListContainer.tsx +1 -0
- package/ui/Data/QueryMaker.tsx +1 -0
- package/ui/Data/RefPicker.tsx +1 -0
- package/ui/Dialog/LazyLegacyModal.tsx +5 -0
- package/ui/Dialog/LegacyModal.tsx +3 -4
- package/ui/Dialog/Modal.tsx +3 -2
- package/ui/Dialog/index.tsx +2 -2
- package/ui/DismissDragGesture.tsx +19 -0
- package/ui/Field/Text.tsx +5 -2
- package/ui/Field/index.tsx +2 -3
- package/ui/Field/lightRefCache.ts +9 -8
- package/ui/Field/useRelationOptions.ts +2 -2
- package/ui/Field/useRelationWindow.ts +9 -4
- package/ui/Input.tsx +1 -1
- package/ui/Layout/FrameSlotPortal.tsx +10 -3
- package/ui/Link/Action.tsx +2 -1
- package/ui/Load/Stream.tsx +8 -0
- package/ui/Load/StreamDeferred.tsx +27 -0
- package/ui/Load/Units.tsx +1 -1
- package/ui/Load/sliceClaim.ts +11 -5
- package/ui/Model/EditModal.tsx +3 -4
- package/ui/Model/EditWrapper.tsx +2 -3
- package/ui/Model/NewWrapper_Client.tsx +2 -3
- package/ui/Model/ViewEditModal.tsx +4 -5
- package/ui/Model/ViewModal.tsx +2 -3
- package/ui/Model/ViewWrapper.tsx +2 -3
- package/ui/Model/resetModels.ts +11 -0
- package/ui/Reference/origin.ts +0 -10
- package/ui/Signal/Arg.tsx +4 -1
- package/ui/Signal/Doc.tsx +1 -0
- package/ui/Signal/Endpoint.tsx +4 -1
- package/ui/Signal/RestApi.tsx +1 -0
- package/ui/Signal/WebSocket.tsx +1 -0
- package/ui/Signal/endpointEntries.ts +1 -0
- package/ui/Signal/makeExample.ts +1 -0
- package/ui/Signal/useApiDescriptions.ts +10 -0
- package/ui/System/CSR.tsx +37 -14
- package/ui/System/Client.tsx +47 -25
- package/ui/System/Common.tsx +8 -2
- package/ui/System/Messages.tsx +28 -43
- package/ui/System/SSR.tsx +7 -4
- package/ui/System/isSamePathValue.ts +13 -0
- package/ui/Tooltip.tsx +1 -1
- package/ui/modelRuntime.ts +2 -0
- package/ui/styles.css +14 -0
- package/ui/useDismissDrag.ts +135 -5
- package/vendor/@akanjs/native/CHANGELOG.md +25 -1
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +27 -14
- package/vendor/@akanjs/native/native/desktop/Cargo.lock +1 -0
- package/vendor/@akanjs/native/native/desktop/Cargo.toml +2 -0
- package/vendor/@akanjs/native/native/desktop/src/acl.rs +27 -7
- package/vendor/@akanjs/native/native/desktop/src/external.rs +240 -29
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +3 -3
- package/vendor/@akanjs/native/native/desktop/src/navigation.rs +4 -0
- package/vendor/@akanjs/native/packages/cli/src/lib/acl.ts +10 -2
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +11 -1
- package/vendor/@akanjs/native/packages/core/src/boot.ts +2 -2
- package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +26 -0
- package/vendor/@akanjs/native/plugins/external-view/src/desktop.ts +9 -1
- package/vendor/@akanjs/native/plugins/external-view/src/index.ts +20 -8
- package/vendor/@akanjs/native/plugins/keyboard/src/index.ts +3 -2
- package/vendor/use-agentic/AgentSession.ts +1 -1
- package/vendor/use-agentic/CHANGELOG.md +34 -0
- package/vendor/use-agentic/Compaction.ts +1 -1
- package/vendor/use-agentic/ToolRunner.ts +12 -0
- package/vendor/use-agentic/WIRE.md +8 -2
- package/vendor/use-agentic/types.ts +10 -0
- package/webkit/CsrStack.ts +17 -9
- package/webkit/McpAppAgent.ts +4 -2
- package/webkit/RenderLayer.tsx +22 -13
- package/webkit/bootCsr.tsx +19 -1
- package/webkit/csrPageReadiness.ts +43 -0
- package/webkit/csrSlide.ts +130 -0
- package/webkit/isDragLift.ts +7 -0
- package/webkit/nativeNavigation.ts +41 -3
- package/webkit/nativeSplash.ts +30 -0
- package/webkit/openSurfaces.ts +54 -0
- package/webkit/scrollerTakesDrag.ts +31 -0
- package/webkit/useCsrKeyboard.ts +7 -1
- package/webkit/useCsrNavigation.ts +79 -23
- package/webkit/useCsrTransitions.ts +159 -44
- package/webkit/useCsrValues.ts +11 -3
- package/webkit/useEscapeKey.tsx +10 -23
- package/webkit/useFrameRuntime.ts +13 -8
- package/webkit/usePageLocation.ts +8 -2
- package/webkit/useVisualViewportFrame.tsx +2 -4
- package/ARCHITECTURE.md +0 -199
- package/client/locale.ts +0 -5
- package/service/serviceRegistry.ts +0 -27
- package/types/client/locale.d.ts +0 -6
- package/types/service/serviceRegistry.d.ts +0 -10
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,323 @@
|
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
+
- 800f3ef: fix(agent): a write's change report carries a changed value the way the screen block does
|
|
8
|
+
|
|
9
|
+
After a tool call that changed something, its result lists the resources that changed. Each entry held the whole
|
|
10
|
+
new value, so free text published with `st.expose`, `st.useState` or `useAgentResource`, which the screen block
|
|
11
|
+
leaves out and `readState` answers as page content, reached the model as the app's own data on the first write. An
|
|
12
|
+
entry now keeps what the screen block keeps (a token, a number, a boolean, an ISO timestamp, a short list or object
|
|
13
|
+
of those, and a list scope's ids and token labels) and is marked `withheld: true` when anything was left out;
|
|
14
|
+
`readState(name)` answers the rest. The in-page agent and an MCP App view both report this way.
|
|
15
|
+
|
|
16
|
+
- `AgentContext.reported(view)` returns a surface view whose change report follows the rule.
|
|
17
|
+
- `ResourceDiff` gains the optional `withheld` field.
|
|
18
|
+
|
|
19
|
+
**Upgrading.** No code change is needed: both additions are optional. A model that read a sentence from a tool
|
|
20
|
+
result's `changes` now finds the entry marked `withheld` and reads it with `readState`, which makes the next change
|
|
21
|
+
ask for approval. Where an agent should act on a changed value without that ask, publish an id, a count or an enum
|
|
22
|
+
member, or return the value from the tool itself. A host that builds its own `ToolRunner` over the store surface
|
|
23
|
+
wraps the surface with `AgentContext.reported` to report the same way.
|
|
24
|
+
|
|
25
|
+
- 4a568b2: What an agent turn carries beside the conversation reaches the model as marked data in a user turn, outside the system prompt.
|
|
26
|
+
|
|
27
|
+
- **A turn's `context` is no longer written into the system prompt.** `OpenaiDialect` and `AnthropicLlm` send it as a `<turn-context …>` block that ends the turn's last user-role content, after that turn's tool results: a text block on the Messages API, and on the chat-completions wire the end of the user message the turn closes on, or a user message of its own after tool messages. The block closes on a delimiter chosen so that its content cannot contain it, in any case or width or with characters that do not show between its letters. The delimiter is keyed with a secret of the process: the same text gets the same one in every request a process sends, and another process gives it another. The system prompt is the instructions alone, so it is the same text on every turn of a conversation and a provider's prefix cache keeps it.
|
|
28
|
+
- **A compaction summary is history in a user turn on both dialects.** It is sent as a `<conversation-summary …>` block. The chat-completions dialect used to send it with the system role, and the Messages API mapping with no fence. When the user's message follows the summary, the block opens that message, so neither dialect sends two user turns in a row.
|
|
29
|
+
- **`LlmContext`** (`akanjs/service`) is what an adaptor of the app's own calls: `LlmContext.of(request.context)` is the context text, empty when there is none, and `LlmContext.summary(text)` the summary block.
|
|
30
|
+
- **A context block can be marked `untrusted: true`** (`AgentWireContext`, and `ContextBlock` in the page) when it holds text someone other than the developer or the user may have written. Both dialects fence marked blocks apart from the app's own, in a `<page-content …>` block, the one a `readScreen` result arrives in. A turn that carries one counts as an untrusted read. In the page the first change after it asks the user first, as after `readScreen`. In `agentService.loop` the run is tainted from its first round: `approve` hears `tainted: true`, and with no `approve` a write is answered with the code `writeAfterPageText` and a sentence for the model, and the loop logs once per run that `approve` is what decides such a call. The run stores `tainted: true` on each assistant message it writes while tainted, so a resume and the next ask in that conversation keep the taint when the block is not passed again.
|
|
31
|
+
- **Text from a mentioned record is treated like text a tool read.** An `@` mention's reference reaches the model with its pointer, label, value and note together in one `<page-content …>` block under the "Referenced data" heading; before, only the value was fenced. The token in the user's message is sent as `@[pointer](mention:pointer)`, so the record's title is in that block only; the chat still draws the title. When the id or the path is not a token, as a slug is not, the token is sent as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` and the block spells the pointer under that name. A message that carries a reference counts as an untrusted read: in `Agent.Chat` the first change after it shows the approval card a change after `readScreen` shows, and an `agentService.loop` run whose messages carry `references` is tainted from its first round. A loop's compaction digest names a pointed-at record by its pointer.
|
|
32
|
+
- **The page's default context keeps ids, enum members, numbers and booleans inline, and leaves free text to a read tool.**
|
|
33
|
+
- A string rides inline only when it is one token: up to 40 letters, digits, `.`, `_` or `-`, of at most three words. A word ends at a separator or at a lower-to-upper case change, so `created-at-desc` and `createdAtDesc` pass and `archive-every-note-now` does not. More parts pass only as an id's: each hex, with a digit or eight characters long, as in a UUID. A run of over sixteen letters with no digit never passes. It used to ride inline up to 200 characters.
|
|
34
|
+
- In the `state` block any other string is listed by key and type with no value.
|
|
35
|
+
- The `route` block applies the rule to each path segment and path param, and keeps at most twelve words of each. A search param rides inline when a store declares its key with `search("key", …)` and its value is a token. Of the others at most four ride, key and value both tokens, so `?tab=settings&page=2&sort=created-at-desc` reads the same on a page whose stores declare none; the rest are left out, key and value. A page's typed `search` is read on the server and does not count as a declaration. What is left out reads `…` in the path, the block names the keys to read in `withheld` and the number of search params left out in `searchParamsWithheld`. `readState` answers `pathname`, `params` and `searchParams` whether or not a component subscribes them, as page content.
|
|
36
|
+
- In the `screen` block a `Load` scope's label, which is its record's title, and the ids and labels of a list scope's `items` follow the rule; the block then says to read the scope with `readScreen`.
|
|
37
|
+
- Not covered: an `Agent.Zone`'s `label` and a value published with `st.expose`, `st.useState` or `useAgentResource` still ride whole, as no read tool returns them. Publish an id or an enum member there, not text a user wrote.
|
|
38
|
+
- The MCP App view names its screen to the host by origin and path under the same rule, without the query string or the hash.
|
|
39
|
+
- `AgentService.preamble` and each adaptor's fallback prompt say what a `<turn-context …>` block is, and that a `<page-content …>` block may also end a user turn.
|
|
40
|
+
- The agent and MCP guidelines and the `akan-agent` skill describe all of the above.
|
|
41
|
+
|
|
42
|
+
**Upgrading.**
|
|
43
|
+
|
|
44
|
+
An `LlmAdaptor` of your own that builds its whole request with `OpenaiDialect.requestBody` or `AnthropicLlm.requestBody` needs no change. One that builds its own messages must change, also when it takes its system prompt from `OpenaiDialect.systemPrompt(request)` or `AnthropicLlm.systemPrompt(request)`: those now return the instructions without the context, so such an adaptor would send no context at all. Append the context to the last user-role content, and map a `summary` message to a user turn:
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// before
|
|
48
|
+
const system = OpenaiDialect.systemPrompt(request); // held the context
|
|
49
|
+
const turns = request.messages.map((message) =>
|
|
50
|
+
message.summary
|
|
51
|
+
? { role: "system", content: message.text }
|
|
52
|
+
: toTurn(message)
|
|
53
|
+
);
|
|
54
|
+
// after
|
|
55
|
+
const system = OpenaiDialect.systemPrompt(request); // the instructions alone
|
|
56
|
+
const turns = request.messages.map((message) =>
|
|
57
|
+
message.summary
|
|
58
|
+
? { role: "user", content: LlmContext.summary(message.text ?? "") }
|
|
59
|
+
: toTurn(message)
|
|
60
|
+
);
|
|
61
|
+
const context = LlmContext.of(request.context); // "" when the turn carries none
|
|
62
|
+
if (context) turns.push({ role: "user", content: context }); // or append it to the last user turn
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Marked blocks come fenced by the same call. A test that looked for a context value in `body.system`, or in the first chat-completions message, finds it in the last user-role content, and one that looked for a summary in a system message finds it in a user message.
|
|
66
|
+
|
|
67
|
+
A loop request or a page context that already used a field named `untrusted` on a block for something else must rename it: any value but `false` or `undefined` now marks the block.
|
|
68
|
+
|
|
69
|
+
A store for `agentService.loop` messages must keep `tainted` on assistant messages too. Store each message `onMessage` hands over whole, as before; a store that picks fields adds this one. A loop that passes user messages with `references` and has no `approve` no longer writes: each write is answered with the code `writeAfterPageText`. Pass `approve`, or send the message without `references`. This lasts for the rest of the conversation, not for one run, because the stored messages keep the reference; a marked context block lasts as long through the mark on what the model said. Passing `untrusted` does not lift it.
|
|
70
|
+
|
|
71
|
+
A loop that passes messages with `references` and has an `approve` hears `tainted: true` on every call from that message on, in that run and in every later ask of the conversation. An approver that allows untainted calls by itself and holds tainted ones for a person will hold them all.
|
|
72
|
+
|
|
73
|
+
In a loop the model reads a mention in the user's words as `@[ticket/t1](mention:ticket/t1)`, or as `@[ref-1a2b3c4d](mention:ref-1a2b3c4d)` when the id or path is not a token, and finds the title only in that message's "Referenced data" block. A compaction summary names a mentioned record by its pointer and no longer by its title, so after a compaction the model reads the record again to name it. A prompt or a test that expected the title in the user's text looks in the block.
|
|
74
|
+
|
|
75
|
+
An app that relied on the model seeing a search param, a path param, a short store string or a list row's title in its context now has the model read it with `readState` or `readScreen`. The model is told which to call, so most apps change nothing. To keep a search param in the context whatever else the link carries, declare it in a store (`search("status", String, { default: "" })`); an undeclared one rides only as one of the first four whose key and value are tokens.
|
|
76
|
+
|
|
77
|
+
An id that is not a token is left out like other free text: a slug of more than three words (`my-first-blog-post`) or a mixed-case random id such as a nanoid (`V1StGXR8_Z5jdHi6B-myT`). A list scope's `items` then lists the other rows only, a list whose ids are all such lists none, and the block's `note` says to call `readScreen` with the scope's path, where every row is. A live store key holding such an id is listed with no value. A 24-character hex id, a UUID, a ULID and a number ride as before.
|
|
78
|
+
|
|
79
|
+
The URL an MCP App view reports to its host as model context no longer has the query string or the hash, and a path segment of free text reads `…`. A host prompt or a test that read a search param from that URL gets it from a tool the view publishes.
|
|
80
|
+
|
|
81
|
+
Two cases need an edit. Instructions that point at the context point at the tool instead:
|
|
82
|
+
|
|
83
|
+
```tsx
|
|
84
|
+
// before
|
|
85
|
+
<Agent.Chat instructions="The search box's text is searchParams.q in the route context." />
|
|
86
|
+
// after
|
|
87
|
+
<Agent.Chat instructions="The search box's text is the q search param: call readState with key searchParams." />
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
And a chat or zone that withholds a read tool gives it back when its agent needs such a value:
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
// before
|
|
94
|
+
<Agent.Zone builtins={["highlight"]}>
|
|
95
|
+
// after
|
|
96
|
+
<Agent.Zone builtins={["highlight", "readState", "readScreen"]}>
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
What `readState` and `readScreen` return is page content, so the first change after one asks the user first.
|
|
100
|
+
|
|
101
|
+
A chat where the user mentions a record now asks before the first change that follows. `AgentConfirm.set({ afterScreenRead: false })` turns that off together with the ask after `readScreen`.
|
|
102
|
+
|
|
103
|
+
- e5d3cac: An `Agent.Zone`'s label and a value published with `st.expose`, `st.useState` or `useAgentResource` reach the model the way route params and store keys do: ids, enum members, numbers and booleans in the turn's context, free text through a read tool.
|
|
104
|
+
|
|
105
|
+
- **A published value rides in the `screen` block only when it is the app's own kind of data.** A string rides when it is one token (the rule route params follow) or an ISO timestamp, beside numbers, booleans and `null`. A list rides when every item does and it spells at most twelve words; a list with free text in it is left out whole. An object keeps its fields of that kind, at most twelve of them and twelve words of values, under names that are tokens. A resource with anything left out is marked `withheld: true`, and one whose read threw is listed with no error text.
|
|
106
|
+
- **`readState(name)` answers a published value.** The name is the one the `screen` block lists, a zone's prefix included. The answer is the whole value, as page content, so the first change after it asks the user first. A store key the screen reads is answered before a published value of the same name.
|
|
107
|
+
- **A zone's `label` rides only when it is one token.** `readScreen` with `section` set to the zone's path, or with no `section` inside the zone's own chat, starts with a `Zone label:` line when the label was left out.
|
|
108
|
+
- `StoreSurfaceSource` takes the surface it is attached to as its second argument, `AgenticSurface.shared` by default.
|
|
109
|
+
- The agent guideline and the `akan-agent` skill describe the rule.
|
|
110
|
+
|
|
111
|
+
**Upgrading.** A model that read a sentence from `st.expose`, `st.useState`, `useAgentResource` or a zone's `label` in the turn's context now finds the resource marked `withheld` and reads it with `readState`, which makes the next change ask for approval. Where an agent should act on a value without that ask, publish an id, a count or an enum member. A host that builds its own `StoreSurfaceSource` on a surface other than `AgenticSurface.shared` passes that surface to it.
|
|
112
|
+
|
|
113
|
+
- af57986: An app declares code that runs in a process of its own, and the framework builds, finds and supervises it.
|
|
114
|
+
|
|
115
|
+
`workers` in an app's `akan.config.ts` maps a name to an entry file (`workers: { vision: "srvkit/vision.worker.ts" }`). `akan build` bundles each as its own entry to `workers/<name>.js`, with the server's externals and env handling and never as a chunk of `server.js`, so a native addon the worker imports is not loaded by the server. The image and a desktop app's server carry the folder; `akan start` and `akan test` run the worker from its declared source.
|
|
116
|
+
|
|
117
|
+
`AppWorker.spawn(name, options)` from `akanjs/server` starts it with the Bun that runs the server: stdout and stderr are relayed line by line to the server's logger, a worker that exits with an error or on a signal is started again with a doubling delay (1s to 30s; `restart: false` leaves it down, an exit with code 0 stays down), `onMessage` opens an IPC channel that `worker.send` writes to, `stop()` sends SIGTERM and then SIGKILL, and every running worker gets SIGTERM when the server process exits. The worker gets the variables a process needs to start plus `options.env`, not the server's env, unless `inheritEnv` is set. `AppWorker.pathOf(name)` returns the file for code that spawns by hand. An undeclared name throws `AppWorkerError` with the code `workerNotDeclared`, and `send` without a channel `workerNotConnected`.
|
|
118
|
+
|
|
119
|
+
The runtime guideline documents the section, and its reference files are larger: `runtimeRule-2.md` by 3430 bytes and `akanApi-app-config.md` by 138.
|
|
120
|
+
|
|
121
|
+
No upgrade step for an app. `AppConfigResult` gains a required `workers`, so code that builds one by hand adds `workers: {}`; `akanjs/server/appWorkerPath` is a new entry point the build tooling reads.
|
|
122
|
+
|
|
123
|
+
- e3f405f: A page whose server component hands a model to a framework component (`Load.Units`, `Load.View`, `Model.New`, `Model.Edit`, `Data.CardList` and the others) now loads that model's store and descriptors, not every module of the app. Before, those components loaded the whole client runtime wherever they rendered.
|
|
124
|
+
|
|
125
|
+
- `akan sync` writes `lib/__client/<model>.ref.ts` for each model with a signal and `lib/__client/refs.ts` for the app. The generated root layout imports `refs.ts`, and the server then adds the model's client reference to every slice, init, view and edit it hands to a client component, as the optional `_runtime` field of `SliceMeta`, `ServerInit`, `ServerView` and `ServerEdit`. The browser loads the reference, and with it the model's store and descriptors, before the component receiving the object renders: on the first page, inside a streamed part of it, and after a client navigation. A model the app extends loads through the app's store, which loads the lib's first. A reference loads what a client file reading `st.use.<model>` loads: the stores the model's store names come with it, and where that store picks a name at run time, the whole client runtime. On a page that already holds the whole runtime the model's store stays the one store, with its state and subscribers.
|
|
126
|
+
- `FetchClient.setModelRuntimes(references)` is the one new static. Only the generated `refs.ts` needs it.
|
|
127
|
+
- The framework components that reach a model only through such an object no longer load the whole runtime. `Data.ListContainer`, `Data.QueryMaker`, `Data.RefPicker`, the `Signal` API explorer and `Constant.Doc` still do: they follow a model named by a field or a filter argument, which no object brought. They are loaded on demand, so a page pays for them only where one renders.
|
|
128
|
+
- A relation field (`Field.Relation` and the others taking a `slice`) loads the related model through the slice it is given, not the whole runtime.
|
|
129
|
+
- A `resets` name on `Model.New`, `Model.Edit` or `Model.View` whose store the page has not loaded is passed over, since there is no state to reset.
|
|
130
|
+
- The route table of `akan build` counts, for each route, the reference files of the models its server modules hand over. Where a server module picks a `fetch` name at run time, or takes `fetch` from the `server` barrel, the route counts every model's runtime and the build names the file and the line once.
|
|
131
|
+
- A handoff object that carries no reference works as before, wherever the page already holds the model's runtime.
|
|
132
|
+
|
|
133
|
+
**Upgrading.**
|
|
134
|
+
|
|
135
|
+
Until `lib/__client/refs.ts` exists (an `akan build` or `akan sync <app>` writes it) the app builds and serves with the whole client runtime and says so once, naming the sync. A spread (`{ ...init }`) or an `Object.assign` of what `fetch` returned keeps the reference; a deep copy (`JSON.parse(JSON.stringify(init))`, `structuredClone(init)`, a cache that stores the object as JSON) leaves `_runtime` an empty object. What that means for a page that builds or copies such an object by hand is in the upgrade note of the entry that makes every app load per route.
|
|
136
|
+
|
|
137
|
+
- edf14fd: A page registers the constants of the models its client code names, not every model's. A page that keeps the whole runtime still loads `lib/cnst.ts`; the one change there is that a registered model no longer carries its type-only `_`-prefixed members as `null` values.
|
|
138
|
+
|
|
139
|
+
- `akan sync` writes one registration piece per model and scalar, `lib/__client/<model>.cnst.ts`, which imports that module's constant file and the pieces of the models the file names, then registers the model. `lib/cnst.ts` keeps its shape and exports. A model's `.fetch` and `.st` pieces load its registration piece first, and so does a handoff reference (`<model>.ref.ts`), which loads one of them. A `.fetch` piece names the pieces it needs first in its own `FetchClient.build` call, so loading them first adds no statement to a page. A registration piece that no page loading only pieces reaches (only pages that also load the whole runtime, or only a handoff) takes its model from `lib/cnst.ts` instead, so those pages keep every constant in the one chunk they already share.
|
|
140
|
+
- The build rewrites `cnst.Memo`, `cnst.memo`, `cnst.MemoStatus`, a lib's `cnst.util.File` and `const { MemoStatus } = cnst` to imports of those names from the file declaring each; a type-only use loads nothing. A file keeps the whole `lib/cnst.ts` when it passes `cnst` on (as an argument, a spread, `Object.keys(cnst)` or another variable), picks a member with a computed key, names something `cnst` does not hand out, or hides names behind a rest or nested destructuring, and so does a constant file that reads its own app's or lib's `cnst`.
|
|
141
|
+
- A framework component that walks every registered model (the API explorer, the schema page, relation pickers, query makers) loads the whole runtime, `lib/cnst.ts` included, so it sees every model on any page. So does `Data.Dashboard`, whose tiles read their filters from a model a prop names: the server registers every model, so with fewer in the browser the tiles would render differently after hydration.
|
|
142
|
+
- Registering the same model or scalar again, from its piece and from `lib/cnst.ts` in one tab, returns the first registration; another class claiming a taken name still fails. A repeat is the same name with the same classes from the same constant file: a file that registers several names registers each, and a name that comes again with other classes registers those.
|
|
143
|
+
- In development, saving a `*.constant.ts` file reloads the tab, which registers the model before its fetch and store pieces run, as a built page does. The names a saved scalar file (`lib/__scalar/<name>/<name>.constant.ts`) declares are read again, as a model's are.
|
|
144
|
+
- The agent's form tools find the setters of a model a page registers after their first lookup.
|
|
145
|
+
- `akan quality runtime` notes each client or constant file that keeps every constant (`akan.runtime.whole-constants`), with its reason, and counts them per app and lib.
|
|
146
|
+
- The build's own check also fails when a registration piece is imported back by a file it loads, or when a page built to load pieces reaches `lib/cnst.ts` other than through a file `akan quality runtime` names or a registration piece answering from it. A page that such a file or piece already makes load every constant may reach them by another path too: a handoff reference no route hands over takes its models from `lib/cnst.ts`, and their constant files stay as written.
|
|
147
|
+
|
|
148
|
+
In the sample apps the memo pages of `apps/minimal` went from 263.5 KB to 262.3 KB and from 236.1 KB to 234.8 KB (brotli); every other route stays within 0.2 KB of before.
|
|
149
|
+
|
|
150
|
+
**Upgrading.**
|
|
151
|
+
|
|
152
|
+
Until the pieces exist (an `akan build` or `akan sync <app>` writes them) the build keeps the whole `lib/cnst.ts`. `akan quality runtime` lists the files that keep every constant and why; rewriting one to `cnst.<Name>` or `const { … } = cnst` lets its pages load fewer constants. What changes for code that looks a model up by name is in the upgrade note of the entry that makes every app load per route.
|
|
153
|
+
|
|
154
|
+
- b5b4834: A production page now loads the endpoint descriptors and stores of only the modules its client code names. Before, a client module importing `fetch` or `st` from a `client` barrel brought every module of that app or lib.
|
|
155
|
+
|
|
156
|
+
- `akan build` reads each client file of the app and its libs. Where every `st.use.<key>()`, `st.do.<action>()`, `st.slice.<name>`, `fetch.<endpoint>()` and `sig.<module>` names something it can tell at build time, the file takes `fetch` and `sig` from `lib/usePage.ts`, `st` from `akanjs/store` (the tab's one store, the object a scope's `lib/st.ts` exports), and imports the `lib/__client/` pieces of the modules those names belong to, each by a name it hands to `loadedAfter` from `akanjs/base`, so the piece's chunk loads first however the build splits the code. A `*.store.ts` file gets its own module's descriptors and those of the modules its model depends on, and no store piece: a file naming a store loads the stores that store's file names.
|
|
157
|
+
- A file that picks a name at run time (`st.do[name]()`), or names something no generated piece answers, imports the app's whole runtime instead, as do the framework components that reach a model by a computed name (`Load`, `Model`, `Data` and the others importing `akanjs/ui/modelRuntime`). In development the whole runtime is assembled from the same pieces (`lib/__client/_useClient.ts`, `lib/__client/_st.ts`); in a build a client entry that needs every module keeps `lib/useClient.ts` and `lib/st.ts` as before, and the files only such entries reach are left as written. A `*.store.ts` file that picks a name at run time (spreading into the object given to its own `this.set` is not one) makes every file naming its store load the whole runtime.
|
|
158
|
+
- A lib file naming a lib module loads the app's piece of it, so a store the app extends arrives with the app's additions. The lib's own store file of that model is the exception: the app's piece is what loads it.
|
|
159
|
+
- A store piece whose model holds a file loads the upload module's descriptors first, so the piece alone has its upload action (`st.do.upload<Field>On<Model>`).
|
|
160
|
+
- An app store that extends a lib store and has no signal of its own loads the upload module's descriptors first too.
|
|
161
|
+
- An import that also takes a `client` barrel's default export (`import Kit, { st } from "@apps/<app>/client"`) is left as written and loads the whole runtime.
|
|
162
|
+
- An app store that extends a lib store answers what it answered before, whichever pieces a page loads and in whatever order: a default both declare is the lib's, an action or a `set<Key>` both declare is the app's. The store runtime itself is unchanged.
|
|
163
|
+
- The development server loads what a production page loads: a client module takes the pieces of the modules it names there too, so a name a route misses shows while you work, and the error for a store key the page has not loaded names the module whose store declares it.
|
|
164
|
+
- An app not yet synced to `lib/__client/_useClient.ts` and `_st.ts`, or whose module names cannot be read from source, builds with the whole runtime on every page, and the build says which of the two happened and names the sync to run. `akan sync` warns when it cannot read a scope's modules, and `akan build --write false` warns that it uses the `lib/__client/` files as they were last written.
|
|
165
|
+
|
|
166
|
+
**Upgrading.**
|
|
167
|
+
|
|
168
|
+
The `lib/__client/` files an earlier release wrote are written again by the sync `akan build` runs. A client module importing `fetch` or `st` no longer brings its whole app or lib; what to check for is in the upgrade note of the entry that makes every app load per route.
|
|
169
|
+
|
|
170
|
+
- 4ff5d5e: Every app loads its client runtime per route: a server-rendered page loads the stores, endpoint descriptors, constants and dictionary texts of the modules that page uses, not every module's. There is no setting for it, in `akan.config.ts` or anywhere else.
|
|
171
|
+
|
|
172
|
+
- A build or development server that cannot use the per-module files (never synced, written by an earlier release, a mounted lib not synced, a module that cannot be read) loads the whole runtime on every page, as before, and says so with the `akan sync` to run. `akan build --write false`, which skips the sync, says its files may be stale.
|
|
173
|
+
- A build that finds its own output would load a module before the piece it needs warns once, naming the files, builds every page on the whole runtime instead and succeeds. That warning is a bug in akan: report it with its text.
|
|
174
|
+
- `akan quality runtime` lists, after an `akan build`, the routes that load every text of the page dictionary under the file and line that cost it (`[dictionary] <file>:<line> <why>`); `--format json` carries every route. For an app with a build report it no longer prints the `akan.runtime.framework-marker` note, which counted every page importing a framework component that reads models by name; the build's `[reader]` line names the routes that component really holds. The `akan quality` reference page lists every rule the report prints and what to change in app code for each.
|
|
175
|
+
- A model's reference, which `fetch.slice`, `fetch.init<Model>`, `fetch.view<Model>` and `fetch.edit<Model>` hand to client components, loads that model's own store. Before, another module's store with a state field named like the model loaded with it.
|
|
176
|
+
|
|
177
|
+
**Upgrading.**
|
|
178
|
+
|
|
179
|
+
This is the one upgrade note for the per-route client runtime; the other entries of this release say what was built.
|
|
180
|
+
|
|
181
|
+
_With no action._ The first `akan build` or `akan start` after upgrading syncs the app and the libs it mounts, writing `lib/usePage.ts` and `lib/__client/` beside the other generated files, and its pages load per module. Add `apps/*/lib/usePage.ts`, `libs/*/lib/usePage.ts`, `apps/**/lib/__client` and `libs/**/lib/__client` to `.gitignore` beside `lib/useClient.ts` and `lib/__lib`. A build run with `--write false` and a lib no built app mounts need `akan sync <app-or-lib>` once; until then the pages load the whole runtime and the build says so. Server rendering, CSR bundles and native apps load everything, as before, and the development server loads what a production page loads. An app with routes to measure bundles its browser code at least twice, where it bundled once; `akan build --verbose` shows each bundle and its time.
|
|
182
|
+
|
|
183
|
+
_What can break, and how it shows._ A page no longer loads a module that no client file of its route names.
|
|
184
|
+
|
|
185
|
+
- A store or endpoint reached by a computed name without the app's or a lib's `client` barrel (the framework's base `st` or `fetch` with a string, a component library built on `akanjs/store`'s `st`, a file outside `apps/` and `libs/`) is found only on a route where a client file names that module. Outside React, `st.get().<key>` of such a store is `undefined`: a store's initial state and persisted keys appear when its code loads.
|
|
186
|
+
- An app store that extends a lib's store adds its actions, state and slices only on a route that loads the app's runtime, so code using them imports `st` from the app's `client` barrel, not the lib's.
|
|
187
|
+
- Top-level code runs only on the pages that name its file. A side effect other pages relied on because a store or a part file (`Memo.Zone.tsx`) imported it must be named by the pages that need it, or moved to where it is used. A member replaced at run time (`Obj.part = other`) is not seen by files that named the original member; read the object whole (pass it on) in the file that depends on the replacement.
|
|
188
|
+
- A slice, init, view or edit object written by hand (`{ refName, sliceName, … }`) or deep-copied (`JSON.parse(JSON.stringify(init))`, `structuredClone(init)`, a cache that stores it as JSON) carries no reference to its model, and neither does a slice parameter that is reassigned or has a default value. On a route where no client file names the model, the framework list, view or form finds no store: in development the error names the store's module and this cause, and in production the page shows nothing where the slice is read. `akan quality runtime` does not report this. Take the object from `fetch`, hand it over uncopied or spread (`{ ...init }`), or name the model in a client file of the route (`st.use.<key>()`).
|
|
189
|
+
- A model looked up by name (`ConstantRegistry.getDatabase("memo")`) is found only on a page that names it: name it in that file (`cnst.Memo`) or read `cnst` whole there. On every page, a registered model's `_`-prefixed member read as a value is `undefined`, where it was `null`; those members are types.
|
|
190
|
+
- A `"use client"` component that builds an endpoint's description key from data (`` l(`${module}.signal.${endpoint}.desc`) ``) gets the text on the server and the raw key in the browser: React reports a hydration mismatch and the key shows. Write the key out, or read the text in a server component and pass it down. A text shown once outside React, such as a toast that calls `Translator.translateByLocale`, can wait on `Translator.ready(lang, key)` so a late module's text is not shown as its key.
|
|
191
|
+
|
|
192
|
+
_How to check._ Run `akan build <app>`, then `akan quality runtime`: it names each file that keeps a page on the whole runtime or the whole dictionary, the line, the reason and the routes. `akan preview <app>` opens the pages and reports what they throw.
|
|
193
|
+
|
|
194
|
+
_How to keep a page on the whole runtime._ In app code: a route keeps the whole runtime when it renders a client file that exports the store, since any file may then read any module through it.
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
// apps/<app>/ui/WholeRuntime.tsx
|
|
198
|
+
"use client";
|
|
199
|
+
import { st } from "@apps/<app>/client";
|
|
200
|
+
|
|
201
|
+
export const wholeRuntime = st;
|
|
202
|
+
|
|
203
|
+
export const WholeRuntime = () => null;
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Render `<WholeRuntime />` in one page to keep that route, or in the root layout (`page/_layout.tsx`) to keep every route. `akan quality runtime` then lists the file under `[reader]` with the routes it holds. A route kept this way loads more than before, so `akan build --check-budget` may name it; `akan build <app> --raise-budget` raises its entry. Use it to ship while the files `akan quality runtime` names are changed, or for a route that reaches a store, an endpoint or a model by a name the build cannot read.
|
|
207
|
+
|
|
208
|
+
- a708a40: A server-rendered page starts from a small page runtime, the first step toward loading a model's endpoint descriptors and store in the browser only on the routes that use them.
|
|
209
|
+
|
|
210
|
+
- Each client entry of a server-rendered page starts from `lib/usePage.ts` (`usePage`, `msg`, `Err` and a fetch client carrying only the framework's own descriptors, such as `ping`, from `lib/__client/_base.fetch.ts`) instead of `lib/useClient.ts` and `lib/st.ts`. A client module that imports `fetch` or `st` from an app or lib `client` barrel still brings that scope's descriptors and stores, and a lib's barrel brings that lib and the libs under it.
|
|
211
|
+
- The framework components that reach a store, an endpoint or a registered constant by a name they compute (`Load`, `Model`, `Data`, `Signal`, `Constant.Doc` and the relation fields) import an empty module, `akanjs/ui/modelRuntime`. A route build keeps the app's `lib/useClient.ts` and `lib/st.ts` in every client entry reaching it, so a page rendering one of them loads the app's whole runtime before the component runs. A test in `akanjs` fails when a `ui` file reaches a model that way without importing it.
|
|
212
|
+
- Server rendering, CSR bundles (MCP App views included) and native apps keep loading the whole runtime. The development server narrows imports from `akanjs/ui` as a production build does, so a missing import shows there too.
|
|
213
|
+
- An app whose generated files predate `lib/usePage.ts` or `lib/__client/_base.fetch.ts` builds with the whole runtime on every page until it is synced.
|
|
214
|
+
- `StoreBootstrap.importLines` and `StoreBootstrap.source` in `@akanjs/devkit` take an optional scope, `"whole"` (the default) or `"page"`.
|
|
215
|
+
|
|
216
|
+
**Upgrading.**
|
|
217
|
+
|
|
218
|
+
What a page stops loading, and what to check for, is in the upgrade note of the entry that makes every app load per route.
|
|
219
|
+
|
|
220
|
+
- 19c6fa7: `akan code` on the `local` profile can be told to stop asking about a command for the rest of the session, and one option turns asking off for a run.
|
|
221
|
+
|
|
222
|
+
- **A third answer.** The prompt before a shell command is now `approve? run: <command> [y/n/a]`. `a` runs the command and stops asking about it until the session ends. What is remembered is the program, and the sub-command too for `git`, `bun`, `bunx`, `npm`, `npx`, `pnpm`, `yarn`, `akan`, `docker`, `kubectl`, `helm`, `cargo` and `go`: allowing `git status` leaves `git diff` asked about, and allowing `bun test` leaves `bun x` asked about. `gh` is remembered two words deep, so allowing `gh pr view` leaves `gh pr merge` asked about. A line of several commands (`&&`, `;`, `|`, `$(…)`, a subshell) runs unasked only once every command in it is allowed. `/allowed` lists what the session has allowed and `/allowed clear` forgets it. Nothing is written to disk, so a resumed, forked or reloaded session asks again.
|
|
223
|
+
- **Still asked every time**, with a prompt that offers only `[y/n]`: a networking command (`curl`, `wget`, `nc`, `ssh`, `scp`, `rsync`, …) and a redirection to or from `/dev/tcp/…` or `/dev/udp/…`; a command that sends something out of the machine (`git push`, `npm publish`, `pnpm publish`, `yarn publish`, `yarn npm`, `bun publish`, `cargo publish`, `gh api`, and a `docker` line with `push` or `--push` in it); `rm`; a command that runs another or sets what a later one runs (`sudo`, `env`, `timeout`, `xargs`, `sh`, `bash`, `eval`, `builtin`, `source`, `.`, `trap`, `alias`, `export`, `declare`, `find -exec`, …); a variable set in front of a command other than `CI`, `NODE_ENV`, `FORCE_COLOR`, `NO_COLOR`, `TZ`, `LANG`, `LC_ALL`, `TERM`, `DEBUG` or `PORT` given one plain word; a line that writes a file with `>` or `>>`; and a line that cannot be split into its commands with confidence (a loop or `if`, backticks, a here-document, a program named by a variable).
|
|
224
|
+
- **`--no-ask`.** `akan code --no-ask` runs the session without asking before a shell command or a network request: the same as `--no-ask-commands --no-ask-network`. It prints one line at start saying so. It changes nothing else: secret files stay refused, this repo's MCP servers and extensions still wait for their own approval (`--trust-workspace`), the agent's own questions are still asked, and the `pod`, `review` and `web` profiles behave as before.
|
|
225
|
+
|
|
226
|
+
A program that drives `akan code --rpc` sees `remember: string[]` on an `approval` request when the session answer is offered, sends `{ "type": "approve", "approvalId": …, "approved": true, "remember": "session" }` to give it, and reads the names on `approval_resolved.remembered`. A host that sends only `approved` keeps working as before.
|
|
227
|
+
|
|
228
|
+
**Upgrading.** No step is needed: the three wire fields in `akanjs/common` (`CodeAgentApprovalRequest.remember`, the `approve` command's `remember`, `approval_resolved.remembered`) and `CodeTranscriptPart`'s `remembered` are optional additions.
|
|
229
|
+
|
|
230
|
+
- 217b061: `akan code` on the default `local` profile now asks before it runs a shell command, as it already did before reaching an unlisted host. File reads, writes and edits are not asked about.
|
|
231
|
+
|
|
232
|
+
**Upgrading.** An interactive `akan code` session shows `approve? run: <command> [y/n/a]` before each shell command; `a` answers yes and stops asking about that command until the session ends. Pass `--no-ask-commands` to run them unasked as before, or `--no-ask` to stop the network questions as well. A one-shot `akan code "<prompt>"` and a sub-agent have nobody to ask, so their commands run as before. A program that drives `akan code --rpc` on the `local` profile receives an `approval` event for each command and answers it with `approve`, as it does for the `web` profile's writes; `codeAgentPresets.local(root).approval` is now `"commands"`.
|
|
233
|
+
|
|
234
|
+
- c7dee50: A browser's access token now lives one hour instead of seven days, and `@libs/shared` gains `session.cookieOnly`: with it on, a server-rendered web app holds its session in HttpOnly cookies alone.
|
|
235
|
+
|
|
236
|
+
- **One hour, one source.** `accessTokenSeconds` in `@libs/util/common` is the lifetime `signAccessToken` uses by default. The refresh token still lives 30 days, the session cookies keep their 30 day `Max-Age`, and an OAuth client's token still follows `oauth.accessTokenSeconds`.
|
|
237
|
+
- **Seven days still, for a caller that keeps its tokens itself.** A native shell, a client-rendered app on another origin, a server (`fetch.clone`) and a test keep the seven day token in this release (`WebSession.cookielessAccessTokenSeconds`), with `session.cookieOnly` on or off. The request has to ask for body tokens (the header below, or an allowlisted origin other than the server's own), carry no session cookie, and not come from a page on the server's own host. A page on the server's own host is a request whose `Origin` is that host, with or without its default port and whatever the letter case, or one the browser marks `Sec-Fetch-Site: same-origin`, as it does a same-origin `GET` that carries no `Origin`. A page on a sibling subdomain (`same-site`) is another origin's app and keeps seven days, and so does a caller that names no origin at all. Every other caller gets one hour: a server-rendered page, any request that carries a session cookie, a page load's renewal, a call sent over the websocket, and a hand-written call that does not ask. `AccountMiddleware` decides per request and the `@libs/shared` user and admin services sign with `WebSession.accessTokenExpiresAt()`.
|
|
238
|
+
- **Renewal.** A page refreshes two minutes before the token expires. It rechecks the expiry when its tab becomes visible, when the window takes focus, when the network comes back and once a minute, so a device that slept past the expiry renews as soon as it wakes. The page counts the token's lifetime on the server's clock, not the device's: each refresh answer measures how far the device clock is off (the token's `iat` against the moment the refresh was asked), the measurement is kept in client storage for the next page load, and a token found at load that disagrees with it is refreshed once to measure again. A device clock that is fast by less than half the token's lifetime is taken as it reads, which only renews early. An answered refresh is not asked again within a minute. New: `@libs/shared` registers `option.setSessionRefresh`, so a page load or RSC navigation that arrives with an expired access token is renewed from the request's refresh cookies before it renders. A user and an admin identity held together each come back on their own refresh cookie. An app's own `setSessionRefresh` wins over the lib's, and `setSessionRefresh(null)` turns it off.
|
|
239
|
+
- **Renewal that holds together.** A browser signed in as user and admin sends its two refreshes one after the other, in one tab and across tabs, so both identities survive a tab that wakes after the expiry. When one of the two sessions has ended, only that identity goes: `refreshAdminJwt` answers a session held in cookies whose admin session ended with the user identity alone, signed to the expiry it already had, and expires the admin refresh cookie; with no live user identity it ends the session as before. `refreshJwt` refuses an ended user session without changing a cookie, so the admin stays signed in. `Auth.TokenRefresh` redraws the page when a refresh leaves the session without its own identity, before the old token's expiry too. A refresh that failed is tried again after three seconds, then after 30 seconds doubling up to ten minutes, and at once when the window takes focus or the network comes back. `refreshAdminJwt` answers a refresh token presented twice within ten seconds, as `refreshJwt` does. A call whose `Authorization` token is this app's own and past its expiry is read by its session cookie instead, so a tab that has not refreshed yet follows the session a page load or another tab renewed; a token that is malformed, signed with another key, minted for another app or environment, or revoked is still answered as signed out.
|
|
240
|
+
- **`session.cookieOnly`** (`env.server.*`, off by default). Sign-in, SSO completion and refresh (`signinWithPassword`, `signinWithPhoneCode`, `signinWithSignToken`, `exchangeSsoCode`, `activateUser`, `activateUserWithAgreePolicies`, `refreshJwt`, `signinAdmin`, `refreshAdminJwt` and the other answers built by `makeAccessTokenResponse`) answer a server-rendered page with the session and refresh cookies and a body of `{ jwt: "", expiresAt }`: no token and no `refreshToken` field. The page's calls, file uploads, agent stream and websocket authenticate by cookie, and the page sends no `Authorization` header. One endpoint still answers an admin's page with tokens in the body: `getAccessTokenByAdmin` hands the admin another user's session, which a cookie could not carry without replacing the admin's own.
|
|
241
|
+
- **Who still gets tokens in the body.** A caller that holds no session cookie and asks for them with the request header `x-akan-session-tokens: body`. The framework's `fetch` sends it to its own server from a native shell, a client-rendered app, a server (`fetch.clone`) and a test, and never from a server-rendered page. A page on an allowlisted origin other than the server's own counts as asking, so a native app released before this version keeps working. Such an answer sets no session cookie.
|
|
242
|
+
- **Framework.** `sessionTokenContract` in `akanjs/common` names the header. `setAuth()` with no token beside a session the server holds stops `fetch` from sending one and reconnects the socket so its handshake carries the cookie. `WsClient.connect({ fresh: true })` replaces an open socket. `CrossSiteGuard.isFromOwnHost(req, url)` in `akanjs/signal` answers whether a request's `Origin` is the serving host. `@libs/shared` adds `ServerClock` (`common`) and `SessionClock` (`webkit`), which `refreshSession` and `Auth.TokenRefresh` read a token's expiry through.
|
|
243
|
+
|
|
244
|
+
**Upgrading.**
|
|
245
|
+
|
|
246
|
+
1. For everyone: a browser's access token expires after an hour. Nothing changes in an app that mounts `Auth.User` / `Auth.Admin` (they mount `Auth.TokenRefresh`) and uses the `@libs/shared` sign-in endpoints. In an app that mounts neither, an open tab's calls and socket go anonymous an hour after sign-in until the next navigation or reload, which renews the session: mount them, or call `refreshSession` from your own code. A native app, a client-rendered app on another origin and a script that signs in through the framework's `fetch` keep seven days. A hand-written HTTP call that keeps its own token and does not send `x-akan-session-tokens: body` gets one hour, and must refresh with `refreshJwt` / `refreshAdminJwt` or sign in again. `getAccessTokenByAdmin` signs for the kind of caller the admin is: one hour for a page on the server's own host or a caller that holds a session cookie, seven days for an admin app on another origin that keeps its tokens itself.
|
|
247
|
+
2. `RevokedSessions.accessTokenDays` is gone. `RevokedSessions.deniedSeconds` is how long a revoked session's tokens stay refused, and stays seven days.
|
|
248
|
+
3. A deployment that answers CORS preflights from its own edge list adds `x-akan-session-tokens` to the allowed request headers: a native shell and a client-rendered app on another origin send it with every call. The chart's `ingress.cors.enabled: true` list names it now, and the app's own CORS answer already allows every header a preflight asks for.
|
|
249
|
+
4. Your own endpoint that answers with `makeAccessTokenResponse` or `makeAdminAccessTokenResponse` passes the request, `makeAccessTokenResponse(token, { req })` (`.with(Req)`). With `session.cookieOnly` on, an answer that names no request never carries tokens in its body.
|
|
250
|
+
5. To turn the option on, set `session: { cookieOnly: true }` in `env/env.server.<env>.ts`. Client code that reads `jwt` or `refreshToken` from a sign-in or refresh answer in a server-rendered page gets an empty string and no field: hand the answer to `setAuth` as the `@libs/shared` stores do, and read the signed-in account with `getAccount()` / `getSelf()`.
|
|
251
|
+
6. Do not turn it on yet if your web pages are served as the client-rendered view on the server's own host (`?csr=true`, `/__csr`) in a browser that also holds the session cookie, if a client of yours on another origin that is not in the allowlist reads body tokens with a hand-written HTTP call, or if page code needs the token itself, for example to put it in a URL or hand it to another service. Tabs still running the code from before the deploy keep their session by cookie, but at their first refresh they lose their live subscriptions and stop scheduling refreshes, so their calls go anonymous about an hour later until a navigation or reload.
|
|
252
|
+
7. In 3.5.0 `session.cookieOnly` is on unless you set it to `false`.
|
|
253
|
+
|
|
254
|
+
- c30e4df: An operator can name the slowest SQL statement and the endpoint that sent it: every statement is counted by its shape, a slow one writes one log line, a local run warns of a full table scan, and the reconnect replay and the Redis publish buffer get gauges.
|
|
255
|
+
|
|
256
|
+
- **One timing point per driver.** `BunSqliteStatement` and the Postgres statement time each statement where it is sent, and the `db:<model>.<op>` spans, the new counters and the slow-statement log all read that one point. A statement's write-turn wait (the SQLite writer turn, the Postgres pool) is timed apart from its run; a transaction's wait shows on its `BEGIN`.
|
|
257
|
+
- **Statements are named by fingerprint**: 12 hex characters of a SHA-1 of the text with every literal `?` and each placeholder, `IN (…)` or repeated `VALUES` list collapsed to one, so `LIMIT 10` and `LIMIT 20` are one statement. The text sent is unchanged. `StatementFingerprint` keeps at most 500 shapes and 2,000 texts, and keeps none of a text over 8 KB.
|
|
258
|
+
- **New series**, labelled `model` and `op` only, so their number follows the app's models and not its statements: `akan_db_statements_total`, `akan_db_statement_seconds_total`, `akan_db_statement_wait_seconds_total`, `akan_db_statement_rows_total` and the `akan_db_statement_duration_seconds` histogram (16 buckets, 0.1 ms to 10 s). A statement sent outside a model call is named by its table and verb (`memo.select`).
|
|
259
|
+
- **`GET /_akan/app/statements`**, behind the metrics token, answers the 20 statements with the most total time and the 20 slowest at p95, each with its normalized text, model, op, wait, rows, its top 3 senders and `sinceMs`. A process keeps 500 statements, the cheapest going first; behind a gateway each replica sends its top 50 with every report and the gateway adds them by fingerprint. These are report values, not counters: they cover the statements a process lists now, since it started or since it last admitted the statement again (`sinceMs`), so a sum can fall when a statement drops out of a list; use the `akan_db_statement*` series for rates.
|
|
260
|
+
- **`AKAN_LOG_SLOW_STATEMENT_MS`** (default 200; `off` or `0` turns it off) writes one `SlowStatement` warning for a statement whose wait and run reach it, at most once a minute per fingerprint, with `suppressed` for the lines held back, `sentBy` (`none` outside a request) and the request's `traceId`.
|
|
261
|
+
- **A query-plan check in the local dev runtime** explains a statement the first time its fingerprint runs and again after a schema change (`EXPLAIN QUERY PLAN` on SQLite, `EXPLAIN` on Postgres) and warns once, as `QueryPlan`, on a full table scan or a temporary sort. It skips tables under 1,000 rows, inserts, an unfiltered `count`, migrations, tables no model owns, the search tables and in-memory SQLite. `AKAN_QUERY_PLAN_IGNORE=<fingerprint>,…` accepts a deliberate scan; `all` turns the check off.
|
|
262
|
+
- **`akan_room_replay_bytes` and `akan_pubsub_buffered_messages`** gauge the frame bytes kept for reconnecting sockets and the publishes waiting for the Redis link; the metrics report carries them as `replayBytes` and `pubsubBufferedCount`. `WebSocketRedisAdaptor.bufferedCount` and the optional `WebsocketAdaptor.bufferedCount` expose the buffer depth.
|
|
263
|
+
- A statement's text is shown with every literal replaced by `?`: strings (dollar-quoted and escaped ones too), numbers in any form, comments and the field paths of JSON filters, so two filters that differ only by field share one entry; a quote that never closes hides the rest of the statement. A Postgres plan is logged with every quoted value replaced, array literals included. No value, id or user data reaches a series, the report or either log line.
|
|
264
|
+
|
|
265
|
+
**Upgrading.** Under `AKAN_TRACE=1` or `x-akan-debug`, a `db:<model>.<op>` span, the request line's `db` and `dbMs` and the `Server-Timing` db entries now count SQL statements, not model calls: a call that sends two statements shows two spans, up to 32 `db:` spans a request so render and cache spans keep their room, and `BEGIN` and `COMMIT` count in `db` and `dbMs` without a span (a store that sends none through the SQLite or Postgres driver still shows one per call), and `dbMs` includes the time spent waiting for the write turn or a pool connection. A dashboard reading `db` as a count of model calls reads higher. A statement taking 200 ms or longer now writes a `SlowStatement` warning; set `AKAN_LOG_SLOW_STATEMENT_MS` higher or to `off` to keep the old log. A custom `WebsocketAdaptor` needs no change; `bufferedCount` is optional.
|
|
266
|
+
|
|
267
|
+
- 0baacae: Every dev route (`/_akan/devtools`, `/_akan/constant`, `/_akan/signal`, `/_akan/dictionary`, `/_akan/deps`, `/_akan/studio`, `/_akan/hmr`, `/_akan/ssr-dev`, `/_akan/csr-dev` and `/__rsc/manifest`) is listed once, in `akanjs/server/routing/devSurfaces`, and takes its gate, its Host check and its `akan dev --share` rule from that entry. A dev route answers only localhost, an IP address or a host the app names, on a deployed server too. A share reads the same list, so it now also refuses `/__rsc/manifest`; it still serves `/_akan/ssr-dev` and `/_akan/csr-dev`, which a shared dev page loads its modules from.
|
|
268
|
+
|
|
269
|
+
The framework keeps `/_akan/`, `/__rsc` and `/__csr` for its own routes: a server now refuses at start an endpoint, a framework route or a web route under them that is neither mounted as a dev route nor on the list of production routes next to the registry, and the error names the path. A dev server starts its on-demand CSR build only for a Host a dev route answers. A share refuses `/__csr` and drops `csr=true` from a page's query, so a shared page renders on the server instead of starting that build.
|
|
270
|
+
|
|
271
|
+
Outside a local runtime, `AKAN_DEVTOOLS=true` opens devtools only to a caller that presents the `AKAN_LOG_DEBUG_HEADER` secret, which must have at least 32 characters: a script sends it as `x-akan-debug`, and a browser posts it once to the form devtools shows, which unlocks that browser for 15 minutes, for that app and environment only, with an HttpOnly, Secure, SameSite=Strict cookie on the devtools paths; ten wrong secrets in a minute from one address get 429 until the minute is over. With no secret set, or a shorter one, devtools stays closed and the server log says which. Request logging through `x-akan-debug` takes the secret as before, whatever its length.
|
|
272
|
+
|
|
273
|
+
**Upgrading.** Open devtools, Studio and `/__rsc/manifest` through `localhost`, an IP address, `<app>-<env>.<serveDomain>`, a domain in the app's routes or a name in `AKAN_ALLOWED_HOSTS`; any other Host now gets 403, even on a server that answers every Host for the rest of the app. A deployed server with `AKAN_DEVTOOLS=true` also needs `AKAN_LOG_DEBUG_HEADER` set to a random secret of at least 32 characters (new: a shorter one keeps devtools closed there, and still works for request logging): send it as `x-akan-debug` from scripts, or unlock a browser at the form on any devtools page over HTTPS or `localhost` (for example through a port-forward). A local `akan start` or dev server needs nothing. An endpoint registered under `/_akan/`, `/__rsc` or `/__csr` (with `globalPrefix: false`) now stops the server at start: move it to another path.
|
|
274
|
+
|
|
275
|
+
- e704d16: A server that cannot write its SQLite directory, its solid SQLite directory or a local file storage root now stops at boot with `directoryNotWritable`, instead of booting and then failing with `attempt to write a readonly database` or an `EACCES` on the first upload. The message names the directory, the uid that owns it, the uid the server runs as, and the one-time fix: `chown -R <uid>:<gid> <dir>` as root on the volume that holds it, or the `volumePermissions` init container of the `infra/app` Helm chart. This is what a volume an image running as root wrote looks like to the generated image, which runs as uid 1000.
|
|
276
|
+
|
|
277
|
+
**Upgrading.** `BlobStorage` now has an `onInit` that makes this check. A subclass of your own that defines `onInit` calls `super.onInit()` first. A deployment whose data directory another user owns stops at boot with the message above: run the `chown` it names once, or let the chart's `volumePermissions` init container do it.
|
|
278
|
+
|
|
279
|
+
- 5c7c6cf: `SignalSerializer.httpRoutesOf(EndpointClass, apiPrefix?)` from `akanjs/server` lists the HTTP routes an endpoint class declares: each query and mutation's `key`, `method` and `path`, the path being the one the route table mounts, with `apiPrefix` joined unless the endpoint opts out of the global prefix. It reads the class's declarations alone, so a test can check an endpoint's routes without booting an app or importing a file `akanjs/server` does not publish.
|
|
280
|
+
- 53bf2de: A problem in an env file is reported without the file's text, so a build or lint log holds no secret.
|
|
281
|
+
|
|
282
|
+
- **Type errors.** `akan build`, `akan typecheck` and `akan verify` report a TypeScript error in `env/env.server.*.ts` or `env/env.client.*.ts` by file, line, column and code alone. The source line and TypeScript's message are left out, because either can quote a value.
|
|
283
|
+
- **Lint.** `akan lint` and `akan verify` report a diagnostic in those files by file, line, column and rule, with no code frame, formatter diff or rule message. The files are still linted and formatted, and their errors still fail the run. Every other file prints as before.
|
|
284
|
+
- **`akan lint` output.** The `Found N errors.` lines are printed once at the end and the "Checked N files in …" line is gone. When Biome cannot read `biome.json`, the error is Biome's own explanation.
|
|
285
|
+
|
|
286
|
+
**Upgrading.** A failed `akan lint` now exits with 3, the code of a failed check, where it exited with 1. A script that tests for a non-zero exit needs no change; one that tests for exactly 1 does. To see what is wrong on a line of an env file, open the file at the position the diagnostic names.
|
|
287
|
+
|
|
288
|
+
- bbc9def: An app hands the errors its users hit to an error tracker of its choice with `option.setErrorReporter`, and with `option.setClientReport` the errors their browsers hit too.
|
|
289
|
+
|
|
290
|
+
- **`option.setErrorReporter((error, context) => …)`** gets each server 5xx, render error, uncaught exception and unhandled rejection as a real `Error` with its `cause` chain. A 4xx never reaches it. `context` is `{ source, traceId, endpoint, routeId, accountId, digest }`: `source` is `server`, `render`, `process` or `client`, `traceId` the request id the response named as `x-request-id`, `endpoint` the `<type>:<key>` that answered, and `routeId` the route pattern, never the URL. `accountId` is set on a `server` report whose request was signed in, and null on the others. A thrown value that is no `Error` arrives as one, with the value as its `cause`.
|
|
291
|
+
- **Each error is reported once, after the response, and a bounded number a minute.** The reporter runs off the request; one that throws or rejects is logged once and changes nothing else. One server process hands it at most 600 errors a minute, at most 10 of them uncaught exceptions and unhandled rejections, and at most 3 render errors of one request; it logs one line when it starts skipping. Await what the reporter sends: a send it does not await, failing, comes back as an unhandled rejection of the process and counts toward those 10. Before a crashed process exits, it waits up to 2 seconds for the reporter.
|
|
292
|
+
- **It runs in the server that answers**, the solo server or each replica. A render error in the RSC worker reaches the replica's reporter with its digest, route pattern and request id, and its cause chain to five levels. So does an error a client component raises while the server renders the page's HTML, and a page the server answers 5xx for because its worker stopped, timed out or refused. The gateway loads no `option.ts` and reports nothing. A page a full render queue turns away (`AKAN_RSC_WORKER_MAX_CONCURRENCY`) is not reported: `akan_rsc_render_refusals_total` counts it.
|
|
293
|
+
- **One fault can arrive more than once, with one `traceId`.** An endpoint that answers 5xx while a page renders arrives as `server` and as `render`; a server error streamed into a page arrives as `render` and, when the browser re-renders that part, as a `client` report of kind `recoverable`. Group by `traceId`.
|
|
294
|
+
- **`option.setClientReport({ sampleRate, perAddress, perServer })`**, off unless set, opens `/_akan/client-report` and makes each page view its sample draws send what its browser hit: a React root's uncaught, caught and recoverable errors, `window.onerror` and unhandled rejections, at most five a page view. The reporter gets each as a `BrowserError` (`akanjs/signal`) with `source: "client"` and the page view's request id; its `data` holds the kind, name, message, stack, route pattern, digest, the server's build id and the user agent. Defaults: every page view, 10 requests a minute per address (an IPv6 address counts as its /64) and 120 reports a minute per server process.
|
|
295
|
+
- **A report is taken only with the id its page view was given.** The page's `Server-Timing` header carries the request id with a signature over it and the half hour it was issued in, and only on a page no shared cache reuses: the default `no-cache` and a signed-in page's `private, no-cache` carry it, a `public` or switched-off `AKAN_HTML_CACHE_CONTROL` does not. The server takes that id for 30 to 60 minutes and five times. The page reads it once, when the document loads, so a report after an in-app navigation carries the first document's id with the current route pattern.
|
|
296
|
+
- **Which servers take a report.** `AKAN_CLIENT_REPORT_KEY` is a secret an operator may set to 32 characters or more: every server that holds it takes an id any of them gave, and a gateway passes it to its replicas unchanged. A shorter value is ignored with one warning that names the variable and never the value. Unset, the replicas behind one gateway share a key the gateway makes at start, and a server run alone uses its own: reports are then taken only behind the gateway, or by the process, that served the page. The app name and environment are signed in either way. The key has nothing to do with `AKAN_LOG_DEBUG_HEADER`.
|
|
297
|
+
- **What a page sends, and what the server keeps.** A report carries no cookies and no referrer. In its name, message and stack, a URL or a path loses its query string and fragment, an email address becomes `[email]`, a `Bearer …` value and a JWT become `[redacted]`, and the characters that reorder how a line displays are removed, in the page before it sends and on the server again; the server also removes terminal escapes and control characters and cuts the name, message, stack and user agent to 100, 1,000, 4,000 and 300 characters. The server keeps only a `text/plain` POST from the app's own origin, of 8 KB or less, with a signed id, within the limits; only such a report counts toward `perServer`. Every request, kept or not, is answered with the same empty 204, and the one log line a kept report writes holds only the cleaned values. The code that sends loads on a page's first error, so a page without errors downloads only the listeners, about 430 bytes compressed.
|
|
298
|
+
- **What the limits leave.** Each server process counts on its own, so N replicas take up to N times `perServer` and five reports per id each; visitors behind one address share its `perAddress`; and `perServer` is one budget for everyone who loaded a page, past which a minute's later reports are dropped, never queued. The cleaning knows a few shapes, not meanings: keep personal data out of error messages.
|
|
299
|
+
- New exports: `ClientReportSetting` from `akanjs/server`, and `BrowserError`, `BrowserErrorData`, `BrowserErrorKind`, `ErrorReporter`, `ErrorReportContext` and `ErrorReportSource` from `akanjs/signal`. The Error Handling cheatsheet has a Report Errors section, the server reference lists both options, and the runtime guideline names them.
|
|
300
|
+
|
|
301
|
+
**Upgrading.** Nothing changes until an app calls one of the options. An app that forwarded errors through a `Logger.addSink` that parsed error lines can move to `setErrorReporter`, which gets the `Error` itself; keep the sink only for lines that are not errors. A lib may set either option; the app's call wins, `setErrorReporter(null)` clears a lib's reporter and `setClientReport(false)` turns a lib's reports off. A page whose `AKAN_HTML_CACHE_CONTROL` is `public, …` sends no browser reports; pages that should send them keep `no-cache`. An app served by more than one gateway or pod sets `AKAN_CLIENT_REPORT_KEY` to the same value of 32 characters or more on each, before it turns `setClientReport` on.
|
|
302
|
+
|
|
303
|
+
- aff1ba2: An external view opens only origins the app's config lists, in `native.desktop.externalView.allowOrigins`: a view's own `allowOrigins` narrow within them, and an origin outside them is `NOT_ALLOWED`, naming that key. `evaluate` and `initScript` need their own permission, granted by `desktop.externalView.evaluate: true`, and `sendKey` its own, granted by `desktop.externalView.sendKey: true`; both are off by default. While a view is open, opening its id again keeps its origins or narrows them, and refuses one it was not opened for; once closed, the id opens again for any origins the config lists, with the same browser profile, which belongs to the id. Origins compare exactly as the URL parser reads them: scheme, host and port, the host in punycode without a trailing dot, the default port left out, and an origin with user info refused; there are no wildcards. A view loads a URL as the URL parser writes it, so the engine never reads the page's text another way. A page opens a view only over its own window. The desktop shell checks all of this itself on macOS, Windows and Linux, and grants nothing when the build carries no permission list; on Windows a view now takes only the two DevTools calls `sendKey` and `capture` make. A top-level navigation or redirect off a view's origins stays refused, as before.
|
|
304
|
+
|
|
305
|
+
A plugin manifest's `scope` can say `required: true`: then every grant of the plugin, not only `<plugin>:default`, is within its `defaultScope` unless the grant gives its own `allow`, and a scope entry naming no field is a build error. `external-view` says so.
|
|
306
|
+
|
|
307
|
+
**Upgrading.** An app that lists `external-view` opens no view until its `akan.config.ts` names the origins, and needs `evaluate` and `sendKey` only for the calls it makes:
|
|
308
|
+
|
|
309
|
+
```ts
|
|
310
|
+
native: {
|
|
311
|
+
plugins: ["external-view"],
|
|
312
|
+
desktop: {
|
|
313
|
+
externalView: {
|
|
314
|
+
allowOrigins: ["https://board.example"], // every origin a view's allowOrigins names
|
|
315
|
+
evaluate: true, // when it calls evaluate or opens with initScript
|
|
316
|
+
sendKey: true, // when it calls sendKey
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
An app built with the akan-native CLI's own config grants the same in its capabilities: `{ identifier: "external-view:default", allow: [{ origin: "https://board.example" }] }`, `"external-view:allow-evaluate"` and `"external-view:allow-sendKey"`. A grant of `external-view:all` or `external-view:allow-open` opens no origin unless its own `allow` lists them. A page that passed `window` to `open` passes its own window or leaves it out.
|
|
323
|
+
|
|
7
324
|
- 90d740f: `native.ios.hideFormAccessoryBar: true` (or a target's `ios.hideFormAccessoryBar`) leaves out the bar WebKit shows above the keyboard while a page field is focused. The iOS shell already had the switch, but `akan.config.ts` refused the key and the native config never carried it, so every iOS app showed the bar.
|
|
8
325
|
|
|
9
326
|
The key defaults to false, so existing apps are unchanged. The api report lists one new optional `AkanNativeIosConfig` property; no upgrade step is needed.
|
|
@@ -12,13 +329,290 @@
|
|
|
12
329
|
|
|
13
330
|
The api report lists additions only: `Device.keyboardAnimationMs`, `Device.keyboardHeight` and `Device.subscribeKeyboard`, the optional `KeyboardFrameState.avoidsContent` and `isPageKeyboardAvoidance` from `akanjs/webkit`; no upgrade step is needed. An iOS app gets the new behavior once it is built with this shell; a page that lifted its own composer by the keyboard's height under the old pan should drop that lift.
|
|
14
331
|
|
|
332
|
+
- b6f1838: An operator can graph and alert on the number of live rooms: `/_akan/app/metrics` now carries the `akan_live_rooms` gauge next to `akan_room_replay_bytes` and `akan_pubsub_buffered_messages`, and the metrics report carries it as `roomCount`.
|
|
333
|
+
|
|
334
|
+
It counts the live-query rooms one process holds, one per room id however many sockets share it. Behind a gateway each replica reports its own and the scrape adds them up per `role`, so a room that sockets on two replicas share counts once on each; the gateway's `rooms` field in the status still gives the distinct count.
|
|
335
|
+
|
|
336
|
+
- 234e31d: A native app's page now sends its errors to `/_akan/client-report` when `option.setClientReport` is on. The page is bundled into the app and loaded from `app://localhost` or `https://app.localhost`, another origin than the server, so no page view gave it a signed id and the browser listeners never ran there. At its first `window.onerror` or unhandled rejection (React's uncaught and recoverable errors and a failed native plugin call among them) it asks `GET /_akan/client-report` on the app's server for an id, which the server gives only to a shell origin, counted against `perAddress` and drawn against `sampleRate` like a page view, and asks again after 30 minutes, or after a minute when the ask did not reach the server. The route answers a shell origin with `Access-Control-Allow-Origin`, so the page's report is an ordinary cross-origin `POST` that carries its `Origin` in every webview. Its reports go through the same checks and caps as a browser page's, reach `setErrorReporter` as a `BrowserError` whose new `data.shell` (`BrowserErrorShell`, added to `akanjs/signal`) names the shell and whose `traceId` is the ask's request id, and are logged as `Native <shell> page error`. A web page loads nothing more, and a page with no error sends nothing.
|
|
337
|
+
|
|
338
|
+
Upgrade: a reporter that reads `BrowserError.data` needs no change; `shell` is `null` for every browser page. Code that builds a `BrowserErrorData` itself, such as a test fake, adds `shell: null`.
|
|
339
|
+
|
|
340
|
+
- 31097f2: A server can send its spans and log lines to an OpenTelemetry collector over OTLP/HTTP, with no package to add. Nothing is exported until an endpoint is set.
|
|
341
|
+
|
|
342
|
+
- **The settings are OpenTelemetry's.** `OTEL_EXPORTER_OTLP_ENDPOINT` is a base that `/v1/traces` is appended to, and `/v1/logs` once logs are asked for; `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` and `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` are full URLs. `OTEL_EXPORTER_OTLP_HEADERS` (and its `_TRACES_` / `_LOGS_` forms) holds credentials, which are never logged. `OTEL_SERVICE_NAME` and `OTEL_RESOURCE_ATTRIBUTES` name the service. `OTEL_TRACES_SAMPLER` takes `always_on`, `always_off`, `traceidratio` and their `parentbased_` forms, with `OTEL_TRACES_SAMPLER_ARG` as the ratio; the default is `parentbased_always_on`, and any other value is logged once and exports no spans. `OTEL_TRACES_EXPORTER=none` or `OTEL_LOGS_EXPORTER=none` turns one signal off, `OTEL_EXPORTER_OTLP_TIMEOUT` and the `OTEL_BSP_*` / `OTEL_BLRP_*` batch settings work as in the spec, and `OTEL_SDK_DISABLED=true` turns it all off. With no endpoint set, nothing is created.
|
|
343
|
+
- **One sampling decision per request.** The first process to take a request over TCP, the gateway or a replica running without one, decides, and the sampled flag of `traceparent` carries the decision to the replica and on to the RSC worker, so a trace arrives whole or not at all. A caller's flag counts only when `AKAN_TRACE_ADOPT` trusts the caller. A queued job decides for itself and links the trace that enqueued it.
|
|
344
|
+
- **Each process sends its own**, marked with `akan.process.role` and `akan.replica.index`. The gateway sends a server span per proxied request, named by its method. A replica sends a server span named by the route pattern it matched, a span per endpoint call and a client span per database call; the spans for each stage of a call (guards, handler, serialize) are added only under `AKAN_TRACE=1` or a passed `x-akan-debug`. The RSC worker sends its page span as a child of the replica's. Attributes carry the method, the route pattern, the status and the error type, never a URL with its query, a header value, SQL text or a user id, and a failure's exception event carries its error code, not its message.
|
|
345
|
+
- **Log records are exported only when asked for**: with `OTEL_LOGS_EXPORTER=otlp`, or with `OTEL_EXPORTER_OTLP_LOGS_ENDPOINT` set. The generic endpoint alone sends spans only, unlike the OpenTelemetry default. A record carries the line's message as its body, its severity, its attrs, the logger's name and context, the endpoint and origin, a link it was handed, and its trace and span id when written inside a request. Attrs whose key names a secret are redacted, as for every other sink; nothing else is: the message text, and an error's message and stack where the line carries them, are sent as written. The floor is the console level the process started with.
|
|
346
|
+
- **The exporter stays out of a request's way.** Each signal has a bounded queue that sends by size, after the call that filled it returns, and on a timer, with at most two requests in flight. A full queue drops its oldest item and counts it. 429, 502, 503, 504 and an unreachable collector are retried with backoff until the timeout; any other status drops the batch. A failing collector is reported at most once a minute, by host. The exporter's own requests and warnings are not traced or exported. On the way out each process, the RSC worker included, sends what is queued once, for at most 1.5 s, and counts what is still unsent then as dropped; a replica under the gateway takes less when its shutdown has used up the gateway's wait. A worker that has not exited 3 s after it was stopped, as one stuck in a render, is killed.
|
|
347
|
+
- **A caller's trace that is not continued is linked.** Where an untrusted caller sent a `traceparent`, the first span links its trace and span id; an id from `x-request-id`, or a job's link to the trace that enqueued it, names no span and is sent as the `akan.trace.link` attribute instead.
|
|
348
|
+
- A sampled call records its own span and its database spans, so its request line carries `db` and `dbMs`, but it does not join the `AKAN_TRACE` metrics. `SignalTrace.exported` says whether a call was sampled for export. The `x-akan-debug` header does not change what is sampled.
|
|
349
|
+
- Bodies are JSON. `http/protobuf` still sends JSON, with a warning; `grpc` and compression are not supported.
|
|
350
|
+
|
|
351
|
+
**Upgrading.** Nothing changes until an `OTEL_EXPORTER_OTLP_*ENDPOINT` is set. A deployment whose environment already sets one for some other tool starts exporting on upgrade: point it at a collector that accepts OTLP/HTTP JSON, or set `OTEL_SDK_DISABLED=true` for the app. With only `OTEL_EXPORTER_OTLP_ENDPOINT` set, spans are exported and log records are not; set `OTEL_LOGS_EXPORTER=otlp` to send them too. A collector that accepts only protobuf does not work; the OpenTelemetry Collector's `otlp` receiver accepts both.
|
|
352
|
+
|
|
353
|
+
- 4040f2d: `overlay: true` (or `"top"` / `"bottom"`) in a route's `.config()` lays the page under that side's safe area and inset instead of below them, so a translucent bar (a frosted tab bar, a glass header) has the page's content scrolling beneath it. On an overlaid side the page's padding is 0, `--akan-overlay-top` / `--akan-overlay-bottom` carry the chrome's height for the page's scrollers to pad by, the top inset's container stops painting the background, and the safe area strip is transparent and lets touches through unless the route sets its color. Until now every bar sat over a reserved band of plain background, so a backdrop blur had nothing to show.
|
|
354
|
+
|
|
355
|
+
The key defaults to off, so existing pages are unchanged. The api report lists the new `PageOverlayConfig` type and one new optional property on `PageConfig` and on `CsrState`; no upgrade step is needed.
|
|
356
|
+
|
|
357
|
+
- 9a7a9d5: Every endpoint and page counts its requests and times them, always, with tracing left off.
|
|
358
|
+
|
|
359
|
+
- `akan_endpoint_requests_total{endpoint, status_class}` and `akan_endpoint_request_duration_seconds{endpoint}` count and time each endpoint call over HTTP, websocket and MCP, labelled `<type>:<key>` as a trace names it. `akan_page_requests_total{route, status_class}` and `akan_page_request_duration_seconds{route}` do the same for page documents, a `?csr=true` shell included, and RSC payloads by route id, and a path no route matches counts as `unmatched`. Every series also carries the process `role`. No label carries a URL, a user, an account or a query.
|
|
360
|
+
- `akan_route_cache_lookups_total{cache, outcome, reason}` counts the route caches' lookups: `cache` is `rsc`, counted in the render worker, or `html`, counted in the web server, and `outcome` is a `hit` or `miss` whose `reason` says whether the key took the query as requested or rewritten, or a `bypass` whose `reason` says why the request skipped the cache. The Grafana dashboard shows each cache's hit ratio and its bypasses by reason.
|
|
361
|
+
- A latency histogram has 12 fixed buckets from 1 ms to 10 s. A label takes at most 2,000 values, and the rest count as `other`. A series appears once it is first observed, at about 2 KB of memory for each endpoint called.
|
|
362
|
+
- `/_akan/app/metrics` answers these series as `metricFamilies`. Behind a gateway, each replica reports its own with its start time, and the gateway adds them up: counters and buckets add, and percentiles are never averaged. A replica that restarts counts from zero again, and the gateway keeps its earlier counts in the sum, so the sum never drops. A series the RSC worker registers reaches its server's scrape the same way, and a recycled or restarted worker does not lower it.
|
|
363
|
+
- `/_akan/app/metrics` answers a Prometheus scrape as text, behind the same token. `Accept: application/openmetrics-text`, which Prometheus sends, gets OpenMetrics 1.0, and `text/plain` alone gets the Prometheus 0.0.4 text; `*/*`, `application/json` or no Accept keeps the JSON. Both carry `akan_build_info{akanjs_version, app}`, `process_start_time_seconds` and the RSC worker series: `akan_rsc_workers`, `akan_rsc_workers_ready`, `akan_rsc_renders_pending`, `akan_rsc_sends_queued`, `akan_rsc_worker_resident_memory_bytes`, `akan_rsc_worker_restarts_total` and `akan_rsc_worker_recycles_total`.
|
|
364
|
+
- A metrics sample no longer walks the JSC heap with `heapStats()`, which stopped the event loop for about 46 ms on a 150 MiB heap at every sample. The `jsc…` fields (`jscHeapSizeBytes`, `jscObjectCount` and the rest, and their `rscWorker…` copies) come only while memory is diagnosed, under `AKAN_MEMORY_LOG=1` or `AKAN_MEMORY_GC_ON_REPORT=1`.
|
|
365
|
+
|
|
366
|
+
**Upgrading.** Most readers change nothing. The metrics JSON gains a top-level `metricFamilies`, and each replica's `metrics` gains `startedAt` and `metricFamilies`; a reader that checks the body's exact keys must allow them. Behind a gateway the sums are as fresh as each replica's last report, sent every `AKAN_MEMORY_LOG_INTERVAL_MS` (60 s by default). Set it to your scrape interval for fresher numbers. A reader that sends `Accept: text/plain` alone now gets the text; send `application/json` to keep the JSON. The response carries `Vary: Accept`. A reader of the `jsc…` fields sets `AKAN_MEMORY_LOG=1`; `heapUsedBytes` stays in every sample.
|
|
367
|
+
|
|
368
|
+
- 8d75f2b: The public surface 3.2.0 deprecated is removed. `akanjs` and `@akanjs/devkit` publish only the subpaths their `exports` name, with no wildcard, so a file becomes public only when an entry names it.
|
|
369
|
+
|
|
370
|
+
- **`@akanjs/devkit` has no root aliases and no `./*` or `./*.ts`.** It publishes `@akanjs/devkit` (types only), `biome.base.json`, the facets `akanApp`, `akanConfig`, `artifact`, `cloud`, `codeAgent`, `commandDecorators`, `executors`, `frontendBuild`, `incrementalBuilder`, `mobile`, `pipeline`, `preview`, `transforms` and `workflow`, and the files `app/applicationBuildRunner`, `cloud/cloudApi`, `cloud/cloudUpdates`, `commandDecorators/exitCodeError`, `mobile/desktopRelease`, `mobile/serverBundleSecrets` and `transforms/serverEnvProfile`. `util/fileEditor`, `util/selectModel` and `workspace/getRelatedCnsts` are named too, and deprecated: nothing in akanjs uses them.
|
|
371
|
+
- **`akanjs` drops `akanjs/common/*`, `akanjs/server/*`, `akanjs/ui/*`, `akanjs/webkit/*` and `akanjs/client/native/*`.** Every `akanjs/client/native/<plugin>` path still resolves, now as its own entry, and so does `akanjs/webkit/usePurchase`. The layouts `akan` generates import `akanjs/ui/System/index.tsx`, `akanjs/ui/System/SSR.tsx`, `akanjs/ui/UiOverride/UiOverride.tsx` and `akanjs/webkit/RouteLevelBoundary.tsx`, and the `akan` command's bundled `@akanjs/language` imports `akanjs/common/akanNames.ts`, `akanjs/common/facetBarrel.ts` and `akanjs/common/routeConvention.ts`: these stay as named entries. `@akanjs/language`'s declarations now import their types from `akanjs/common`. Barrel imports in an installed workspace's build now resolve to files on disk instead of package subpaths.
|
|
372
|
+
- **The error-constructor plumbing is gone**: `setErrorConstructor` on `FetchClient`, `HttpClient` and `WsClient`, `HttpClientOptions.ErrorCls`, and `FetchClient.build`'s `Err` option. Every restored error is `akanjs/common`'s `Err`, as it already was. `registerClientRuntime` no longer re-points the shared client at the runtime's `Err`.
|
|
373
|
+
- **Thirteen deprecated exports are deleted, and eleven internals are no longer exported.**
|
|
374
|
+
|
|
375
|
+
**Upgrading.**
|
|
376
|
+
|
|
377
|
+
- `@akanjs/devkit/<name>` and `@akanjs/devkit/<name>.ts`, for 81 root names, and `@akanjs/devkit/executors.ts` (`@akanjs/devkit/executors` stays, as a facet):
|
|
378
|
+
- `applicationBuildRunner` → `@akanjs/devkit/app/applicationBuildRunner`, `fileEditor` → `@akanjs/devkit/util/fileEditor`, `selectModel` → `@akanjs/devkit/util/selectModel` and `getRelatedCnsts` → `@akanjs/devkit/workspace/getRelatedCnsts` (the last three are deprecated).
|
|
379
|
+
- Import the types of `akanContext`, `akanMcpContract`, `applicationBuildReporter`, `applicationTestPreload`, `createTunnel`, `dependencyScanner`, `fileSys`, `maintainabilityContract`, `packageExportsMap`, `prompter`, `qualityScanner`, `recipeScanner`, `scanInfo`, `spinner`, `stripAnsi`, `typeChecker` and `types` from `@akanjs/devkit`. Their values have no public entry.
|
|
380
|
+
- `abstractDoc`, `agentAssets`, `agentsIndex`, `akanMcpToolError`, `apiReference`, `appSelectionMemory`, `bareErrorScanner`, `biomeBase`, `codegenLock`, `commentDensityScanner`, `componentSizeScanner`, `componentWriteChainScanner`, `conventionSet`, `declarationReader`, `deprecatedCommentScanner`, `endpointReach`, `envSeed`, `errorCodeReference`, `errorCodeScan`, `formSetterScanner`, `frameworkGraph`, `gitRevision`, `jsonFormatter`, `kindBranchScanner`, `libSource`, `linter`, `maintainabilityBaseline`, `maintainabilityExceptionScanner`, `maintainabilityLimits`, `maintainabilityReport`, `manifestDependencies`, `moduleFieldNames`, `renderMutationScanner`, `repoIdentity`, `routeJsBudget`, `routeSourceValidator`, `semver`, `serviceLoopCallScanner`, `shellOnlyEnv`, `signalMutationIndex`, `slicePlanner`, `sourceComments`, `sshHostKeys`, `sshTunnel`, `ssrScanner`, `storeAccessScanner`, `storeSource`, `storeWriteScanner`, `structureScanner`, `subspace`, `subspaceClone`, `subspaceConfig`, `subspaceReport`, `testHelpers`, `testOnlyExportScanner`, `workspaceGraph`, `workspaceLayout`, `writePath`, `writePlacementScanner` and `writingActionIndex` have no replacement: they are the `akan` command's internals, which its build inlines.
|
|
381
|
+
- Any other `@akanjs/devkit/<dir>/<file>` that only `./*` reached: import its types from `@akanjs/devkit` where that barrel exports them; it is otherwise internal, with no replacement.
|
|
382
|
+
- `akanjs/<common|server|ui|webkit>/<file>`: import from the barrel, `akanjs/common`, `akanjs/server`, `akanjs/ui` or `akanjs/webkit` (`akanjs/server/machine/machineToken` → `akanjs/server`; `akanjs/ui/Constant/schemaDoc` → `akanjs/ui`), or from a named entry such as `akanjs/server/tunnel` for `akanjs/server/tunnel/index.ts`. A file no barrel re-exports is internal, `SignalResolver` and `akanjs/ui/Agent/RichInput` included, with no replacement: check which routes an endpoint serves with a signal test (`akan test <app>`) rather than through `SignalResolver.resolveEndpoint`. These 28 were public only through a wildcard and are internal now: `isIndexable`; `DEFAULT_HTML_CONTENT_SECURITY_POLICY`, `htmlContentSecurityPolicy`, `DEFAULT_STRICT_TRANSPORT_SECURITY`, `CONTENT_ENCODINGS`, `topologicalStages`, `traceCycle`, `getSystemPageErrorDetails`, `SYSTEM_PAGE_STYLE`, `getSameOriginHref`, `carriesCredentials`, `DEFAULT_ROUTE_CACHE_TTL_SECONDS`, `isAkanRouterStateV1`, `countCommonRouteSegments`, `AKAN_RSC_STATE_VERSION`, `decodeAkanRedirectDigest` and `validateRscSegmentPatch` (server); `getKeyboardAccessorySlots`, `blurActiveElement`, `KEYBOARD_SHOW_ANIMATION_DURATION_MS`, `KEYBOARD_HIDE_ANIMATION_DURATION_MS`, `KEYBOARD_SHOW_ANIMATION_EASING`, `KEYBOARD_HIDE_ANIMATION_EASING` and `clonePageState` (webkit); `DefaultPagination`, `DefaultTable`, `DefaultUnauthorized` and `isPublicEndpoint` (ui).
|
|
383
|
+
- `fetch.setErrorConstructor(Err)` in an older `lib/sig.ts`, and `{ Err: pageProto.Err }` passed to `FetchClient.build` in an older `lib/useClient.ts`: run `akan sync`, which rewrites both. Elsewhere, drop the `setErrorConstructor` call, the `ErrorCls` option and the `Err` option. A `FetchClient` constructed with its own error class still restores its WebSocket, bridge, refusal and abort errors into it, but an HTTP response error is always `Err`.
|
|
384
|
+
- `MAX_INT` → `2 ** 31 - 1`. `isFilterModel(ref)` → `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(ms)` → `getCurrentTrace()?.countDbQuery(ms)`. `isSitemapPath(pathname, basePaths)` → `getSitemapBasePath(pathname, basePaths, headerBasePath) !== undefined`. `useRscNavigation` → `navigateRsc`, `clearRscNavigationCache` and `isRscNavigationFromCache`. `getSearchParam` and `getBaseSearchParam` → read `searchParams[key]`, taking the first value of an array. `dictionaryContext`, `groupByOwner` and `ServiceRegistry` have no replacement.
|
|
385
|
+
- No longer exported, with no replacement: `setFilterMeta` and `getFilterArgInfo` (`akanjs/document`), `isDebugHeaderAllowed` (`akanjs/signal`), `parseAkanConsoleQuery`, `createAkanConsoleLogCommands` and `createAkanConsoleContext` (`akanjs/server`), `isResponsiveInset`, `getClientRuntime`, `colorTokens` and `radiusTokens` (`akanjs/client`), and `isStateBuilderMarker` (`akanjs/store`).
|
|
386
|
+
|
|
387
|
+
- d5e60f2: A render worker can run a set number of renders at a time, keep the rest in a first-come, first-served queue, and answer 503 once that queue is full. It does so only when `AKAN_RSC_WORKER_MAX_CONCURRENCY` is set.
|
|
388
|
+
|
|
389
|
+
- `AKAN_RSC_WORKER_MAX_CONCURRENCY=<n>` lets one render worker run `n` renders at once: page documents, `/__rsc` navigations and prefetches, and the error or not-found page rendered in a failed render's place. The rest wait in the order they arrived. A page the worker has stored is replayed without a slot, also when another request stored it while this one waited; a request its client aborted leaves the queue without rendering, and a slot comes back when its render ends, throws or is cancelled. A render that has held its slot as long as the idle timeout gives it back and runs on. The cap is per worker, so per replica behind a gateway, and it bounds the renders admitted, not the ones still running after their slot came back: a page whose client left keeps running until its own `await` settles. MCP page prompts and static app cards are not queued. A value that is not a whole number or `off` is warned about once and ignored.
|
|
390
|
+
- `AKAN_RSC_WORKER_MAX_QUEUE` bounds the queue: by default the cap times the idle timeout's seconds (`AKAN_IDLE_TIMEOUT`, 120), and `0` or `off` for no bound. A render past it, or one that has waited as long as the idle timeout (the default 120 seconds where that timeout is off, as under `akan start`), is answered `503` with `Retry-After: 1` and `Cache-Control: no-store` before any of it renders: for a browser a page that reloads itself once, after a second plus jitter and twice as long after each refusal in a row up to 30 seconds; `base.error.serverUnavailable` JSON for a JSON caller; and text otherwise and for `/__rsc`. The error codes are `renderQueueFull` and `renderQueueTimeout`.
|
|
391
|
+
- `/_akan/app/metrics` gains `akan_rsc_renders_in_flight`, `akan_rsc_render_queue_depth`, `akan_rsc_renders_abandoned` (renders still running after their slot came back), `akan_rsc_render_queue_wait_seconds` and `akan_rsc_render_refusals_total{reason}` (`queue-full`, `wait-timeout`, and `hold-timeout` for a slot taken back). A refused page also counts as a `5xx` of its route in `akan_page_requests_total`. A page that waited carries `queueMs` on its request line and, under `AKAN_TRACE=1`, a `renderQueue` span.
|
|
392
|
+
- The cap is off by default, because a page that awaits data holds its slot while it waits. Measured on the production build of `apps/akan` with 32 requests at once (`pkgs/@akanjs/devkit/integration/renderAdmissionSoak.ts`, the median of three runs): pages that wait 20–200 ms on data served 151 requests a second with no cap, 150 with a cap of 32, 95 with 16, 59 with 8 and 32 with 4. Pages that only use the CPU served 102 to 108 a second at every cap, and their median latency moved by less than a tenth (250 ms at a cap of 4, 264 ms with none): the worker starts and finishes renders in order, but while it stays busy its payloads reach the web server together, once it pauses, so a cap bounds a burst and does not answer the first pages sooner. What a cap of 4 changed for them was the worker's heap growth during a run: 54 to 64 MB, against 82 to 284 MB with none. `pkgs/akanjs/server/SSR_MEMORY_DIAGNOSIS.md` has the table.
|
|
393
|
+
|
|
394
|
+
**Upgrading.** Nothing changes until `AKAN_RSC_WORKER_MAX_CONCURRENCY` is set; three new gauges appear in the metrics scrape. When you set it, start from the number of requests one replica is sized to hold at once, so the cap only bounds a burst past that, and go lower only for pages that render without waiting on data. A capped server answers `503` with `Retry-After` under overload, so let the load balancer pass that status through uncached, and treat it as retryable in an uptime check.
|
|
395
|
+
|
|
396
|
+
- 4225827: Every request has one id: `x-request-id` on its response, `traceId` in the body of a failed call and on every log record written while it is answered.
|
|
397
|
+
|
|
398
|
+
- The server mints the id. A request that arrives with a W3C `traceparent`, or else an `x-request-id` that is a UUID or 32 hex digits, keeps that id as `link` on every record it writes and on its request line; an id of any other shape is not kept at all. `akan logs --trace <id>` matches `link` as well as `traceId` and reads the id the way an inbound one is read, so a caller finds its request by the id it sent.
|
|
399
|
+
- The gateway settles the id once and hands it to the replica over its unix socket, so both write the same `traceId`. It no longer forwards a caller's `x-request-id` as it came.
|
|
400
|
+
- `AKAN_TRACE_ADOPT=trusted-proxies` lets a proxy choose the id: a peer `AKAN_TRUSTED_PROXIES` names by address, by CIDR or with `private`. Loopback and the private ranges count only when the list spells them, and `*` does not. Turn it on only when that proxy overwrites or strips `traceparent` and `x-request-id` on every request.
|
|
401
|
+
- `SignalFailure.answer(error, extra)` builds the response `SignalContext.try` answers with, for a transport that catches a failure itself. The OpenAPI error schema lists `traceId`.
|
|
402
|
+
|
|
403
|
+
**Upgrading.** A trace id is now 32 lower-case hex digits (`0af7651916cd43dd8448eb211c80319c`) in place of `mdx3k2a1-4f9z0q`; a log query, a dashboard or a test that matched the old shape needs the new one. With no setting, the id on a response is always the server's own. A client that sent its own `x-request-id` and read it back from logs now finds it as `link`, stored in lower case without dashes (`0AF76519-16CD-43DD-8448-EB211C80319C` becomes `0af7651916cd43dd8448eb211c80319c`); `akan logs --trace` and `.trace` accept it as it was sent. A proxy in front that should choose the id needs `AKAN_TRACE_ADOPT=trusted-proxies` and its address in `AKAN_TRUSTED_PROXIES`. `AKAN_BENCH_SKIP_REQUEST_ID` is gone.
|
|
404
|
+
|
|
405
|
+
- 4225827: A request's id follows it through every process and call it starts, so one search finds all of it.
|
|
406
|
+
|
|
407
|
+
- A page view is one id in the gateway, the replica and the RSC worker: the render message carries the request's `traceparent`, and the worker's `page:` trace and log records take it.
|
|
408
|
+
- A `fetch` call a server makes, while rendering or inside an endpoint, sends `traceparent` to this app's own server and to the server a `clone({ origin })` or a `FetchPolicy.origin` names. No other header is added, and calls made through `RemoteFetch` send none.
|
|
409
|
+
- Every frame of a websocket runs under the id of its handshake, each as a span of its own, and a refused frame names that id as `traceId`.
|
|
410
|
+
- A queued job runs as a trace of its own and names the call that enqueued it as `link` on its request line. The id travels as `traceLink` in the job's options (`AkanJobOptions.traceLink`), which the framework sets.
|
|
411
|
+
|
|
412
|
+
**Upgrading.** Nothing to change. A server that receives another akan server's calls keeps their `traceparent` as `link` on its own id, unless it runs with `AKAN_TRACE_ADOPT=trusted-proxies` and lists the caller's address in `AKAN_TRUSTED_PROXIES`.
|
|
413
|
+
|
|
414
|
+
- fb5e77e: The route caches key a page on the locale it resolved to, not on the `Accept-Language` it was asked in, and on its query sorted and without tracking parameters.
|
|
415
|
+
|
|
416
|
+
- The RSC and HTML result caches keyed every page on the request's raw `Accept-Language` as well as on the locale the locale proxy resolved from its path, so each set of browser languages kept its own copy of a page that renders the same for all of them. Only the resolved locale is in the key now, and visitors who ask for one locale's page in different languages share its entry. A page that reads the header with `headers()` is still rendered for each request and never stored.
|
|
417
|
+
- The key took the query exactly as requested, so `?b=2&a=1` and `?a=1&b=2`, or a link carrying `utm_source` or `gclid`, each rendered and stored their own copy. The key now takes the query sorted by name, as the URL standard parses it (a repeated name keeps its values in order), without the tracking parameters in `AKAN_ROUTE_CACHE_TRACKING_PARAMS`: by default `utm_*`, `gclid`, `gclsrc`, `dclid`, `gbraid`, `wbraid`, `fbclid`, `msclkid`, `twclid`, `ttclid`, `li_fat_id`, `igshid`, `yclid`, `mc_cid`, `mc_eid`, `_ga` and `_gl`. Set it to comma-separated names (a trailing `*` matches a prefix, `default` adds the built-in list) or to `off`.
|
|
418
|
+
- A page shares an entry across queries only when every level of its route declares what it reads with `.search()`. A page or layout with `.config({ canonicalQuery: false })`, one that declares a tracking parameter, and a legacy default-function page keep one entry per query as requested. A page keyed on the sorted query is rendered with that URL, whether the cache stores it or not: its `.search()` values are the request's, while a guard's `request.path`, `usePathCtx().location` and the router state carry the sorted query until the first client navigation, and `usePageLocation()` carries it until the URL's query moves, so the browser hydrates the query the server rendered. `window.location` keeps every parameter.
|
|
419
|
+
- Each process now counts its route cache lookups: the RSC cache in the render worker and the HTML cache in the web server, as hits and misses by whether the route's key took the query as requested or sorted and without tracking parameters, and as bypasses by why the request skipped the cache (an environment opt-out, the dev default, a zero TTL, an excluded path, a request that is not public, a dev registry or no matching route). The RSC count covers full-page lookups, not partial-commit patches.
|
|
420
|
+
|
|
421
|
+
**Upgrading.** Nothing changes for a page that reads `Accept-Language` with `headers()`. One that reads it through `untrackedHeaders()` or `headers({ trackDynamic: false })`, which skip the tracking that keeps a render out of the caches, now gets another language's stored copy: read it with `headers()` instead. A `page()` or `layout()` whose server render reads the query outside `.search()`, or reads a tracking parameter it does not declare, through `untrackedRequest()` for instance, now gets another query's stored copy: declare the parameter with `.search()` or set `.config({ canonicalQuery: false })` on it.
|
|
422
|
+
|
|
423
|
+
The sorted URL is what such a page renders with in every mode, not only when it is stored: in dev, with `AKAN_RSC_RESULT_CACHE=0` or `AKAN_HTML_RESULT_CACHE=0`, and for a request with cookies that skips the cache. Where a page needs the query as it was asked:
|
|
424
|
+
|
|
425
|
+
- A guard's `request.path` no longer carries tracking parameters or the order they came in, so a redirect such as `/login?next=${request.path}` drops `utm_*` on the way: declare each parameter it must pass on with `.search()`, which keys the route on its query as requested, or set `.config({ canonicalQuery: false })` on the route.
|
|
426
|
+
- On the client, `usePathCtx().location` and the router state keep the sorted query without tracking parameters until the first navigation, and `usePageLocation()` until the URL's query moves: declare the parameter with `.search()` or set `canonicalQuery: false` on the route, or read `window.location` in an effect, after hydration.
|
|
427
|
+
|
|
428
|
+
- bfa67d8: The descriptions of API endpoints leave the dictionary file every page loads, and load only on a page that shows them.
|
|
429
|
+
|
|
430
|
+
- `akan build` and the development server write two files per language under `/_akan/dict`: the page dictionary, without the `.desc` and `.arg` texts of each `signal` entry, and an API file holding exactly those. The page file names the API file in an exported `parts` map. The endpoint labels stay in the page file.
|
|
431
|
+
- Each `Signal` component of `akanjs/ui` that shows an endpoint's description or argument texts, `Signal.Arg.Table` rendered on its own included, loads the API file before it shows them: a server-rendered page preloads it and carries its texts in the HTML, and a client navigation into such a page waits for it. A page showing no description never requests it. A file that fails to load is retried once; after a second failure the page shows without descriptions and logs the error, and the next navigation tries again.
|
|
432
|
+
- The server, MCP, the API and schema reference routes and a CSR build keep the whole dictionary.
|
|
433
|
+
- `TranslatorState` merges the files of a language into its dictionary, each file once. A language switch keeps each language's merged files to that language, and a file arriving after its language moved to another build is dropped. A page dictionary asked for before another of the same language but answering after it no longer replaces the newer one.
|
|
434
|
+
- `akan build` prints one line per language with the brotli size of each file: `Dictionary en: 4.9KB brotli on every page, API descriptions 836B where shown`.
|
|
435
|
+
- `DictionaryAssetBuilder.build` in `@akanjs/devkit` takes an option `{ splitApi }`.
|
|
436
|
+
|
|
437
|
+
**Upgrading.**
|
|
438
|
+
|
|
439
|
+
A `"use client"` component of your own that writes an endpoint's description or argument key out (`l("<module>.signal.<endpoint>.desc")`) brings the API file to its route. What happens to one that builds the key from data is in the upgrade note of the entry that makes every app load per route.
|
|
440
|
+
|
|
441
|
+
- 6f8f6aa: A page loads the dictionary texts it can show rather than every module's.
|
|
442
|
+
|
|
443
|
+
- **What a route can show.** `akan build` and the development server read the keys each route's client modules name: a written key, a template whose module name is written, and a key picked from literal values or property names of an object in the same file, from a typed union, or from a template type with a written module name. To those they add the models, scalars and enums whose labels and options the framework's lists, views, forms and remove dialogs build at run time, reached through the module pieces the route loads, and `base`. A route that hands the translator on or keeps it in a variable, or has a key the build cannot follow, such as one read from data, loads the whole page dictionary, and `akan build` warns with its file, line and reason. A route that renders a `Signal` or `Constant` component loads the whole page dictionary too, and so does a route that keeps the whole client runtime, whose files `akan quality runtime` names. Server components need nothing: their texts arrive rendered.
|
|
444
|
+
- **Files.** Each language's dictionary is packed into files by module, sized on the default language, so that a route loads at most four of them besides the API description file. Each file is written to `/_akan/dict` with the table naming the file of every module. A route whose client components name an endpoint's description or argument key loads the API description file with them.
|
|
445
|
+
- **Loading.** A server-rendered page preloads its route's files and merges them before hydration; a client navigation merges the next route's files before the new page commits; a language switch loads that language's files. Each file is requested once per language, and a file that fails is tried again.
|
|
446
|
+
- **Safety net.** A key of a module the route's files leave out loads that module's file, and the page renders again once it merges, so the key shows only until then. A toast from `msg`, an action error or an agent message waits for its text rather than showing the key. Development logs the first such key of each module once; production never throws.
|
|
447
|
+
- **Development.** `akan start` writes one file per module and loads what each route's build counted, so saving a `*.dictionary.ts` file updates the page as in production. The save restarts the backend, and a page open meanwhile now takes the new texts without a reload: `RenderState.dictionaryStamp` names the dictionary files the backend serves, and the development socket's greeting carries it. A route's modules are read when it builds, so a key added to a client file and saved shows as the key, with that log, until the route builds again.
|
|
448
|
+
- **Unchanged.** The server, MCP and the single-file CSR build that native apps load keep the whole dictionary inline.
|
|
449
|
+
- **Size.** In the framework's sample apps, the English dictionary a first visit downloads drops from 4.9 KB (brotli) to 2.5 KB on the median route of `minimal`, and from 5.0 KB to 4.0 KB on `akan`, in one request on the median route and at most two. The loader adds about 1.4 KB to every route's JavaScript.
|
|
450
|
+
- `akan build` prints one line per language: `Dictionary en: first visit 2.5KB / 2.5KB / 3.0KB brotli on the lightest / median / largest route (whole 5.0KB), API descriptions 846B where shown`.
|
|
451
|
+
- `Translator.ready(lang, key)` answers `null` when the key's module is loaded, or a promise settling once it is. `DictionaryAssetBuilder.buildAll` in `@akanjs/devkit` takes `{ routes, everyGroupAlone }` beside `{ splitApi }`.
|
|
452
|
+
|
|
453
|
+
**Upgrading.**
|
|
454
|
+
|
|
455
|
+
A client component whose key the build cannot follow makes its route load the whole dictionary, and `akan build` names it: writing the key out, or picking it from an object or union in the same file, lets the route load only its own files. A text shown outside React is covered in the upgrade note of the entry that makes every app load per route.
|
|
456
|
+
|
|
457
|
+
- ee302c4: A page loads less of the framework's own UI code: the icons its files name rather than whole `react-icons` sets, no agent library unless it has an agent, no spring library for a dialog, and the gesture library only when a sheet is first pressed. This applies to every app; what a page shows and how it behaves do not change.
|
|
458
|
+
|
|
459
|
+
- **Icons.** A production browser build rewrites each named import from a `react-icons/<set>` package to a module written to the app's `.akan/generated/react-icons`, and each icon lives in exactly one such module: the naming file's own when one file names it, the app's shared module for that set when only the app's files name it, or the set's module shared with the workspace's libs and the framework when one of them names it too. A page loads each icon it uses once, and can carry the other icons of a shared module it touches, never more of a set than the whole set held. A name the set does not define as a plain icon, a namespace or default import, and a re-export keep the set. The server bundle keeps the set, and both draw the same markup. The development server already loaded icons per file.
|
|
460
|
+
- **Agent.** A server-rendered page no longer loads `use-agentic` for its page gate, so a page without an agent ships only the part of it that `akanjs/store` uses. `Agent.Chat`, `useAgent` and `SessionContext` work as before.
|
|
461
|
+
- **Dialog.** `Dialog.LegacyModal` loads the first time it renders, behind its own Suspense boundary, so `<Dialog>`, `Dialog.Modal` and `Modal` no longer load it or `@react-spring/web`. `Dialog.LegacyModal` remains a member of `Dialog`.
|
|
462
|
+
- **Drag to dismiss.** `BottomSheet`, `Dialog.Modal` and `Dialog.LegacyModal` load `@use-gesture/react` on the first press of their drag handle; the events that arrive while it loads are replayed into it, so the first drag, its flick speed and a tap land as a later one does.
|
|
463
|
+
- **Field.** `Field.Text` and `Field.TextArea` are memoized in their own file, so `Field`'s file only gathers its members: a page that names `Field.Text` loads that kind's file and not every kind, and a server component that names only members can render it. In a CSR bundle `Field` stays one client module, as before.
|
|
464
|
+
|
|
465
|
+
**Upgrading.**
|
|
466
|
+
|
|
467
|
+
Nothing to do, with one change in timing: `Dialog.LegacyModal`, and the top-level `LegacyModal` that renders through it, load in a chunk of their own, with `@react-spring/web`, the first time they render. A legacy modal mounted only when it opens therefore shows its first open one chunk load later; it then springs in from transparent as a later open does, nothing is drawn in its place meanwhile, and the open is not lost. A test that expects its content in the first render must wait for it.
|
|
468
|
+
|
|
469
|
+
- 31097f2: Under `AKAN_MEMORY_LOG=1`, the RSC worker's metrics name the routes whose first render grew it most.
|
|
470
|
+
|
|
471
|
+
- `rscFirstRenderMemory` on `AkanMetricsReport`, served in `/_akan/app/metrics` beside the last render's fields, lists for each route what its first render in this worker added to `rss`, `heapUsed`, `external` and `arrayBuffers`, with the modules that render loaded. Largest RSS growth comes first, and at most 20 routes are kept. Renders running at the same time land in the same delta, so read it on a quiet replica.
|
|
472
|
+
- With `AKAN_MEMORY_LOG` off, a render pays one check and the field is absent. With it on, a route's first render reads process memory twice. The list lasts for the worker's life, through a pages reload.
|
|
473
|
+
|
|
474
|
+
**Upgrading.** Nothing to change. Code that copies every `AkanMetricsReport` field into a metrics backend gets one more field, an array, and only under `AKAN_MEMORY_LOG=1`.
|
|
475
|
+
|
|
476
|
+
- 6e5da23: `akan build` no longer puts the secret values of `env/env.server.<env>.ts` into the server it builds. The server reads each one from an environment variable when it starts, and says at boot which ones its deployment has not set.
|
|
477
|
+
|
|
478
|
+
- **What counts as a secret.** A string under a secret-sounding key (password, secret, token, apiKey, privateKey, accessKey, webhook, …), at any depth below it, or a URL with a password in it. It is the rule a desktop profile build already applies and the logger masks by, now also for a key named `aesKey`. Numbers, booleans, `null` and every other string stay in the build as before.
|
|
479
|
+
- **Where it is read from.** A variable named after the value's place in the env file, one upper snake case segment per key joined with `__`: `security.sso.google.clientSecret` is read from `SECURITY__SSO__GOOGLE__CLIENT_SECRET`. An array holding a secret is read whole from one variable holding JSON (`discord.tokens` from `DISCORD__TOKENS`). Four settings keep the names the framework already reads: `security.jwtSecret` is `JWT_SECRET`, and `database.postgres.url`, `.password` and `.insightUrl` are `POSTGRES_URL` (or `POSTGRES_URI`), `POSTGRES_PASSWORD` and `POSTGRES_INSIGHT_URL`. In `process.env.MY_VAR ?? "literal"` only the literal is replaced, so your own variable still comes first.
|
|
480
|
+
- **What the build writes.** `akan.env.json` and the Dockerfile gain `AKAN_ENV_NAMES`, the names the server reads (never a value), and the build prints them.
|
|
481
|
+
- **`akan secret-env <app> [--env <env>]`** lists each variable, its kind, its key in the env file and whether the shell sets it. With `--out <file>` it writes the values from the env file: `--format k8s` (the default) a Kubernetes Secret named by `--name` (default `<app>-env`), `--format dotenv` `NAME=value` lines that Bun's loader reads back unchanged. The file is readable by its user alone; a path under `dist/`, a path git would track, and an existing file without `--force` are refused.
|
|
482
|
+
- **At boot** (`AkanApp.start`, before the server is loaded or a replica is spawned) a variable that is not set is one warning naming every such variable. The framework does not stop for them, though whatever reads a value may, as a missing `JWT_SECRET` does. A JSON variable that does not parse is refused with the code `secretEnvInvalid`. A multi-line value that arrives with a backslash and an n in place of its line breaks is warned about by name.
|
|
483
|
+
- **What stops a build.** A secret-named key whose value the env file computes or imports rather than writes as a string stops the build before it writes anything, whatever the value's length, naming the app, the env file and the keys. After the bundles are written, the build looks in them for each secret string it left out: a long mixed one that another key of the env, the app's code or a copied file holds as well stops the build by its keys, and a short or plain one is a warning. No message prints a value.
|
|
484
|
+
- **Your own `process.env` reads stay yours.** A secret-named key the env file reads from `process.env.<NAME>` itself is left as that read: the build does not move it, does not stop at it, and writes no value of it, whether or not the build's shell sets the variable.
|
|
485
|
+
- **How the build finds the secrets.** It loads the env file, first with none of the shell's variables, so the list is the same from any shell, and with them when the file cannot load without (`process.env.HOSTS!.split(",")`). A file that loads neither way stops the build with the error's class and its file and line, never its message. Loading has a 60 second limit.
|
|
486
|
+
- **Unchanged:** your env files, `akan start`, `akan test`, `--profile` builds, and desktop and mobile builds, whose carried server still bundles its env file as written.
|
|
487
|
+
|
|
488
|
+
**Upgrading.** This changes how every app deploys. Before you deploy an image built with this version:
|
|
489
|
+
|
|
490
|
+
1. Run `akan secret-env <app> --env <env>` for each app and environment you deploy. It lists the variables the server now expects. It prints names, never values.
|
|
491
|
+
2. Give the server those variables.
|
|
492
|
+
- Kubernetes: `akan secret-env <app> --env <env> --format k8s --name <secret-name> --out <file>`, `kubectl apply -f <file>` in the app's namespace, reference the Secret from the container with `envFrom: [{ secretRef: { name: <secret-name> } }]`, then delete the file.
|
|
493
|
+
- Docker: `docker run -e NAME=value …`. `docker run --env-file` takes each line as written, so of a `--format dotenv` file it reads the values written without quotes and no quoted or multi-line one: pass those with `-e`.
|
|
494
|
+
- `bun main.js` on a host: `bun --env-file=<file> main.js` with the dotenv file, or set the variables in the service's environment. Keep the file outside `dist/apps/<app>`, which the image copies whole.
|
|
495
|
+
- Another platform: set them in its secret settings.
|
|
496
|
+
3. Deploy. At start the server logs one warning naming any variable it is missing. The framework does not stop for it, though whatever reads the value may. Version 3.5.0 will refuse to start instead.
|
|
497
|
+
4. When the new images are live, rotate those secrets and delete the old image tags. Images built before this version still contain the values.
|
|
498
|
+
5. If you cannot change your deployment yet, build with `akan build <app> --inline-secrets`. The image then carries the values as before, and a variable you set still wins. When the env file cannot be loaded, this build warns and bundles the env files as written, reading no variable. Version 3.5.0 removes the flag.
|
|
499
|
+
6. If a build stops with "holds … this build cannot leave out", each named key is computed or imported in the env file. Write the string at the key, or write `process.env.<NAME>` there and set that variable in the deployment.
|
|
500
|
+
7. If a build stops with "holds secret values the server reads from its process env", a secret string is also somewhere the build keeps as written: the plain key the message names, the app's code, or a copied file. Take it out there, or read it there from the same variable.
|
|
501
|
+
8. If a build stops with "could not be evaluated to check it for secrets", the env file throws at the named line when it is loaded. Set the variable it reads there in the build's shell, or give it a fallback.
|
|
502
|
+
9. If a build stops at a key "a build would read from the environment variable …", two keys map to one variable name, or the name is one the platform or akan owns (`PWD`, `HOSTNAME`, `AKAN_*`, …). Rename the key, or write `process.env.<NAME>` there yourself.
|
|
503
|
+
|
|
504
|
+
A key file an env value points at by path (an Apple sign-in key under `private/`) is not an env value and still ships in the image: mount it instead. A key the rule does not recognise (`stripeKey`, a `salt`) stays in the build; write `process.env.<NAME>` for it.
|
|
505
|
+
|
|
506
|
+
- 48d33a7: Every HTML response now sends `Content-Security-Policy-Report-Only` with a `script-src` that names each script the framework writes, so the browser reports any other inline script a page runs. 3.5.0 will enforce the same policy.
|
|
507
|
+
|
|
508
|
+
- A server-rendered page sends `script-src 'self' 'nonce-…' 'sha256-…' 'strict-dynamic'`: the hashes name the document's bootstrap script, its flush call and the build's import map, and the nonce the scripts React writes to reveal a streamed boundary. A page replayed from the HTML cache carries no nonce and lists the hash of each of those scripts instead; a response names at most 32 hashes, which keeps the header under 2 KB (a proxy in front reads a response's headers into one buffer, 4 KB in nginx unless configured), so a page whose replay would need more is rendered each time, answers `X-Akan-Cache: BYPASS` with `X-Akan-Cache-Reason: script-hashes`, counts under that reason in `akan_route_cache_lookups_total` and is warned about once per route. `akan start` adds `'unsafe-eval'` and runs its dev scripts under the nonce.
|
|
509
|
+
- The document's per-request values (route state, dictionary URL, import map key, API and WebSocket prefixes) and its Flight chunks are now `<script type="application/json">` blocks that the static bootstrap script reads, where they used to be script text. The bootstrap script is the first element of `<head>`, and the client entry module is added by that script once the document ends, where it used to be a `<script type="module">` tag.
|
|
510
|
+
- The CSR document, the system pages, Akan Studio, the gateway's status page and the OAuth error page send the header too, each naming its own script by hash. The OAuth error page now also carries the headers every other HTML page has (`Content-Security-Policy: frame-ancestors 'self'; base-uri 'self'`, `X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`).
|
|
511
|
+
- `scriptHashes("sha256-…")` and `scriptNonce()` from `akanjs/client` let a `.head()` name its own inline script: by hash for a constant snippet, which keeps the page cacheable, or by the response's nonce, which makes the page dynamic. Hashes a page declares past the 32 a response names are left out, with one warning per route.
|
|
512
|
+
- `AKAN_CONTENT_SECURITY_POLICY_SCRIPT_SRC` adds source expressions to every response's `script-src`, such as `'wasm-unsafe-eval'` for a page that compiles WebAssembly or the hash of a snippet every page carries.
|
|
513
|
+
- `AKAN_CONTENT_SECURITY_POLICY_REPORT_ONLY=off` drops the header, and any other value is sent in its place as written. `AKAN_CONTENT_SECURITY_POLICY_REPORT_URI` adds `report-uri` and `report-to` with a `Reporting-Endpoints` header. `AKAN_CONTENT_SECURITY_POLICY` works as before and does not change the report-only header.
|
|
514
|
+
|
|
515
|
+
**Upgrading.** The header only reports in 3.4; what changes for a page is its source and when `load` fires, both below. Load your pages with the browser console open. For each `[Report Only]` line about an inline script of your own, either call `scriptHashes()` in that page's or layout's `.head()` with the hash the line prints, or pass `nonce={scriptNonce()}` to the `<script>`; a `<script src>` written in JSX needs the nonce. Move an `onclick="…"` attribute or a `javascript:` URL into a component's handler. A page that compiles WebAssembly is reported as `wasm-eval`: set `AKAN_CONTENT_SECURITY_POLICY_SCRIPT_SRC="'wasm-unsafe-eval'"`. In the page source, the route state, the dictionary URL and each Flight chunk are now `<script type="application/json">` blocks, and the markup has no `<script type="module">` tag for the client entry: code or a test that read `self.__RSC_PUSH__(…)` text or looked for that tag finds neither. Because the bootstrap script adds the entry module, `DOMContentLoaded` and `load` no longer wait for it and can fire before any client code runs (on a cached docs page, `load` at 31 ms and the entry at 63 ms). A `load` or `DOMContentLoaded` listener that client code adds without checking `document.readyState` may never be called:
|
|
516
|
+
|
|
517
|
+
```ts
|
|
518
|
+
if (document.readyState === "complete") onLoad();
|
|
519
|
+
else window.addEventListener("load", onLoad, { once: true });
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
(`document.readyState !== "loading"` for `DOMContentLoaded`.) A browser test that clicks or types as soon as navigation reports `load` can meet a page that has not hydrated: wait for something only the hydrated page does, such as the result of the action under a retrying assertion or a marker a client component sets in an effect, instead of `load`. If a proxy or CDN in front of the app sets its own `Content-Security-Policy-Report-Only`, set `AKAN_CONTENT_SECURITY_POLICY_REPORT_ONLY=off` or let the app's header through.
|
|
523
|
+
|
|
524
|
+
- f4b5aa6: A page switched in place (a tab, any move with `transition: "none"`) is now drawn before it shows, and an Android app's back button closes an open dialog before it leaves the page.
|
|
525
|
+
|
|
526
|
+
A page that draws later (an async render, or a guard on it or on a layout above it) used to swap in at once and show its loading fallbacks, so every tab switch flashed a shell. Such a page is now mounted out of sight and takes the screen once its layers are drawn, or after 300ms with whatever it has, so a slow page still answers the tap. A page that draws in the commit it mounts in, and one the stack already holds (a tab kept by `cache`, the page under the current one), switch at once as before. The page left under the current one stays asleep through that wait, so its effects do not run again for a page nobody sees.
|
|
527
|
+
|
|
528
|
+
Android's back button and back swipe now close the newest open surface (a modal, a sheet, a confirm) and only leave the page once none is open: Escape and back share the one stack `useEscapeKey` registers on. `useEscapeKey(active, onEscape, { back: false })` keeps the back button for the page, which `Tooltip` uses: a tap focuses a button on Android, so its tooltip would otherwise swallow the next back press. The third argument is optional, so no upgrade step is needed.
|
|
529
|
+
|
|
530
|
+
- 4225827: A trace's spans say where they ran and when, database calls are spans of their own, and a developer can read a call's timing from the response.
|
|
531
|
+
|
|
532
|
+
- `SpanRecord` gains `id`, `parentId`, `startMs` and optional `attrs` beside `name` and `durationMs`. The call's own span is `total`, with the trace's `spanId` as its id and its caller's span as its parent; it is recorded even when the call ran past the 64-span limit.
|
|
533
|
+
- Under `AKAN_TRACE=1` every database call is a span named `db:<model>.<op>` with `attrs: { model, op }`, where `op` is the store operation (`find`, `count`, `updateMany`, ...). No statement and no value is recorded. The metrics document lists them per endpoint with the other spans.
|
|
534
|
+
- A signal's HTTP response carries `Server-Timing` in a local runtime, and anywhere else only for a request whose `x-akan-debug` matches `AKAN_LOG_DEBUG_HEADER`. Such a request also records its spans for that one call, without `AKAN_TRACE`, so the header reads `total;dur=12.4, guards;dur=0.3, handler;dur=11.2, db;desc="memo.find";dur=9.8`.
|
|
535
|
+
|
|
536
|
+
**Upgrading.** Code that builds a `SpanRecord` itself, or compares `trace.spans` with `toEqual`, needs the new fields; reading `name` and `durationMs` is unchanged. `trace.endpoints[].spans` in `/_akan/app/metrics` gains one `db:<model>.<op>` entry per model and operation an endpoint used while `AKAN_TRACE=1`.
|
|
537
|
+
|
|
15
538
|
### Patch Changes
|
|
16
539
|
|
|
17
540
|
- c44d068: A coding agent reads less to build its first app: the `akanjs` README keeps the path to a first app and links the rest on akanjs.com (17 KB to 7 KB), the `akan-page` and `akan-service` skills ship the API reference one section at a time with every entry named in the skill's index (`Link` now lists the anchor attributes it takes and `Link.Back`, `Link.Close` and `Link.Lang`), the `akan-page` skill holds what a first page looks up while `pageRule` keeps the deeper contract, and each rule is stated once across AGENTS.md, the path rules and the skills. Run `akan agent install` in a workspace to pick up the new files.
|
|
541
|
+
- 43b44ca: An Android app's page now meets the keyboard the way the iOS app's does: the keys rise over the page and only what the page moves rides up with them. In keyboard mode "none" (what akan apps ship) the Android WebView still heard of the keyboard through the window insets, shrank its visual viewport to the space above the keys and panned the whole page so the focused field showed, which lifted a chat composer far above the keys, dragged whatever sat under it (a tab bar's room) up too, and slid the top of the page under the status bar. The Android shell now hands the WebView its insets with the keyboard taken out in "none" (and its animation callbacks too), keeps the bottom safe area while the keys are up, reports the keys' whole overlap with the screen as the iOS shell does, and tells the page through `__AKAN_NATIVE__.keyboardAvoidance = "page"`. Under such a shell the frame ends the content at the keys and `KeyboardRide` carries what is marked `data-akan-keyboard-ride` with them, on the duration the shell reports and Android's IME curve (`ANDROID_KEYBOARD_ANIMATION_EASING`, added to `akanjs/client`). A page under an older shell, which still pans, keeps today's behavior; an Android app gets the new behavior once it is built with this shell.
|
|
542
|
+
- 6443972: `AppWorker.spawn` runs the worker when the server itself was started as `bun -e <code>`: under `akan start`, and in a backend a gateway starts.
|
|
543
|
+
|
|
544
|
+
Such a server handed its own start code on to the worker's command, so the child ran the server's code again with the worker file as an argument, exited with 1 and was started again every second: the worker never ran, and the log showed `[Worker:<name>] WARN exited 1; restarting in 1000ms` over and over. A server started from its file (`bun main.js` with no backends of its own) was not affected. The same command builds the `ops snapshot` and `ops migrate` children, which now leave the start code out as well.
|
|
545
|
+
|
|
546
|
+
- f678e80: The `akanjs` package no longer ships `ARCHITECTURE.md`. The map of the framework's processes and messages is for contributors and stays in the repository (`pkgs/akanjs/ARCHITECTURE.md`); a coding agent building an app read its 11.9 KB from the unpacked package before scaffolding. Verifying a built `akanjs` dist now fails if the file is back in it.
|
|
547
|
+
- cda53a8: fix(signal): a bare value for an array argument is refused over HTTP and WebSocket
|
|
548
|
+
|
|
549
|
+
An endpoint declaring `tags: [String]` and sent `"a"` handed its handler the string `"a"` where it expects a list: the
|
|
550
|
+
primitive parser read the lone value as one item and returned it unwrapped. It now answers 400 `invalidArgument`,
|
|
551
|
+
as a model argument and a filter already did. A repeated query string (`?tags=a`) is always read as a list, so
|
|
552
|
+
`fetch` and the generated client are unaffected; a hand-written body must send `["a"]`. MCP still lifts a lone value
|
|
553
|
+
into a one-item list, since models send a bare value for an array.
|
|
554
|
+
|
|
555
|
+
- af09c4f: `router.backOrFallback()` and `Link.Back` with a `fallback` close a browser tab the app itself opened instead of replacing to the fallback, when there is nothing to go back to. The tab counts as opened by the app when it holds one history entry and has an opener or a same-origin referrer, so a `window.open(href, "_blank", "noopener")` or `target="_blank"` link qualifies. A tab the person opened (a bookmark, a typed URL), one another site opened, and an iOS, Android or desktop shell keep going to the fallback, as does a tab the browser refuses to close.
|
|
18
556
|
- 24315d1: A page asks for its stylesheet before its client chunks. The preload tags for the chunks a page's first screen imports are written at the end of `<head>` instead of at its top, so the stylesheet link comes first; the bootstrap module, the dictionary and the import map stay at the top. On a throttled mobile connection (Lighthouse's slow 4G applied in the browser, over HTTP/2) a 56-chunk page first paints about 160 ms sooner (1.83 s to 1.67 s), and a page whose largest element is a small image shows it about 140 ms sooner; a large image still shares the connection with the chunks and arrives when it did. Every chunk still starts loading with the document, so the page hydrates when it did.
|
|
557
|
+
- 7c4143e: `akanjs/client` exports `nativeKeyboardEasing()`, the curve the keyboard of the shell a page runs in moves on: Android's (`ANDROID_KEYBOARD_ANIMATION_EASING`) in an Android app, iOS's (`IOS_KEYBOARD_ANIMATION_EASING`) anywhere else. `KeyboardRide` already used it; with the name on the barrel, a page's browser code holds the device and keyboard files once, where a build would otherwise have shipped them in two bundles.
|
|
558
|
+
- 55d1518: A production build of a workspace with several libs loads its client modules in order, and a page that needs every module weighs what it weighed before.
|
|
559
|
+
|
|
560
|
+
- Each generated piece exports a name, and a module that needs the piece imports that name and hands it to `loadedAfter` from `akanjs/base`. A piece imported only for its effect could end up in a chunk the importer's chunk did not load first; a store or an endpoint was then read before it existed.
|
|
561
|
+
- A store file, and every file a store file imports, loads no store piece. The stores its code names are loaded by each file outside that imports it or names its store, so no store file is defined through a piece that imports it back. Where the importing file is one the build leaves as written (it holds a macro import, or lies outside `apps/` and `libs/`), the page keeps the whole runtime.
|
|
562
|
+
- A store spreading a value into the object it gives its own `this.set` (`this.set({ ...patch })`) no longer counts as picking a name at run time. A value or a function handed over whole (`this.set(patch)`, `this.set(update)`) still does, since an updater may read any module's state. `fetch.ws`, `fetch.http`, `fetch.origin`, `fetch.jwt`, `fetch.logger`, `fetch.setJwt`, `fetch.setTimeout`, `fetch.connect`, `fetch.connectOnUse`, `fetch.disconnect` and `fetch.configureWs` are the fetch client's own members, not endpoint names.
|
|
563
|
+
- A client entry that reaches a file needing every module keeps the whole runtime, as does an entry held only by pages with such an entry, and one naming a module that more such pages hold than other pages. Their files are left as written, so the page loads the code it loaded before.
|
|
564
|
+
- `akan build` checks its output before it serves it: every chunk holding a module that needs a piece reaches the chunk holding that piece, no store file sits in an import cycle with a piece, and no entry built to load pieces reaches a file needing every module. On a failure the build warns once with the two source files named, builds every page on the whole runtime instead and succeeds; the warning is a bug in akan to report. The development server serves each module on its own and checks nothing, so the production build is the guard.
|
|
565
|
+
- `akan quality runtime` adds a note, `akan.runtime.framework-marker`, per file that brings a framework component reading models by name (`Field`'s relation fields, `Load`, `Model`, `Data`, `Signal`, `Constant.Doc`) onto a page: the imports from that file to the component, and the pages that load the whole runtime through it.
|
|
566
|
+
|
|
567
|
+
Nothing to do. A file outside every app and lib that imports a `lib/__client/` piece by hand should import the piece's exported name and pass it to `loadedAfter`; the build's check names it otherwise.
|
|
568
|
+
|
|
569
|
+
- 0a2f6dd: `akan sync` also writes each app's and lib's client runtime as one generated piece per module under `lib/__client/`, ready for a later release that loads a model's endpoint descriptors and store only on the routes that use them. Nothing imports the pieces yet: `lib/useClient.ts`, `lib/st.ts` and `lib/usePage.ts` are unchanged, and every route loads exactly what it loaded before.
|
|
570
|
+
|
|
571
|
+
- `<module>.fetch.ts` applies that module's endpoint descriptors onto the tab's fetch client, after the same module's piece of each lib it extends; `_base.fetch.ts` applies the descriptors every scope inherits from `akanjs/signal` itself.
|
|
572
|
+
- `<module>.st.ts` registers and builds that module's store alone, after the extended lib store's own piece.
|
|
573
|
+
- `_useClient.ts` imports every fetch piece of the scope and its libs and exports what `lib/useClient.ts` exports; `_st.ts` imports every store piece and exports `st`, `RootStore` and each store, as `lib/st.ts` does.
|
|
574
|
+
- `lib/sig.ts` exports one more build-time macro, `getSerializedSignalOf(name)`, which answers the descriptors one module brings, or with `"base"` the ones from `akanjs/signal`.
|
|
575
|
+
- `lib/__lib/lib.store.ts` imports each extended lib store from its own file instead of the lib's `client` barrel, and registers it when the lib's runtime has not yet, so an app store file imported on its own still has the lib store's actions.
|
|
576
|
+
- A server render reads a fetch piece's descriptors from the live server signal, as it does for `lib/useClient.ts`.
|
|
577
|
+
- `akan sync` removes the pieces of a module that was deleted or renamed.
|
|
578
|
+
- Adding a store root to a running store does work in proportion to the keys that root brings, not to every key already in the store, so building one root per module stays linear. A computed key that a later root adds now starts from the state as it is, so with a lib store's `count: 1` in place, an app store overriding `count: 10` and adding `tripled = computed(["count"], …)` starts at `tripled: 3` rather than 30.
|
|
579
|
+
- `lib/__client/` is listed with the other generated files: in the agent guide, the agent hook that stops hand edits, the Biome overrides, the code graph, and the `.gitignore` of a new workspace.
|
|
580
|
+
|
|
581
|
+
**Upgrading.**
|
|
582
|
+
|
|
583
|
+
Nothing to change in app code. The `.gitignore` lines for the new files are in the upgrade note of the entry that makes every app load per route.
|
|
584
|
+
|
|
585
|
+
- b5b4834: The development server now loads what a production page loads, so a page that works in development works the same once built.
|
|
586
|
+
|
|
587
|
+
- A server-rendered page in development takes the descriptors and stores of only the modules its client code names, from the same `lib/__client/` pieces a route build uses, and imports from `akanjs/ui` narrow as they do in a build. The tab keeps one store, and each piece loads once.
|
|
588
|
+
- Saving a store, signal or constant file rereads which module declares each name and recompiles the files whose names moved to another module. A store save that adds an action replaces that store's actions and keeps its state, without reloading the page.
|
|
589
|
+
- Saving a lib's store file or store piece runs the app's piece of that module and the app's assembled store again after it, and the app's store of that model too when it extends the lib's, so a lib store the app extends keeps the app's actions.
|
|
590
|
+
- A component saved to name another module loads that module's piece without reloading the page; a file saved to pick a name at run time loads the whole runtime.
|
|
591
|
+
- An app whose `lib/__client/` files, or a mounted lib's, are missing, or whose modules cannot be read, loads the whole runtime in development as a build does. The development server says which once, names the sync to run, and loads per module again on the next save after that sync, with no restart.
|
|
592
|
+
- Reading a store key the page has not loaded fails with the name of the module whose store declares it, and says to name the key in the file that reads it or import `st` from the app's `client` barrel there. The list of each store's keys behind that message exists only in development: a production bundle carries neither the list nor the message.
|
|
593
|
+
|
|
594
|
+
- 170fa28: A page downloads the framework's `akanjs/client` code once. A production build used to bundle the `akanjs/client` files that the framework's UI imports by path into the page's own chunks, beside the copy the page's server-rendering client already loaded, so a page ran two copies of them, each with its own state (`Device.instance` among it). Both now come from one browser entry for `akanjs/client`, which, like the other framework entries, holds only the names the app uses. This applies to a page loading per module and to one keeping the whole runtime alike; what a page shows and how it behaves do not change.
|
|
595
|
+
|
|
596
|
+
- **Size.** In the framework's own sample apps each route loads 9 to 17 KB (brotli) less when it loads per module and 9 to 50 KB less when it loads every module. A page loading per module can make one more request, for the `akanjs/client` entry; a page loading every module makes the same number or fewer.
|
|
597
|
+
- **Which files.** A file comes from the entry when the `akanjs/client` barrel re-exports all of it under its own names, whether the importer names `akanjs/client`, a path into it, a relative path, or a path through a linked `akanjs` install. A file the barrel leaves out or renames, such as `akanjs/client/native`, any dynamic `import()`, and a file of another framework entry imported by its path stay in the page's chunks. The native bridge behind `akanjs/client/native` is therefore still written into both builds, because the entry's `Device` and `storage` import it lazily, but only the CSR shell loads it.
|
|
598
|
+
- **Development.** `akan start` serves those files from its whole `akanjs/client` entry as well, so a development page runs one copy of the client's state; a few stateless helpers the framework's UI imports by path (`cn` among them) still load beside it from the development module registry.
|
|
599
|
+
- **Unchanged.** The single-file CSR build that native apps load and MCP App views carry one copy, as before.
|
|
600
|
+
|
|
601
|
+
Nothing to do. A workspace on an older `akanjs` without the `akanjs/client` entry builds as it did.
|
|
602
|
+
|
|
19
603
|
- bf582c1: A page stored in the HTML cache is kept as the bytes it streamed, instead of being decoded to text and encoded again before compression. Storing a 600 KB page takes about a fifth of the main-thread time it did, and the stored page and every response from it are unchanged.
|
|
604
|
+
- 8bbe7c8: Every response from `/_akan/image` carries `X-Content-Type-Options: nosniff`, `Referrer-Policy` and a sandboxing `Content-Security-Policy` (`script-src 'none'; frame-src 'none'; sandbox;`), and an image response carries `Content-Disposition: attachment` named after its source file. An SVG an app allows with `dangerouslyAllowSVG` still shows in an `<img>`, and runs no script when its URL is opened on its own.
|
|
605
|
+
|
|
606
|
+
**Upgrading.** Opening an optimized image's URL directly in a browser tab now downloads it instead of showing it; images in pages, CSS and `srcset` are unchanged. A cached passthrough image of type heic, ico, icns, bmp, jxl or tiff is now stored under its own extension instead of `.jpg`, so each one is fetched once more and its old cache file is left behind.
|
|
607
|
+
|
|
608
|
+
- 2030f6c: `Input` (and `Field.Text` over it) drops its invalid message when the value is emptied, as `Input.TextArea`, `Input.Password` and `Input.Email` already did. A form the store cleared after a successful submit kept showing the length message of the value typed before.
|
|
609
|
+
- 1a225e8: A chat list under an iOS overlay (`data-akan-keyboard-ride="inset"`) now slides down with the keys instead of dropping at once when they go down. Once the keys were up the list held its rise as bottom padding, so its box reached past what it showed by that padding; on the way down `KeyboardRide` read the box's bottom as where the list was drawn, found no distance to travel, and the list fell into place in one frame. The rise each inset rider took is now remembered and subtracted, so the list starts from where it was drawn.
|
|
610
|
+
- e9598f3: Under an iOS shell that leaves the keyboard to the page, the page box now starts moving with the keys on their first frame. It followed a store update and React's render of the frame, which on a phone started the move about 100 ms after the keys, then jumped to catch up. `Device` now sets `--akan-keyboard-cover`, `--akan-keyboard-duration`, `--akan-keyboard-easing` and `data-akan-keyboard` on the root in the shell's keyboard event itself, and the page box's height and bottom padding follow `--akan-keyboard-cover` in CSS, so the transition starts before any render. `isPageKeyboardAvoidance` and `IOS_KEYBOARD_ANIMATION_EASING` now come from `akanjs/client` too.
|
|
611
|
+
- 1885caf: A chat screen in an iOS app can now keep the whole screen while the keys are up, as a native chat does, so its tab bar and background stay drawn under the glass keyboard instead of the page ending at the keys. When the focused field sits inside an element marked `data-akan-keyboard-overlay`, `KeyboardRide` leaves the page box whole: the riders (`data-akan-keyboard-ride`) go where the shorter box would have put them and stay there, and a rider marked `data-akan-keyboard-ride="inset"` (a list's content) trades its lift for bottom padding once the keys are up, so the list still scrolls to its top. The root carries `data-akan-keyboard-overlay` meanwhile. Every other field keeps the page box ending at the keys, so a form field elsewhere is never left under them.
|
|
612
|
+
- 45e3ffa: Under an iOS shell that leaves the keyboard to the page, the page now follows the keys without laying out on every frame. #715 animated the page box's `height`, which re-laid the page out on each frame of the keys' move and dropped frames on a phone, more so under glass (backdrop-filter) surfaces. `KeyboardRide` now changes the box once and carries whatever the page marks `data-akan-keyboard-ride` (a chat's list content, its composer) there as a `transform`, which WebKit hands to Core Animation: keys coming up hold the old box until they are up, since the shorter box would clip a rider still on its way, and keys going down give the taller box at once while the riders start from where they were drawn. A scroller resting at its end stays there. `data-akan-keyboard` on the root follows the keys at once, for what moves with them by transform or opacity; `data-akan-keyboard-layout` and `--akan-keyboard-cover` follow the box, for what changes layout. A page with no rider still gets the box in one step.
|
|
20
613
|
- c10f7cf: A loader sends its store at most 500 distinct keys per query and splits a larger batch into several queries that run together. A `load<Model>Many` or a nested list with more ids than a database takes in one statement now loads instead of failing: Postgres refused more than 65,534 values, and SQLite refused a `byQuery` batch of about 1,000 keys.
|
|
21
614
|
- c10f7cf: A loader asks its store for each key once per batch: loads of the same key in one batch share one lookup, and each caller still gets its own document wherever the loader has `copy`, as every model and declared loader does. A `new DataLoader(...)` without `copy` now hands the callers of a repeated key one result object, where a batch function that built a fresh object per position gave each its own: pass `copy` to keep them apart. A batch function that throws, or resolves to something that is not an array, now rejects its callers instead of leaving them waiting.
|
|
615
|
+
- 10641a0: `agentService.loop` keeps fewer tools in a long run's requests. A compaction closes each toolkit from `toolkits` that the messages it keeps neither opened nor called a tool of, and the model opens it again with `openToolkit` when it needs it. Remotes stay open. `compact.at` now counts the round's tools, instructions and context along with the transcript, so a run with a large tool list compacts before the provider refuses the request, not after. An opened toolkit's tools are listed after every tool already listed, in the order the toolkits were opened, so opening one leaves the start of the tool list unchanged.
|
|
22
616
|
- 045699c: The `create-akan-workspace` README shows how to run it on a host with only Node and npm (`npx -y bun@1.4.4 x create-akan-workspace@latest`) and the `npm run build` / `npm start` scripts it then writes, and `akanjs`, `@akanjs/cli` and `create-akan-workspace` each carry a one-line `description`, so `npm view` says what the package is and how to start.
|
|
23
617
|
- 5c7e083: Every page of a list is read with one SQL text: the page offset is a bound parameter, so paging no longer adds a prepared statement per page to the SQLite statement cache or to each Postgres connection. On Postgres a list of two or more values (`q.oneOf`, `q.notOneOf`, a raw table's `$in` and `$nin`) is bound as one array, so its length adds no prepared statement either, and a list past the 65,534 parameters one statement may bind is now read. An insight is read in one statement instead of one per field, so its counts and sums come from one snapshot and, with six fields, in about a third of the time.
|
|
24
618
|
- aead1aa: A page render no longer sends the whole client manifest to the RSC worker with every request. The worker process receives a manifest once and each render names it by revision, which takes a burst of cached pages from about 38 ms to about 7 ms at the median on the docs app.
|
|
@@ -29,8 +623,17 @@
|
|
|
29
623
|
|
|
30
624
|
The server still fails a render whose stream it has 256 messages of undrained, and since a message now holds up to 32 KB that is about 8 MB of a streamed page where it was about 1 MB; a cached page arrives as one message, so it is never counted.
|
|
31
625
|
|
|
626
|
+
- 040c561: Two cases where a room id did not match the arguments it was built from are fixed.
|
|
627
|
+
|
|
628
|
+
- A publish to a pubsub room whose required `String` argument is `""` now reaches its subscribers. The publisher's side spelled that argument as "no value" while the subscriber had joined with the empty string, so the message went to a room nobody was in. The publisher now reads each argument with the argument's own nullability, the way the client serializes it and the server parses it.
|
|
629
|
+
- An own `__proto__` key in an `Any` room argument or in a live query is part of the room id. It used to be dropped, so two subscriptions whose arguments differed only by that key shared a room.
|
|
630
|
+
|
|
32
631
|
- 5c6d039: A precompressed `.br` or `.gz` asset is now streamed from disk instead of being read whole and copied on every request, which cuts the server CPU per asset request to about a quarter. In production the answer of whether a sidecar exists is remembered per path.
|
|
33
632
|
An existing zero-byte `.br` or `.gz` sibling is skipped, because an empty body is not valid brotli or gzip.
|
|
633
|
+
- b30db27: A signal test's fetch opens its socket at the first subscribe or message, so a pubsub test needs no clone.
|
|
634
|
+
|
|
635
|
+
`getOrSetupSignalTestFetch()` handed back a fetch whose socket was never opened: `fetch.subscribe<Event>(…)` on it heard nothing and warned `WebSocket is not connected. Call fetch.instance.connect()…`, and the way through was `fetch.clone({ connect: true })`. The test fetch now connects on first use, as a page's does, and the socket is closed when the test context ends. A test that never subscribes or sends a message opens no socket, as before.
|
|
636
|
+
|
|
34
637
|
- 0492e0b: The SQLite cache sweeps expired entries through an index on their expiry, a thousand at a time with a pause between, so a large backlog no longer stalls the server for hundreds of milliseconds, and `hkeys` and `hentries` no longer run a sweep on every call. They skip expired fields themselves, so they return the same fields as before. The index is built once, at the first start after upgrading.
|
|
35
638
|
- 0492e0b: On the SQLite cache, a value or hash field written by another process is no longer removed by a `get` or `hget` that saw the key's previous, expired entry.
|
|
36
639
|
- 5c7e083: On SQLite a read, count or write by a list of ids (`q.oneOf` on `id`, which is how a batched load by id reads) goes through the primary key. A model with an index that leads with `removedAt` had a list of five or more ids read every live row instead: at 20,000 rows a load of five ids took about 6 ms and now takes about 0.03 ms.
|
|
@@ -38,6 +641,18 @@
|
|
|
38
641
|
|
|
39
642
|
The port now answers from the start of the build. A request to `localhost` or an IP address, page or API, waits for the first artifact; a build longer than the 15 s the gateway holds a request ends the wait with a 503 "Backend is starting" page that reloads itself. A request to one of the app's own domains (a custom local domain) gets that 503 at once until the backend is ready, because the build has not written the app's hosts yet; after that it is served as before, and any other Host is refused as before.
|
|
40
643
|
|
|
644
|
+
- 05ef91f: The database statement metrics no longer freeze the server at 100% CPU. One statement sent by a seventeenth endpoint when no untraced call had sent it before, or a ninth text of one query shape in local dev's plan check, made the counter call itself with the same arguments forever, with no error or log. Senders past sixteen are counted in one `other` slot and texts past eight share one plan, as intended.
|
|
645
|
+
- 8720b88: `st.do.<action>` and a generated `st.do.set<Key>` stay the same function when a later store root repeats their store, so a component that holds one in an effect's dependency array no longer reruns that effect once when, for example, a lib's root and then the app's root are built. An action whose method changed, as after an edit under hot reload, is still replaced, and a later root's `static silent` still quiets an action an earlier root built. A `set<Key>` action a store declares itself also stays in place when a later root that does not declare it is added, where it was replaced by a plain setter of the same name.
|
|
646
|
+
|
|
647
|
+
In development (`NODE_ENV=development`, as under `akan start`), `st.use`, `st.do` and `st.slice` throw on a key no loaded store declares, naming it (`st.do.initMemo is not registered: …`), where they answered `undefined` and the call failed later with `… is not a function`. `in`, `Object.keys` and a symbol key still answer as before, and a production build and a test run are unchanged.
|
|
648
|
+
|
|
649
|
+
- 8f9d432: A page no longer shows a broken character where React's output buffer ends. React writes a page's HTML in 4 KB pieces cut by bytes; when the piece that carried the document's head ended inside a character of more than one byte (Korean, Japanese, an accented letter, an emoji), that character arrived as replacement marks and a stray one closed the document. It depended on where the text fell, so the same page could be right on one request and wrong on the next.
|
|
650
|
+
- fb46b5d: Three malformed requests now get the refusal a well-formed mistake gets, instead of a 500 or a stray answer.
|
|
651
|
+
|
|
652
|
+
- A WebSocket frame whose `key` names a member of `Object.prototype` (`constructor`, `toString`, `valueOf`, `hasOwnProperty`, `__proto__`) answers 404 `routeNotFound`, like any other unregistered key. It used to find that member in the route table and answer 500 with an error log line, `{}` or `"[object Undefined]"`.
|
|
653
|
+
- A WebSocket frame whose `data` is not an array answers 400 `invalidMessage`. A missing or `null` `data` used to answer 500 with an error log line, and a string had its characters read as the arguments.
|
|
654
|
+
- An MCP `POST` whose JSON body is `null` answers 400 with a JSON-RPC `invalidRequest` error instead of throwing.
|
|
655
|
+
|
|
41
656
|
## 3.2.0
|
|
42
657
|
|
|
43
658
|
### Minor Changes
|