akanjs 3.3.0-rc.2 → 3.3.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +3 -2
- package/CHANGELOG.md +391 -23
- package/CONTRIBUTING.md +2 -2
- package/README.ko.md +40 -296
- package/README.md +41 -297
- 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 +17 -0
- package/client/device.ts +43 -3
- package/client/frameConfig.ts +27 -6
- package/client/index.ts +12 -6
- package/client/keyboardRide.ts +124 -0
- package/client/router.ts +6 -3
- package/client/rscNavigation.ts +0 -7
- package/client/scriptPolicy.ts +14 -0
- 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/constant/index.ts +0 -1
- package/constant/types.ts +0 -2
- package/document/documentSchema.ts +0 -3
- package/document/filterMeta.ts +3 -16
- package/fetch/client/fetchClient.ts +8 -17
- package/fetch/client/httpClient.ts +22 -12
- package/fetch/client/wsClient.ts +10 -6
- package/fetch/requestStorage.ts +30 -0
- package/index.ts +8 -0
- package/package.json +263 -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/assetHeaders.ts +8 -3
- package/server/cachePolicy.ts +2 -1
- package/server/clientErrorReport.ts +191 -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/csrDevShell.ts +7 -4
- package/server/htmlResultCache.ts +81 -14
- package/server/imageOptimizer.ts +44 -12
- package/server/index.ts +2 -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/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 +20 -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/reportText.ts +27 -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 +34 -11
- 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 +13 -0
- package/server/routing/soloAppRoutes.ts +14 -1
- package/server/rscClient.tsx +6 -1
- package/server/rscClientChunks.ts +8 -1
- package/server/rscClientErrorSender.ts +77 -0
- package/server/rscClientErrors.ts +26 -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/serverConfig.ts +11 -0
- package/server/serverMetrics.ts +34 -1
- package/server/sitemap.ts +0 -5
- package/server/ssrFromRscRenderer.tsx +32 -204
- package/server/ssrInlineScripts.ts +195 -0
- package/server/ssrTypes.ts +15 -2
- package/server/systemPageDocument.tsx +6 -2
- package/server/systemPages.tsx +9 -4
- package/server/webCsrSurface.ts +55 -21
- package/server/webDocumentRoute.ts +47 -21
- package/server/webRouteContext.ts +25 -8
- package/server/webRouter.ts +15 -12
- package/server/webRscRoute.ts +18 -14
- 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 +24 -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/signalContext.ts +15 -22
- package/signal/spanExport.ts +137 -0
- package/signal/trace.ts +168 -37
- package/store/agent/AgentBridge.ts +6 -2
- package/store/agent/AgentContext.ts +81 -14
- package/store/agent/AgentInline.ts +72 -0
- package/store/agent/StoreSurfaceSource.ts +2 -1
- package/store/baseSt.ts +0 -6
- package/store/index.ts +1 -3
- package/store/stateBuilder.ts +1 -6
- 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 +20 -0
- package/types/client/device.d.ts +8 -0
- package/types/client/frameConfig.d.ts +1 -3
- package/types/client/index.d.ts +7 -7
- package/types/client/keyboardRide.d.ts +16 -0
- package/types/client/rscNavigation.d.ts +0 -10
- package/types/client/scriptPolicy.d.ts +4 -0
- 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 +1 -4
- package/types/fetch/client/httpClient.d.ts +2 -5
- package/types/fetch/client/wsClient.d.ts +3 -3
- package/types/fetch/requestStorage.d.ts +9 -0
- package/types/index.d.ts +12 -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/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/htmlResultCache.d.ts +13 -3
- package/types/server/index.d.ts +4 -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 +5 -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/reportText.d.ts +4 -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/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 +2 -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/rscClientErrorSender.d.ts +8 -0
- 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/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 +39 -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/webRouteContext.d.ts +7 -4
- 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 +17 -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/agent/AgentBridge.d.ts +1 -0
- package/types/store/agent/AgentContext.d.ts +6 -2
- package/types/store/agent/AgentInline.d.ts +16 -0
- 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/ui/Link/Action.d.ts +2 -1
- package/types/ui/Reference/origin.d.ts +0 -2
- package/types/ui/System/Common.d.ts +1 -1
- 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 +5 -0
- 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 +8 -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/index.d.ts +1 -1
- package/types/webkit/nativeNavigation.d.ts +2 -2
- package/types/webkit/nativeSplash.d.ts +6 -0
- package/types/webkit/openSurfaces.d.ts +13 -0
- package/types/webkit/useCsrKeyboard.d.ts +2 -1
- package/types/webkit/useCsrNavigation.d.ts +1 -1
- package/types/webkit/useEscapeKey.d.ts +7 -2
- package/types/webkit/useFrameRuntime.d.ts +6 -2
- package/types/webkit/usePageLocation.d.ts +3 -1
- package/types/webkit/useVisualViewportFrame.d.ts +2 -0
- package/ui/Dialog/Modal.tsx +16 -2
- package/ui/KeyboardAvoiding.tsx +2 -1
- package/ui/Layout/FrameSlotPortal.tsx +10 -3
- package/ui/Link/Action.tsx +2 -1
- package/ui/Reference/origin.ts +0 -10
- package/ui/System/CSR.tsx +33 -13
- package/ui/System/Common.tsx +8 -2
- package/ui/System/SSR.tsx +7 -4
- package/ui/Tooltip.tsx +1 -1
- package/ui/styles.css +14 -0
- package/vendor/@akanjs/native/CHANGELOG.md +20 -52
- 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/native/ios/Sources/AkanNativeViewController.swift +21 -2
- 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 +6 -0
- 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 +9 -59
- 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 +8 -0
- package/webkit/CsrStack.ts +17 -9
- package/webkit/McpAppAgent.ts +3 -1
- 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/index.ts +1 -1
- package/webkit/nativeNavigation.ts +12 -3
- package/webkit/nativeSplash.ts +30 -0
- package/webkit/openSurfaces.ts +54 -0
- package/webkit/useCsrKeyboard.ts +33 -1
- package/webkit/useCsrNavigation.ts +69 -21
- package/webkit/useCsrTransitions.ts +130 -29
- package/webkit/useCsrValues.ts +17 -5
- package/webkit/useEscapeKey.tsx +10 -23
- package/webkit/useFrameRuntime.ts +55 -6
- package/webkit/usePageLocation.ts +8 -2
- package/webkit/useVisualViewportFrame.tsx +24 -0
- 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
|
@@ -4,62 +4,30 @@
|
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- 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.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
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.
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
- **Akan Graph and Akan Studio.** `get_graph` (MCP) returns the Akan Graph, read from source with no dev server: models, scalars, slices, endpoints with guards, services, jobs, adaptors, routes, layouts, the framework itself, and the Change Map for `since: <revision>`. `akan start` serves Studio at `/_akan/studio`, and it opens from the CLI and the editor.
|
|
13
|
-
- **Editor support.** `@akanjs/language` resolves names Akan.js derives (`fetch.initMemoInPublic`, `st.do.setNameOnMemo`, `this.memoService.listByName`) and ships `akan-language-server`. The VS Code / Cursor extension opens a module side by side, runs `akan verify` and workflows, and publishes from CI to the VS Marketplace and Open VSX.
|
|
14
|
-
- **Secure defaults.** Signals, websocket rooms, MCP, OAuth, the agent relay, the server edge, the ops channel, native builds, `akan code`, the CLI's tunnels and workflows, and the in-page agent each take the narrower default. Every change names how to get the old behaviour back.
|
|
15
|
-
- **Faster pages.** Every SSR page loads 72K less framework JS (22K less Brotli); client modules preload from `<head>`; Link prefetch; Flight rows share inline scripts; one preloaded font face per family; faster RSC decoding and store writes; a route JS budget (`akan build --check-budget`).
|
|
16
|
-
- **Realtime.** Per-socket, per-caller and per-model room limits, subscribe budgets, gateway subscribe acks, per-model live-sync routing, Redis room sharding, resync after a Redis outage, and an outbox limit for a down socket.
|
|
17
|
-
- **Native.** `external-view` on Linux (Wayland and X11) with `sendKey`; Android 12 launch crash fixed; AppImage relaunch; tighter CSP, external-link, temp-folder and update defaults.
|
|
11
|
+
**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:
|
|
18
12
|
|
|
19
|
-
|
|
13
|
+
```ts
|
|
14
|
+
native: {
|
|
15
|
+
plugins: ["external-view"],
|
|
16
|
+
desktop: {
|
|
17
|
+
externalView: {
|
|
18
|
+
allowOrigins: ["https://board.example"], // every origin a view's allowOrigins names
|
|
19
|
+
evaluate: true, // when it calls evaluate or opens with initScript
|
|
20
|
+
sendKey: true, // when it calls sendKey
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
```
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
- **`Err`.** Every `Err` is one class, `Err` from `akanjs/common`, and an `AkanError`. `err.code` is always set (a generalized failure's code, else its status's code), so `{ ...err }` now holds it. `Err.NotFound.is(error)` also requires status 404. Check across a page bundle and the framework with `Err.is`, not `instanceof`. `setErrorConstructor`, `HttpClientOptions.ErrorCls` and `FetchClient.build`'s `Err` option are deprecated.
|
|
23
|
-
- **Coded failures.** The signal, service, server, route-tree, RSC and client facets throw coded `AkanError`s instead of a bare `Error`; messages and statuses are unchanged. A production 500 shows the status reason and code only. `bun run error:codes` lists the codes. A failed tool call and a failed agent turn carry a `code`.
|
|
24
|
-
- **Log levels.** A failure under 500 logs at `warn`, a 5xx is one `error` record with `type` and `stack`, a declared error, a 429 and a by-id read of a missing id log at `debug`, and a crashed RSC worker logs at `warn`. Alerts and `--level error` filters see fewer lines. A page `redirect()` is `ok` at `info` with its 3xx status, and `notFound()` is `warn` with 404. Every log record reaches ndjson stdout, and a request line is never folded.
|
|
25
|
-
- **Loaders.** A loader no longer shares a batch between a transaction and the requests outside it, and each caller gets its own document. A loader that keeps its keys forgets them when the model is written; a write by query clears every kept key of the model, and `cache: true` keeps the 10,000 most recent keys. A custom `DatabaseAdaptor` can implement `transactionKey()`; a `batchScheduleFn` must run its callback in the caller's async context.
|
|
26
|
-
- **SQLite.** Work outside an open `this.transaction()` no longer sees its uncommitted rows, on `:memory:` or a non-WAL file either. `SqliteDatabase.getMeta` and `listMeta` return promises, so await them. A reader pays one database copy per transaction on `:memory:`; past a few tens of megabytes, put the database in a file.
|
|
27
|
-
- **Indexes.** A boot keeps an index the release no longer declares and warns about it. After every instance runs this release, run `akan migrate <app> prune-indexes` once. `migrationActions` gains `indexes` and `prune-indexes`, so code that switches over every action needs the two cases.
|
|
28
|
-
- **Websockets.** A socket holds at most 256 rooms, a caller 2,000 per process, a model 50,000 evaluated live rooms; a subscribe past a limit gets a 429 frame coded `liveRoomLimit`. Subscribes are budgeted at 1,000 a minute per socket and 10,000 per caller. A `pubsub` room's `onResync` also runs after Redis returns; a custom `WebsocketAdaptor.onRecovered` handler now takes the held rooms. A down socket keeps at most 100 emits.
|
|
29
|
-
- **Gateway.** `/_akan/app/ready` answers 503 while no replica's RSC worker can render. A subscribe is acknowledged once the gateway routes the room.
|
|
30
|
-
- **CLI.** A CLI whose major.minor differs from the workspace's `akanjs` refuses every command that writes, with exit 2; run `akan update`, or set `AKAN_ALLOW_VERSION_MISMATCH=1`. Exit codes: 2 for usage and unknown targets, 3 for failed checks (`verify`, `typecheck`), 130 for an interrupted prompt; a script that tested for exit 1 tests for non-zero. With `--json`, a failure ends stdout with `{"ok":false,"error":"<message>","code":"<code>"}`. `akan doctor` exits 1 on `"status": "failed"`; `akan workflow plan`, `apply` and `validate` exit non-zero on failure. A shell `AKAN_PUBLIC_ENV` now outranks the workspace `.env`, and `akan build --env <env>` builds another environment.
|
|
31
|
-
- **Package budget.** `akan lint` and `akan verify` hold each package under `pkgs/` to the file, function and class budget. Run `akan quality baseline` once in a workspace whose packages are over it. `akan verify` also typechecks every app and lib that uses a changed lib.
|
|
32
|
-
- **Secure defaults.**
|
|
33
|
-
- Write tools in the in-page agent confirm by default (`submit`, `create`, `update`, `send`, `export` and the rest, not only `remove`); opt out with `{ confirm: false }`. Page text reaches the model fenced as data, and a transcript belongs to one account.
|
|
34
|
-
- A `FetchClient` sends its session token only to its own origin; pass `clone({ origin, jwt })` to send one elsewhere.
|
|
35
|
-
- A connection idle for 120 s closes (`AKAN_IDLE_TIMEOUT`), a body is capped at 128 MiB (`AKAN_MAX_UPLOAD_BODY`) and 16 MiB for a non-multipart one (`AKAN_MAX_REQUEST_BODY`), `akan start` binds 127.0.0.1 (`AKAN_LISTEN_HOST=*` restores it), and HTML carries `Cache-Control`, HSTS and a `frame-ancestors` policy.
|
|
36
|
-
- The dev server answers only `localhost`, `*.localhost` and IP hosts unless `AKAN_ALLOWED_HOSTS` is set.
|
|
37
|
-
- A 500 shows its message and stack only under `akan start`, `NODE_ENV` `development` or `test`, or `AKAN_ERROR_DETAIL=1`.
|
|
38
|
-
- `ops snapshot` outside local operation needs `AKAN_BACKUP_RECIPIENT` or `--allow-plaintext`; the ops key must differ from `AKAN_MACHINE_PUBLIC_KEY`.
|
|
39
|
-
- `/__rsc/manifest` is dev-only (`AKAN_EXPOSE_RSC_MANIFEST=1`), and health detail, metrics and devtools need a local dev runtime.
|
|
40
|
-
- Filter arguments are parsed against their declared type and an `Any` filter argument throws at declaration; `q.search()` text is capped at 32 terms and 1000 characters.
|
|
41
|
-
- The image optimizer refuses non-public remote hosts (`images.dangerouslyAllowLocalIP`).
|
|
42
|
-
- The CLI's tunnels listen on loopback and check the SSH host key, workflow commands run without a shell, `akan download-env` copies only env and secret files, a Dockerfile built with `AKAN_PUBLIC_ENV=local` needs `--build-arg AKAN_ALLOW_LOCAL_IMAGE=1`, and `akan code` asks before network access and trusts a repository's MCP servers and extensions only after one terminal approval.
|
|
43
|
-
- MCP rate-limits an unverified bearer by address, checks the browser Origin, and bounds client registration; the agent relay refuses a request past fixed limits with `agent.error.requestRefused` (413) unless a policy sets its own.
|
|
44
|
-
- Native builds ship a Content-Security-Policy, open only `https:`, `mailto:` and `tel:` links, and recheck a downloaded desktop update before installing it; `updates.windowsSigners` and `updates.expiresIn` are new.
|
|
45
|
-
- **UI.** `Field.Switch`'s on position is `primary` (pass `variant="accent"` for the old look), and two `Data.Item` status tags change color. `useCamera` and `useGeoLocation` no longer send the user to Settings after a denial. A page `.head()` can set `theme-color`, and a level that writes an image no longer inherits the image tags above it. `--akan-theme-color` drives the browser's `theme-color`.
|
|
46
|
-
- **Libraries.** The `shared` and `util` libraries `akan install-library` copies are refreshed; compare your copy. In `util`, `security` and `security.jwtSecret` are optional in `ModulesOptions`. `libs/shared` keeps its SSO and refresh cookies on `__Host-` names outside local.
|
|
47
|
-
- **Other.** `LLM` stream endings are read more completely: a cut tool call ends as `length`, and unparseable arguments in a finished answer get `argsError` and the code `invalidArgument`. `ConformanceEnv.has` fails instead of skipping when `AKAN_TEST_REQUIRE_BACKENDS=1`. A new workspace has no `patches/` folder, no `agent:sample:*` scripts and one `setup:agent` script; `create-akan-workspace` no longer hangs when `akan` is not on PATH.
|
|
26
|
+
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.
|
|
48
27
|
|
|
49
|
-
|
|
28
|
+
### Patch Changes
|
|
50
29
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **Data.** `create<Model>Many(rows)` runs every row through `_preCreate`, `_postCreate` and the document hooks; `bulkWrite` runs in one transaction; a cascade removes a long array's documents 200 ids at a time; `Binary` arguments are typed `Uint8Array<ArrayBuffer>`; a hidden `.optional()` field is optional in create inputs; store form setters and writes cost about one copy of the state; `onError` on store writes receives the failed request's dictionary error.
|
|
54
|
-
- **Server and ops.** `/_akan/app/ready`; `RestartSchedule` shared by every child-restart loop; a single-flight `cache` endpoint; stopped or failed starts tear down what they brought up; the Redis WebSocket adaptor shards channels per room and model and flushes publishes on shutdown; a log stream stops growing for a client that stops reading; missing assets answer `no-store`.
|
|
55
|
-
- **CLI.** `akan test --parallel=<n>`, `--junit <path>` and `--coverage`; `akan build --env`; a `rename-key` workflow; `akan remove-module pokedex:_billing` removes a service module; `akan create-workspace` works in an existing folder, without sample code, and without a git identity; `akan preview` opens `/_akan/studio`, `/openapi.json` and `/mcp` as written and restarts a dead browser; `akan verify` reports step durations and gives a dictionary hint for a missing key; commands without a terminal take the workspace's only app, lib or package, and remove commands never pick a target themselves; release candidates publish from CI with npm provenance.
|
|
56
|
-
- **Native.** `external-view` and `sendKey` on Linux; Android 12 and 12L launch fix; AppImage relaunch; a `single-instance` pipe that another account cannot own on Windows.
|
|
57
|
-
- **Types and styling.** A new app's default style is Pretendard with -3% letter spacing, even sizes from 12px, 150% line height for wrapping text and `leading-auto` for one line.
|
|
30
|
+
- 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.
|
|
31
|
+
- 3032627: An iOS app's page now meets the keyboard the way a native screen does: its content ends at the keys and moves with them, and a header stays where it is. In keyboard mode "none" (what akan apps ship) WKWebView still met the keyboard on its own, insetting its scroll view and panning the whole page until the focused field cleared the keys, so the header went off screen, the page showed under the status bar, and whatever the frame did for the keyboard came on top of the pan. The iOS shell now takes the keyboard notifications away from WKWebView in "none", as Capacitor's Keyboard plugin does, and tells the page through `__AKAN_NATIVE__.keyboardAvoidance = "page"`. Under such a shell the frame ends every page's content at the keys (not only a page with a keyboard accessory), drops the bottom safe area and inset the keys cover, animates on the duration the shell reports with UIKit's keyboard curve (`IOS_KEYBOARD_ANIMATION_EASING`), and scrolls a field the keys cover back into view; a dialog ends at the keys too, `useVisualViewportFrame` reports the keys from the shell, `KeyboardAvoiding` steps aside, and `--akan-keyboard-duration` / `--akan-keyboard-easing` plus `data-akan-keyboard` (while the keys are up) on the root let a page move its own parts with the keys. A page under an older shell, which still pans, keeps today's behavior.
|
|
58
32
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
- A dev page keeps its styles after a stylesheet change arrives with a pages rebuild; idle-suspended dev servers apply every save, stay awake when work arrives, and stop cleanly; `[BarrelAnalyzer] ERROR scan failed` is gone; a backend replica's builder answer no longer reaches its replacement.
|
|
62
|
-
- A page that renders a string of 1024 characters or more renders and hydrates whatever its lines say; a page cut off by a disconnected client, or one that streamed an error, is no longer cached; partial RSC commit (`AKAN_PUBLIC_RSC_PARTIAL_COMMIT=1`) patches real pages, replays patches from cache and cancels overtaken navigations.
|
|
63
|
-
- In production, a render error no longer reaches the browser as its message; reading the client address from a crafted forwarded header no longer stalls the server; `happy-dom` peers ask for `^21.0.4`; the pi agent packages move to 1.5.2, dropping undici and minimatch advisories.
|
|
64
|
-
- The build lock records its host and survives a dead remover, a Windows antivirus hold and a devcontainer; `akan` no longer rebuilds the dev CLI from a command it runs; the typecheck behind `akan verify` and `akan build` uses its incremental cache.
|
|
65
|
-
- Internal: the largest classes and methods in `akanjs`, `@akanjs/devkit` and `@akanjs/cli` are split by concern with unchanged public members, and the `akanjs` facets import sibling files instead of their own barrel and list every export by name.
|
|
33
|
+
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.
|
|
@@ -358,8 +358,9 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
358
358
|
// The shell's origin and engine: one value every origin comparison uses (`__AKAN_NATIVE__.origin`).
|
|
359
359
|
val version = JSONObject.quote(WebView.getCurrentWebViewPackage()?.versionName ?: "")
|
|
360
360
|
val engine = "window.__AKAN_NATIVE__.origin=\"${AkanNativeAssetServer.ORIGIN}\";window.__AKAN_NATIVE__.engine=\"android-webview\";window.__AKAN_NATIVE__.engineVersion=$version;\n"
|
|
361
|
+
val keyboard = if (imeResize) "" else "window.__AKAN_NATIVE__.keyboardAvoidance=\"page\";\n"
|
|
361
362
|
// A new document starts with the current safe area (N14); later changes are pushed.
|
|
362
|
-
return INIT_PREFIX + AkanNativeBridge.jsSafe(bootJson) + "," + AkanNativeBridge.jsSafe(env) + INIT_SUFFIX + engine + cssInsets(currentInsets)
|
|
363
|
+
return INIT_PREFIX + AkanNativeBridge.jsSafe(bootJson) + "," + AkanNativeBridge.jsSafe(env) + INIT_SUFFIX + engine + keyboard + cssInsets(currentInsets)
|
|
363
364
|
}
|
|
364
365
|
|
|
365
366
|
private fun readAsset(path: String): String = assets.open(path).bufferedReader().use { it.readText() }
|
|
@@ -605,8 +606,9 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
605
606
|
val m = if (Build.VERSION.SDK_INT >= 30) Api30.measure(insets) else legacyMeasure(insets)
|
|
606
607
|
val sys = m.bars
|
|
607
608
|
val density = resources.displayMetrics.density
|
|
608
|
-
// Keyboard height above the navigation bar, like react-native ReactRootView
|
|
609
|
-
|
|
609
|
+
// Keyboard height above the navigation bar, like react-native ReactRootView; a page that meets the keyboard
|
|
610
|
+
// itself spans the screen, so it gets the whole overlap, as on iOS.
|
|
611
|
+
val keyboard = if (!m.imeVisible) 0 else if (imeResize) maxOf(0, m.imeBottom - sys.bottom) else m.imeBottom
|
|
610
612
|
val next = AkanNativeInsets(sys.top / density, sys.right / density, sys.bottom / density, sys.left / density, m.imeVisible, keyboard / density)
|
|
611
613
|
if (next != currentInsets) {
|
|
612
614
|
val wasVisible = currentInsets.imeVisible
|
|
@@ -625,11 +627,13 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
625
627
|
// "Resize" keyboard mode: shrink the WebView container by the IME so fixed bottom UI stays
|
|
626
628
|
// visible (WebView ignores interactive-widget). Do not consume the insets (crbug 461332423).
|
|
627
629
|
view.setPadding(0, 0, 0, if (m.imeVisible && imeResize) m.imeBottom else 0)
|
|
628
|
-
|
|
629
|
-
|
|
630
|
+
// Keyboard mode "none": the WebView never hears of the keyboard, or it shrinks its visual viewport and pans the
|
|
631
|
+
// page to the focused field on top of what the page does (`keyboardAvoidance`).
|
|
632
|
+
val bars = Insets.of(sys.left, sys.top, sys.right, if (m.imeVisible && imeResize) 0 else sys.bottom)
|
|
633
|
+
if (Build.VERSION.SDK_INT >= 30) Api30.withBars(insets, bars, hidesIme = !imeResize)
|
|
630
634
|
else @Suppress("DEPRECATION") WindowInsets.Builder(insets).setSystemWindowInsets(bars).build()
|
|
631
635
|
}
|
|
632
|
-
if (Build.VERSION.SDK_INT >= 30) Api30.watchImeAnimation(root) { show, heightPx, duration, done ->
|
|
636
|
+
if (Build.VERSION.SDK_INT >= 30) Api30.watchImeAnimation(root, { !imeResize }) { show, heightPx, duration, done ->
|
|
633
637
|
val phase = if (done) (if (show) "didShow" else "didHide") else (if (show) "willShow" else "willHide")
|
|
634
638
|
keyboardTransition(phase, if (show) heightPx / resources.displayMetrics.density else 0f, duration)
|
|
635
639
|
}
|
|
@@ -658,9 +662,9 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
658
662
|
return Measured(bars, if (imeVisible) sw.bottom else 0, imeVisible)
|
|
659
663
|
}
|
|
660
664
|
|
|
661
|
-
/** The CSS variables for these insets, in CSS px; bottom is 0 while the keyboard shows (as WebView's env() does). */
|
|
665
|
+
/** The CSS variables for these insets, in CSS px; bottom is 0 while the keyboard shows over a resized WebView (as WebView's env() does). */
|
|
662
666
|
private fun cssInsets(i: AkanNativeInsets): String {
|
|
663
|
-
val bottom = if (i.imeVisible) 0f else i.bottom
|
|
667
|
+
val bottom = if (i.imeVisible && imeResize) 0f else i.bottom
|
|
664
668
|
return "document.documentElement&&(function(s){s.setProperty('--akan-native-safe-area-top','${i.top}px');" +
|
|
665
669
|
"s.setProperty('--akan-native-safe-area-right','${i.right}px');s.setProperty('--akan-native-safe-area-bottom','${bottom}px');" +
|
|
666
670
|
"s.setProperty('--akan-native-safe-area-left','${i.left}px')})(document.documentElement.style);\n"
|
|
@@ -947,19 +951,27 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
947
951
|
return Measured(insets.getInsets(bars), if (visible) insets.getInsets(ime).bottom else 0, visible)
|
|
948
952
|
}
|
|
949
953
|
|
|
950
|
-
fun withBars(insets: WindowInsets, value: Insets): WindowInsets =
|
|
954
|
+
fun withBars(insets: WindowInsets, value: Insets, hidesIme: Boolean): WindowInsets =
|
|
955
|
+
WindowInsets.Builder(insets).setInsets(bars, value).build().let { if (hidesIme) withoutIme(it) else it }
|
|
956
|
+
|
|
957
|
+
fun withoutIme(insets: WindowInsets): WindowInsets {
|
|
958
|
+
val ime = WindowInsets.Type.ime()
|
|
959
|
+
return WindowInsets.Builder(insets).setInsets(ime, Insets.NONE).setVisible(ime, false).build()
|
|
960
|
+
}
|
|
951
961
|
|
|
952
962
|
/**
|
|
953
963
|
* The IME's show and hide animations: [report] (show, height px above the bars once it ends,
|
|
954
|
-
* duration ms, ended) at the start and at the end. At the
|
|
955
|
-
* already the end state.
|
|
964
|
+
* or the whole overlap when [isPage], duration ms, ended) at the start and at the end. At the
|
|
965
|
+
* start the view's root insets are already the end state. With [isPage] the WebView's own
|
|
966
|
+
* animation callbacks see no IME either.
|
|
956
967
|
*/
|
|
957
|
-
fun watchImeAnimation(view: View, report: (Boolean, Float, Long, Boolean) -> Unit) {
|
|
968
|
+
fun watchImeAnimation(view: View, isPage: () -> Boolean, report: (Boolean, Float, Long, Boolean) -> Unit) {
|
|
958
969
|
val ime = WindowInsets.Type.ime()
|
|
959
970
|
fun target(): Pair<Boolean, Float> {
|
|
960
971
|
val insets = view.rootWindowInsets ?: return false to 0f
|
|
961
972
|
val show = insets.isVisible(ime)
|
|
962
|
-
val
|
|
973
|
+
val bottom = insets.getInsets(ime).bottom
|
|
974
|
+
val height = if (isPage()) bottom else maxOf(0, bottom - insets.getInsets(WindowInsets.Type.systemBars()).bottom)
|
|
963
975
|
return show to height.toFloat()
|
|
964
976
|
}
|
|
965
977
|
view.setWindowInsetsAnimationCallback(object : android.view.WindowInsetsAnimation.Callback(DISPATCH_MODE_CONTINUE_ON_SUBTREE) {
|
|
@@ -968,7 +980,8 @@ class AkanNativeActivity : Activity(), AkanNativePluginContext.Host {
|
|
|
968
980
|
return bounds
|
|
969
981
|
}
|
|
970
982
|
|
|
971
|
-
override fun onProgress(insets: WindowInsets, running: MutableList<android.view.WindowInsetsAnimation>): WindowInsets =
|
|
983
|
+
override fun onProgress(insets: WindowInsets, running: MutableList<android.view.WindowInsetsAnimation>): WindowInsets =
|
|
984
|
+
if (isPage()) withoutIme(insets) else insets
|
|
972
985
|
|
|
973
986
|
override fun onEnd(animation: android.view.WindowInsetsAnimation) {
|
|
974
987
|
if (animation.typeMask and ime != 0) target().let { (show, height) -> report(show, height, animation.durationMillis, true) }
|
|
@@ -14,6 +14,8 @@ crate-type = ["cdylib"]
|
|
|
14
14
|
wry = { version = "=0.57.0", default-features = false, features = ["devtools"] }
|
|
15
15
|
# tao defaults = rwh_06 + x11 + dbus. macOS needs only rwh_06 (wry uses raw-window-handle 0.6).
|
|
16
16
|
tao = { version = "=0.37.0", default-features = false, features = ["rwh_06"] }
|
|
17
|
+
# The WHATWG URL parser, already in the tao tree: an external view's origins compared as a browser reads them.
|
|
18
|
+
url = "2.5"
|
|
17
19
|
|
|
18
20
|
[target.'cfg(target_os = "macos")'.dependencies]
|
|
19
21
|
# Already in the wry/tao dependency tree; we only enable more features (menu, appearance, workspace,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
//! core/src/acl.ts as far as the
|
|
1
|
+
//! core/src/acl.ts as far as the shell needs it: the links it hands to the OS (vectors.rs runs the shared vectors on
|
|
2
|
+
//! them) and what an external view may be opened for and sent.
|
|
2
3
|
|
|
3
4
|
use crate::json::V;
|
|
4
5
|
|
|
@@ -65,24 +66,43 @@ impl Acl {
|
|
|
65
66
|
parsed().unwrap_or(Acl { grants: Vec::new(), denied: Vec::new() })
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
/// aclCheck: the grants that allow `item` of `plugin` in `window`, None when it is not allowed.
|
|
70
|
+
fn granted(&self, plugin: &str, item: &str, window: u32) -> Option<Vec<&Grant>> {
|
|
70
71
|
if self.denied.iter().any(|(p, items)| p == plugin && items.iter().any(|i| i == item)) {
|
|
71
|
-
return
|
|
72
|
+
return None;
|
|
72
73
|
}
|
|
73
74
|
let matching: Vec<&Grant> = self
|
|
74
75
|
.grants
|
|
75
76
|
.iter()
|
|
76
77
|
.filter(|g| g.plugin == plugin && g.items.as_ref().is_none_or(|i| i.iter().any(|x| x == item)) && g.windows.as_ref().is_none_or(|w| w.contains(&window)))
|
|
77
78
|
.collect();
|
|
78
|
-
|
|
79
|
+
(!matching.is_empty()).then_some(matching)
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
pub fn permits(&self, plugin: &str, item: &str, window: u32) -> bool {
|
|
83
|
+
self.granted(plugin, item, window).is_some()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/// aclCheck, then scopePermits: no deny entry matches, and the grants have no allow list or one of its entries matches.
|
|
87
|
+
pub fn scope_permits(&self, plugin: &str, item: &str, window: u32, matches: impl Fn(&[(String, String)], bool) -> bool) -> bool {
|
|
88
|
+
let Some(matching) = self.granted(plugin, item, window) else { return false };
|
|
89
|
+
if matching.iter().any(|g| g.deny.iter().any(|e| matches(e, true))) {
|
|
79
90
|
return false;
|
|
80
91
|
}
|
|
81
|
-
|
|
92
|
+
matching.iter().any(|g| g.allow.is_none()) || matching.iter().flat_map(|g| g.allow.iter().flatten()).any(|e| matches(e, false))
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/// scope_permits for a scope the app must list: a grant without an allow list, and an entry naming no field, give nothing.
|
|
96
|
+
pub fn scope_lists(&self, plugin: &str, item: &str, window: u32, matches: impl Fn(&[(String, String)], bool) -> bool) -> bool {
|
|
97
|
+
let Some(matching) = self.granted(plugin, item, window) else { return false };
|
|
82
98
|
if matching.iter().any(|g| g.deny.iter().any(|e| matches(e, true))) {
|
|
83
99
|
return false;
|
|
84
100
|
}
|
|
85
|
-
matching.iter().
|
|
101
|
+
matching.iter().flat_map(|g| g.allow.iter().flatten()).any(|e| !e.is_empty() && matches(e, false))
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
pub fn opener_permits(&self, url: &str, window: u32) -> bool {
|
|
105
|
+
self.scope_permits("opener", "openUrl", window, |e, deny| e.iter().all(|(field, pattern)| field == "url" && url_match(pattern, url, deny)))
|
|
86
106
|
}
|
|
87
107
|
}
|
|
88
108
|
|