akanjs 3.2.0-rc.8 → 3.2.0
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 +41 -38
- package/CHANGELOG.md +0 -679
- package/CONTRIBUTING.md +3 -0
- package/base/base.ts +2 -1
- package/client/clientRuntime.ts +1 -0
- package/client/cn.ts +2 -2
- package/client/csrTypes.ts +2 -0
- package/client/frameConfig.ts +1 -0
- package/client/index.ts +249 -26
- package/client/locale.ts +1 -0
- package/client/makePageProto.tsx +12 -85
- package/client/nativeThemeColor.ts +51 -0
- package/client/route/PageDefinition.ts +11 -3
- package/client/route/RouteDefinition.ts +24 -7
- package/client/route/RouteGuards.ts +2 -1
- package/client/route/RouteHead.ts +4 -1
- package/client/route/routeArgs.ts +8 -0
- package/client/router.ts +17 -2
- package/client/rscNavigation.ts +1 -0
- package/client/viewportMeta.ts +86 -6
- package/common/CodeTranscript.ts +1 -1
- package/common/Logger.ts +4 -2
- package/common/PipelinePlanSchema.ts +2 -2
- package/common/clientAddress.ts +14 -0
- package/common/err.ts +122 -0
- package/common/eventStream.ts +71 -19
- package/common/facetBarrel.ts +38 -0
- package/common/index.ts +7 -0
- package/common/isGuardRefusal.ts +14 -0
- package/common/loggedFailure.ts +11 -0
- package/common/mcpExposure.ts +17 -4
- package/common/pipelinePlan.ts +1 -1
- package/common/routeConvention.ts +3 -1
- package/common/types.ts +18 -1
- package/constant/constantRegistry.ts +4 -8
- package/constant/crystalize.ts +1 -2
- package/constant/getDefault.ts +1 -1
- package/constant/immerify.ts +1 -1
- package/constant/index.ts +78 -21
- package/constant/purify.ts +4 -9
- package/constant/serialize.ts +4 -2
- package/constant/types.ts +1 -0
- package/constant/via.ts +1 -2
- package/dictionary/agent.dictionary.ts +12 -0
- package/dictionary/base.dictionary.ts +11 -0
- package/dictionary/locale.ts +1 -1
- package/dictionary/trans.ts +14 -97
- package/document/dataLoader.ts +39 -19
- package/document/databaseRegistry.ts +2 -1
- package/document/documentSchema.ts +1 -0
- package/document/filterMeta.ts +4 -1
- package/document/into.ts +2 -1
- package/document/loaderInfo.ts +2 -1
- package/document/noDocumentError.ts +4 -1
- package/document/queryEvaluator.ts +1 -1
- package/document/types.ts +1 -1
- package/fetch/client/fetchClient.ts +83 -269
- package/fetch/client/fetchClientTypes.ts +49 -0
- package/fetch/client/httpClient.ts +3 -2
- package/fetch/client/remoteError.ts +4 -20
- package/fetch/client/requestScope.ts +41 -0
- package/fetch/client/signalCatalog.ts +131 -0
- package/fetch/client/wsClient.ts +82 -6
- package/fetch/requestStorage.ts +1 -0
- package/package.json +1 -1
- package/server/agentHooks.ts +16 -0
- package/server/akanApp.ts +110 -1272
- package/server/akanOption.ts +30 -3
- package/server/akanServer.ts +179 -674
- package/server/artifact/builderRpc.ts +14 -6
- package/server/artifact/routeSeedIndexStore.ts +4 -2
- package/server/assetHeaders.ts +6 -0
- package/server/console.ts +6 -4
- package/server/decorators.ts +2 -2
- package/server/di/diLifecycle.ts +24 -35
- package/server/di/predefinedAdaptor.ts +24 -1
- package/server/di/resolveHierarchy.ts +19 -6
- package/server/di/stageFailedError.ts +10 -0
- package/server/di/utils.ts +8 -3
- package/server/ed25519Key.ts +31 -15
- package/server/flightRowReader.ts +106 -20
- package/server/gateway/childSupervisor.ts +328 -0
- package/server/gateway/devHostChannel.ts +47 -0
- package/server/gateway/gatewayChildren.ts +161 -0
- package/server/gateway/gatewayConfig.ts +182 -0
- package/server/gateway/gatewayHttpProxy.ts +231 -0
- package/server/gateway/gatewayLogging.ts +111 -0
- package/server/gateway/gatewayRooms.ts +141 -0
- package/server/gateway/gatewayStatus.ts +122 -0
- package/server/gateway/gatewayStatusPage.ts +54 -0
- package/server/gateway/gatewayWebSocketRelay.ts +149 -0
- package/server/gateway/listeningPort.ts +13 -0
- package/server/hmr/devHmrController.ts +10 -1
- package/server/htmlResultCache.ts +234 -0
- package/server/imageOptimizer.ts +4 -1
- package/server/index.ts +281 -17
- package/server/lifecycle/parentChannel.ts +79 -0
- package/server/lifecycle/shutdownManager.ts +6 -3
- package/server/lifecycle/startGuard.ts +90 -0
- package/server/logging/hubFileSink.ts +1 -0
- package/server/logging/logControlSocket.ts +42 -3
- package/server/logging/logHub.ts +0 -0
- package/server/logging/logStdoutWriter.ts +3 -1
- package/server/logging/logStreamRoute.ts +28 -11
- package/server/logging/serverLogging.ts +74 -0
- package/server/machine/machineToken.ts +10 -3
- package/server/mcp/AgentTools.ts +149 -0
- package/server/mcp/AgentToolsAccount.ts +26 -0
- package/server/mcp/McpApps.ts +32 -2
- package/server/mcp/McpDispatcher.ts +44 -30
- package/server/mcp/McpPages.ts +34 -12
- package/server/mcp/McpRateLimiter.ts +14 -0
- package/server/mcp/McpRouter.ts +4 -2
- package/server/mcp/McpUiSession.ts +2 -1
- package/server/mcp/index.ts +1 -0
- package/server/migration/migrationCommand.ts +31 -2
- package/server/migration/migrationRunner.ts +36 -1
- package/server/nativeFile.ts +39 -12
- package/server/nativeSecret.ts +12 -3
- package/server/oauth/OAuthClientIdMetadata.ts +2 -2
- package/server/ops/migrateJobs.ts +2 -2
- package/server/ops/opsCommand.ts +1 -1
- package/server/ops/opsRoute.ts +5 -1
- package/server/ops/opsToken.ts +3 -1
- package/server/remote/RemoteFetch.ts +161 -0
- package/server/remote/RemoteMcp.ts +242 -0
- package/server/remote/RemoteOAuth.ts +270 -0
- package/server/remote/RemoteSource.ts +214 -0
- package/server/remote/index.ts +17 -0
- package/server/remote/remoteError.ts +19 -0
- package/server/resolver/CascadeRunner.ts +20 -8
- package/server/resolver/database.resolver.ts +10 -417
- package/server/resolver/databaseModelInstance.ts +209 -0
- package/server/resolver/invalidSignal.ts +7 -0
- package/server/resolver/livePause.ts +34 -0
- package/server/resolver/modelFacade.ts +136 -0
- package/server/resolver/modelLoaders.ts +84 -0
- package/server/resolver/modelSchema.ts +52 -0
- package/server/resolver/roomAdmission.ts +68 -0
- package/server/resolver/signal.resolver.ts +45 -111
- package/server/resolver/sliceCrud.ts +63 -0
- package/server/resolver/timedQuery.ts +16 -0
- package/server/resolver/websocketOf.ts +2 -1
- package/server/routeElementComposer.tsx +45 -6
- package/server/routeTreeBuilder.ts +23 -9
- package/server/routing/apiRouter.ts +53 -28
- package/server/routing/builtinRoutes.ts +194 -0
- package/server/routing/localRooms.ts +34 -0
- package/server/routing/roomReplay.ts +2 -2
- package/server/routing/serverLimits.ts +4 -1
- package/server/routing/serverListener.ts +194 -0
- package/server/rscClient.tsx +122 -195
- package/server/rscClientCache.ts +165 -0
- package/server/rscClientChunks.ts +126 -8
- package/server/rscClientFetch.ts +9 -2
- package/server/rscClientPatch.ts +78 -15
- package/server/rscDocumentHead.tsx +177 -0
- package/server/rscFlightRenderer.ts +83 -0
- package/server/rscFlightStream.ts +259 -0
- package/server/rscHostReloads.ts +238 -0
- package/server/rscHostRenderStream.ts +297 -0
- package/server/rscHostRequests.ts +158 -0
- package/server/rscHttp.ts +18 -6
- package/server/rscNavigationState.ts +24 -1
- package/server/rscPagePrompts.ts +65 -14
- package/server/rscPrefetchCache.ts +31 -17
- package/server/rscRenderControl.ts +33 -0
- package/server/rscRenderFallbacks.ts +299 -0
- package/server/rscRenderHandler.ts +439 -0
- package/server/rscRenderStats.ts +49 -0
- package/server/rscResultCaches.ts +74 -0
- package/server/rscRouteDocument.tsx +316 -0
- package/server/rscSegmentOutletReference.ts +5 -1
- package/server/rscStaticApp.tsx +73 -0
- package/server/rscWorker.tsx +112 -1341
- package/server/rscWorkerHost.ts +175 -803
- package/server/rscWorkerProcess.ts +155 -0
- package/server/rscWorkerRecycler.ts +128 -0
- package/server/serverConfig.ts +128 -0
- package/server/serverMetrics.ts +52 -0
- package/server/sitemap.ts +1 -0
- package/server/ssrFromRscRenderer.tsx +20 -20
- package/server/ssrStaticApp.tsx +243 -0
- package/server/webArtifact.ts +86 -0
- package/server/webAssetRoutes.ts +84 -0
- package/server/webCsrSurface.ts +172 -0
- package/server/webDocumentRoute.ts +180 -0
- package/server/webRouteContext.ts +232 -0
- package/server/webRouter.ts +129 -1165
- package/server/webRscRoute.ts +155 -0
- package/server/webSiteFiles.ts +139 -0
- package/server/webStaticApp.ts +62 -0
- package/server/wellKnownRoutes.ts +73 -0
- package/service/agent.service.ts +14 -2
- package/service/agentAccounts.ts +19 -0
- package/service/agentLoop/agentLoop.ts +550 -0
- package/service/agentLoop/agentLoopTypes.ts +220 -0
- package/service/agentLoop/deltaStream.ts +40 -0
- package/service/agentLoop/loopAnswer.ts +67 -0
- package/service/agentLoop/loopAsk.ts +44 -0
- package/service/agentLoop/loopCompaction.ts +146 -0
- package/service/agentLoop/loopRemotes.ts +181 -0
- package/service/agentLoop/loopRequest.ts +120 -0
- package/service/agentLoop/loopStored.ts +24 -0
- package/service/agentLoop/loopToolOutput.ts +54 -0
- package/service/agentLoop/loopToolkits.ts +155 -0
- package/service/agentLoop/loopTranscript.ts +138 -0
- package/{signal → service}/agentMeter.ts +2 -1
- package/{signal → service}/agentRelayPolicy.ts +43 -8
- package/service/endpointCacheKeys.ts +14 -2
- package/service/index.ts +6 -0
- package/service/injectInfo.ts +2 -1
- package/service/ipcTypes.ts +8 -2
- package/service/liveRoomLimit.ts +68 -0
- package/service/liveRoomLimitError.ts +16 -0
- package/service/liveSyncHub.ts +24 -2
- package/service/predefinedAdaptor/agentTools.adaptor.ts +34 -0
- package/service/predefinedAdaptor/anthropicLlm.ts +33 -14
- package/service/predefinedAdaptor/compress.adaptor.ts +2 -2
- package/service/predefinedAdaptor/database.adaptor.ts +62 -19
- package/service/predefinedAdaptor/index.ts +1 -0
- package/service/predefinedAdaptor/llm.adaptor.ts +24 -1
- package/service/predefinedAdaptor/openaiDialect.ts +72 -23
- package/service/predefinedAdaptor/openaiLlm.ts +1 -1
- package/service/predefinedAdaptor/role.adaptor.ts +2 -0
- package/service/predefinedAdaptor/solidPubsub.adaptor.ts +35 -2
- package/service/predefinedAdaptor/solidQueue.adaptor.ts +2 -2
- package/service/predefinedAdaptor/solidSqlite.ts +6 -3
- package/service/predefinedAdaptor/sql/DocumentHydrator.ts +95 -0
- package/service/predefinedAdaptor/sql/DocumentRowCodec.ts +192 -0
- package/service/predefinedAdaptor/sql/DocumentWriter.ts +298 -0
- package/service/predefinedAdaptor/sql/QueryScope.ts +70 -0
- package/service/predefinedAdaptor/sql/QueryWriter.ts +200 -0
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +127 -1069
- package/service/predefinedAdaptor/sql/SqlTableSchema.ts +357 -0
- package/service/predefinedAdaptor/sql/StoredRows.ts +95 -0
- package/service/predefinedAdaptor/sql/TransactionScope.ts +14 -7
- package/service/predefinedAdaptor/sql/dialect/postgres.ts +1 -1
- package/service/predefinedAdaptor/sql/dialect/sqlite.ts +1 -1
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +20 -9
- package/service/predefinedAdaptor/sql/driver/postgres.ts +1 -1
- package/service/predefinedAdaptor/sql/types.ts +28 -4
- package/service/predefinedAdaptor/sseData.ts +88 -0
- package/service/predefinedAdaptor/storage.adaptor.ts +2 -1
- package/service/predefinedAdaptor/websocket.adaptor.ts +74 -44
- package/service/serviceRegistry.ts +1 -0
- package/signal/SignalFailure.ts +35 -0
- package/signal/agent.signal.ts +15 -9
- package/signal/agentTurnStream.ts +23 -9
- package/signal/byIdRead.ts +18 -0
- package/signal/carriedClientIps.ts +1 -0
- package/signal/endpointCache.ts +61 -6
- package/signal/endpointErrorContract.ts +1 -1
- package/signal/endpointRateLimit.ts +84 -3
- package/signal/index.ts +322 -32
- package/signal/mcp/McpDocument.ts +8 -1
- package/signal/mcp/mcpProtocol.ts +6 -1
- package/signal/mcp/pagePrompt.ts +15 -0
- package/signal/middleware.ts +10 -3
- package/signal/openapi/openapi.ts +10 -1
- package/signal/resolveFieldContext.ts +34 -0
- package/signal/serializer/fetch.serializer.ts +22 -15
- package/signal/signalContext.ts +15 -42
- package/signal/slice.ts +22 -19
- package/signal/trace.ts +44 -5
- package/signal/types.ts +46 -8
- package/store/action.ts +32 -1057
- package/store/actionErrorMessage.ts +20 -0
- package/store/actionOption.ts +22 -0
- package/store/baseSt.ts +1 -0
- package/store/formFieldSetters.ts +229 -0
- package/store/index.ts +125 -17
- package/store/modelActionContext.ts +65 -0
- package/store/modelOpenActions.ts +158 -0
- package/store/modelWriteActions.ts +240 -0
- package/store/modelWriteGuard.ts +3 -12
- package/store/openSeq.ts +34 -0
- package/store/sliceListActions.ts +370 -0
- package/store/sliceLiveActions.ts +140 -0
- package/store/stateBuilder.ts +2 -0
- package/store/storeInstance.ts +4 -18
- package/store/storeRegistry.ts +1 -1
- package/test/conformance.ts +25 -5
- package/types/base/base.d.ts +2 -1
- package/types/client/clientRuntime.d.ts +1 -0
- package/types/client/cn.d.ts +2 -2
- package/types/client/csrTypes.d.ts +2 -0
- package/types/client/frameConfig.d.ts +1 -0
- package/types/client/index.d.ts +25 -26
- package/types/client/locale.d.ts +1 -0
- package/types/client/makePageProto.d.ts +5 -13
- package/types/client/nativeThemeColor.d.ts +6 -0
- package/types/client/route/PageDefinition.d.ts +5 -2
- package/types/client/route/RouteDefinition.d.ts +2 -2
- package/types/client/route/routeArgs.d.ts +7 -0
- package/types/client/router.d.ts +3 -1
- package/types/client/rscNavigation.d.ts +1 -0
- package/types/client/viewportMeta.d.ts +5 -2
- package/types/common/CodeTranscript.d.ts +1 -1
- package/types/common/clientAddress.d.ts +5 -0
- package/types/common/err.d.ts +48 -0
- package/types/common/eventStream.d.ts +5 -1
- package/types/common/facetBarrel.d.ts +4 -0
- package/types/common/index.d.ts +6 -3
- package/types/common/isGuardRefusal.d.ts +3 -0
- package/types/common/loggedFailure.d.ts +2 -0
- package/types/common/mcpExposure.d.ts +9 -2
- package/types/common/routeConvention.d.ts +2 -0
- package/types/common/types.d.ts +18 -1
- package/types/constant/constantRegistry.d.ts +3 -1
- package/types/constant/crystalize.d.ts +1 -1
- package/types/constant/getDefault.d.ts +1 -1
- package/types/constant/immerify.d.ts +1 -1
- package/types/constant/index.d.ts +21 -21
- package/types/constant/purify.d.ts +2 -1
- package/types/constant/serialize.d.ts +1 -1
- package/types/constant/types.d.ts +1 -0
- package/types/dictionary/agent.dictionary.d.ts +1 -1
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictionary.d.ts +9 -9
- package/types/dictionary/locale.d.ts +1 -1
- package/types/dictionary/trans.d.ts +3 -26
- package/types/document/dataLoader.d.ts +5 -0
- package/types/document/databaseRegistry.d.ts +2 -1
- package/types/document/documentSchema.d.ts +1 -0
- package/types/document/filterMeta.d.ts +4 -1
- package/types/document/into.d.ts +1 -1
- package/types/document/loaderInfo.d.ts +2 -1
- package/types/document/noDocumentError.d.ts +8 -1
- package/types/document/queryEvaluator.d.ts +1 -1
- package/types/document/types.d.ts +1 -1
- package/types/fetch/client/fetchClient.d.ts +6 -36
- package/types/fetch/client/fetchClientTypes.d.ts +40 -0
- package/types/fetch/client/httpClient.d.ts +2 -0
- package/types/fetch/client/remoteError.d.ts +0 -4
- package/types/fetch/client/requestScope.d.ts +11 -0
- package/types/fetch/client/signalCatalog.d.ts +25 -0
- package/types/fetch/client/wsClient.d.ts +2 -0
- package/types/fetch/requestStorage.d.ts +1 -0
- package/types/server/agentHooks.d.ts +4 -0
- package/types/server/akanApp.d.ts +2 -20
- package/types/server/akanOption.d.ts +16 -2
- package/types/server/akanServer.d.ts +2 -2
- package/types/server/assetHeaders.d.ts +1 -0
- package/types/server/console.d.ts +4 -3
- package/types/server/di/predefinedAdaptor.d.ts +1 -0
- package/types/server/di/stageFailedError.d.ts +5 -0
- package/types/server/ed25519Key.d.ts +1 -0
- package/types/server/flightRowReader.d.ts +8 -2
- package/types/server/gateway/childSupervisor.d.ts +35 -0
- package/types/server/gateway/devHostChannel.d.ts +14 -0
- package/types/server/gateway/gatewayChildren.d.ts +50 -0
- package/types/server/gateway/gatewayConfig.d.ts +82 -0
- package/types/server/gateway/gatewayHttpProxy.d.ts +22 -0
- package/types/server/gateway/gatewayLogging.d.ts +16 -0
- package/types/server/gateway/gatewayRooms.d.ts +25 -0
- package/types/server/gateway/gatewayStatus.d.ts +63 -0
- package/types/server/gateway/gatewayStatusPage.d.ts +9 -0
- package/types/server/gateway/gatewayWebSocketRelay.d.ts +17 -0
- package/types/server/gateway/listeningPort.d.ts +5 -0
- package/types/server/htmlResultCache.d.ts +51 -0
- package/types/server/index.d.ts +19 -17
- package/types/server/lifecycle/parentChannel.d.ts +13 -0
- package/types/server/lifecycle/startGuard.d.ts +10 -0
- package/types/server/logging/logHub.d.ts +5 -1
- package/types/server/logging/logStreamRoute.d.ts +2 -0
- package/types/server/logging/rotatingLogWriter.d.ts +1 -1
- package/types/server/logging/serverLogging.d.ts +12 -0
- package/types/server/mcp/AgentTools.d.ts +31 -0
- package/types/server/mcp/AgentToolsAccount.d.ts +7 -0
- package/types/server/mcp/McpApps.d.ts +6 -2
- package/types/server/mcp/McpDispatcher.d.ts +10 -1
- package/types/server/mcp/McpPages.d.ts +2 -1
- package/types/server/mcp/McpRateLimiter.d.ts +3 -0
- package/types/server/mcp/index.d.ts +1 -0
- package/types/server/migration/migrationCommand.d.ts +1 -1
- package/types/server/migration/migrationRunner.d.ts +9 -1
- package/types/server/remote/RemoteFetch.d.ts +42 -0
- package/types/server/remote/RemoteMcp.d.ts +52 -0
- package/types/server/remote/RemoteOAuth.d.ts +58 -0
- package/types/server/remote/RemoteSource.d.ts +51 -0
- package/types/server/remote/index.d.ts +5 -0
- package/types/server/remote/remoteError.d.ts +12 -0
- package/types/server/remote.d.ts +1 -0
- package/types/server/resolver/CascadeRunner.d.ts +2 -2
- package/types/server/resolver/database.resolver.d.ts +2 -2
- package/types/server/resolver/databaseModelInstance.d.ts +4 -0
- package/types/server/resolver/invalidSignal.d.ts +2 -0
- package/types/server/resolver/livePause.d.ts +5 -0
- package/types/server/resolver/modelFacade.d.ts +5 -0
- package/types/server/resolver/modelLoaders.d.ts +15 -0
- package/types/server/resolver/modelSchema.d.ts +6 -0
- package/types/server/resolver/roomAdmission.d.ts +7 -0
- package/types/server/resolver/signal.resolver.d.ts +1 -1
- package/types/server/resolver/sliceCrud.d.ts +8 -0
- package/types/server/resolver/timedQuery.d.ts +8 -0
- package/types/server/routeElementComposer.d.ts +21 -5
- package/types/server/routing/builtinRoutes.d.ts +24 -0
- package/types/server/routing/localRooms.d.ts +14 -0
- package/types/server/routing/roomReplay.d.ts +2 -2
- package/types/server/routing/serverListener.d.ts +31 -0
- package/types/server/rscClientCache.d.ts +34 -0
- package/types/server/rscClientChunks.d.ts +3 -1
- package/types/server/rscClientFetch.d.ts +1 -1
- package/types/server/rscClientPatch.d.ts +12 -1
- package/types/server/rscDocumentHead.d.ts +33 -0
- package/types/server/rscFlightRenderer.d.ts +14 -0
- package/types/server/rscFlightStream.d.ts +53 -0
- package/types/server/rscHostReloads.d.ts +54 -0
- package/types/server/rscHostRenderStream.d.ts +53 -0
- package/types/server/rscHostRequests.d.ts +29 -0
- package/types/server/rscHttp.d.ts +4 -2
- package/types/server/rscNavigationState.d.ts +5 -1
- package/types/server/rscPagePrompts.d.ts +13 -0
- package/types/server/rscPrefetchCache.d.ts +7 -6
- package/types/server/rscRenderControl.d.ts +12 -0
- package/types/server/rscRenderFallbacks.d.ts +41 -0
- package/types/server/rscRenderHandler.d.ts +29 -0
- package/types/server/rscRenderStats.d.ts +32 -0
- package/types/server/rscResultCaches.d.ts +18 -0
- package/types/server/rscRouteDocument.d.ts +52 -0
- package/types/server/rscStaticApp.d.ts +28 -0
- package/types/server/rscWorker.d.ts +1 -3
- package/types/server/rscWorkerHost.d.ts +10 -70
- package/types/server/rscWorkerProcess.d.ts +31 -0
- package/types/server/rscWorkerRecycler.d.ts +22 -0
- package/types/server/serverConfig.d.ts +30 -0
- package/types/server/serverMetrics.d.ts +11 -0
- package/types/server/sitemap.d.ts +1 -0
- package/types/server/ssrFromRscRenderer.d.ts +2 -2
- package/types/server/ssrStaticApp.d.ts +20 -0
- package/types/server/webArtifact.d.ts +7 -0
- package/types/server/webAssetRoutes.d.ts +11 -0
- package/types/server/webCsrSurface.d.ts +18 -0
- package/types/server/webDocumentRoute.d.ts +19 -0
- package/types/server/webRouteContext.d.ts +45 -0
- package/types/server/webRouter.d.ts +3 -28
- package/types/server/webRscRoute.d.ts +24 -0
- package/types/server/webSiteFiles.d.ts +12 -0
- package/types/server/webStaticApp.d.ts +8 -0
- package/types/server/wellKnownRoutes.d.ts +5 -0
- package/types/service/agent.service.d.ts +3 -0
- package/types/service/agentAccounts.d.ts +8 -0
- package/types/service/agentLoop/agentLoop.d.ts +33 -0
- package/types/service/agentLoop/agentLoopTypes.d.ts +235 -0
- package/types/service/agentLoop/deltaStream.d.ts +3 -0
- package/types/service/agentLoop/loopAnswer.d.ts +13 -0
- package/types/service/agentLoop/loopAsk.d.ts +12 -0
- package/types/service/agentLoop/loopCompaction.d.ts +12 -0
- package/types/service/agentLoop/loopRemotes.d.ts +40 -0
- package/types/service/agentLoop/loopRequest.d.ts +9 -0
- package/types/service/agentLoop/loopStored.d.ts +6 -0
- package/types/service/agentLoop/loopToolOutput.d.ts +8 -0
- package/types/service/agentLoop/loopToolkits.d.ts +17 -0
- package/types/service/agentLoop/loopTranscript.d.ts +13 -0
- package/types/{signal → service}/agentMeter.d.ts +1 -1
- package/types/{signal → service}/agentRelayPolicy.d.ts +18 -3
- package/types/service/index.d.ts +6 -0
- package/types/service/injectInfo.d.ts +2 -1
- package/types/service/ipcTypes.d.ts +10 -0
- package/types/service/liveRoomLimit.d.ts +26 -0
- package/types/service/liveRoomLimitError.d.ts +9 -0
- package/types/service/predefinedAdaptor/agentTools.adaptor.d.ts +31 -0
- package/types/service/predefinedAdaptor/anthropicLlm.d.ts +2 -2
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +9 -7
- package/types/service/predefinedAdaptor/index.d.ts +1 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +12 -0
- package/types/service/predefinedAdaptor/openaiDialect.d.ts +3 -2
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/solidPubsub.adaptor.d.ts +3 -0
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +1 -1
- package/types/service/predefinedAdaptor/sql/DocumentHydrator.d.ts +11 -0
- package/types/service/predefinedAdaptor/sql/DocumentRowCodec.d.ts +26 -0
- package/types/service/predefinedAdaptor/sql/DocumentWriter.d.ts +25 -0
- package/types/service/predefinedAdaptor/sql/QueryScope.d.ts +16 -0
- package/types/service/predefinedAdaptor/sql/QueryWriter.d.ts +20 -0
- package/types/service/predefinedAdaptor/sql/SqlDocumentStore.d.ts +5 -28
- package/types/service/predefinedAdaptor/sql/SqlTableSchema.d.ts +22 -0
- package/types/service/predefinedAdaptor/sql/StoredRows.d.ts +27 -0
- package/types/service/predefinedAdaptor/sql/TransactionScope.d.ts +3 -1
- package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +3 -15
- package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +0 -8
- package/types/service/predefinedAdaptor/sql/types.d.ts +27 -4
- package/types/service/predefinedAdaptor/sseData.d.ts +13 -0
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +7 -3
- package/types/service/serviceRegistry.d.ts +1 -0
- package/types/signal/SignalFailure.d.ts +4 -0
- package/types/signal/agentTurnStream.d.ts +3 -0
- package/types/signal/byIdRead.d.ts +7 -0
- package/types/signal/carriedClientIps.d.ts +4 -0
- package/types/signal/endpointRateLimit.d.ts +12 -0
- package/types/signal/index.d.ts +32 -32
- package/types/signal/mcp/McpDocument.d.ts +2 -0
- package/types/signal/mcp/mcpProtocol.d.ts +5 -0
- package/types/signal/mcp/pagePrompt.d.ts +13 -0
- package/types/signal/resolveFieldContext.d.ts +15 -0
- package/types/signal/serializer/fetch.serializer.d.ts +3 -1
- package/types/signal/signalContext.d.ts +2 -14
- package/types/signal/slice.d.ts +15 -13
- package/types/signal/trace.d.ts +12 -1
- package/types/signal/types.d.ts +38 -7
- package/types/store/action.d.ts +4 -27
- package/types/store/actionErrorMessage.d.ts +1 -0
- package/types/store/actionOption.d.ts +24 -0
- package/types/store/baseSt.d.ts +1 -0
- package/types/store/formFieldSetters.d.ts +80 -0
- package/types/store/index.d.ts +17 -16
- package/types/store/modelActionContext.d.ts +189 -0
- package/types/store/modelOpenActions.d.ts +12 -0
- package/types/store/modelWriteActions.d.ts +16 -0
- package/types/store/modelWriteGuard.d.ts +2 -5
- package/types/store/openSeq.d.ts +17 -0
- package/types/store/sliceListActions.d.ts +295 -0
- package/types/store/sliceLiveActions.d.ts +6 -0
- package/types/store/stateBuilder.d.ts +2 -0
- package/types/test/conformance.d.ts +3 -1
- package/types/ui/Agent/Chat.d.ts +5 -2
- package/types/ui/Agent/ChatHeader.d.ts +13 -0
- package/types/ui/Agent/ChatPendingCards.d.ts +23 -0
- package/types/ui/Agent/ToolRow.d.ts +13 -0
- package/types/ui/Field/Choice.d.ts +2 -1
- package/types/ui/Field/index.d.ts +1 -1
- package/types/ui/Reference/origin.d.ts +1 -0
- package/types/ui/UiOverride/UiOverride.d.ts +2 -0
- package/types/ui/index.d.ts +2 -1
- package/types/ui/overlayLayer.d.ts +8 -2
- package/types/ui/recipe/badgeRecipe.d.ts +3 -3
- package/types/ui/recipe/buttonRecipe.d.ts +3 -3
- package/types/ui/recipe/inputRecipe.d.ts +1 -1
- package/types/vendor/@akanjs/native/packages/cli/src/lib/project.d.ts +4 -0
- package/types/vendor/@akanjs/native/packages/desktop/src/relaunch.d.ts +1 -0
- package/types/vendor/@akanjs/native/plugins/appearance/src/index.d.ts +9 -0
- package/types/vendor/@akanjs/native/plugins/external-view/src/index.d.ts +22 -13
- package/types/vendor/@akanjs/native/plugins/single-instance/src/socket.d.ts +15 -2
- package/types/vendor/use-agentic/AgentClientTools.d.ts +19 -0
- package/types/vendor/use-agentic/Compaction.d.ts +3 -1
- package/types/vendor/use-agentic/SessionQuestion.d.ts +26 -0
- package/types/vendor/use-agentic/Transcript.d.ts +1 -1
- package/types/vendor/use-agentic/failureCode.d.ts +4 -0
- package/types/vendor/use-agentic/index.d.ts +1 -0
- package/types/vendor/use-agentic/types.d.ts +12 -3
- package/types/webkit/CsrGuards.d.ts +3 -0
- package/types/webkit/McpAppHost.d.ts +24 -0
- package/types/webkit/RouteLevelBoundary.d.ts +17 -0
- package/types/webkit/csrRefresh.d.ts +13 -0
- package/types/webkit/index.d.ts +3 -0
- package/types/webkit/needsBrowser.d.ts +5 -0
- package/types/webkit/useCamera.d.ts +1 -1
- package/types/webkit/useCsrKeyboard.d.ts +19 -0
- package/types/webkit/useCsrLocationState.d.ts +21 -0
- package/types/webkit/useCsrNavigation.d.ts +25 -0
- package/types/webkit/useCsrRefs.d.ts +33 -0
- package/types/webkit/useCsrRenderTrace.d.ts +13 -0
- package/types/webkit/useCsrStackLifecycle.d.ts +12 -0
- package/types/webkit/useCsrTransitions.d.ts +2 -0
- package/types/webkit/useGeoLocation.d.ts +1 -1
- package/types/webkit/useHistory.d.ts +2 -3
- package/types/webkit/useResolvedFrame.d.ts +38 -0
- package/types/webkit/useSyncNavigation.d.ts +22 -0
- package/ui/Agent/Bubble.tsx +4 -118
- package/ui/Agent/Chat.tsx +402 -235
- package/ui/Agent/ChatHeader.tsx +59 -0
- package/ui/Agent/ChatPendingCards.tsx +49 -0
- package/ui/Agent/ToolRow.tsx +117 -0
- package/ui/Agent/fetchRunner.ts +8 -1
- package/ui/BottomSheet.tsx +1 -1
- package/ui/Data/Item.tsx +2 -2
- package/ui/Data/ListContainer.tsx +348 -181
- package/ui/Data/useViewModal.ts +10 -4
- package/ui/Dialog/LegacyModal.tsx +1 -1
- package/ui/Dialog/Modal.tsx +1 -1
- package/ui/Field/Choice.tsx +3 -1
- package/ui/Load/StreamBoundary.tsx +1 -6
- package/ui/Load/View.tsx +2 -1
- package/ui/Model/EditModal.tsx +2 -1
- package/ui/Popconfirm.tsx +1 -1
- package/ui/Reference/origin.ts +1 -0
- package/ui/Select.tsx +43 -51
- package/ui/Signal/RestApi.tsx +3 -2
- package/ui/System/Client.tsx +4 -1
- package/ui/UiOverride/UiOverride.tsx +2 -0
- package/ui/index.ts +5 -0
- package/ui/overlayLayer.ts +25 -2
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativeActivity.kt +31 -13
- package/vendor/@akanjs/native/native/android/src/com/akanjs/runtime/AkanNativePlugin.kt +4 -0
- 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/external.rs +240 -114
- package/vendor/@akanjs/native/native/desktop/src/json.rs +14 -1
- package/vendor/@akanjs/native/native/desktop/src/lib.rs +12 -4
- package/vendor/@akanjs/native/native/desktop/src/linux/external.rs +696 -0
- package/vendor/@akanjs/native/native/desktop/src/linux/mod.rs +1 -0
- package/vendor/@akanjs/native/native/ios/Sources/AkanNativeViewController.swift +6 -1
- package/vendor/@akanjs/native/packages/cli/src/lib/native-plugins.ts +5 -3
- package/vendor/@akanjs/native/packages/cli/src/lib/project.ts +25 -1
- package/vendor/@akanjs/native/packages/desktop/src/deeplinks.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/host.ts +2 -2
- package/vendor/@akanjs/native/packages/desktop/src/relaunch.ts +8 -3
- package/vendor/@akanjs/native/plugins/app/src/desktop.ts +2 -2
- package/vendor/@akanjs/native/plugins/appearance/android/AppearancePlugin.kt +13 -0
- package/vendor/@akanjs/native/plugins/appearance/ios/AppearancePlugin.swift +27 -0
- package/vendor/@akanjs/native/plugins/appearance/native-plugin.json +2 -2
- package/vendor/@akanjs/native/plugins/appearance/src/index.ts +8 -1
- package/vendor/@akanjs/native/plugins/autostart/src/desktop.ts +2 -1
- package/vendor/@akanjs/native/plugins/external-view/native-plugin.json +4 -1
- package/vendor/@akanjs/native/plugins/external-view/src/index.ts +22 -13
- package/vendor/@akanjs/native/plugins/single-instance/src/socket.ts +113 -24
- package/vendor/use-agentic/AgentClientTools.ts +33 -0
- package/vendor/use-agentic/AgentSession.ts +35 -73
- package/vendor/use-agentic/CHANGELOG.md +0 -43
- package/vendor/use-agentic/Compaction.ts +12 -2
- package/vendor/use-agentic/SessionQuestion.ts +99 -0
- package/vendor/use-agentic/ToolRunner.ts +3 -15
- package/vendor/use-agentic/Transcript.ts +8 -5
- package/vendor/use-agentic/WIRE.md +28 -9
- package/vendor/use-agentic/failureCode.ts +44 -0
- package/vendor/use-agentic/httpRunner.ts +22 -8
- package/vendor/use-agentic/index.ts +1 -0
- package/vendor/use-agentic/types.ts +13 -1
- package/webkit/CsrGuards.ts +11 -2
- package/webkit/McpAppFetchBridge.ts +3 -1
- package/webkit/McpAppHost.ts +122 -0
- package/webkit/RenderLayer.tsx +48 -14
- package/webkit/RouteLevelBoundary.tsx +37 -0
- package/webkit/csrRefresh.ts +33 -0
- package/webkit/index.ts +3 -0
- package/webkit/lazy.tsx +5 -1
- package/webkit/needsBrowser.ts +10 -0
- package/webkit/useCamera.tsx +18 -7
- package/webkit/useCsrKeyboard.ts +155 -0
- package/webkit/useCsrLocationState.ts +58 -0
- package/webkit/useCsrNavigation.ts +302 -0
- package/webkit/useCsrRefs.ts +52 -0
- package/webkit/useCsrRenderTrace.ts +68 -0
- package/webkit/useCsrStackLifecycle.ts +120 -0
- package/webkit/useCsrTransitions.ts +552 -0
- package/webkit/useCsrValues.ts +73 -1235
- package/webkit/useGeoLocation.tsx +1 -3
- package/webkit/useHistory.ts +2 -2
- package/webkit/useLocation.ts +3 -2
- package/webkit/useResolvedFrame.ts +116 -0
- package/webkit/useSyncNavigation.ts +109 -0
- package/vendor/@akanjs/native/CHANGELOG.md +0 -21
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { AgentLoopRemote, AgentLoopRemoteResult, AgentTool } from "akanjs/service";
|
|
2
|
+
import type { RemoteFetch } from "./RemoteFetch.d.ts";
|
|
3
|
+
import { type RemoteMcpCallResult } from "./RemoteMcp.d.ts";
|
|
4
|
+
export interface RemoteAccess {
|
|
5
|
+
/** The connection's access token, `""` for a remote that asks for none, or `null` with no connection. */
|
|
6
|
+
token(): Promise<string | null>;
|
|
7
|
+
/** Asked after a 401: a renewed token, or `null` once the connection cannot be renewed. */
|
|
8
|
+
renew(): Promise<string | null>;
|
|
9
|
+
}
|
|
10
|
+
export interface RemoteSourceProps {
|
|
11
|
+
name: string;
|
|
12
|
+
/** The remote's MCP endpoint, as `RemoteSource.endpointOf` normalized it. */
|
|
13
|
+
url: string;
|
|
14
|
+
description: string;
|
|
15
|
+
/** Narrows what the model is listed to these tool names; omitted, every tool the remote lists to the account. */
|
|
16
|
+
allow?: readonly string[];
|
|
17
|
+
access: RemoteAccess;
|
|
18
|
+
fetcher: RemoteFetch;
|
|
19
|
+
clientName?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface RemoteScreen {
|
|
22
|
+
html: string;
|
|
23
|
+
href?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class RemoteSource implements AgentLoopRemote {
|
|
26
|
+
#private;
|
|
27
|
+
static readonly disconnected = "remoteDisconnected";
|
|
28
|
+
static readonly viewBytes: number;
|
|
29
|
+
readonly name: string;
|
|
30
|
+
readonly description: string;
|
|
31
|
+
constructor(props: RemoteSourceProps);
|
|
32
|
+
/** A typed address as an MCP endpoint: a bare origin means the `/mcp` an akan server answers at. */
|
|
33
|
+
static endpointOf(fetcher: RemoteFetch, input: string): string;
|
|
34
|
+
list(): Promise<AgentTool[] | null>;
|
|
35
|
+
call(tool: string, args: Record<string, unknown>): Promise<AgentLoopRemoteResult>;
|
|
36
|
+
/**
|
|
37
|
+
* A static app's screen as the remote rendered it for this account, or `null` when it sent none.
|
|
38
|
+
* Security: reached from a browser with no `approve` in front, so it calls only what the remote lists as a
|
|
39
|
+
* read-only static app.
|
|
40
|
+
*/
|
|
41
|
+
screen(tool: string, args: Record<string, unknown>): Promise<RemoteScreen | null>;
|
|
42
|
+
/**
|
|
43
|
+
* An app's view document, framed for a sandboxed frame on another origin, or `null` when the remote lists no such view.
|
|
44
|
+
* Security: the document is the remote's own script. The policy put ahead of it lets it load only from the remote's
|
|
45
|
+
* origin and connect nowhere, so everything it does goes through the host that frames it.
|
|
46
|
+
*/
|
|
47
|
+
view(uri: string): Promise<string | null>;
|
|
48
|
+
/** A call the view itself makes, answered as its server answers a view: raw values, for that frame alone. */
|
|
49
|
+
viewCall(tool: string, args: Record<string, unknown>): Promise<RemoteMcpCallResult | null>;
|
|
50
|
+
static framed(html: string, origin: string): string;
|
|
51
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { type RemoteAddressLookup, RemoteFetch, type RemoteFetchOptions, type RemoteRequest, type RemoteResponse, } from "./RemoteFetch.d.ts";
|
|
2
|
+
export { RemoteMcp, type RemoteMcpCallResult, type RemoteMcpContent, type RemoteMcpOptions, type RemoteMcpTool, } from "./RemoteMcp.d.ts";
|
|
3
|
+
export { type RemoteAuthServer, type RemoteClient, RemoteOAuth, type RemoteTokens } from "./RemoteOAuth.d.ts";
|
|
4
|
+
export { type RemoteAccess, type RemoteScreen, RemoteSource, type RemoteSourceProps } from "./RemoteSource.d.ts";
|
|
5
|
+
export { RemoteError, type RemoteErrorCode } from "./remoteError.d.ts";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AkanError } from "akanjs/base";
|
|
2
|
+
export type RemoteErrorCode = "remoteUrlRejected" | "remoteUnauthorized" | "remoteUnavailable" | "remoteTooLarge" | "remoteProtocol" | "remoteOAuth";
|
|
3
|
+
export declare class RemoteError extends AkanError<RemoteErrorCode, {
|
|
4
|
+
challenge?: string;
|
|
5
|
+
status?: number;
|
|
6
|
+
}> {
|
|
7
|
+
constructor(code: RemoteErrorCode, message: string, data?: {
|
|
8
|
+
challenge?: string;
|
|
9
|
+
status?: number;
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
export declare const clipRemoteText: (text: string, max?: number) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./remote/index.d.ts";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ConstantModel } from "akanjs/constant";
|
|
2
2
|
import { type DocumentSchema } from "akanjs/document";
|
|
3
|
-
import type { DatabaseService, ServiceCls } from "akanjs/service";
|
|
3
|
+
import type { DatabaseService, Service, ServiceCls } from "akanjs/service";
|
|
4
4
|
export declare class CascadeRunner {
|
|
5
5
|
#private;
|
|
6
6
|
register(constant: ConstantModel, schema: DocumentSchema, srvRef: ServiceCls): void;
|
|
7
|
-
seal(getService: (refName: string) => DatabaseService): void;
|
|
7
|
+
seal(getService: (refName: string) => DatabaseService & Service): void;
|
|
8
8
|
run(refName: string, doc: Record<string, unknown>): Promise<void>;
|
|
9
9
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { type DatabaseInstance, type DatabaseModel, DocumentSchema } from "akanjs/document";
|
|
1
|
+
import type { ConstantModel } from "akanjs/constant";
|
|
2
|
+
import { type DatabaseInstance, type DatabaseModel, type DocumentSchema } from "akanjs/document";
|
|
3
3
|
import { type AdaptorCls } from "akanjs/service";
|
|
4
4
|
export declare class DatabaseResolver {
|
|
5
5
|
static applyFilterMethods(prototype: object, database: DatabaseModel, className: string): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type ConstantModel } from "akanjs/constant";
|
|
2
|
+
import { type DatabaseInstance, type DatabaseModel, type DocumentSchema } from "akanjs/document";
|
|
3
|
+
import { type AdaptorCls } from "akanjs/service";
|
|
4
|
+
export declare const databaseModelInstanceOf: (constant: ConstantModel, database: DatabaseModel, schema: DocumentSchema) => AdaptorCls<DatabaseInstance<any, any, any, any, any, any>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type Mdl, NoDocumentError } from "akanjs/document";
|
|
2
|
+
import type { DocumentStore } from "akanjs/service";
|
|
3
|
+
import type { SchemaListener } from "./modelSchema.d.ts";
|
|
4
|
+
export declare const missedById: (refName: string, id: string) => NoDocumentError;
|
|
5
|
+
export declare const modelFacadeOf: (store: DocumentStore, modelName: string, listenPreHook: SchemaListener, listenPostHook: SchemaListener) => Mdl<any, any>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DataLoader, type LoaderInfo } from "akanjs/document";
|
|
2
|
+
import type { DatabaseAdaptor, DocumentStore, DocumentWriteListener } from "akanjs/service";
|
|
3
|
+
interface StoreHost {
|
|
4
|
+
readonly __database: DatabaseAdaptor;
|
|
5
|
+
readonly __store: DocumentStore;
|
|
6
|
+
}
|
|
7
|
+
type DocumentCopy = (doc: Record<string, unknown> | null) => unknown;
|
|
8
|
+
export declare const idLoaderOf: (host: StoreHost, name: string, copy: DocumentCopy) => DataLoader<string, any, string>;
|
|
9
|
+
export declare const declaredLoaderOf: (host: StoreHost, key: string, loaderInfo: LoaderInfo, copy: DocumentCopy) => DataLoader<any, any, string>;
|
|
10
|
+
interface KeptLoader {
|
|
11
|
+
loaderInfo: LoaderInfo;
|
|
12
|
+
loader: DataLoader<any, any, string>;
|
|
13
|
+
}
|
|
14
|
+
export declare const forgetWritten: (kept: KeptLoader[]) => DocumentWriteListener;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PromiseOrObject } from "akanjs/base";
|
|
2
|
+
import type { ConstantModel } from "akanjs/constant";
|
|
3
|
+
import { type CRUDEventType, type DatabaseModel, DocumentSchema, type SaveEventType } from "akanjs/document";
|
|
4
|
+
export declare const modelSchemaOf: (constant: ConstantModel, database: DatabaseModel) => DocumentSchema;
|
|
5
|
+
export declare const schemaListenerOf: (schema: DocumentSchema, phase: "pre" | "post") => (type: SaveEventType, listener: (doc: any, type: CRUDEventType, previous?: any) => PromiseOrObject<void>) => () => void;
|
|
6
|
+
export type SchemaListener = ReturnType<typeof schemaListenerOf>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LiveRegistry } from "akanjs/service";
|
|
2
|
+
import type { SignalContext } from "../../signal/signalContext.d.ts";
|
|
3
|
+
export declare class RoomAdmission {
|
|
4
|
+
#private;
|
|
5
|
+
static admit(ws: object, held: Map<string, SignalContext>, roomId: string, context: SignalContext, live: LiveRegistry, query: unknown): void;
|
|
6
|
+
static release(ws: object, roomIds: Iterable<string>): void;
|
|
7
|
+
}
|
|
@@ -13,7 +13,7 @@ export declare class SignalResolver {
|
|
|
13
13
|
#private;
|
|
14
14
|
static logger: Logger;
|
|
15
15
|
static coalescesRoom(roomId: string): boolean;
|
|
16
|
-
static setLocalPublish(localPublish: LocalPublish, websocket: WebsocketAdaptor, live?: LiveRegistry, roomReplay?: RoomReplay | null): void;
|
|
16
|
+
static setLocalPublish(localPublish: LocalPublish, websocket: WebsocketAdaptor, live?: LiveRegistry, roomReplay?: RoomReplay | null, resync?: (roomId: string) => void): void;
|
|
17
17
|
static resolveServerSignal(serverSignalCls: ServerSignalCls, { registry, live }: {
|
|
18
18
|
registry: InjectRegistry;
|
|
19
19
|
live: LiveRegistry;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EndpointInfo } from "../../signal/endpointInfo.d.ts";
|
|
2
|
+
import type { SliceCls } from "../../signal/slice.d.ts";
|
|
3
|
+
export declare class SliceCrud {
|
|
4
|
+
#private;
|
|
5
|
+
static endpoints(builder: unknown, sliceCls: SliceCls, cnst: NonNullable<SliceCls["srv"]["cnst"]>): {
|
|
6
|
+
[key: string]: EndpointInfo;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DocumentTouchOptions } from "akanjs/document";
|
|
2
|
+
export declare const timedQuery: <T>(fn: () => Promise<T>) => Promise<T>;
|
|
3
|
+
export declare const touchOf: (options?: DocumentTouchOptions) => {
|
|
4
|
+
touch: boolean;
|
|
5
|
+
} | {
|
|
6
|
+
touch?: undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const touchArgs: (options?: DocumentTouchOptions) => [] | [DocumentTouchOptions];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Head, LayoutFallbackRoute, PathRoute, ResolvedHead, ResolveHeadResult, RouteRender } from "akanjs/client";
|
|
2
|
-
import { type ReactElement, type ReactNode } from "react";
|
|
2
|
+
import { type ComponentType, type ReactElement, type ReactNode } from "react";
|
|
3
3
|
import type { FallbackHead } from "./fallbackHead.d.ts";
|
|
4
4
|
import { RouteShellGate } from "./routeShellGate.d.ts";
|
|
5
5
|
import { type AkanRouteSegmentState } from "./routeState.d.ts";
|
|
@@ -17,19 +17,32 @@ export interface AdmittedNotFoundFallback {
|
|
|
17
17
|
params: Record<string, string>;
|
|
18
18
|
searchParams: Record<string, string | string[]>;
|
|
19
19
|
}
|
|
20
|
+
export type LevelBoundary = ComponentType<{
|
|
21
|
+
children?: ReactNode;
|
|
22
|
+
}>;
|
|
23
|
+
export interface LevelBoundaryOwner {
|
|
24
|
+
getLevelBoundary?: () => Promise<LevelBoundary | undefined>;
|
|
25
|
+
}
|
|
26
|
+
export interface OwnedLevelBoundary {
|
|
27
|
+
Boundary: LevelBoundary;
|
|
28
|
+
owner: RouteRender;
|
|
29
|
+
}
|
|
30
|
+
export interface SsrPathRoute extends PathRoute {
|
|
31
|
+
levelBoundary?: OwnedLevelBoundary;
|
|
32
|
+
}
|
|
20
33
|
export declare class RouteElementComposer {
|
|
21
34
|
#private;
|
|
22
35
|
static streamed(error: unknown): boolean;
|
|
23
36
|
static resolveSsrFramePathRoute({ pathRoute, basePath, }: {
|
|
24
37
|
pathRoute: PathRoute;
|
|
25
38
|
basePath?: string | null;
|
|
26
|
-
}): Promise<
|
|
39
|
+
}): Promise<SsrPathRoute>;
|
|
27
40
|
static resolveSsrFallbackFrameState({ route, basePath, }: {
|
|
28
41
|
route: PathRoute | LayoutFallbackRoute;
|
|
29
42
|
basePath?: string | null;
|
|
30
43
|
}): Promise<import("akanjs/client").PageState>;
|
|
31
44
|
static compose({ pathRoute, params, searchParams, navKey, notFound, gate, }: {
|
|
32
|
-
pathRoute:
|
|
45
|
+
pathRoute: SsrPathRoute;
|
|
33
46
|
params: Record<string, string>;
|
|
34
47
|
searchParams: Record<string, string | string[]>;
|
|
35
48
|
navKey?: string;
|
|
@@ -59,7 +72,7 @@ export declare class RouteElementComposer {
|
|
|
59
72
|
params: Record<string, string>;
|
|
60
73
|
} | null, searchParams: Record<string, string | string[]>): Promise<AdmittedNotFoundFallback | null>;
|
|
61
74
|
static composeSuffix({ pathRoute, params, searchParams, patchStartIndex, navKey, notFound, }: {
|
|
62
|
-
pathRoute:
|
|
75
|
+
pathRoute: SsrPathRoute;
|
|
63
76
|
params: Record<string, string>;
|
|
64
77
|
searchParams: Record<string, string | string[]>;
|
|
65
78
|
patchStartIndex: number;
|
|
@@ -97,11 +110,14 @@ export declare class RouteElementComposer {
|
|
|
97
110
|
gate?: RouteShellGate;
|
|
98
111
|
head?: FallbackHead;
|
|
99
112
|
}): Promise<ReactNode | null>;
|
|
100
|
-
static composeRenders({ renders, owners, segments, params, searchParams, navKey, notFound, gate, }: {
|
|
113
|
+
static composeRenders({ renders, owners, segments, levelBoundary, params, searchParams, navKey, notFound, gate, }: {
|
|
101
114
|
renders: RouteRender[];
|
|
102
115
|
/** Layouts above `renders` that this element leaves out (a patch) but whose `.notFound()` still applies. */
|
|
103
116
|
owners?: RouteRender[];
|
|
104
117
|
segments?: AkanRouteSegmentState[];
|
|
118
|
+
/** Around each level below its owner: the Flight server only references it and React's server renderer runs no
|
|
119
|
+
* error boundary, so a level failing before the first byte still takes its `.error()`. */
|
|
120
|
+
levelBoundary?: OwnedLevelBoundary;
|
|
105
121
|
params: Record<string, string>;
|
|
106
122
|
searchParams: Record<string, string | string[]>;
|
|
107
123
|
navKey?: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AkanServer } from "../akanServer.d.ts";
|
|
2
|
+
import type { DiLifecycle } from "../di/diLifecycle.d.ts";
|
|
3
|
+
import type { ServerLogging } from "../logging/serverLogging.d.ts";
|
|
4
|
+
import { McpRouter } from "../mcp.d.ts";
|
|
5
|
+
import type { ServerMetrics } from "../serverMetrics.d.ts";
|
|
6
|
+
import type { HttpRoutes } from "../types.d.ts";
|
|
7
|
+
import type { WebRouter } from "../webRouter.d.ts";
|
|
8
|
+
import type { ServerListener } from "./serverListener.d.ts";
|
|
9
|
+
type BuiltinRoutesOwner = Pick<AkanServer, "name" | "logger" | "env" | "status" | "serverMode" | "prefix" | "websocketPrefix" | "openapi" | "mcp" | "mcpReadOnly" | "mcpAuth" | "mcpOption">;
|
|
10
|
+
interface BuiltinRoutesProps {
|
|
11
|
+
owner: BuiltinRoutesOwner;
|
|
12
|
+
di: DiLifecycle;
|
|
13
|
+
solo: boolean;
|
|
14
|
+
listener: ServerListener;
|
|
15
|
+
metrics: ServerMetrics;
|
|
16
|
+
logging: ServerLogging;
|
|
17
|
+
}
|
|
18
|
+
export declare class BuiltinRoutes {
|
|
19
|
+
#private;
|
|
20
|
+
constructor({ owner, di, solo, listener, metrics, logging }: BuiltinRoutesProps);
|
|
21
|
+
get mcpRouter(): McpRouter | null;
|
|
22
|
+
timed(webRouter: WebRouter | null, initTimings: Map<string, number>): HttpRoutes;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { BinaryPubsub } from "../binaryPubsub.d.ts";
|
|
2
|
+
import type { LocalPublish } from "../types.d.ts";
|
|
3
|
+
import type { RoomReplay } from "./roomReplay.d.ts";
|
|
4
|
+
export interface LocalRoomsOptions {
|
|
5
|
+
servers: (Bun.Server<never> | null)[];
|
|
6
|
+
replay: RoomReplay;
|
|
7
|
+
binary: BinaryPubsub;
|
|
8
|
+
subscribed: (roomId: string) => boolean;
|
|
9
|
+
coalesces: (roomId: string) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const localRoomsOf: ({ servers, replay, binary, subscribed, coalesces }: LocalRoomsOptions) => {
|
|
12
|
+
publish: LocalPublish;
|
|
13
|
+
resync: (roomId: string) => void;
|
|
14
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type WebsocketAdaptor } from "akanjs/service";
|
|
2
|
-
import type { WebsocketPublishData, WebsocketRoomCursor } from "akanjs/signal";
|
|
2
|
+
import type { WebsocketPublishData, WebsocketResyncData, WebsocketRoomCursor } from "akanjs/signal";
|
|
3
3
|
export interface RoomReplayOptions {
|
|
4
4
|
/** Whether this process sees every publish to a room, so a run of sequence numbers it holds has no hole. */
|
|
5
5
|
vouches: boolean;
|
|
@@ -29,7 +29,7 @@ export declare class RoomReplay {
|
|
|
29
29
|
/** A frame went out to the room without a number, so no cursor taken before it is vouched for. */
|
|
30
30
|
unnumbered(roomId: string): void;
|
|
31
31
|
/** The frame to send for one publish; numbered while the room is watched, and kept when this process vouches. */
|
|
32
|
-
frameOf(publishData: WebsocketPublishData, subscribed: boolean, now?: number): string;
|
|
32
|
+
frameOf(publishData: WebsocketPublishData | WebsocketResyncData, subscribed: boolean, now?: number): string;
|
|
33
33
|
/** Where the room's numbering stands here, for a subscribe's ack; `null` for a room nobody watches. */
|
|
34
34
|
cursor(roomId: string): WebsocketRoomCursor | null;
|
|
35
35
|
/** The frames numbered after the cursor, or `null` when this process cannot tell whether that is all of them. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AkanServer } from "../akanServer.d.ts";
|
|
2
|
+
import type { DiLifecycle } from "../di/diLifecycle.d.ts";
|
|
3
|
+
import type { HmrWsData, HmrWsHub } from "../hmr/wsHub.d.ts";
|
|
4
|
+
import type { WebProxyRunner } from "../proxy.d.ts";
|
|
5
|
+
import type { HttpRoutes, LocalPublish, SignalRoutes, WebsocketRoutes } from "../types.d.ts";
|
|
6
|
+
import type { WebRouter } from "../webRouter.d.ts";
|
|
7
|
+
export interface AkanAppPrepared {
|
|
8
|
+
routes: SignalRoutes["routes"];
|
|
9
|
+
routeOptions: SignalRoutes["routeOptions"];
|
|
10
|
+
wsRoutes: WebsocketRoutes;
|
|
11
|
+
builtinRoutes: HttpRoutes;
|
|
12
|
+
renderEnvRoutes: HttpRoutes;
|
|
13
|
+
hmrHub: HmrWsHub | null;
|
|
14
|
+
webProxyRunner: WebProxyRunner | null;
|
|
15
|
+
}
|
|
16
|
+
type ListenerOwner = Pick<AkanServer, "name" | "logger" | "prefix" | "websocketPrefix">;
|
|
17
|
+
export declare class ServerListener {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(owner: ListenerOwner, di: DiLifecycle, solo: boolean);
|
|
20
|
+
get port(): number | undefined;
|
|
21
|
+
get wsPort(): number | undefined;
|
|
22
|
+
get coalescedCount(): number;
|
|
23
|
+
upgradeHmrWs(req: Request, data: HmrWsData): boolean;
|
|
24
|
+
publishLocal(roomId: string, data: Parameters<LocalPublish>[1]): void;
|
|
25
|
+
listen(prepared: AkanAppPrepared, webRouter: WebRouter | null): {
|
|
26
|
+
unix: string | undefined;
|
|
27
|
+
port: number | undefined;
|
|
28
|
+
};
|
|
29
|
+
close(): void;
|
|
30
|
+
}
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { PrefetchPriority } from "../client/rscNavigation.d.ts";
|
|
2
|
+
import { type AkanRouterStateV1 } from "./routeState.d.ts";
|
|
3
|
+
import type { RscPatchedResult } from "./rscClientPatch.d.ts";
|
|
4
|
+
import { type AkanSegmentCacheNode, type RscNavigationCacheNode } from "./rscNavigationState.d.ts";
|
|
5
|
+
import { RscPrefetchCache } from "./rscPrefetchCache.d.ts";
|
|
6
|
+
export declare const normalizeHref: (href: string) => string;
|
|
7
|
+
export declare const withoutHash: (href: string | undefined) => string | undefined;
|
|
8
|
+
export declare const pageKeyOf: (href: string) => string;
|
|
9
|
+
interface RscClientScreen<T> {
|
|
10
|
+
routerState: () => AkanRouterStateV1 | null;
|
|
11
|
+
tree: () => AkanSegmentCacheNode<T> | null;
|
|
12
|
+
base: () => RscNavigationCacheNode<T> | null;
|
|
13
|
+
navId: () => number;
|
|
14
|
+
pendingTarget: () => string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export declare class RscClientCache<T extends object> {
|
|
17
|
+
#private;
|
|
18
|
+
static readonly maxEntries = 32;
|
|
19
|
+
readonly pages: Map<string, RscNavigationCacheNode<T>>;
|
|
20
|
+
readonly prefetches: RscPrefetchCache<RscNavigationCacheNode<T> | null>;
|
|
21
|
+
constructor(screen: RscClientScreen<T>);
|
|
22
|
+
clear(): void;
|
|
23
|
+
forgetAnotherAccount(): boolean;
|
|
24
|
+
noteFailedRender(thenable: T): void;
|
|
25
|
+
pageOf(target: string): RscNavigationCacheNode<T> | undefined;
|
|
26
|
+
replayedPageOf(target: string): RscNavigationCacheNode<T> | undefined;
|
|
27
|
+
replayPatch(target: string, navId: number, commit: (patch: RscPatchedResult<T>) => boolean): boolean;
|
|
28
|
+
rememberPatch(href: string, { patch, patchedNode, outletKey, headSnapshot }: RscPatchedResult<T>): void;
|
|
29
|
+
forgetPatch(target: string): void;
|
|
30
|
+
forgetPatchesOfLostBases(base: RscNavigationCacheNode<T>): void;
|
|
31
|
+
takePrefetch(target: string, signal: AbortSignal): import("./rscPrefetchCache.d.ts").RscPrefetched | null;
|
|
32
|
+
prefetch(href: string, priority?: PrefetchPriority): () => void;
|
|
33
|
+
}
|
|
34
|
+
export {};
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import type { FlightLineRowHandler } from "./flightRowReader.d.ts";
|
|
1
2
|
export interface ChunkNavigation {
|
|
2
3
|
navId: number;
|
|
3
4
|
href: string;
|
|
4
5
|
replace: () => boolean;
|
|
5
6
|
}
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function chunkRecorderOf(navigation: ChunkNavigation): FlightLineRowHandler;
|
|
7
8
|
export declare const navigationOfChunk: (chunkId: string) => ChunkNavigation | undefined;
|
|
8
9
|
export declare const isLinkFailure: (error: unknown) => boolean;
|
|
9
10
|
export declare const noteChunkLoadFailure: (error: unknown) => void;
|
|
10
11
|
export declare const lazyLinkFailureKeyOf: (error: unknown) => string | null;
|
|
12
|
+
export declare const ifLazyChunkGone: (error: unknown, then: (key: string) => void) => void;
|
|
11
13
|
export declare const reportingRootErrors: (onError: (error: unknown) => void) => {
|
|
12
14
|
onCaughtError: (error: unknown) => void;
|
|
13
15
|
onUncaughtError: (error: unknown) => void;
|
|
@@ -13,7 +13,7 @@ export type RscClientFetchResponseResult = {
|
|
|
13
13
|
type: "redirected";
|
|
14
14
|
status?: number;
|
|
15
15
|
};
|
|
16
|
-
export declare const fetchRscPrefetchResponse: (href: string, signal: AbortSignal) => Promise<Response>;
|
|
16
|
+
export declare const fetchRscPrefetchResponse: (href: string, signal: AbortSignal, currentRouterState?: AkanRouterStateV1 | null) => Promise<Response>;
|
|
17
17
|
export declare function fetchRscNavigationResponse(href: string, options: {
|
|
18
18
|
buildId?: number;
|
|
19
19
|
currentRouterState: AkanRouterStateV1 | null;
|
|
@@ -1,11 +1,21 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
import { type FlightRowPass } from "./flightRowReader.d.ts";
|
|
1
3
|
import { type AkanHeadSnapshotV1, type AkanRscPatchMetadata } from "./routeState.d.ts";
|
|
2
4
|
import { type AkanSegmentCacheNode, type AkanSegmentPatchFailureReason, type AkanSegmentPatchResult } from "./rscNavigationState.d.ts";
|
|
5
|
+
export interface RscPatchedResult<T> {
|
|
6
|
+
type: "patched";
|
|
7
|
+
tree: AkanSegmentCacheNode<T>;
|
|
8
|
+
patchedNode: AkanSegmentCacheNode<T>;
|
|
9
|
+
patch: AkanRscPatchMetadata;
|
|
10
|
+
outletKey: string;
|
|
11
|
+
headSnapshot: AkanHeadSnapshotV1;
|
|
12
|
+
}
|
|
3
13
|
interface ValidateRscSegmentPatchInput<T extends PromiseLike<unknown>> {
|
|
4
14
|
href: string;
|
|
5
15
|
response: Response;
|
|
6
16
|
patch: AkanRscPatchMetadata;
|
|
7
17
|
currentTree: AkanSegmentCacheNode<T> | null;
|
|
8
|
-
createThenable: (
|
|
18
|
+
createThenable: (rows: FlightRowPass) => T;
|
|
9
19
|
navId?: number;
|
|
10
20
|
getCurrentNavId?: () => number;
|
|
11
21
|
getHeadSnapshotPatchFailureReason?: (snapshot: AkanHeadSnapshotV1) => AkanSegmentPatchFailureReason | null;
|
|
@@ -18,4 +28,5 @@ export declare function validateRscSegmentPatch<T extends PromiseLike<unknown>>(
|
|
|
18
28
|
export declare function validateRscPatchForGuardedCommit<T extends PromiseLike<unknown>>({ partialCommitEnabled, ...input }: ValidateRscSegmentPatchInput<T> & {
|
|
19
29
|
partialCommitEnabled: boolean;
|
|
20
30
|
}): Promise<AkanSegmentPatchResult<T>>;
|
|
31
|
+
export declare function commitRscPatch<T extends PromiseLike<ReactNode>>(target: string, patch: RscPatchedResult<T>, onCommitted: () => void, onLateControl: () => void): boolean;
|
|
21
32
|
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { AkanHeadSnapshotNode, ResolvedHead, RouteRender, RouteViewport } from "akanjs/client";
|
|
2
|
+
import { type AkanI18nConfig } from "akanjs/common";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import type { RouteHeadSnapshots } from "./rscPatchPlanner.d.ts";
|
|
5
|
+
interface RscDocumentHeadProps {
|
|
6
|
+
i18n: () => AkanI18nConfig;
|
|
7
|
+
basePaths: () => string[];
|
|
8
|
+
cssAssets: () => Record<string, {
|
|
9
|
+
cssUrl: string;
|
|
10
|
+
cssRelPath: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare class RscDocumentHead {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(props: RscDocumentHeadProps);
|
|
16
|
+
static firstRootValue<T>(renderRootLayouts: RouteRender[], read: (render: RouteRender) => T | Promise<T | undefined> | undefined): Promise<T | undefined>;
|
|
17
|
+
renderViewport(viewport: RouteViewport | undefined): ReactNode;
|
|
18
|
+
renderManifestLink(url: URL, renderRootLayouts: RouteRender[]): Promise<ReactNode>;
|
|
19
|
+
renderHeadTags(url: URL, { manifestLink, routeHead, snapshots, noindex, tags, themeColors, }: {
|
|
20
|
+
manifestLink: ReactNode;
|
|
21
|
+
routeHead: ResolvedHead;
|
|
22
|
+
themeColors?: AkanHeadSnapshotNode[];
|
|
23
|
+
snapshots?: RouteHeadSnapshots;
|
|
24
|
+
noindex?: boolean;
|
|
25
|
+
tags?: ReactNode[] | null;
|
|
26
|
+
}): ReactNode;
|
|
27
|
+
renderDefaultHead(): ReactNode;
|
|
28
|
+
getBasePath(url: URL): string | null;
|
|
29
|
+
getLocaleAlternateLanguages(url: URL): Record<string, string>;
|
|
30
|
+
renderStylesheet(pathname: string): ReactNode;
|
|
31
|
+
getStylesheetHref(pathname: string): string | null;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Logger } from "akanjs/common";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import type { ClientManifest } from "./artifact.d.ts";
|
|
4
|
+
import { type FlightRenderOptions, type FlightRenderResult } from "./rscFlightStream.d.ts";
|
|
5
|
+
export declare class RscFlightRenderer {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(logger: Logger, send: (message: unknown) => void);
|
|
8
|
+
renderFlightElement(element: ReactNode, clientManifest: ClientManifest, options?: FlightRenderOptions): Promise<FlightRenderResult>;
|
|
9
|
+
get inFlightCount(): number;
|
|
10
|
+
begin(requestId: string): void;
|
|
11
|
+
isCancelled(requestId: string): boolean;
|
|
12
|
+
handleCancel(requestId: string): void;
|
|
13
|
+
release(requestId: string): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { RedirectStatus } from "akanjs/client";
|
|
2
|
+
import type { Logger } from "akanjs/common";
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import type { ClientManifest } from "./artifact.d.ts";
|
|
5
|
+
import type { RouteCacheRenderState } from "./cachePolicy.d.ts";
|
|
6
|
+
import type { RouteShellGate } from "./routeShellGate.d.ts";
|
|
7
|
+
import type { RscTraceMetadata } from "./ssrTypes.d.ts";
|
|
8
|
+
export type RenderControl = {
|
|
9
|
+
type: "redirect";
|
|
10
|
+
location: string;
|
|
11
|
+
method: "replace" | "push";
|
|
12
|
+
status: RedirectStatus;
|
|
13
|
+
} | {
|
|
14
|
+
type: "not-found";
|
|
15
|
+
} | {
|
|
16
|
+
type: "error";
|
|
17
|
+
error: unknown;
|
|
18
|
+
};
|
|
19
|
+
export interface FlightRenderResult {
|
|
20
|
+
chunks: Uint8Array[];
|
|
21
|
+
bytes: number;
|
|
22
|
+
chunksCount: number;
|
|
23
|
+
control: RenderControl | null;
|
|
24
|
+
lateControlSent: boolean;
|
|
25
|
+
cancelled: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface FlightRenderOptions {
|
|
28
|
+
requestId?: string;
|
|
29
|
+
collectChunks?: boolean;
|
|
30
|
+
status?: number;
|
|
31
|
+
trace?: RscTraceMetadata;
|
|
32
|
+
/** Raised by a render that answered `router.notFound()` in place, which React never reports as an error. */
|
|
33
|
+
notFoundProbe?: {
|
|
34
|
+
hit: boolean;
|
|
35
|
+
};
|
|
36
|
+
gate?: RouteShellGate;
|
|
37
|
+
signal?: AbortSignal;
|
|
38
|
+
onComplete?: (result: Omit<FlightRenderResult, "cancelled">) => Promise<RouteCacheRenderState> | RouteCacheRenderState;
|
|
39
|
+
}
|
|
40
|
+
interface RscFlightStreamProps {
|
|
41
|
+
logger: Logger;
|
|
42
|
+
send: (message: unknown) => void;
|
|
43
|
+
isCancelled: (requestId: string) => boolean;
|
|
44
|
+
track: (requestId: string, reader: ReadableStreamDefaultReader<Uint8Array>) => void;
|
|
45
|
+
untrack: (requestId: string) => void;
|
|
46
|
+
reportRenderError: (error: unknown, pathname?: string) => string;
|
|
47
|
+
}
|
|
48
|
+
export declare class RscFlightStream {
|
|
49
|
+
#private;
|
|
50
|
+
constructor(props: RscFlightStreamProps, options: FlightRenderOptions);
|
|
51
|
+
render(element: ReactNode, clientManifest: ClientManifest): Promise<FlightRenderResult>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ClientManifest } from "./artifact.d.ts";
|
|
2
|
+
import type { RscProcess, RscWorkerErrorCode, RscWorkerProcess } from "./rscWorkerProcess.d.ts";
|
|
3
|
+
import type { RscWorkerRecycler } from "./rscWorkerRecycler.d.ts";
|
|
4
|
+
import type { BaseBuildArtifact, CssAsset } from "./types.d.ts";
|
|
5
|
+
export interface RscWorkerReloadInput {
|
|
6
|
+
clientManifest: ClientManifest;
|
|
7
|
+
cssAssets?: Record<string, CssAsset>;
|
|
8
|
+
buildId: number;
|
|
9
|
+
/** Undefined keeps the latest bundle a reload named (e.g. a client-manifest-only reload after a lazy route build). */
|
|
10
|
+
pagesBundlePath?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface RscAdoptedBundle {
|
|
13
|
+
pagesBundlePath: string;
|
|
14
|
+
buildId: number;
|
|
15
|
+
}
|
|
16
|
+
/** A reload the worker did not take: what it runs instead, and whether a later reload failed in this one's place. */
|
|
17
|
+
export interface RscReloadFailure extends Error {
|
|
18
|
+
/** What the worker runs now. */
|
|
19
|
+
adopted: RscAdoptedBundle;
|
|
20
|
+
/** The latest state it was asked to take, which a later reload may have moved past the caller's own. */
|
|
21
|
+
failed: RscAdoptedBundle;
|
|
22
|
+
}
|
|
23
|
+
export type RscHostArtifact = Pick<BaseBuildArtifact, "rscRuntimeClientManifest" | "pagesBundlePath" | "pagesBundleBuildId" | "cssAssets" | "basePaths" | "i18n">;
|
|
24
|
+
interface RscBootState extends RscAdoptedBundle {
|
|
25
|
+
reloadState: number;
|
|
26
|
+
cssAssets: Record<string, CssAsset>;
|
|
27
|
+
}
|
|
28
|
+
interface RscReloadedReply {
|
|
29
|
+
buildId: number;
|
|
30
|
+
reloadId?: number;
|
|
31
|
+
pagesBundlePath?: string;
|
|
32
|
+
}
|
|
33
|
+
interface RscReloadErrorReply {
|
|
34
|
+
message: string;
|
|
35
|
+
reloadId?: number;
|
|
36
|
+
running?: RscAdoptedBundle;
|
|
37
|
+
}
|
|
38
|
+
export declare class RscHostReloads {
|
|
39
|
+
#private;
|
|
40
|
+
cssAssets: Record<string, CssAsset>;
|
|
41
|
+
static readArtifact({ rscRuntimeClientManifest, pagesBundlePath, pagesBundleBuildId, cssAssets, basePaths, i18n, }: BaseBuildArtifact): RscHostArtifact;
|
|
42
|
+
constructor(artifact: RscHostArtifact, worker: RscWorkerProcess, recycler: RscWorkerRecycler);
|
|
43
|
+
get init(): Readonly<RscBootState>;
|
|
44
|
+
reload(input: RscWorkerReloadInput): Promise<RscAdoptedBundle>;
|
|
45
|
+
sendPendingReload(): void;
|
|
46
|
+
rejectReload(message: string, code?: RscWorkerErrorCode): void;
|
|
47
|
+
rejectIfCovered(message: string): boolean;
|
|
48
|
+
sendInit(): void;
|
|
49
|
+
answerSentReloads(): void;
|
|
50
|
+
adoptInit(): void;
|
|
51
|
+
onReloaded(message: RscReloadedReply, proc: RscProcess): void;
|
|
52
|
+
onReloadFailed(message: RscReloadErrorReply, proc: RscProcess): void;
|
|
53
|
+
}
|
|
54
|
+
export {};
|