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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AkanDynamicUsage, AkanRequestPolicy } from "akanjs/fetch";
|
|
2
|
+
import type { RouteCacheQueryForm } from "./routeCacheQuery.d.ts";
|
|
2
3
|
export declare const DEFAULT_ROUTE_CACHE_TTL_SECONDS = 30;
|
|
3
4
|
export interface RouteCacheKeyInput {
|
|
4
5
|
request: Request;
|
|
@@ -13,6 +14,7 @@ export interface RouteCacheRenderState {
|
|
|
13
14
|
tags?: string[];
|
|
14
15
|
dynamicUsage?: AkanDynamicUsage;
|
|
15
16
|
reason?: string;
|
|
17
|
+
queryForm?: RouteCacheQueryForm;
|
|
16
18
|
}
|
|
17
19
|
export interface RouteCacheMetadata {
|
|
18
20
|
pathname: string;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { HttpRoutes } from "./types.d.ts";
|
|
2
|
+
export interface ClientReportSetting {
|
|
3
|
+
/** The share of page views, from 0 to 1, whose browser sends its errors, drawn from the page view's request id. */
|
|
4
|
+
sampleRate?: number;
|
|
5
|
+
/** Requests one address, an IPv6 one counted as its /64, may send the route a minute. */
|
|
6
|
+
perAddress?: number;
|
|
7
|
+
/** Reports one server hands the reporter a minute from every address together. */
|
|
8
|
+
perServer?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class ClientErrorReport {
|
|
11
|
+
#private;
|
|
12
|
+
static readonly path = "/_akan/client-report";
|
|
13
|
+
static readonly timingName = "akan-report";
|
|
14
|
+
static readonly maxBodyBytes = 8192;
|
|
15
|
+
static readonly perPageView = 5;
|
|
16
|
+
static readonly fieldLimits: {
|
|
17
|
+
readonly name: 100;
|
|
18
|
+
readonly message: 1000;
|
|
19
|
+
readonly stack: 4000;
|
|
20
|
+
readonly userAgent: 300;
|
|
21
|
+
};
|
|
22
|
+
static configure(setting: ClientReportSetting | boolean): void;
|
|
23
|
+
static get enabled(): boolean;
|
|
24
|
+
static routes(): HttpRoutes;
|
|
25
|
+
static timingEntry(cacheControl: string | null, traceId?: string | undefined): string | null;
|
|
26
|
+
static handle(req: Request): Promise<Response>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class ClientReportId {
|
|
2
|
+
#private;
|
|
3
|
+
static readonly keyEnv = "AKAN_CLIENT_REPORT_KEY";
|
|
4
|
+
static readonly bucketMs: number;
|
|
5
|
+
static readonly minSecretLength = 32;
|
|
6
|
+
static operatorKey(): string | null;
|
|
7
|
+
static sign(traceId: string, now?: number): string;
|
|
8
|
+
static verify(value: unknown, now?: number): string | null;
|
|
9
|
+
}
|
|
@@ -2,7 +2,6 @@ import { type BaseEnv } from "akanjs/base";
|
|
|
2
2
|
import type { Adaptor, Service } from "akanjs/service";
|
|
3
3
|
import type { ServerSignal } from "akanjs/signal";
|
|
4
4
|
import type { AkanServer } from "./akanServer.d.ts";
|
|
5
|
-
import { type AkanConsoleCommand } from "./consoleSession.d.ts";
|
|
6
5
|
export { evaluateAkanConsoleInput, isAkanConsoleInputComplete } from "./consoleSession.d.ts";
|
|
7
6
|
export interface AkanConsoleOptions {
|
|
8
7
|
prompt?: string;
|
|
@@ -12,10 +11,6 @@ export interface AkanConsoleOptions {
|
|
|
12
11
|
/** Where the running server keeps `akan-control.sock`; the console is its own process and has to be told. */
|
|
13
12
|
runtimeDir?: string;
|
|
14
13
|
}
|
|
15
|
-
/** @internal `level=warn grep="payment failed" endpoint=mutation:*` → a query object the socket parses. */
|
|
16
|
-
export declare const parseAkanConsoleQuery: (args: string) => Record<string, string>;
|
|
17
|
-
/** @internal Attaches to the running server's control socket, not the console's own `listen: false` server. */
|
|
18
|
-
export declare const createAkanConsoleLogCommands: (appName: string, runtimeDir: string) => Record<string, AkanConsoleCommand>;
|
|
19
14
|
export interface AkanConsoleContext extends Record<string, unknown> {
|
|
20
15
|
server: AkanServer;
|
|
21
16
|
env: AkanServer["env"];
|
|
@@ -28,6 +23,4 @@ export interface AkanConsoleContext extends Record<string, unknown> {
|
|
|
28
23
|
}
|
|
29
24
|
export declare const assertAkanConsoleAllowed: (env?: Partial<Pick<BaseEnv, "environment" | "operationMode">>) => void;
|
|
30
25
|
export declare const getAkanConsoleMethods: (value: unknown) => string[];
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const createAkanConsoleContext: (server: AkanServer, globals?: Record<string, unknown>) => AkanConsoleContext;
|
|
33
26
|
export declare const startAkanConsole: (server: AkanServer, options?: AkanConsoleOptions) => Promise<void>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { BaseEnv } from "akanjs/base";
|
|
2
|
+
export type DevtoolsEnv = Partial<Pick<BaseEnv, "appName" | "environment" | "operationMode">>;
|
|
3
|
+
export type DevtoolsAccessMode = "closed" | "open" | "secret";
|
|
4
|
+
export declare class DevtoolsAccess {
|
|
5
|
+
#private;
|
|
6
|
+
static readonly unlockPath = "/_akan/devtools/unlock";
|
|
7
|
+
static readonly minSecretLength = 32;
|
|
8
|
+
static modeOf(env: DevtoolsEnv): DevtoolsAccessMode;
|
|
9
|
+
static closedReason(env: DevtoolsEnv): string | null;
|
|
10
|
+
static refusalOf(req: Request, env: DevtoolsEnv, path: string): Response | null;
|
|
11
|
+
static unlock(req: Request, env: DevtoolsEnv, client: string | null): Promise<Response>;
|
|
12
|
+
}
|
|
@@ -22,7 +22,6 @@ export declare class DevtoolsRouter {
|
|
|
22
22
|
#private;
|
|
23
23
|
static readonly basePath = "/_akan";
|
|
24
24
|
static readonly logger: Logger;
|
|
25
|
-
/** A local dev runtime only, unless `AKAN_DEVTOOLS` ("true"/"1", "false"/"0") overrides it, e.g. to debug a deployed env. */
|
|
26
25
|
static isEnabled(env: BaseEnv): boolean;
|
|
27
26
|
static buildsFrom(webRouter: {
|
|
28
27
|
readonly builderRpc: BuilderRpc | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { EndpointCls } from "akanjs/signal";
|
|
1
2
|
import type { DiLifecycle } from "../di/diLifecycle.d.ts";
|
|
2
|
-
import type { SignalData } from "./types.d.ts";
|
|
3
|
+
import type { EndpointHttpRoute, SignalData } from "./types.d.ts";
|
|
3
4
|
export interface SignalSerializerContext {
|
|
4
5
|
di: DiLifecycle;
|
|
5
6
|
serverMode: "federation" | "batch" | "all";
|
|
@@ -10,4 +11,5 @@ export interface SignalSerializerContext {
|
|
|
10
11
|
export declare class SignalSerializer {
|
|
11
12
|
#private;
|
|
12
13
|
static serialize({ di, serverMode, prefix, websocketPrefix }: SignalSerializerContext): SignalData;
|
|
14
|
+
static httpRoutesOf(endpointCls: EndpointCls, apiPrefix?: string): EndpointHttpRoute[];
|
|
13
15
|
}
|
|
@@ -22,6 +22,7 @@ export declare class StudioDocument {
|
|
|
22
22
|
static unavailable({ basePath, appName, query, reason }: Omit<StudioDocumentProps, "payload"> & {
|
|
23
23
|
reason: string;
|
|
24
24
|
}): import("react").JSX.Element;
|
|
25
|
+
static readonly runtimeScript: string;
|
|
25
26
|
static href(basePath: string, { view, module, editor, since }: StudioQuery): string;
|
|
26
27
|
static editorHref(editor: StudioEditor, workspaceRoot: string, at: AkanGraphLocation): string;
|
|
27
28
|
}
|
|
@@ -203,6 +203,11 @@ export interface RouteRow {
|
|
|
203
203
|
timeout?: number;
|
|
204
204
|
fileUpload?: boolean;
|
|
205
205
|
}
|
|
206
|
+
export interface EndpointHttpRoute {
|
|
207
|
+
key: string;
|
|
208
|
+
method: "GET" | HttpMutationMethod;
|
|
209
|
+
path: string;
|
|
210
|
+
}
|
|
206
211
|
export interface SignalData {
|
|
207
212
|
prefix: string;
|
|
208
213
|
websocketPrefix: string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AkanError } from "akanjs/base";
|
|
2
|
+
export interface SerializedError {
|
|
3
|
+
name: string;
|
|
4
|
+
message: string;
|
|
5
|
+
stack: string | null;
|
|
6
|
+
code: string | null;
|
|
7
|
+
cause: SerializedError | null;
|
|
8
|
+
}
|
|
9
|
+
export declare class ForwardedError extends AkanError {
|
|
10
|
+
#private;
|
|
11
|
+
constructor({ name, message, stack, code, cause }: SerializedError);
|
|
12
|
+
static serialize(error: unknown, depth?: number): SerializedError;
|
|
13
|
+
}
|
|
@@ -2,6 +2,7 @@ import type { Logger } from "akanjs/common";
|
|
|
2
2
|
import type { AkanChildRole, AkanChildStatus, AkanIpcMessage, AkanMetricsReport, AkanRscWorkerStatus, AkanUpstream } from "akanjs/service";
|
|
3
3
|
import type { RestartSchedule } from "../../common/restartSchedule.d.ts";
|
|
4
4
|
import type { BuilderMessage } from "../artifact.d.ts";
|
|
5
|
+
import { MetricAggregate } from "../metrics/metricAggregate.d.ts";
|
|
5
6
|
export interface ChildState {
|
|
6
7
|
idx: number;
|
|
7
8
|
role: AkanChildRole;
|
|
@@ -28,6 +29,7 @@ export interface ChildState {
|
|
|
28
29
|
}
|
|
29
30
|
export declare class GatewayChildren {
|
|
30
31
|
#private;
|
|
32
|
+
readonly metricAggregate: MetricAggregate;
|
|
31
33
|
constructor(logger: Logger);
|
|
32
34
|
get stopping(): boolean;
|
|
33
35
|
markStopping(): void;
|
|
@@ -74,6 +74,7 @@ export declare class GatewayConfig {
|
|
|
74
74
|
SERVER_MODE: AkanChildRole;
|
|
75
75
|
AKAN_API_PREFIX: string;
|
|
76
76
|
AKAN_WS_PREFIX: string;
|
|
77
|
+
AKAN_CLIENT_REPORT_KEY: string;
|
|
77
78
|
};
|
|
78
79
|
roleOf(idx: number): AkanChildRole;
|
|
79
80
|
childUpstreamOf(idx: number, role: AkanChildRole): GatewayUpstream;
|
|
@@ -15,6 +15,7 @@ interface GatewayHttpProxyParts {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class GatewayHttpProxy {
|
|
17
17
|
#private;
|
|
18
|
+
static readonly immutableRoutes: string[];
|
|
18
19
|
constructor({ config, children, supervisor, status, limits, logger }: GatewayHttpProxyParts);
|
|
19
20
|
serveImmutableArtifact(req: Request, url: URL): Promise<Response | null>;
|
|
20
21
|
proxyHttp(req: Request, server: Bun.Server<GatewayWsData>): Promise<Response>;
|
|
@@ -57,7 +57,9 @@ export declare class GatewayStatus {
|
|
|
57
57
|
lastRestartAt: number | undefined;
|
|
58
58
|
lastRestartReason: string | undefined;
|
|
59
59
|
}[];
|
|
60
|
+
metricFamilies: import("akanjs/service").AkanMetricFamily[];
|
|
60
61
|
};
|
|
62
|
+
statementsStatus(): import("../metrics/statementReport.d.ts").StatementReportBody;
|
|
61
63
|
recordProxyHop(durationMs: number): void;
|
|
62
64
|
reportMetrics(): Promise<void>;
|
|
63
65
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface HeadSpliceOptions {
|
|
2
|
+
afterOpen: string;
|
|
3
|
+
beforeClose: string;
|
|
4
|
+
rewriteOpening?: (html: string) => string;
|
|
5
|
+
withoutHead?: (html: string) => string;
|
|
6
|
+
}
|
|
7
|
+
export declare class HeadSplice {
|
|
8
|
+
#private;
|
|
9
|
+
static into(stream: ReadableStream<Uint8Array>, { afterOpen, beforeClose, rewriteOpening, withoutHead }: HeadSpliceOptions): ReadableStream<Uint8Array>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -13,4 +13,6 @@ export declare class ClientReport {
|
|
|
13
13
|
static parse(value: unknown): HmrClientReport | null;
|
|
14
14
|
static describe(report: HmrClientReport): string;
|
|
15
15
|
static log(report: HmrClientReport): void;
|
|
16
|
+
static clean(text: string, limit?: number): string;
|
|
17
|
+
static line(text: string, limit?: number): string;
|
|
16
18
|
}
|
|
@@ -4,6 +4,8 @@ export interface CsrDevShellRenderOptions {
|
|
|
4
4
|
lang: string;
|
|
5
5
|
title: string;
|
|
6
6
|
cssHref: string | null;
|
|
7
|
+
/** The response's script nonce: the three scripts load by URL, which the page's script policy otherwise refuses. */
|
|
8
|
+
nonce?: string;
|
|
7
9
|
}
|
|
8
10
|
export interface CsrDevShellOptions {
|
|
9
11
|
/** The registry this serves: the CSR one by default, `ssr-dev` for the client code of SSR pages. */
|
|
@@ -17,6 +19,6 @@ export declare class CsrDevShell {
|
|
|
17
19
|
#private;
|
|
18
20
|
constructor(artifactDir: string, { dirName, routePrefix, appWaitMs, appPollMs, bootWaitMs, }?: CsrDevShellOptions);
|
|
19
21
|
readManifest(): Promise<CsrDevManifest | null>;
|
|
20
|
-
render({ basePath, lang, title, cssHref }: CsrDevShellRenderOptions): Promise<string | null>;
|
|
22
|
+
render({ basePath, lang, title, cssHref, nonce }: CsrDevShellRenderOptions): Promise<string | null>;
|
|
21
23
|
serve(req: Request): Promise<Response>;
|
|
22
24
|
}
|
|
@@ -2,6 +2,7 @@ import type { Logger } from "akanjs/common";
|
|
|
2
2
|
import type { AkanRequestStore } from "akanjs/fetch";
|
|
3
3
|
import { type RouteCacheEntry, type RouteCacheInvalidation, type RouteCacheRenderState } from "./cachePolicy.d.ts";
|
|
4
4
|
import { type EncodedBody } from "./contentEncoding.d.ts";
|
|
5
|
+
import { type ScriptPolicySources } from "./scriptPolicy.d.ts";
|
|
5
6
|
import type { SsrLateControl } from "./ssrTypes.d.ts";
|
|
6
7
|
export declare const DEFAULT_HTML_RESULT_CACHE_MAX_BODY_BYTES: number;
|
|
7
8
|
interface HtmlCacheStreamOptions {
|
|
@@ -18,26 +19,35 @@ export declare function resolveHtmlRouteCacheStoreTtl(input: {
|
|
|
18
19
|
type: "redirect" | "not-found";
|
|
19
20
|
} | null;
|
|
20
21
|
}): number | null;
|
|
22
|
+
export interface CachedHtmlPage {
|
|
23
|
+
body: EncodedBody;
|
|
24
|
+
/** Every hash source the stored page's scripts need: a replay has no nonce of its own to name them by. */
|
|
25
|
+
scriptHashes: string[];
|
|
26
|
+
}
|
|
27
|
+
export interface HtmlCacheEntry extends RouteCacheEntry {
|
|
28
|
+
exactKey: string;
|
|
29
|
+
}
|
|
21
30
|
interface HtmlResultCacheOptions {
|
|
22
31
|
prodMode: boolean;
|
|
23
32
|
devRegistry: boolean;
|
|
24
33
|
}
|
|
25
34
|
interface HtmlStoreInput {
|
|
26
|
-
entry:
|
|
35
|
+
entry: HtmlCacheEntry;
|
|
27
36
|
pathname: string;
|
|
28
37
|
lateControl: Promise<SsrLateControl | null>;
|
|
29
38
|
cacheState: Promise<RouteCacheRenderState>;
|
|
30
39
|
hostRequestStore: AkanRequestStore;
|
|
31
40
|
logger: Logger;
|
|
41
|
+
scripts?: ScriptPolicySources;
|
|
32
42
|
}
|
|
33
43
|
export declare class HtmlResultCache {
|
|
34
44
|
#private;
|
|
35
45
|
constructor({ prodMode, devRegistry }: HtmlResultCacheOptions);
|
|
36
46
|
entryFor(req: Request, url: URL, isCrawler: boolean): {
|
|
37
|
-
entry:
|
|
47
|
+
entry: HtmlCacheEntry | null;
|
|
38
48
|
reason?: string;
|
|
39
49
|
};
|
|
40
|
-
get(
|
|
50
|
+
get(entry: HtmlCacheEntry): CachedHtmlPage | null;
|
|
41
51
|
storeWhileStreaming(htmlStream: ReadableStream<Uint8Array>, input: HtmlStoreInput): ReadableStream<Uint8Array>;
|
|
42
52
|
invalidate(invalidation?: string | RouteCacheInvalidation): void;
|
|
43
53
|
metrics(): {
|
package/types/server/index.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ export { AkanLib, type AkanLibProps, type DatabaseModule, type ScalarModule, typ
|
|
|
3
3
|
export { type AdaptorOverride, AkanOption, createDefaultAkanOption } from "./akanOption.d.ts";
|
|
4
4
|
export { AkanServer, type AkanServerConsoleInfo, type AkanServerOptions, type AkanServerProps, type McpServerOption, } from "./akanServer.d.ts";
|
|
5
5
|
export { type BuildChangesPayload, type BuilderControl, type BuilderCsrReq, type BuilderCsrRes, type BuilderEvent, type BuilderFailureKind, type BuilderGraphReq, type BuilderGraphRes, type BuilderMessage, type BuilderMetrics, type BuilderReq, type BuilderRequest, type BuilderRes, type BuilderResponse, BuilderRpc, type BuilderRpcEventHandlers, type BuilderRpcTimeout, type BuilderRpcUnavailable, type BuilderStateReason, type BuildFrameworkPayload, type BuildGraphPayload, type BuildPhase, type BuildRouteClientResult, type BuildRouteResultPayload, type ClientManifest, type ClientManifestEntry, type CsrUpdatedPayload, type CssPayload, DevBuildRecovery, type DevBuildStatus, type DevChangeAction, type DevChangePlan, type DevChangeRole, type HmrTrace, type InvalidateClientEntriesOptions, type MatchedRoute, type MergedManifest, ModulePreloadPlan, type ModulePreloadTable, type PagesBundlePayload, ROUTE_SEED_INDEX_JSON, RouteClientCache, type RouteSeedEntry, type RouteSeedIndex, RouteSeedIndexStore, type RoutesManifest, RoutesManifestStore, type SsrUpdatedPayload, } from "./artifact.d.ts";
|
|
6
|
-
export
|
|
6
|
+
export type { ClientReportSetting } from "./clientErrorReport.d.ts";
|
|
7
|
+
export { type AkanConsoleContext, type AkanConsoleOptions, assertAkanConsoleAllowed, evaluateAkanConsoleInput, getAkanConsoleMethods, isAkanConsoleInputComplete, startAkanConsole, } from "./console.d.ts";
|
|
7
8
|
export { Transaction, Try } from "./decorators.d.ts";
|
|
8
|
-
export { type ArgType, type ConstantData, type ConstantFieldKind, type ConstantFieldNode, type ConstantModelNode, type ConstantModelView, type ConstantModelViewKey, ConstantSerializer, type DepEdge, type DepEdgeKind, type DepNode, type DepNodeKind, type DepsData, DepsSerializer, type DepsSerializerContext, type DevtoolsApp, type DevtoolsEnvelope, type DevtoolsIndex, DevtoolsJson, DevtoolsRouter, type DevtoolsRouterContext, type DictionaryData, type DictionaryModuleNode, type EndpointNode, type EnumNode, type FieldType, type FilterArg, type InternalNode, type InternalType, type RelationEdge, type RouteRow, type SerializedArg, type SerializedReturns, type SignalData, type SignalNode, SignalSerializer, type SignalSerializerContext, type SliceNode, type Unserializable, } from "./devtools.d.ts";
|
|
9
|
+
export { type ArgType, type ConstantData, type ConstantFieldKind, type ConstantFieldNode, type ConstantModelNode, type ConstantModelView, type ConstantModelViewKey, ConstantSerializer, type DepEdge, type DepEdgeKind, type DepNode, type DepNodeKind, type DepsData, DepsSerializer, type DepsSerializerContext, type DevtoolsApp, type DevtoolsEnvelope, type DevtoolsIndex, DevtoolsJson, DevtoolsRouter, type DevtoolsRouterContext, type DictionaryData, type DictionaryModuleNode, type EndpointHttpRoute, type EndpointNode, type EnumNode, type FieldType, type FilterArg, type InternalNode, type InternalType, type RelationEdge, type RouteRow, type SerializedArg, type SerializedReturns, type SignalData, type SignalNode, SignalSerializer, type SignalSerializerContext, type SliceNode, type Unserializable, } from "./devtools.d.ts";
|
|
9
10
|
export { StageFailedError } from "./di/stageFailedError.d.ts";
|
|
10
11
|
export type { ChangeBatch, ChangeKind } from "./hmr/wsHub.d.ts";
|
|
11
12
|
export { MachineAccount, type MachineProof, MachineToken, type MachineTokenIssueOptions, type MachineTokenVerdict, } from "./machine.d.ts";
|
|
@@ -17,6 +18,6 @@ export { ProcessMetricsCollector } from "./processMetricsCollector.d.ts";
|
|
|
17
18
|
export { AkanResponse, copyBunRequestFields, HostBasePathWebProxy, LocaleWebProxy, type WebProxy, type WebProxyCls, type WebProxyMatcher, type WebProxyNextInit, type WebProxyRegistration, type WebProxyResult, type WebProxyReturn, WebProxyRunner, type WebProxyRunResult, } from "./proxy.d.ts";
|
|
18
19
|
export { type RemoteAccess, type RemoteAddressLookup, type RemoteAuthServer, type RemoteClient, RemoteError, type RemoteErrorCode, RemoteFetch, type RemoteFetchOptions, RemoteMcp, type RemoteMcpCallResult, type RemoteMcpContent, type RemoteMcpOptions, type RemoteMcpTool, RemoteOAuth, type RemoteRequest, type RemoteResponse, type RemoteScreen, RemoteSource, type RemoteSourceProps, type RemoteTokens, } from "./remote.d.ts";
|
|
19
20
|
export type { SessionRefreshHook } from "./sessionRefresh.d.ts";
|
|
20
|
-
export { createDefaultSitemapUrls, createDefaultSitemapXml, createSitemapXml, type DefaultSitemapOptions, getSitemapBasePath,
|
|
21
|
+
export { createDefaultSitemapUrls, createDefaultSitemapXml, createSitemapXml, type DefaultSitemapOptions, getSitemapBasePath, } from "./sitemap.d.ts";
|
|
21
22
|
export type { SsrManifest, SsrManifestEntry } from "./ssrTypes.d.ts";
|
|
22
23
|
export { type AkanImageConfig, type AkanImageFormat, type AkanImagePattern, type BaseBuildArtifact, type CssAsset, type DictAsset, defaultAkanImageConfig, getAkanImageWidths, getWebConfigFromEnv, type HttpRoutes, type LocalFile, type LocalPublish, type MobileDeepLinkAssociation, mergeAkanImageConfig, type RenderState, type ResolvedAkanImageConfig, resolveWebConfig, type SignalRouteOptions, type SignalRoutes, type WebsocketRoute, type WebsocketRoutes, } from "./types.d.ts";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type SecretEnvKind = "string" | "json" | "multiline";
|
|
2
|
+
export interface SecretEnvEntry {
|
|
3
|
+
name: string;
|
|
4
|
+
kind: SecretEnvKind;
|
|
5
|
+
}
|
|
6
|
+
export interface SecretEnvReport {
|
|
7
|
+
missing: string[];
|
|
8
|
+
escaped: string[];
|
|
9
|
+
}
|
|
10
|
+
interface SecretEnvLogger {
|
|
11
|
+
warn: (message: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare class SecretEnv {
|
|
14
|
+
#private;
|
|
15
|
+
static readonly listKey = "AKAN_ENV_NAMES";
|
|
16
|
+
static readonly fallbackKey = "AKAN_ENV_FALLBACK";
|
|
17
|
+
static read(name: string, inlined?: string): string | undefined;
|
|
18
|
+
static json(name: string, inlined?: unknown): unknown;
|
|
19
|
+
static format(entries: readonly SecretEnvEntry[]): string;
|
|
20
|
+
static parse(list: string | undefined): SecretEnvEntry[];
|
|
21
|
+
static check(logger: SecretEnvLogger, env?: NodeJS.ProcessEnv): SecretEnvReport;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -14,6 +14,7 @@ export declare class LogForwarder {
|
|
|
14
14
|
static readonly defaultMaxBytes: number;
|
|
15
15
|
static readonly defaultMaxQueue = 1000;
|
|
16
16
|
static readonly defaultMaxMessageChars: number;
|
|
17
|
+
static readonly closeTimeoutMs = 1000;
|
|
17
18
|
constructor(send: (message: AkanIpcMessage, onSent?: () => void) => void, options?: LogForwarderOptions);
|
|
18
19
|
get minSev(): number | null;
|
|
19
20
|
get active(): boolean;
|
|
@@ -19,5 +19,5 @@ export declare class RotatingLogWriter {
|
|
|
19
19
|
static sanitizeFilePart(value: string): string;
|
|
20
20
|
write(processKey: string, chunk: string): void;
|
|
21
21
|
close(): Promise<void>;
|
|
22
|
-
static fileMode(value?: string | undefined, warn?: typeof RotatingLogWriter.__#
|
|
22
|
+
static fileMode(value?: string | undefined, warn?: typeof RotatingLogWriter.__#181@#defaultWarn): number;
|
|
23
23
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AkanMetricFamily } from "akanjs/service";
|
|
2
|
+
export type ExpositionFormat = "openmetrics" | "prometheus";
|
|
3
|
+
export declare class MetricExposition {
|
|
4
|
+
#private;
|
|
5
|
+
static negotiate(accept: string | null): ExpositionFormat | null;
|
|
6
|
+
static contentType(format: ExpositionFormat): string;
|
|
7
|
+
static render(families: readonly AkanMetricFamily[], format: ExpositionFormat): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AkanMetricFamily } from "akanjs/service";
|
|
2
|
+
export declare class MetricMerge {
|
|
3
|
+
#private;
|
|
4
|
+
add(families: readonly AkanMetricFamily[], { gauges, labels }?: {
|
|
5
|
+
gauges?: boolean;
|
|
6
|
+
labels?: Record<string, string>;
|
|
7
|
+
}): this;
|
|
8
|
+
families(): AkanMetricFamily[];
|
|
9
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { AkanMetricFamily } from "akanjs/service";
|
|
2
|
+
export type MetricLabels = Readonly<Record<string, string>>;
|
|
3
|
+
export declare const LATENCY_BUCKETS_SECONDS: readonly number[];
|
|
4
|
+
export declare const OVERFLOW_LABEL_VALUE = "other";
|
|
5
|
+
export declare const MAX_LABEL_VALUES = 2000;
|
|
6
|
+
export declare class LabelValues {
|
|
7
|
+
#private;
|
|
8
|
+
constructor(limit?: number);
|
|
9
|
+
admit(value: string): string;
|
|
10
|
+
}
|
|
11
|
+
export declare class CounterSeries {
|
|
12
|
+
value: number;
|
|
13
|
+
inc(by?: number): void;
|
|
14
|
+
}
|
|
15
|
+
export declare class GaugeSeries {
|
|
16
|
+
value: number;
|
|
17
|
+
set(value: number): void;
|
|
18
|
+
inc(by?: number): void;
|
|
19
|
+
dec(by?: number): void;
|
|
20
|
+
}
|
|
21
|
+
export declare class HistogramSeries {
|
|
22
|
+
readonly bounds: readonly number[];
|
|
23
|
+
readonly counts: Float64Array;
|
|
24
|
+
sum: number;
|
|
25
|
+
count: number;
|
|
26
|
+
constructor(bounds: readonly number[]);
|
|
27
|
+
observe(value: number): void;
|
|
28
|
+
}
|
|
29
|
+
interface MetricInfo {
|
|
30
|
+
name: string;
|
|
31
|
+
help: string;
|
|
32
|
+
labelNames: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export declare class Counter {
|
|
35
|
+
#private;
|
|
36
|
+
readonly type = "counter";
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly help: string;
|
|
39
|
+
constructor({ name, help, labelNames }: MetricInfo);
|
|
40
|
+
get labelNames(): readonly string[];
|
|
41
|
+
series(labels?: MetricLabels): CounterSeries;
|
|
42
|
+
inc(labels?: MetricLabels, by?: number): void;
|
|
43
|
+
snapshot(constLabels: MetricLabels): AkanMetricFamily;
|
|
44
|
+
}
|
|
45
|
+
export declare class Gauge {
|
|
46
|
+
#private;
|
|
47
|
+
readonly type = "gauge";
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly help: string;
|
|
50
|
+
constructor({ name, help, labelNames }: MetricInfo);
|
|
51
|
+
get labelNames(): readonly string[];
|
|
52
|
+
series(labels?: MetricLabels): GaugeSeries;
|
|
53
|
+
set(value: number, labels?: MetricLabels): void;
|
|
54
|
+
snapshot(constLabels: MetricLabels): AkanMetricFamily;
|
|
55
|
+
}
|
|
56
|
+
export declare class Histogram {
|
|
57
|
+
#private;
|
|
58
|
+
readonly type = "histogram";
|
|
59
|
+
readonly name: string;
|
|
60
|
+
readonly help: string;
|
|
61
|
+
readonly buckets: readonly number[];
|
|
62
|
+
constructor({ name, help, labelNames }: MetricInfo, buckets: readonly number[]);
|
|
63
|
+
get labelNames(): readonly string[];
|
|
64
|
+
series(labels?: MetricLabels): HistogramSeries;
|
|
65
|
+
observe(value: number, labels?: MetricLabels): void;
|
|
66
|
+
snapshot(constLabels: MetricLabels): AkanMetricFamily;
|
|
67
|
+
}
|
|
68
|
+
export declare class MetricRegistry {
|
|
69
|
+
#private;
|
|
70
|
+
counter(name: string, help: string, labelNames?: readonly string[]): Counter;
|
|
71
|
+
gauge(name: string, help: string, labelNames?: readonly string[]): Gauge;
|
|
72
|
+
histogram(name: string, help: string, labelNames?: readonly string[], buckets?: readonly number[]): Histogram;
|
|
73
|
+
snapshot(constLabels?: MetricLabels): AkanMetricFamily[];
|
|
74
|
+
}
|
|
75
|
+
export declare const metricRegistry: MetricRegistry;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Counter, type Histogram } from "./metricRegistry.d.ts";
|
|
2
|
+
export declare const UNMATCHED_ROUTE = "unmatched";
|
|
3
|
+
export declare class RequestSeries {
|
|
4
|
+
#private;
|
|
5
|
+
constructor(counter: Counter, histogram: Histogram, labels: Record<string, string>);
|
|
6
|
+
observe(status: number, elapsedMs: number): void;
|
|
7
|
+
tracked<Args extends unknown[], T>(handler: (...args: Args) => Promise<T>): (...args: Args) => Promise<T>;
|
|
8
|
+
track<T>(call: () => Promise<T>): Promise<T>;
|
|
9
|
+
}
|
|
10
|
+
declare class RequestSeriesSet {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(counter: Counter, histogram: Histogram, labelName: string);
|
|
13
|
+
of(name: string): RequestSeries;
|
|
14
|
+
}
|
|
15
|
+
export declare const endpointRequests: RequestSeriesSet;
|
|
16
|
+
export declare const pageRequests: RequestSeriesSet;
|
|
17
|
+
export declare class PageCall {
|
|
18
|
+
#private;
|
|
19
|
+
route: string;
|
|
20
|
+
finish(response: Response): Response;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AkanMetricFamily, AkanMetricsReport, AkanRscWorkerStatus } from "akanjs/service";
|
|
2
|
+
type Labels = Record<string, string>;
|
|
3
|
+
export declare class RuntimeFamilies {
|
|
4
|
+
#private;
|
|
5
|
+
static process(): AkanMetricFamily[];
|
|
6
|
+
static rscWorker(report: AkanMetricsReport | undefined, labels: Labels): AkanMetricFamily[];
|
|
7
|
+
static rscReadiness(statuses: readonly (AkanRscWorkerStatus | undefined)[]): AkanMetricFamily[];
|
|
8
|
+
}
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SignalTrace } from "akanjs/signal";
|
|
2
|
+
import type { SiteSeries, StatementStat } from "./statementMetrics.d.ts";
|
|
3
|
+
interface SlowStatement {
|
|
4
|
+
durationMs: number;
|
|
5
|
+
waitMs: number;
|
|
6
|
+
rows: number;
|
|
7
|
+
trace: SignalTrace | undefined;
|
|
8
|
+
}
|
|
9
|
+
export declare class SlowStatementLog {
|
|
10
|
+
#private;
|
|
11
|
+
static readonly defaultThresholdMs = 200;
|
|
12
|
+
static readonly repeatWindowMs = 60000;
|
|
13
|
+
get thresholdMs(): number;
|
|
14
|
+
set thresholdMs(ms: number | null);
|
|
15
|
+
static thresholdOf(value: string | undefined): number;
|
|
16
|
+
log(stat: StatementStat, site: SiteSeries, { durationMs, waitMs, rows, trace }: SlowStatement, now?: number): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AkanStatementStat, SentStatement, StatementShape, StatementSink, StatementSite } from "akanjs/service";
|
|
2
|
+
import { type SignalTrace } from "akanjs/signal";
|
|
3
|
+
import { SlowStatementLog } from "./slowStatementLog.d.ts";
|
|
4
|
+
import { StatementPlanCheck } from "./statementPlanCheck.d.ts";
|
|
5
|
+
export declare class SiteSeries {
|
|
6
|
+
#private;
|
|
7
|
+
readonly model: string;
|
|
8
|
+
readonly op: string;
|
|
9
|
+
totalMs: number;
|
|
10
|
+
constructor(model: string, op: string);
|
|
11
|
+
observe(bucket: number, durationMs: number, waitMs: number, rows: number): void;
|
|
12
|
+
}
|
|
13
|
+
export interface PlanState {
|
|
14
|
+
epoch: number;
|
|
15
|
+
pending: boolean;
|
|
16
|
+
dueAt: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class StatementStat {
|
|
19
|
+
#private;
|
|
20
|
+
readonly shape: StatementShape;
|
|
21
|
+
count: number;
|
|
22
|
+
totalMs: number;
|
|
23
|
+
waitMs: number;
|
|
24
|
+
rows: number;
|
|
25
|
+
readonly admittedAt: number;
|
|
26
|
+
readonly buckets: Float64Array<ArrayBuffer>;
|
|
27
|
+
slowLoggedAt: number;
|
|
28
|
+
slowSuppressed: number;
|
|
29
|
+
constructor(shape: StatementShape);
|
|
30
|
+
planOf(variant: string): PlanState;
|
|
31
|
+
siteOf(site: StatementSite | undefined): SiteSeries;
|
|
32
|
+
observe(site: SiteSeries, durationMs: number, waitMs: number, rows: number): void;
|
|
33
|
+
sentBy(trace: SignalTrace | undefined, durationMs: number): void;
|
|
34
|
+
toStat(): AkanStatementStat;
|
|
35
|
+
}
|
|
36
|
+
export declare class StatementMetrics implements StatementSink {
|
|
37
|
+
#private;
|
|
38
|
+
static readonly maxStatements = 500;
|
|
39
|
+
readonly slowLog: SlowStatementLog;
|
|
40
|
+
planCheck: StatementPlanCheck | null | undefined;
|
|
41
|
+
sent(statement: SentStatement, site: StatementSite | undefined, params: readonly unknown[], durationMs: number, waitMs: number, rows: number): void;
|
|
42
|
+
top(limit: number): AkanStatementStat[];
|
|
43
|
+
reset(): void;
|
|
44
|
+
}
|
|
45
|
+
export declare const statementMetrics: StatementMetrics;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type SentStatement, type StatementSite } from "akanjs/service";
|
|
2
|
+
import { type SignalTrace } from "akanjs/signal";
|
|
3
|
+
import type { SiteSeries, StatementStat } from "./statementMetrics.d.ts";
|
|
4
|
+
interface PlanFinding {
|
|
5
|
+
scans: string | null;
|
|
6
|
+
sorts: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare class StatementPlanCheck {
|
|
9
|
+
#private;
|
|
10
|
+
static readonly minRows = 1000;
|
|
11
|
+
constructor(ignored?: Iterable<string>);
|
|
12
|
+
static fromEnv(): StatementPlanCheck | null;
|
|
13
|
+
consider(stat: StatementStat, statement: SentStatement, params: readonly unknown[], site: StatementSite | undefined, series: SiteSeries, trace: SignalTrace | undefined): void;
|
|
14
|
+
static findingOf(plan: readonly string[], table: string): PlanFinding;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { AkanStatementSender, AkanStatementStat } from "akanjs/service";
|
|
2
|
+
export declare const STATEMENT_BUCKETS_SECONDS: readonly number[];
|
|
3
|
+
export interface StatementReportRow {
|
|
4
|
+
fingerprint: string;
|
|
5
|
+
text: string;
|
|
6
|
+
model: string;
|
|
7
|
+
op: string;
|
|
8
|
+
count: number;
|
|
9
|
+
totalMs: number;
|
|
10
|
+
meanMs: number;
|
|
11
|
+
p95Ms: number;
|
|
12
|
+
waitMs: number;
|
|
13
|
+
rows: number;
|
|
14
|
+
/** The report covers the statements this process lists now, since it first listed them or last admitted them again; not a lifetime total. */
|
|
15
|
+
sinceMs: number;
|
|
16
|
+
sentBy: AkanStatementSender[];
|
|
17
|
+
}
|
|
18
|
+
export interface StatementReportBody {
|
|
19
|
+
byTotalTime: StatementReportRow[];
|
|
20
|
+
byP95: StatementReportRow[];
|
|
21
|
+
}
|
|
22
|
+
export declare class StatementReport {
|
|
23
|
+
#private;
|
|
24
|
+
static readonly limit = 20;
|
|
25
|
+
static quantile(counts: readonly number[], q: number): number;
|
|
26
|
+
static merge(lists: readonly (readonly AkanStatementStat[] | undefined)[]): AkanStatementStat[];
|
|
27
|
+
static view(stats: readonly AkanStatementStat[], limit?: number): StatementReportBody;
|
|
28
|
+
}
|