akanjs 3.2.0-rc.9 → 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 -680
- 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 +121 -204
- package/server/rscClientCache.ts +165 -0
- package/server/rscClientChunks.ts +126 -8
- package/server/rscClientFetch.ts +3 -1
- 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 +5 -1
- 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/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/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
|
@@ -9,8 +9,10 @@ import { type FileRef } from "../../../packages/core/src/index.ts";
|
|
|
9
9
|
* permissions and links another program would open (`mailto:`, a custom scheme) are refused. Listing the plugin in
|
|
10
10
|
* `native.plugins` is what lets an app open one.
|
|
11
11
|
*
|
|
12
|
-
* Windows has every method.
|
|
13
|
-
*
|
|
12
|
+
* Windows has every method. Linux has every method and sends no `consoleMessage`; there the visible view shown last
|
|
13
|
+
* also holds the keyboard focus inside its window, so the user's own keys reach it, until a click on the page takes the
|
|
14
|
+
* focus or the view is hidden or closed. macOS (14 or later, for its separate profile) has all but `sendKey`,
|
|
15
|
+
* `setMuted` and `capture`, and sends no `loadFailed` or `consoleMessage`. iOS and Android: UNSUPPORTED.
|
|
14
16
|
*/
|
|
15
17
|
export type ExternalViewBounds = "fill" | {
|
|
16
18
|
x: number;
|
|
@@ -32,7 +34,7 @@ export interface ExternalViewOpenOptions {
|
|
|
32
34
|
* with `evaluate`. It may not declare `__akanTopOnly`, and an empty one registers nothing.
|
|
33
35
|
*/
|
|
34
36
|
initScript?: string;
|
|
35
|
-
/**
|
|
37
|
+
/** macOS refuses `true` as UNSUPPORTED. */
|
|
36
38
|
muted?: boolean;
|
|
37
39
|
/** Media plays with sound without a gesture first (default true): nobody taps a signage screen. */
|
|
38
40
|
autoplay?: boolean;
|
|
@@ -53,7 +55,7 @@ export interface ExternalViewApi {
|
|
|
53
55
|
/**
|
|
54
56
|
* Opens the view, or brings an open one with this id to these options (a page that mounts again finds it). Another
|
|
55
57
|
* `initScript` builds the view again and loads its page anew, as does another `console` on Windows and another
|
|
56
|
-
* `autoplay` on macOS; Windows refuses another `autoplay` as UNSUPPORTED, before anything is built.
|
|
58
|
+
* `autoplay` on macOS and Linux; Windows refuses another `autoplay` as UNSUPPORTED, before anything is built.
|
|
57
59
|
*/
|
|
58
60
|
open(args: ExternalViewOpenOptions): Promise<ExternalViewState>;
|
|
59
61
|
/** Rejects NOT_ALLOWED for a URL on none of its `allowOrigins`. */
|
|
@@ -78,8 +80,8 @@ export interface ExternalViewApi {
|
|
|
78
80
|
}): Promise<void>;
|
|
79
81
|
/**
|
|
80
82
|
* The script's completion value as JSON has it (a Date as its ISO string, a lone surrogate as U+FFFD), and `null`
|
|
81
|
-
* for undefined, NaN, a cycle or an exception: catch it in the script. macOS
|
|
82
|
-
* nesting too. A promise is not awaited. CANCELLED: a close or a rebuild of the view cut the call off. TIMEOUT: no
|
|
83
|
+
* for undefined, NaN, a cycle or an exception: catch it in the script. macOS and Linux answer `null` past 128 levels
|
|
84
|
+
* of nesting too. A promise is not awaited. CANCELLED: a close or a rebuild of the view cut the call off. TIMEOUT: no
|
|
83
85
|
* answer within 30 s, as from a page busy in a loop; `sendKey` and `capture` time out the same way.
|
|
84
86
|
*/
|
|
85
87
|
evaluate(args: {
|
|
@@ -88,13 +90,18 @@ export interface ExternalViewApi {
|
|
|
88
90
|
}): Promise<{
|
|
89
91
|
value: unknown;
|
|
90
92
|
}>;
|
|
91
|
-
/**
|
|
93
|
+
/**
|
|
94
|
+
* A trusted key press (`{ key: "z", code: "KeyZ" }`), whether or not the view has the focus. Not on macOS; on Linux
|
|
95
|
+
* UNSUPPORTED while the view's window is hidden. On Linux a Tab past the page's last element takes the page's focus
|
|
96
|
+
* out of it, as in a browser, but the keyboard stays with the view or the app's page, whichever had it; `Dead` is
|
|
97
|
+
* INVALID_ARGS there, since GTK's input method would compose it with the next key into one character.
|
|
98
|
+
*/
|
|
92
99
|
sendKey(args: {
|
|
93
100
|
id: string;
|
|
94
101
|
key: string;
|
|
95
102
|
code: string;
|
|
96
103
|
}): Promise<void>;
|
|
97
|
-
/** The view's own sound only; the system volume is the volume plugin's.
|
|
104
|
+
/** The view's own sound only; the system volume is the volume plugin's. Not on macOS. */
|
|
98
105
|
setMuted(args: {
|
|
99
106
|
id: string;
|
|
100
107
|
muted: boolean;
|
|
@@ -103,7 +110,7 @@ export interface ExternalViewApi {
|
|
|
103
110
|
clearData(args: {
|
|
104
111
|
id: string;
|
|
105
112
|
}): Promise<void>;
|
|
106
|
-
/** A PNG of the view's content (not the screen), kept until its next capture or the next launch.
|
|
113
|
+
/** A PNG of the view's content (not the screen), kept until its next capture or the next launch. Not on macOS. */
|
|
107
114
|
capture(args: {
|
|
108
115
|
id: string;
|
|
109
116
|
}): Promise<FileRef & {
|
|
@@ -120,7 +127,8 @@ export interface ExternalViewEvents {
|
|
|
120
127
|
/**
|
|
121
128
|
* A navigation that failed. `errorCode`: `http<status>` for a server's 4xx or 5xx page, else WebView2's own
|
|
122
129
|
* (`hostNameNotResolved`, `cannotConnect`, `timeout`, `certificate`, `disconnected`, …; a refused connection is
|
|
123
|
-
* `unknown`).
|
|
130
|
+
* `unknown`). Linux names the same failures by those names (a refused connection is `cannotConnect`) and any other
|
|
131
|
+
* `unknown`. Not on macOS.
|
|
124
132
|
*/
|
|
125
133
|
loadFailed: {
|
|
126
134
|
id: string;
|
|
@@ -128,9 +136,10 @@ export interface ExternalViewEvents {
|
|
|
128
136
|
errorCode: string;
|
|
129
137
|
};
|
|
130
138
|
/**
|
|
131
|
-
* Its web process ended (`reason`: `crashed`, `unresponsive` or `browserExited` on Windows, `terminated` on macOS
|
|
132
|
-
* the view loads its page again by itself, sooner the first times, and an end
|
|
133
|
-
* again. `rebuildFailed`: after its browser exited the view could not be built
|
|
139
|
+
* Its web process ended (`reason`: `crashed`, `unresponsive` or `browserExited` on Windows, `terminated` on macOS,
|
|
140
|
+
* `crashed`, `killed` or `oom` on Linux); the view loads its page again by itself, sooner the first times, and an end
|
|
141
|
+
* while that waits is not reported again. `rebuildFailed`: after its browser exited the view could not be built
|
|
142
|
+
* again, and is closed; open it again.
|
|
134
143
|
*/
|
|
135
144
|
gone: {
|
|
136
145
|
id: string;
|
|
@@ -5,10 +5,22 @@ export declare function sidText(sid: Uint8Array): string | null;
|
|
|
5
5
|
export declare function tokenSid(query?: (info: Uint8Array) => boolean): string | null;
|
|
6
6
|
/**
|
|
7
7
|
* sun_path is 104 bytes on macOS, so the name is a short hash, not the app id. Windows pipe names
|
|
8
|
-
* are one namespace for the whole PC, so the user is part of the hash there
|
|
9
|
-
*
|
|
8
|
+
* are one namespace for the whole PC, so the user is part of the hash there. The hash is no secret:
|
|
9
|
+
* another account can work the name out and create the pipe first. The pipe's default security only
|
|
10
|
+
* keeps others from writing to a pipe this account created, so a launch reads who owns the pipe
|
|
11
|
+
* before it sends (claimPipe).
|
|
10
12
|
*/
|
|
11
13
|
export declare function socketPath(appId: string, env?: Record<string, string | undefined>, platform?: NodeJS.Platform, account?: string): string;
|
|
14
|
+
export interface PipeCalls {
|
|
15
|
+
open(name: Uint8Array): bigint;
|
|
16
|
+
security(handle: bigint, descriptor: Uint8Array): boolean;
|
|
17
|
+
close(handle: bigint): void;
|
|
18
|
+
}
|
|
19
|
+
export interface HeldPipe {
|
|
20
|
+
owner: string | null;
|
|
21
|
+
close(): void;
|
|
22
|
+
}
|
|
23
|
+
export declare function heldPipe(path: string, calls?: PipeCalls): HeldPipe | null;
|
|
12
24
|
export declare function encodeMessage(message: SecondInstance): string;
|
|
13
25
|
export declare function decodeMessage(line: string): SecondInstance | null;
|
|
14
26
|
export type Claim = {
|
|
@@ -47,6 +59,7 @@ export declare function lockFile(path: string): Lock;
|
|
|
47
59
|
* starting a second window next to it is what the plugin exists to prevent.
|
|
48
60
|
*/
|
|
49
61
|
export declare function claim(path: string, message: SecondInstance, onMessage: (m: SecondInstance) => void, timeoutMs?: number): Promise<Claim>;
|
|
62
|
+
export declare function claimPipe(path: string, message: SecondInstance, onMessage: (m: SecondInstance) => void, timeoutMs: number, hold?: (path: string) => HeldPipe | null, account?: () => string | null): Promise<Claim>;
|
|
50
63
|
/** The lock and socket need a folder of this user's alone: another user's could block the app or read its arguments. */
|
|
51
64
|
export declare function privateFolder(dir: string, uid?: number): string | Error;
|
|
52
65
|
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ToolRunnerHost } from "./ToolRunner.d.ts";
|
|
2
|
+
import type { PublishedTool, SurfaceView, ToolCallRequest, ToolCallResult } from "./types.d.ts";
|
|
3
|
+
/** `readOnly` is always `false`: a screen tool declares no such flag, so a server loop counts every one as a write. */
|
|
4
|
+
export interface AgentClientToolDefinition extends PublishedTool {
|
|
5
|
+
readOnly: false;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* A screen's tools lent to an agent loop that runs on the server: `list()` is what that loop takes as its client
|
|
9
|
+
* tools, and `run(call)` answers a call it parked. A call goes through the same `ToolRunner` as the in-page chat, so a
|
|
10
|
+
* `confirm` still asks through `host.approve` (refused without one), a card needs `host.card`, and the answer is
|
|
11
|
+
* clipped and fenced as the chat's would be.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AgentClientTools {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(surface?: SurfaceView, host?: ToolRunnerHost);
|
|
16
|
+
list(): AgentClientToolDefinition[];
|
|
17
|
+
/** Never throws: a tool no longer on the screen, a refusal and a failure all come back as the result's `error`. */
|
|
18
|
+
run(call: ToolCallRequest, signal?: AbortSignal): Promise<ToolCallResult>;
|
|
19
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChatMessage, ToolCallResult, TurnLimits } from "./types.d.ts";
|
|
1
|
+
import type { ChatMessage, RunnerRequest, ToolCallResult, TurnLimits, TurnOverflow } from "./types.d.ts";
|
|
2
2
|
export interface CompactOptions {
|
|
3
3
|
/**
|
|
4
4
|
* Estimated transcript tokens above which a turn summarizes its own history first — a ceiling on what each turn
|
|
@@ -52,6 +52,7 @@ export declare class Compaction {
|
|
|
52
52
|
static tokensOf(messages: readonly ChatMessage[]): number;
|
|
53
53
|
/** One tool result as it rides the wire, by the same rule. */
|
|
54
54
|
static resultTokensOf(result: ToolCallResult): number;
|
|
55
|
+
static frameTokensOf(frame: Omit<RunnerRequest, "messages" | "signal">): number;
|
|
55
56
|
/**
|
|
56
57
|
* What the next request is estimated to cost, prompt and all: the provider's own count for the last turn that
|
|
57
58
|
* reported one, plus four characters a token for what the transcript gained since. The provider's number is the
|
|
@@ -60,6 +61,7 @@ export declare class Compaction {
|
|
|
60
61
|
* transcript: the tools, the screen context and the instructions.
|
|
61
62
|
*/
|
|
62
63
|
static promptTokensOf(messages: readonly ChatMessage[], overhead: () => number): number;
|
|
64
|
+
static windowOf({ limit, requested }: TurnOverflow, messages: readonly ChatMessage[], overhead: number): number | undefined;
|
|
63
65
|
/**
|
|
64
66
|
* The prompt size past which a turn compacts first, or `Infinity` while the window is unknown. The answer shares
|
|
65
67
|
* the window with the prompt, so its ceiling is held back along with `buffer`.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PendingQuestion } from "./AgentSession.d.ts";
|
|
2
|
+
import type { ChatMessage, ToolCallRequest, ToolCallResult } from "./types.d.ts";
|
|
3
|
+
type Settled = {
|
|
4
|
+
result: string | string[];
|
|
5
|
+
} | {
|
|
6
|
+
error: string;
|
|
7
|
+
};
|
|
8
|
+
type Asked = Pick<PendingQuestion, "question" | "choices" | "multiple">;
|
|
9
|
+
export declare class SessionQuestion {
|
|
10
|
+
#private;
|
|
11
|
+
static readonly toolName = "askUser";
|
|
12
|
+
static readonly dismissed = "The user dismissed the question without answering it.";
|
|
13
|
+
constructor(changed: () => void);
|
|
14
|
+
get pending(): PendingQuestion | null;
|
|
15
|
+
clear(): void;
|
|
16
|
+
/** No surface call and so no diff to report: the only thing this changes is what the model knows. */
|
|
17
|
+
ask(call: ToolCallRequest, signal: AbortSignal): Promise<ToolCallResult>;
|
|
18
|
+
wait(callId: string, asked: Asked, signal: AbortSignal): Promise<Settled>;
|
|
19
|
+
/**
|
|
20
|
+
* Puts back a question a restored transcript ends on, which a run asked while no chat was open; settling it hands
|
|
21
|
+
* the result to `resume` once, and a turn that starts first takes it down, leaving the call to the wire's closing.
|
|
22
|
+
*/
|
|
23
|
+
reopen(messages: readonly ChatMessage[], resume: (result: ToolCallResult) => void): void;
|
|
24
|
+
static openCall(messages: readonly ChatMessage[]): ToolCallRequest | null;
|
|
25
|
+
}
|
|
26
|
+
export {};
|
|
@@ -22,7 +22,7 @@ export declare class Transcript {
|
|
|
22
22
|
static seen(messages: readonly ChatMessage[]): ChatMessage[];
|
|
23
23
|
/** A message without the provider's count for its turn — what the wire carries and what a compaction keeps. */
|
|
24
24
|
static unmeasured(message: ChatMessage): ChatMessage;
|
|
25
|
-
static sanitize(messages: readonly ChatMessage[]): ChatMessage[];
|
|
25
|
+
static sanitize(messages: readonly ChatMessage[], openCallId?: string): ChatMessage[];
|
|
26
26
|
/** An empty assistant message is a draft a reload or an abort caught before it said anything. */
|
|
27
27
|
static carries(message: ChatMessage): boolean;
|
|
28
28
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const isFailureCode: (value: unknown) => value is string;
|
|
2
|
+
export declare const codeOfStatus: (status: number) => string;
|
|
3
|
+
export declare const codeOfAnswer: (status: number, body: unknown) => string;
|
|
4
|
+
export declare const failureCodeOf: (value: unknown) => string | undefined;
|
|
@@ -246,6 +246,8 @@ export interface ChatMessage {
|
|
|
246
246
|
toolResults?: ToolCallResult[];
|
|
247
247
|
/** A failed or capped turn, recorded in the transcript rather than thrown past it. */
|
|
248
248
|
error?: string;
|
|
249
|
+
/** The code the runner named that failure by, for a host to branch on where `error` is text. Never sent. */
|
|
250
|
+
errorCode?: string;
|
|
249
251
|
/**
|
|
250
252
|
* Host-rendered and never sent: a command's own output belongs in the transcript the user reads but not in the
|
|
251
253
|
* history the model reads, which would take it for something it had said itself.
|
|
@@ -289,15 +291,22 @@ export type RunnerEvent = {
|
|
|
289
291
|
*
|
|
290
292
|
* `overflow` marks the provider refusing a prompt too long for its window — the one refusal a session can undo
|
|
291
293
|
* on its own, by compacting and asking again. `limit` is the window when the refusal named it.
|
|
294
|
+
*
|
|
295
|
+
* `code` names the failure for a host to branch on, since `message` may reach it already translated: a
|
|
296
|
+
* dictionary key (`<module>.error.<key>`) or a camelCase token, never prose.
|
|
292
297
|
*/
|
|
293
298
|
| {
|
|
294
299
|
type: "error";
|
|
295
300
|
message: string;
|
|
301
|
+
code?: string;
|
|
296
302
|
data?: Record<string, string | number>;
|
|
297
|
-
overflow?:
|
|
298
|
-
limit?: number;
|
|
299
|
-
};
|
|
303
|
+
overflow?: TurnOverflow;
|
|
300
304
|
};
|
|
305
|
+
/** `limit` alone is a window in tokens; with `requested` beside it, both are in the refusal's own unit, bytes included. */
|
|
306
|
+
export interface TurnOverflow {
|
|
307
|
+
limit?: number;
|
|
308
|
+
requested?: number;
|
|
309
|
+
}
|
|
301
310
|
export interface RunnerRequest {
|
|
302
311
|
messages: ChatMessage[];
|
|
303
312
|
tools: PublishedTool[];
|
|
@@ -4,6 +4,8 @@ interface GuardedLocation {
|
|
|
4
4
|
pathRoute: PathRoute;
|
|
5
5
|
params: Record<string, string>;
|
|
6
6
|
searchParams: Record<string, string | string[]>;
|
|
7
|
+
pathname?: string;
|
|
8
|
+
search?: string;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* A CSR navigation's route guards, run before any of its layers draws. On the client a guard refuses by moving the
|
|
@@ -21,5 +23,6 @@ export declare class CsrGuards {
|
|
|
21
23
|
/** Whether a verdict for `key` is held or on its way. */
|
|
22
24
|
static asked(key: string): boolean;
|
|
23
25
|
static hold(key: string): () => void;
|
|
26
|
+
static expire(location: GuardedLocation): void;
|
|
24
27
|
}
|
|
25
28
|
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { McpJsonRpcMessage, McpToolResult } from "../signal/mcp/mcpProtocol.d.ts";
|
|
2
|
+
import type { McpHostContext } from "./McpAppBridge.d.ts";
|
|
3
|
+
export interface McpAppHostProps {
|
|
4
|
+
/** Delivers a message to the frame that holds the view. */
|
|
5
|
+
post: (message: McpJsonRpcMessage) => void;
|
|
6
|
+
/** The app tool's result as its server answers a view: what the screen starts from. */
|
|
7
|
+
start: () => Promise<Partial<McpToolResult>>;
|
|
8
|
+
/** Relays a call the view makes; the caller decides which server and tools that may reach. */
|
|
9
|
+
callTool: (name: string, args: Record<string, unknown>, signal: AbortSignal) => Promise<Partial<McpToolResult>>;
|
|
10
|
+
/** `false` declines the link. */
|
|
11
|
+
openLink: (url: string) => boolean;
|
|
12
|
+
context: () => McpHostContext;
|
|
13
|
+
onSize?: (height: number) => void;
|
|
14
|
+
name?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class McpAppHost {
|
|
17
|
+
#private;
|
|
18
|
+
static readonly protocolVersion = "2026-01-26";
|
|
19
|
+
static readonly maxHeight = 4000;
|
|
20
|
+
constructor(props: McpAppHostProps);
|
|
21
|
+
receive(data: unknown): void;
|
|
22
|
+
contextChanged(): void;
|
|
23
|
+
dispose(): void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component, type ReactNode } from "react";
|
|
2
|
+
interface RouteLevelBoundaryProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
interface RouteLevelBoundaryState {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
failure: {
|
|
8
|
+
error: unknown;
|
|
9
|
+
} | null;
|
|
10
|
+
}
|
|
11
|
+
export declare class RouteLevelBoundary extends Component<RouteLevelBoundaryProps, RouteLevelBoundaryState> {
|
|
12
|
+
state: RouteLevelBoundaryState;
|
|
13
|
+
static getDerivedStateFromError(error: unknown): Partial<RouteLevelBoundaryState>;
|
|
14
|
+
static getDerivedStateFromProps(props: RouteLevelBoundaryProps, state: RouteLevelBoundaryState): Partial<RouteLevelBoundaryState> | null;
|
|
15
|
+
render(): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Location } from "akanjs/client";
|
|
2
|
+
interface CsrRefreshRequest {
|
|
3
|
+
epoch: number;
|
|
4
|
+
locationId: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare class CsrRefresh {
|
|
7
|
+
#private;
|
|
8
|
+
static idOf({ entryId, href }: Pick<Location, "entryId" | "href">): string;
|
|
9
|
+
static request(location: Location): void;
|
|
10
|
+
static subscribe(listener: () => void): () => void;
|
|
11
|
+
static current(): CsrRefreshRequest;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
package/types/webkit/index.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export { bootCsr, replacePages } from "./bootCsr.d.ts";
|
|
2
2
|
export { lazy } from "./lazy.d.ts";
|
|
3
3
|
export { McpAppBoot, type McpAppBootProps, type McpAppRootProps } from "./McpAppBoot.d.ts";
|
|
4
|
+
export type { McpHostContext } from "./McpAppBridge.d.ts";
|
|
5
|
+
export { McpAppHost, type McpAppHostProps } from "./McpAppHost.d.ts";
|
|
6
|
+
export { needsBrowser } from "./needsBrowser.d.ts";
|
|
4
7
|
export { createRobotPage, createSitemapPage } from "./seoPages.d.ts";
|
|
5
8
|
export type * from "./types.d.ts";
|
|
6
9
|
export { useBodyScrollLock } from "./useBodyScrollLock.d.ts";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Called while a component renders, says what it draws is finished only in a browser (a canvas, a chart drawn in an
|
|
3
|
+
* effect, data read after mount): a `{ static: true }` app drawing it sends no HTML. A no-op in a browser.
|
|
4
|
+
*/
|
|
5
|
+
export declare const needsBrowser: () => void;
|
|
@@ -6,7 +6,7 @@ export interface CameraPromptLabels {
|
|
|
6
6
|
picture?: string;
|
|
7
7
|
cancel?: string;
|
|
8
8
|
}
|
|
9
|
-
/** Photos arrive as upright JPEG data URLs
|
|
9
|
+
/** Photos arrive as upright JPEG data URLs. A denial resolves `undefined`; a camera denied earlier offers Settings. */
|
|
10
10
|
export declare const useCamera: ({ promptLabels }?: {
|
|
11
11
|
promptLabels?: CameraPromptLabels;
|
|
12
12
|
}) => {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
2
|
+
import type { CsrRefs } from "./useCsrRefs.d.ts";
|
|
3
|
+
import { type useFrameSlots, type useFrameViewport } from "./useFrameRuntime.d.ts";
|
|
4
|
+
import type { ResolvedFrame } from "./useResolvedFrame.d.ts";
|
|
5
|
+
export declare const useCsrKeyboard: ({ viewport, updateViewport, frameSlots, phase, resolvedLocation, pageContentRef, }: {
|
|
6
|
+
viewport: ReturnType<typeof useFrameViewport>["viewport"];
|
|
7
|
+
updateViewport: ReturnType<typeof useFrameViewport>["updateViewport"];
|
|
8
|
+
frameSlots: ReturnType<typeof useFrameSlots>["frameSlots"];
|
|
9
|
+
phase: CsrLocationState["phase"];
|
|
10
|
+
resolvedLocation: ResolvedFrame["resolvedLocation"];
|
|
11
|
+
pageContentRef: CsrRefs["pageContentRef"];
|
|
12
|
+
}) => {
|
|
13
|
+
platformProfile: import("akanjs/client").FramePlatformProfile;
|
|
14
|
+
accessoryHeight: number;
|
|
15
|
+
shouldAnchorContentBottom: boolean;
|
|
16
|
+
keyboardFrame: import("akanjs/client").KeyboardFrameState;
|
|
17
|
+
keyboardLayout: Pick<import("akanjs/client").FrameLayoutState, "keyboardAccessory" | "contentViewport">;
|
|
18
|
+
};
|
|
19
|
+
export type CsrKeyboard = ReturnType<typeof useCsrKeyboard>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type LocationState, type RouteGuide } from "akanjs/client";
|
|
2
|
+
export declare const useCsrLocationState: (rootRouteGuide: RouteGuide) => {
|
|
3
|
+
getLocation: (href: string) => import("akanjs/client").Location;
|
|
4
|
+
history: import("react").RefObject<import("akanjs/client").History>;
|
|
5
|
+
setHistoryForward: ({ type, location, scrollTop, scrollToTop }: import("./useHistory.d.ts").setForwardOptions) => void;
|
|
6
|
+
setHistoryBack: ({ location, scrollTop, scrollToTop }: import("./useHistory.d.ts").setBackOptions) => void;
|
|
7
|
+
setHistoryJump: (idx: number, scrollTop?: number) => void;
|
|
8
|
+
getNextLocation: () => import("akanjs/client").Location | null;
|
|
9
|
+
getCurrentLocation: () => import("akanjs/client").Location;
|
|
10
|
+
getPrevLocation: () => import("akanjs/client").Location | null;
|
|
11
|
+
getScrollTop: (location: import("akanjs/client").Location) => number;
|
|
12
|
+
isBackgrounded: boolean;
|
|
13
|
+
setIsBackgrounded: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
14
|
+
setLocationState: import("react").Dispatch<import("react").SetStateAction<LocationState>>;
|
|
15
|
+
location: import("akanjs/client").Location;
|
|
16
|
+
prevLocation: import("akanjs/client").Location | null;
|
|
17
|
+
pendingLocation: import("akanjs/client").Location | null;
|
|
18
|
+
navigationIntent: import("akanjs/client").NavigationIntent | null;
|
|
19
|
+
phase: import("akanjs/client").CsrNavigationPhase;
|
|
20
|
+
};
|
|
21
|
+
export type CsrLocationState = ReturnType<typeof useCsrLocationState>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type LocationState, type NavigationIntent, type PageState, type RouteOptions } from "akanjs/client";
|
|
2
|
+
import type { CsrKeyboard } from "./useCsrKeyboard.d.ts";
|
|
3
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
4
|
+
import { type CsrRefs } from "./useCsrRefs.d.ts";
|
|
5
|
+
import { type useFrameSlots, type useFrameViewport } from "./useFrameRuntime.d.ts";
|
|
6
|
+
import type { ResolvedFrame } from "./useResolvedFrame.d.ts";
|
|
7
|
+
interface CsrNavigationInput {
|
|
8
|
+
viewport: ReturnType<typeof useFrameViewport>["viewport"];
|
|
9
|
+
slots: ReturnType<typeof useFrameSlots>;
|
|
10
|
+
setTransitionPageStateSnapshot: (snapshot: Map<string, PageState> | null) => void;
|
|
11
|
+
refs: CsrRefs;
|
|
12
|
+
nav: CsrLocationState;
|
|
13
|
+
frame: ResolvedFrame;
|
|
14
|
+
keyboard: CsrKeyboard;
|
|
15
|
+
}
|
|
16
|
+
export declare const useCsrNavigation: ({ viewport, slots, setTransitionPageStateSnapshot, refs, nav, frame, keyboard: { keyboardFrame }, }: CsrNavigationInput) => {
|
|
17
|
+
shouldPrepareFrameTransition: (nextHref?: string) => boolean;
|
|
18
|
+
startFrameTransition: () => Promise<void>;
|
|
19
|
+
settle: (prev: LocationState["prevLocation"]) => void;
|
|
20
|
+
cancelPendingNavigation: () => NavigationIntent | null;
|
|
21
|
+
broadcastSyncNavigation: (kind: "replace" | "pop" | "push" | "back", href: string) => void;
|
|
22
|
+
runForwardNavigation: (kind: "push" | "replace", href: string, { scrollToTop }?: RouteOptions) => void;
|
|
23
|
+
};
|
|
24
|
+
export type CsrNavigation = ReturnType<typeof useCsrNavigation>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { NavigationIntent, PageState, PathRoute, RouterInstance } from "akanjs/client";
|
|
2
|
+
export declare const useCsrRefs: () => {
|
|
3
|
+
pageStateByPathRef: import("react").RefObject<Map<string, PageState>>;
|
|
4
|
+
navigationIntentId: import("react").RefObject<number>;
|
|
5
|
+
transitionPlanId: import("react").RefObject<number>;
|
|
6
|
+
navigationLocked: import("react").RefObject<boolean>;
|
|
7
|
+
pendingNavigation: import("react").RefObject<NavigationIntent | null>;
|
|
8
|
+
waitingNavigation: import("react").RefObject<{
|
|
9
|
+
kind: "push" | "replace";
|
|
10
|
+
href: string;
|
|
11
|
+
scrollToTop?: boolean;
|
|
12
|
+
} | null>;
|
|
13
|
+
renderCountRef: import("react").RefObject<number>;
|
|
14
|
+
basePageStateMap: import("react").RefObject<WeakMap<PathRoute, PageState>>;
|
|
15
|
+
topSafeAreaRef: import("react").RefObject<HTMLDivElement | null>;
|
|
16
|
+
bottomSafeAreaRef: import("react").RefObject<HTMLDivElement | null>;
|
|
17
|
+
pageContentRef: import("react").RefObject<HTMLDivElement | null>;
|
|
18
|
+
prevPageContentRef: import("react").RefObject<HTMLDivElement | null>;
|
|
19
|
+
onBack: import("react").RefObject<{
|
|
20
|
+
none?: (() => Promise<void>) | undefined;
|
|
21
|
+
stack?: (() => Promise<void>) | undefined;
|
|
22
|
+
fade?: (() => Promise<void>) | undefined;
|
|
23
|
+
bottomUp?: (() => Promise<void>) | undefined;
|
|
24
|
+
scaleOut?: (() => Promise<void>) | undefined;
|
|
25
|
+
}>;
|
|
26
|
+
frameRootRef: import("react").RefObject<HTMLDivElement | null>;
|
|
27
|
+
lastBroadcastSyncHref: import("react").RefObject<string | null>;
|
|
28
|
+
syncNavigationReset: import("react").RefObject<NodeJS.Timeout | null>;
|
|
29
|
+
applyingSyncNavigation: import("react").RefObject<boolean>;
|
|
30
|
+
latestRouter: import("react").RefObject<RouterInstance | null>;
|
|
31
|
+
};
|
|
32
|
+
export type CsrRefs = ReturnType<typeof useCsrRefs>;
|
|
33
|
+
export declare const currentRouter: ({ current }: CsrRefs["latestRouter"]) => RouterInstance;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { CsrKeyboard } from "./useCsrKeyboard.d.ts";
|
|
2
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
3
|
+
import type { CsrRefs } from "./useCsrRefs.d.ts";
|
|
4
|
+
import type { useFrameSlots, useFrameViewport } from "./useFrameRuntime.d.ts";
|
|
5
|
+
import type { ResolvedFrame } from "./useResolvedFrame.d.ts";
|
|
6
|
+
export declare const useCsrRenderTrace: ({ viewport, frameSlots, refs: { renderCountRef }, nav: { getCurrentLocation }, frame: { resolvedLocation }, keyboard: { keyboardFrame, keyboardLayout, accessoryHeight, platformProfile }, }: {
|
|
7
|
+
viewport: ReturnType<typeof useFrameViewport>["viewport"];
|
|
8
|
+
frameSlots: ReturnType<typeof useFrameSlots>["frameSlots"];
|
|
9
|
+
refs: CsrRefs;
|
|
10
|
+
nav: CsrLocationState;
|
|
11
|
+
frame: ResolvedFrame;
|
|
12
|
+
keyboard: CsrKeyboard;
|
|
13
|
+
}) => void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type UseCsrTransition } from "akanjs/client";
|
|
2
|
+
import type { CsrKeyboard } from "./useCsrKeyboard.d.ts";
|
|
3
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
4
|
+
import type { CsrRefs } from "./useCsrRefs.d.ts";
|
|
5
|
+
import type { ResolvedFrame } from "./useResolvedFrame.d.ts";
|
|
6
|
+
export declare const useCsrStackLifecycle: ({ refs: { pageContentRef, prevPageContentRef }, nav: { location, prevLocation, history, getScrollTop, getCurrentLocation, setIsBackgrounded, phase }, frame: { resolvedLocation, stackEntries }, keyboard: { keyboardFrame }, csrTransition, }: {
|
|
7
|
+
refs: CsrRefs;
|
|
8
|
+
nav: CsrLocationState;
|
|
9
|
+
frame: ResolvedFrame;
|
|
10
|
+
keyboard: CsrKeyboard;
|
|
11
|
+
csrTransition: UseCsrTransition;
|
|
12
|
+
}) => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** `getPosition`
|
|
1
|
+
/** `getPosition` resolves `undefined` when location permission is denied. */
|
|
2
2
|
export declare const useGeoLocation: () => {
|
|
3
3
|
checkPermission: () => Promise<import("../vendor/@akanjs/native/plugins/geolocation/src/index.d.ts").LocationPermission>;
|
|
4
4
|
getPosition: (options?: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { History, Location } from "akanjs/client";
|
|
2
|
-
interface setForwardOptions {
|
|
2
|
+
export interface setForwardOptions {
|
|
3
3
|
type: "push" | "replace" | "popForward";
|
|
4
4
|
location: Location;
|
|
5
5
|
scrollTop?: number;
|
|
6
6
|
scrollToTop?: boolean;
|
|
7
7
|
}
|
|
8
|
-
interface setBackOptions {
|
|
8
|
+
export interface setBackOptions {
|
|
9
9
|
type: "back" | "popBack";
|
|
10
10
|
location: Location;
|
|
11
11
|
scrollTop?: number;
|
|
@@ -24,4 +24,3 @@ export declare const useHistory: (locations?: Location[], { idx, dormant }?: {
|
|
|
24
24
|
getPrevLocation: () => Location | null;
|
|
25
25
|
getScrollTop: (location: Location) => number;
|
|
26
26
|
};
|
|
27
|
-
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PageState, PathRoute } from "akanjs/client";
|
|
2
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
3
|
+
import type { CsrRefs } from "./useCsrRefs.d.ts";
|
|
4
|
+
import { type useFrameSlots } from "./useFrameRuntime.d.ts";
|
|
5
|
+
export declare const useResolvedFrame: ({ pathRoutes, slots: { frameSlots, pendingFrameSlots }, transitionPageStateSnapshot, refs: { pageStateByPathRef, basePageStateMap }, nav: { history, location, prevLocation, pendingLocation, phase }, }: {
|
|
6
|
+
pathRoutes: PathRoute[];
|
|
7
|
+
slots: ReturnType<typeof useFrameSlots>;
|
|
8
|
+
transitionPageStateSnapshot: Map<string, PageState> | null;
|
|
9
|
+
refs: CsrRefs;
|
|
10
|
+
nav: CsrLocationState;
|
|
11
|
+
}) => {
|
|
12
|
+
latestPageStateByPath: import("react").RefObject<Map<string, PageState>>;
|
|
13
|
+
latestFrameSlots: import("react").RefObject<import("./useFrameRuntime.d.ts").FrameSlotMap>;
|
|
14
|
+
latestPendingFrameSlots: import("react").RefObject<import("./useFrameRuntime.d.ts").FrameSlotMap>;
|
|
15
|
+
effectivePageStateByPath: Map<string, PageState>;
|
|
16
|
+
resolvedPathRoutes: {
|
|
17
|
+
pageState: PageState;
|
|
18
|
+
path: string;
|
|
19
|
+
pathSegments: string[];
|
|
20
|
+
renderPage: import("akanjs/client").RouteRender;
|
|
21
|
+
pageConfigChain?: import("akanjs/client").PageConfig[];
|
|
22
|
+
explicitPageConfigKeys?: Partial<Record<keyof import("akanjs/client").PageConfig, boolean>>;
|
|
23
|
+
renderRootLayouts: import("akanjs/client").RouteRender[];
|
|
24
|
+
renderLayouts: import("akanjs/client").RouteRender[];
|
|
25
|
+
resolveHead?: import("akanjs/client").ResolveHead;
|
|
26
|
+
resolveLayoutsHead?: import("akanjs/client").ResolveHead;
|
|
27
|
+
}[];
|
|
28
|
+
resolvedLocation: import("akanjs/client").Location;
|
|
29
|
+
resolvedPrevLocation: import("akanjs/client").Location | null;
|
|
30
|
+
resolvedPendingLocation: import("akanjs/client").Location | null;
|
|
31
|
+
stackEntries: {
|
|
32
|
+
location: import("akanjs/client").Location;
|
|
33
|
+
key: string;
|
|
34
|
+
pageType: import("akanjs/client").CsrPageType;
|
|
35
|
+
zIndex: number;
|
|
36
|
+
}[];
|
|
37
|
+
};
|
|
38
|
+
export type ResolvedFrame = ReturnType<typeof useResolvedFrame>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type RouterInstance } from "akanjs/client";
|
|
2
|
+
import type { CsrLocationState } from "./useCsrLocationState.d.ts";
|
|
3
|
+
import type { CsrRefs } from "./useCsrRefs.d.ts";
|
|
4
|
+
import type { ResolvedFrame } from "./useResolvedFrame.d.ts";
|
|
5
|
+
export declare const getSyncRouteHref: (location: {
|
|
6
|
+
pathname: string;
|
|
7
|
+
search: string;
|
|
8
|
+
hash: string;
|
|
9
|
+
params?: {
|
|
10
|
+
[key: string]: string;
|
|
11
|
+
};
|
|
12
|
+
}) => string;
|
|
13
|
+
type SyncNavigationKind = "push" | "replace" | "back" | "pop";
|
|
14
|
+
export declare const useBroadcastSyncNavigation: ({ applyingSyncNavigation, lastBroadcastSyncHref }: CsrRefs) => (kind: SyncNavigationKind, href: string) => void;
|
|
15
|
+
export declare const useSyncNavigation: ({ refs: { lastBroadcastSyncHref, applyingSyncNavigation, syncNavigationReset }, nav: { history, getCurrentLocation, getPrevLocation }, resolvedLocation, broadcastSyncNavigation, router, }: {
|
|
16
|
+
refs: CsrRefs;
|
|
17
|
+
nav: CsrLocationState;
|
|
18
|
+
resolvedLocation: ResolvedFrame["resolvedLocation"];
|
|
19
|
+
broadcastSyncNavigation: ReturnType<typeof useBroadcastSyncNavigation>;
|
|
20
|
+
router: RouterInstance;
|
|
21
|
+
}) => void;
|
|
22
|
+
export {};
|