akanjs 3.0.0-alpha.9 → 3.0.0-alpha.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +103 -0
- package/README.ko.md +1 -1
- package/README.md +1 -1
- package/base/baseEnv.ts +51 -5
- package/base/primitiveRegistry.ts +59 -12
- package/base/symbols.ts +4 -0
- package/client/capacitor.ts +34 -0
- package/client/clientRuntime.ts +5 -0
- package/client/cookie.ts +60 -40
- package/client/csrTypes.ts +4 -15
- package/client/frameConfig.ts +13 -0
- package/client/index.ts +1 -0
- package/client/locale.ts +2 -2
- package/client/makePageProto.tsx +5 -3
- package/client/router.ts +7 -7
- package/client/sharedContext.ts +31 -0
- package/client/translator.ts +13 -4
- package/client/types.ts +3 -3
- package/common/Logger.ts +287 -67
- package/common/TrustedProxy.ts +134 -0
- package/common/authToken.ts +44 -0
- package/common/clamp.ts +2 -0
- package/common/clientAddress.ts +40 -0
- package/common/deepObjectify.ts +3 -2
- package/common/dynamicRecord.ts +12 -0
- package/common/index.ts +56 -2
- package/common/interpolateTranslation.ts +12 -0
- package/common/isValidDate.ts +1 -1
- package/common/logContext.ts +27 -0
- package/common/mcpExposure.ts +114 -0
- package/common/pathGetLoose.ts +31 -0
- package/common/plainFieldsOf.ts +13 -0
- package/common/requestOrigin.ts +32 -0
- package/common/{httpClient.ts → restClient.ts} +16 -9
- package/common/routeConvention.ts +22 -12
- package/common/websocketBinaryFrame.ts +46 -0
- package/constant/crystalize.ts +92 -28
- package/constant/dateSlot.ts +62 -0
- package/constant/deserialize.ts +3 -2
- package/constant/fieldInfo.ts +43 -3
- package/constant/fieldQueryMeta.ts +35 -0
- package/constant/getDefault.ts +16 -11
- package/constant/hydrationPlan.ts +72 -0
- package/constant/immerify.ts +4 -6
- package/constant/index.ts +5 -0
- package/constant/labelOf.ts +26 -0
- package/constant/mask.ts +94 -0
- package/constant/purify.ts +17 -11
- package/constant/textFieldPaths.ts +13 -7
- package/constant/types.ts +41 -13
- package/constant/via.ts +24 -17
- package/dictionary/DictionaryLookup.ts +30 -0
- package/dictionary/agent.dictionary.ts +31 -0
- package/dictionary/agentTurn.dictionary.ts +29 -0
- package/dictionary/base.dictionary.ts +95 -0
- package/dictionary/dictInfo.ts +11 -2
- package/dictionary/dictionary.ts +9 -3
- package/dictionary/dictionaryRegistry.ts +27 -0
- package/dictionary/index.ts +1 -0
- package/dictionary/trans.ts +40 -14
- package/document/dataLoader.ts +0 -4
- package/document/database.ts +8 -2
- package/document/documentQuery.ts +22 -0
- package/document/documentSchema.ts +8 -0
- package/document/filterMeta.ts +79 -14
- package/document/index.ts +2 -0
- package/document/into.ts +10 -10
- package/document/loaderInfo.ts +4 -1
- package/document/noDocumentError.ts +12 -0
- package/document/queryEvaluator.ts +319 -0
- package/document/types.ts +0 -1
- package/fetch/agentTurn.ts +19 -0
- package/fetch/client/fetchClient.ts +180 -92
- package/fetch/client/fetchHandle.ts +57 -0
- package/fetch/client/httpClient.ts +140 -30
- package/fetch/client/sliceInitHandle.ts +101 -0
- package/fetch/client/wsClient.ts +73 -17
- package/fetch/fetchType/appliedReturn.type.ts +126 -42
- package/fetch/fetchType/endpointFetch.type.ts +17 -8
- package/fetch/fetchType/sliceFetch.type.ts +30 -53
- package/fetch/index.ts +1 -0
- package/fetch/requestStorage.ts +19 -5
- package/index.ts +138 -8
- package/local/apps/akan/akan-local.db +0 -0
- package/local/apps/akan/akan-local.db-shm +0 -0
- package/local/apps/akan/akan-local.db-wal +0 -0
- package/local/apps/akan/akan-local_solid.db +0 -0
- package/local/apps/akan/akan-local_solid.db-shm +0 -0
- package/local/apps/akan/akan-local_solid.db-wal +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db-shm +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local.db-wal +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-shm +0 -0
- package/local/apps/serverLifecycle/serverLifecycle-local_solid.db-wal +0 -0
- package/package.json +27 -18
- package/server/akanApp.ts +350 -160
- package/server/akanAppHeaders.ts +23 -3
- package/server/akanOption.ts +76 -8
- package/server/akanServer.ts +440 -38
- package/server/animatedImage.ts +83 -0
- package/server/assetEncoding.ts +4 -24
- package/server/binaryPubsub.ts +55 -0
- package/server/cachePolicy.ts +2 -11
- package/server/console.ts +110 -101
- package/server/consoleEvaluator.ts +51 -0
- package/server/consolePasteFilter.ts +91 -0
- package/server/consoleSession.ts +242 -0
- package/server/contentEncoding.ts +83 -0
- package/server/decorators.ts +12 -3
- package/server/devtools/constantSerializer.ts +8 -1
- package/server/devtools/signalSerializer.ts +2 -2
- package/server/devtools/types.ts +4 -4
- package/server/di/diLifecycle.ts +147 -14
- package/server/di/predefinedAdaptor.ts +6 -0
- package/server/di/resolveHierarchy.ts +3 -3
- package/server/di/utils.ts +40 -0
- package/server/hmr/clientScript.ts +1 -1
- package/server/imageOptimizer.ts +156 -74
- package/server/lifecycle/runtimeDir.ts +14 -0
- package/server/lifecycle/shutdownManager.ts +17 -2
- package/server/logging/childOutputReader.ts +137 -0
- package/server/logging/hubFileSink.ts +39 -0
- package/server/logging/logControlSocket.ts +173 -0
- package/server/logging/logForwarder.ts +131 -0
- package/server/logging/logHub.ts +0 -0
- package/server/logging/logQuery.ts +130 -0
- package/server/logging/logStdoutWriter.ts +39 -0
- package/server/logging/logStreamRoute.ts +87 -0
- package/server/logging/logTailClient.ts +161 -0
- package/server/mcp/McpAuth.ts +177 -0
- package/server/mcp/McpDispatcher.ts +295 -0
- package/server/mcp/McpEventStream.ts +24 -0
- package/server/mcp/McpExecutionContext.ts +105 -0
- package/server/mcp/McpRouter.ts +621 -0
- package/server/mcp/index.ts +5 -0
- package/server/processMetricsCollector.ts +1 -1
- package/server/proxy/localeWebProxy.ts +3 -1
- package/server/resolver/database.resolver.ts +42 -24
- package/server/resolver/service.resolver.ts +2 -2
- package/server/resolver/signal.resolver.ts +377 -88
- package/server/robots.ts +4 -2
- package/server/routeTreeBuilder.ts +11 -23
- package/server/routing/apiRouter.ts +51 -19
- package/server/routing/appWsData.ts +40 -6
- package/server/routing/eventStream.ts +93 -0
- package/server/routing/soloAppRoutes.ts +50 -0
- package/server/rscWorker.tsx +63 -22
- package/server/rscWorkerHost.ts +59 -8
- package/server/semaphore.ts +22 -0
- package/server/ssrFromRscRenderer.tsx +68 -3
- package/server/staticPath.ts +34 -0
- package/server/subRouteIndexDocument.tsx +61 -0
- package/server/systemPageDocument.tsx +3 -3
- package/server/systemPages.tsx +49 -16
- package/server/types.tsx +28 -0
- package/server/vendor/akanjs-fetch.ts +1 -0
- package/server/webRouter.ts +130 -73
- package/service/adapt.ts +5 -9
- package/service/agent.service.ts +81 -0
- package/service/base.service.ts +2 -1
- package/service/index.ts +2 -1
- package/service/injectInfo.ts +12 -3
- package/service/ipcTypes.ts +6 -0
- package/service/liveSyncHub.ts +185 -0
- package/service/predefinedAdaptor/cache.adaptor.ts +8 -4
- package/service/predefinedAdaptor/compress.adaptor.ts +5 -1
- package/service/predefinedAdaptor/database.adaptor.ts +59 -1757
- package/service/predefinedAdaptor/deepseekLlm.ts +271 -0
- package/service/predefinedAdaptor/index.ts +3 -0
- package/service/predefinedAdaptor/insightQuery.ts +183 -0
- package/service/predefinedAdaptor/llm.adaptor.ts +115 -0
- package/service/predefinedAdaptor/logging.adaptor.ts +1 -1
- package/service/predefinedAdaptor/queue.adaptor.ts +5 -2
- package/service/predefinedAdaptor/role.adaptor.ts +2 -0
- package/service/predefinedAdaptor/schedule.adaptor.ts +12 -5
- package/service/predefinedAdaptor/solidPubsub.adaptor.ts +10 -6
- package/service/predefinedAdaptor/solidQueue.adaptor.ts +6 -2
- package/service/predefinedAdaptor/solidSqlite.ts +11 -9
- package/service/predefinedAdaptor/sql/PendingStoreEnsures.ts +22 -0
- package/service/predefinedAdaptor/sql/QueryCompiler.ts +225 -0
- package/service/predefinedAdaptor/sql/SqlDocumentStore.ts +815 -0
- package/service/predefinedAdaptor/sql/UpdateCompiler.ts +67 -0
- package/service/predefinedAdaptor/sql/dialect/postgres.ts +151 -0
- package/service/predefinedAdaptor/sql/dialect/sqlite.ts +134 -0
- package/service/predefinedAdaptor/sql/driver/bunSqlite.ts +29 -0
- package/service/predefinedAdaptor/sql/driver/libsql.ts +37 -0
- package/service/predefinedAdaptor/sql/driver/postgres.ts +42 -0
- package/service/predefinedAdaptor/sql/types.ts +237 -0
- package/service/predefinedAdaptor/sql/values.ts +91 -0
- package/service/predefinedAdaptor/storage.adaptor.ts +4 -3
- package/service/predefinedAdaptor/websocket.adaptor.ts +37 -1
- package/service/serve.ts +16 -9
- package/service/serviceModule.ts +2 -2
- package/service/toolNames.ts +119 -0
- package/service/types.ts +8 -2
- package/signal/CrossSiteGuard.ts +71 -0
- package/signal/SignalFailure.ts +51 -0
- package/signal/agent/AgentCatalogue.ts +165 -0
- package/signal/agent/index.ts +1 -0
- package/signal/agent.signal.ts +38 -0
- package/signal/agentTurn.ts +8 -0
- package/signal/agentTurnStream.ts +60 -0
- package/signal/base.signal.ts +2 -1
- package/signal/endpoint.ts +2 -2
- package/signal/endpointInfo.ts +38 -2
- package/signal/exception.ts +43 -6
- package/signal/guard.ts +28 -1
- package/signal/guards.ts +49 -1
- package/signal/index.ts +8 -0
- package/signal/intercept.ts +9 -6
- package/signal/internal.ts +10 -2
- package/signal/internalArg.ts +21 -4
- package/signal/mcp/McpDocument.ts +326 -0
- package/signal/mcp/McpProgress.ts +106 -0
- package/signal/mcp/McpUriTemplate.ts +80 -0
- package/signal/mcp/Msg.ts +368 -0
- package/signal/mcp/index.ts +5 -0
- package/signal/mcp/mcpProtocol.ts +120 -0
- package/signal/middleware.ts +3 -3
- package/signal/openapi/openapi.ts +36 -173
- package/signal/schema/JsonSchemaBuilder.ts +221 -0
- package/signal/schema/index.ts +1 -0
- package/signal/serializer/fetch.serializer.ts +63 -1
- package/signal/signalContext.ts +391 -95
- package/signal/slice.ts +63 -28
- package/signal/sliceInfo.ts +42 -0
- package/signal/trace.ts +268 -9
- package/signal/types.ts +104 -6
- package/store/SliceRequest.ts +23 -0
- package/store/action.ts +484 -190
- package/store/actionTag.ts +33 -0
- package/store/agent/AgentBridge.ts +89 -0
- package/store/agent/AgentContext.ts +71 -0
- package/store/agent/AgentPrompts.ts +111 -0
- package/store/agent/ScreenReader.ts +349 -0
- package/store/agent/ScreenSettle.ts +45 -0
- package/store/agent/ScreenTarget.ts +135 -0
- package/store/agent/StoreCatalogue.ts +116 -0
- package/store/agent/StoreSurfaceSource.ts +225 -0
- package/store/agent/index.ts +13 -0
- package/store/agent/storeSurface.ts +28 -0
- package/store/agent/types.ts +16 -0
- package/store/agentic/AgentValue.ts +119 -0
- package/store/agentic/StExposeBuilder.ts +50 -0
- package/store/agentic/StExposeDraft.ts +24 -0
- package/store/agentic/StStateBuilder.ts +90 -0
- package/store/agentic/StStateDraft.ts +23 -0
- package/store/agentic/StToolBuilder.ts +293 -0
- package/store/agentic/StToolDraft.ts +22 -0
- package/store/agentic/attachAgentic.ts +33 -0
- package/store/agentic/formFields.ts +194 -0
- package/store/agentic/index.ts +12 -0
- package/store/agentic/useFieldTool.ts +183 -0
- package/store/agentic/useFormTools.ts +77 -0
- package/store/agentic/useRelationFieldTool.ts +113 -0
- package/store/baseSt.ts +1 -1
- package/store/databaseStateNames.ts +32 -0
- package/store/draftStore.ts +321 -0
- package/store/formSetterNames.ts +35 -0
- package/store/index.ts +10 -0
- package/store/liveInsert.ts +82 -0
- package/store/rootStore.ts +3 -1
- package/store/sliceRole.ts +38 -0
- package/store/state.ts +25 -12
- package/store/stateBuilder.ts +49 -5
- package/store/store.ts +13 -1
- package/store/storeInstance.ts +288 -24
- package/store/storeRegistry.ts +40 -2
- package/store/types.ts +5 -0
- package/store/withSelector.ts +5 -4
- package/test/index.ts +1 -1
- package/test/registerDom.ts +4 -0
- package/test/sampleOf.ts +2 -0
- package/test/signalTestRuntime.ts +5 -5
- package/test/testServer.ts +14 -11
- package/types/base/baseEnv.d.ts +17 -1
- package/types/base/primitiveRegistry.d.ts +20 -8
- package/types/base/symbols.d.ts +4 -0
- package/types/client/capacitor.d.ts +39 -0
- package/types/client/clientRuntime.d.ts +7 -0
- package/types/client/cookie.d.ts +19 -3
- package/types/client/csrTypes.d.ts +0 -1
- package/types/client/frameConfig.d.ts +1 -0
- package/types/client/index.d.ts +1 -0
- package/types/client/sharedContext.d.ts +21 -0
- package/types/client/translator.d.ts +1 -0
- package/types/client/types.d.ts +5 -3
- package/types/common/Logger.d.ts +88 -6
- package/types/common/TrustedProxy.d.ts +24 -0
- package/types/common/authToken.d.ts +19 -0
- package/types/common/clamp.d.ts +2 -0
- package/types/common/clientAddress.d.ts +19 -0
- package/types/common/dynamicRecord.d.ts +14 -0
- package/types/common/index.d.ts +15 -3
- package/types/common/interpolateTranslation.d.ts +7 -0
- package/types/common/logContext.d.ts +17 -0
- package/types/common/mcpExposure.d.ts +64 -0
- package/types/common/pathGetLoose.d.ts +8 -0
- package/types/common/plainFieldsOf.d.ts +6 -0
- package/types/common/requestOrigin.d.ts +14 -0
- package/types/common/restClient.d.ts +27 -0
- package/types/common/routeConvention.d.ts +6 -0
- package/types/common/websocketBinaryFrame.d.ts +17 -0
- package/types/constant/constantRegistry.d.ts +2 -10
- package/types/constant/crystalize.d.ts +5 -0
- package/types/constant/dateSlot.d.ts +14 -0
- package/types/constant/fieldInfo.d.ts +20 -3
- package/types/constant/fieldQueryMeta.d.ts +17 -0
- package/types/constant/getDefault.d.ts +8 -0
- package/types/constant/hydrationPlan.d.ts +24 -0
- package/types/constant/index.d.ts +5 -0
- package/types/constant/labelOf.d.ts +7 -0
- package/types/constant/mask.d.ts +54 -0
- package/types/constant/purify.d.ts +2 -2
- package/types/constant/types.d.ts +18 -5
- package/types/dictionary/DictionaryLookup.d.ts +14 -0
- package/types/dictionary/agent.dictionary.d.ts +1 -0
- package/types/dictionary/agentTurn.dictionary.d.ts +1 -0
- package/types/dictionary/base.dictionary.d.ts +1 -1
- package/types/dictionary/dictInfo.d.ts +7 -1
- package/types/dictionary/dictionary.d.ts +11 -9
- package/types/dictionary/dictionaryRegistry.d.ts +14 -0
- package/types/dictionary/index.d.ts +1 -0
- package/types/dictionary/trans.d.ts +1 -2
- package/types/document/dataLoader.d.ts +0 -3
- package/types/document/database.d.ts +2 -2
- package/types/document/documentQuery.d.ts +4 -0
- package/types/document/documentSchema.d.ts +8 -1
- package/types/document/filterMeta.d.ts +26 -6
- package/types/document/index.d.ts +2 -0
- package/types/document/into.d.ts +10 -10
- package/types/document/loaderInfo.d.ts +2 -2
- package/types/document/noDocumentError.d.ts +12 -0
- package/types/document/queryEvaluator.d.ts +49 -0
- package/types/document/types.d.ts +0 -1
- package/types/fetch/agentTurn.d.ts +475 -0
- package/types/fetch/client/fetchClient.d.ts +18 -0
- package/types/fetch/client/fetchHandle.d.ts +24 -0
- package/types/fetch/client/httpClient.d.ts +10 -4
- package/types/fetch/client/sliceInitHandle.d.ts +29 -0
- package/types/fetch/client/wsClient.d.ts +2 -0
- package/types/fetch/fetchType/appliedReturn.type.d.ts +71 -15
- package/types/fetch/fetchType/endpointFetch.type.d.ts +8 -5
- package/types/fetch/fetchType/sliceFetch.type.d.ts +14 -18
- package/types/fetch/index.d.ts +1 -0
- package/types/fetch/requestStorage.d.ts +14 -0
- package/types/index.d.ts +130 -12
- package/types/server/akanApp.d.ts +23 -1
- package/types/server/akanAppHeaders.d.ts +7 -1
- package/types/server/akanOption.d.ts +43 -6
- package/types/server/akanServer.d.ts +67 -9
- package/types/server/animatedImage.d.ts +7 -0
- package/types/server/assetEncoding.d.ts +1 -1
- package/types/server/binaryPubsub.d.ts +18 -0
- package/types/server/console.d.ts +11 -1
- package/types/server/consoleEvaluator.d.ts +2 -0
- package/types/server/consolePasteFilter.d.ts +11 -0
- package/types/server/consoleSession.d.ts +22 -0
- package/types/server/contentEncoding.d.ts +28 -0
- package/types/server/decorators.d.ts +12 -2
- package/types/server/devtools/types.d.ts +4 -4
- package/types/server/di/diLifecycle.d.ts +19 -3
- package/types/server/di/predefinedAdaptor.d.ts +4 -1
- package/types/server/di/utils.d.ts +16 -0
- package/types/server/lifecycle/runtimeDir.d.ts +5 -0
- package/types/server/lifecycle/shutdownManager.d.ts +2 -1
- package/types/server/logging/childOutputReader.d.ts +40 -0
- package/types/server/logging/hubFileSink.d.ts +18 -0
- package/types/server/logging/logControlSocket.d.ts +60 -0
- package/types/server/logging/logForwarder.d.ts +37 -0
- package/types/server/logging/logHub.d.ts +70 -0
- package/types/server/logging/logQuery.d.ts +31 -0
- package/types/server/logging/logStdoutWriter.d.ts +35 -0
- package/types/server/logging/logStreamRoute.d.ts +20 -0
- package/types/server/logging/logTailClient.d.ts +42 -0
- package/types/server/mcp/McpAuth.d.ts +62 -0
- package/types/server/mcp/McpDispatcher.d.ts +61 -0
- package/types/server/mcp/McpEventStream.d.ts +17 -0
- package/types/server/mcp/McpExecutionContext.d.ts +44 -0
- package/types/server/mcp/McpRouter.d.ts +65 -0
- package/types/server/mcp/index.d.ts +5 -0
- package/types/server/mcp.d.ts +1 -0
- package/types/server/resolver/signal.resolver.d.ts +21 -6
- package/types/server/routeTreeBuilder.d.ts +1 -2
- package/types/server/routing/apiRouter.d.ts +5 -2
- package/types/server/routing/appWsData.d.ts +19 -3
- package/types/server/routing/eventStream.d.ts +23 -0
- package/types/server/routing/soloAppRoutes.d.ts +17 -0
- package/types/server/rscWorkerHost.d.ts +4 -1
- package/types/server/semaphore.d.ts +5 -0
- package/types/server/ssrFromRscRenderer.d.ts +14 -0
- package/types/server/staticPath.d.ts +17 -0
- package/types/server/subRouteIndexDocument.d.ts +8 -0
- package/types/server/systemPageDocument.d.ts +1 -0
- package/types/server/systemPages.d.ts +5 -0
- package/types/server/types.d.ts +16 -0
- package/types/server/vendor/akanjs-fetch.d.ts +1 -0
- package/types/server/webRouter.d.ts +15 -4
- package/types/service/adapt.d.ts +3 -3
- package/types/service/agent.service.d.ts +32 -0
- package/types/service/base.service.d.ts +4 -0
- package/types/service/index.d.ts +2 -1
- package/types/service/injectInfo.d.ts +5 -2
- package/types/service/ipcTypes.d.ts +12 -0
- package/types/service/liveSyncHub.d.ts +67 -0
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +1 -1
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +16 -402
- package/types/service/predefinedAdaptor/deepseekLlm.d.ts +76 -0
- package/types/service/predefinedAdaptor/index.d.ts +3 -0
- package/types/service/predefinedAdaptor/insightQuery.d.ts +50 -0
- package/types/service/predefinedAdaptor/llm.adaptor.d.ts +105 -0
- package/types/service/predefinedAdaptor/queue.adaptor.d.ts +3 -2
- package/types/service/predefinedAdaptor/role.adaptor.d.ts +2 -0
- package/types/service/predefinedAdaptor/schedule.adaptor.d.ts +10 -6
- package/types/service/predefinedAdaptor/solidQueue.adaptor.d.ts +6 -2
- package/types/service/predefinedAdaptor/solidSqlite.d.ts +2 -2
- package/types/service/predefinedAdaptor/sql/PendingStoreEnsures.d.ts +6 -0
- package/types/service/predefinedAdaptor/sql/QueryCompiler.d.ts +28 -0
- package/types/service/predefinedAdaptor/sql/SqlDocumentStore.d.ts +127 -0
- package/types/service/predefinedAdaptor/sql/UpdateCompiler.d.ts +17 -0
- package/types/service/predefinedAdaptor/sql/dialect/postgres.d.ts +27 -0
- package/types/service/predefinedAdaptor/sql/dialect/sqlite.d.ts +27 -0
- package/types/service/predefinedAdaptor/sql/driver/bunSqlite.d.ts +16 -0
- package/types/service/predefinedAdaptor/sql/driver/libsql.d.ts +17 -0
- package/types/service/predefinedAdaptor/sql/driver/postgres.d.ts +17 -0
- package/types/service/predefinedAdaptor/sql/types.d.ts +226 -0
- package/types/service/predefinedAdaptor/sql/values.d.ts +13 -0
- package/types/service/predefinedAdaptor/storage.adaptor.d.ts +2 -2
- package/types/service/predefinedAdaptor/websocket.adaptor.d.ts +9 -0
- package/types/service/serve.d.ts +3 -3
- package/types/service/serviceModule.d.ts +3 -3
- package/types/service/toolNames.d.ts +35 -0
- package/types/service/types.d.ts +2 -2
- package/types/signal/CrossSiteGuard.d.ts +44 -0
- package/types/signal/SignalFailure.d.ts +28 -0
- package/types/signal/agent/AgentCatalogue.d.ts +100 -0
- package/types/signal/agent/index.d.ts +1 -0
- package/types/signal/agent.d.ts +1 -0
- package/types/signal/agent.signal.d.ts +24 -0
- package/types/signal/agentTurn.d.ts +9 -0
- package/types/signal/agentTurnStream.d.ts +24 -0
- package/types/signal/base.signal.d.ts +1 -1
- package/types/signal/endpointInfo.d.ts +21 -3
- package/types/signal/exception.d.ts +38 -54774
- package/types/signal/guard.d.ts +12 -0
- package/types/signal/guards.d.ts +23 -1
- package/types/signal/index.d.ts +8 -0
- package/types/signal/intercept.d.ts +5 -5
- package/types/signal/internal.d.ts +5 -1
- package/types/signal/internalArg.d.ts +22 -6
- package/types/signal/mcp/McpDocument.d.ts +84 -0
- package/types/signal/mcp/McpProgress.d.ts +40 -0
- package/types/signal/mcp/McpUriTemplate.d.ts +25 -0
- package/types/signal/mcp/Msg.d.ts +143 -0
- package/types/signal/mcp/index.d.ts +5 -0
- package/types/signal/mcp/mcpProtocol.d.ts +107 -0
- package/types/signal/mcp.d.ts +1 -0
- package/types/signal/middleware.d.ts +7 -7
- package/types/signal/openapi/openapi.d.ts +3 -3
- package/types/signal/schema/JsonSchemaBuilder.d.ts +51 -0
- package/types/signal/schema/index.d.ts +1 -0
- package/types/signal/schema.d.ts +1 -0
- package/types/signal/serializer/fetch.serializer.d.ts +7 -1
- package/types/signal/signalContext.d.ts +89 -9
- package/types/signal/slice.d.ts +42 -15
- package/types/signal/sliceInfo.d.ts +31 -0
- package/types/signal/trace.d.ts +52 -2
- package/types/signal/types.d.ts +99 -4
- package/types/store/SliceRequest.d.ts +16 -0
- package/types/store/action.d.ts +25 -9
- package/types/store/actionTag.d.ts +21 -0
- package/types/store/agent/AgentBridge.d.ts +37 -0
- package/types/store/agent/AgentContext.d.ts +16 -0
- package/types/store/agent/AgentPrompts.d.ts +31 -0
- package/types/store/agent/ScreenReader.d.ts +29 -0
- package/types/store/agent/ScreenSettle.d.ts +22 -0
- package/types/store/agent/ScreenTarget.d.ts +34 -0
- package/types/store/agent/StoreCatalogue.d.ts +26 -0
- package/types/store/agent/StoreSurfaceSource.d.ts +30 -0
- package/types/store/agent/index.d.ts +11 -0
- package/types/store/agent/storeSurface.d.ts +14 -0
- package/types/store/agent/types.d.ts +15 -0
- package/types/store/agent.d.ts +1 -0
- package/types/store/agentic/AgentValue.d.ts +43 -0
- package/types/store/agentic/StExposeBuilder.d.ts +21 -0
- package/types/store/agentic/StExposeDraft.d.ts +13 -0
- package/types/store/agentic/StStateBuilder.d.ts +21 -0
- package/types/store/agentic/StStateDraft.d.ts +12 -0
- package/types/store/agentic/StToolBuilder.d.ts +65 -0
- package/types/store/agentic/StToolDraft.d.ts +13 -0
- package/types/store/agentic/attachAgentic.d.ts +25 -0
- package/types/store/agentic/formFields.d.ts +53 -0
- package/types/store/agentic/index.d.ts +12 -0
- package/types/store/agentic/useFieldTool.d.ts +22 -0
- package/types/store/agentic/useFormTools.d.ts +19 -0
- package/types/store/agentic/useRelationFieldTool.d.ts +27 -0
- package/types/store/agentic.d.ts +1 -0
- package/types/store/baseSt.d.ts +35 -39
- package/types/store/databaseStateNames.d.ts +26 -0
- package/types/store/draftStore.d.ts +57 -0
- package/types/store/formSetterNames.d.ts +30 -0
- package/types/store/index.d.ts +9 -0
- package/types/store/liveInsert.d.ts +40 -0
- package/types/store/rootStore.d.ts +5 -1
- package/types/store/sliceRole.d.ts +25 -0
- package/types/store/state.d.ts +24 -0
- package/types/store/stateBuilder.d.ts +21 -0
- package/types/store/store.d.ts +5 -1
- package/types/store/storeInstance.d.ts +35 -1
- package/types/store/storeRegistry.d.ts +5 -0
- package/types/store/types.d.ts +4 -0
- package/types/store/withSelector.d.ts +5 -4
- package/types/test/index.d.ts +1 -1
- package/types/test/registerDom.d.ts +1 -0
- package/types/test/signalTestRuntime.d.ts +2 -3
- package/types/test/testServer.d.ts +6 -4
- package/types/ui/Agent/Approval.d.ts +8 -0
- package/types/ui/Agent/Attach.d.ts +16 -0
- package/types/ui/Agent/Bubble.d.ts +26 -0
- package/types/ui/Agent/Chat.d.ts +91 -0
- package/types/ui/Agent/ChatCommands.d.ts +34 -0
- package/types/ui/Agent/Composer.d.ts +23 -0
- package/types/ui/Agent/Context.d.ts +13 -0
- package/types/ui/Agent/Dock.d.ts +17 -0
- package/types/ui/Agent/Guide.d.ts +9 -0
- package/types/ui/Agent/History.d.ts +26 -0
- package/types/ui/Agent/Launcher.d.ts +16 -0
- package/types/ui/Agent/Markdown.d.ts +19 -0
- package/types/ui/Agent/Menu.d.ts +18 -0
- package/types/ui/Agent/Mic.d.ts +8 -0
- package/types/ui/Agent/Question.d.ts +14 -0
- package/types/ui/Agent/Queued.d.ts +16 -0
- package/types/ui/Agent/Section.d.ts +10 -0
- package/types/ui/Agent/Skip.d.ts +22 -0
- package/types/ui/Agent/StateKey.d.ts +16 -0
- package/types/ui/Agent/Tool.d.ts +15 -0
- package/types/ui/Agent/Transcript.d.ts +13 -0
- package/types/ui/Agent/Zone.d.ts +48 -0
- package/types/ui/Agent/agentSessionOf.d.ts +27 -0
- package/types/ui/Agent/attachment.d.ts +36 -0
- package/types/ui/Agent/fetchRunner.d.ts +12 -0
- package/types/ui/Agent/index.d.ts +19 -0
- package/types/ui/Agent/index_.d.ts +1 -0
- package/types/ui/Agent/markdownBlocks.d.ts +35 -0
- package/types/ui/Agent/markdownSpans.d.ts +2 -0
- package/types/ui/Agent/markdownTable.d.ts +16 -0
- package/types/ui/Agent/sessionHistory.d.ts +14 -0
- package/types/ui/Agent/sessionView.d.ts +15 -0
- package/types/ui/Agent/tokenCount.d.ts +6 -0
- package/types/ui/Agent/useChatAttachments.d.ts +25 -0
- package/types/ui/Agent/useChatQueue.d.ts +31 -0
- package/types/ui/Agent/useChatVoice.d.ts +31 -0
- package/types/ui/Agent/useDraftRecall.d.ts +14 -0
- package/types/ui/Agent/useKeyboardInset.d.ts +8 -0
- package/types/ui/Agent/useSlashMenu.d.ts +24 -0
- package/types/ui/Agent/voice.d.ts +71 -0
- package/types/ui/Agent.d.ts +1 -0
- package/types/ui/Badge.d.ts +1 -1
- package/types/ui/Button.d.ts +1 -1
- package/types/ui/Constant/Graph.d.ts +10 -0
- package/types/ui/Constant/index.d.ts +2 -1
- package/types/ui/Constant/schemaGraph.d.ts +39 -0
- package/types/ui/Data/Dashboard.d.ts +16 -3
- package/types/ui/Data/Insight.d.ts +1 -1
- package/types/ui/Data/ListContainer.d.ts +15 -7
- package/types/ui/Data/QueryMaker.d.ts +45 -3
- package/types/ui/Data/RefPicker.d.ts +16 -0
- package/types/ui/Data/dataExport.d.ts +5 -0
- package/types/ui/Data/dataText.d.ts +6 -0
- package/types/ui/Data/index.d.ts +2 -0
- package/types/ui/Data/index_.d.ts +1 -0
- package/types/ui/DatePicker.d.ts +15 -11
- package/types/ui/Dialog/LegacyModal.d.ts +13 -0
- package/types/ui/Dialog/Provider.d.ts +3 -1
- package/types/ui/Dialog/context.d.ts +9 -1
- package/types/ui/Dialog/index.d.ts +1 -0
- package/types/ui/DraggableList.d.ts +1 -1
- package/types/ui/Dropdown.d.ts +5 -1
- package/types/ui/Field/Choice.d.ts +52 -0
- package/types/ui/Field/Collection.d.ts +50 -0
- package/types/ui/Field/DateField.d.ts +32 -0
- package/types/ui/Field/Label.d.ts +9 -0
- package/types/ui/Field/NumberField.d.ts +41 -0
- package/types/ui/Field/Relation.d.ts +80 -0
- package/types/ui/Field/Text.d.ts +96 -0
- package/types/ui/Field/index.d.ts +50 -0
- package/types/ui/Field.d.ts +1 -411
- package/types/ui/Input.d.ts +0 -6
- package/types/ui/Layout/BottomTab.d.ts +3 -2
- package/types/ui/LegacyModal.d.ts +24 -0
- package/types/ui/Load/Edit_Client.d.ts +6 -1
- package/types/ui/Load/Stream.d.ts +22 -0
- package/types/ui/Load/index.d.ts +2 -0
- package/types/ui/Loading/ProgressBar.d.ts +4 -0
- package/types/ui/Loading/Spin.d.ts +2 -1
- package/types/ui/Loading/index_.d.ts +13 -0
- package/types/ui/Model/AdminPanel.d.ts +15 -3
- package/types/ui/Model/DraftBar.d.ts +14 -0
- package/types/ui/Model/EditModal.d.ts +8 -2
- package/types/ui/Model/EditWrapper.d.ts +4 -1
- package/types/ui/Model/New.d.ts +6 -1
- package/types/ui/Model/NewWrapper.d.ts +5 -0
- package/types/ui/Model/NewWrapper_Client.d.ts +4 -1
- package/types/ui/Model/draftScope.d.ts +17 -0
- package/types/ui/Pagination.d.ts +2 -2
- package/types/ui/Radio.d.ts +1 -1
- package/types/ui/RecentTime.d.ts +18 -1
- package/types/ui/Reference/Collapse.d.ts +11 -0
- package/types/ui/Reference/Panel.d.ts +29 -0
- package/types/ui/Reference/Segmented.d.ts +17 -0
- package/types/ui/Reference/Summary.d.ts +13 -0
- package/types/ui/Reference/Toolbar.d.ts +21 -0
- package/types/ui/Reference/dictText.d.ts +6 -0
- package/types/ui/Reference/index.d.ts +7 -0
- package/types/ui/Reference/style.d.ts +20 -0
- package/types/ui/Reference.d.ts +1 -0
- package/types/ui/ScreenNavigator.d.ts +3 -1
- package/types/ui/Signal/Arg.d.ts +7 -3
- package/types/ui/Signal/Doc.d.ts +4 -6
- package/types/ui/Signal/Object.d.ts +2 -1
- package/types/ui/Signal/RestApi.d.ts +2 -1
- package/types/ui/Signal/WebSocket.d.ts +2 -1
- package/types/ui/Signal/endpointEntries.d.ts +20 -0
- package/types/ui/Signal/style.d.ts +9 -8
- package/types/ui/System/Client.d.ts +1 -2
- package/types/ui/System/Common.d.ts +3 -4
- package/types/ui/System/Messages.d.ts +1 -1
- package/types/ui/System/Root.d.ts +4 -0
- package/types/ui/Tab/Provider.d.ts +3 -1
- package/types/ui/Tab/context.d.ts +4 -2
- package/types/ui/ToggleSelect.d.ts +1 -0
- package/types/ui/UiOverride/context.d.ts +20 -1
- package/types/ui/agentAttrs.d.ts +14 -0
- package/types/ui/index.d.ts +24 -1
- package/types/ui/overlayLayer.d.ts +13 -0
- package/types/ui/overlayPosition.d.ts +28 -0
- package/types/ui/recipe/badgeRecipe.d.ts +2 -2
- package/types/ui/recipe/buttonRecipe.d.ts +2 -2
- package/types/vendor/use-agentic/AgentAbort.d.ts +17 -0
- package/types/vendor/use-agentic/AgentProgress.d.ts +27 -0
- package/types/vendor/use-agentic/AgentProvider.d.ts +17 -0
- package/types/vendor/use-agentic/AgentScope.d.ts +9 -0
- package/types/vendor/use-agentic/AgentSession.d.ts +163 -0
- package/types/vendor/use-agentic/Agentic.d.ts +21 -0
- package/types/vendor/use-agentic/AgenticSurface.d.ts +58 -0
- package/types/vendor/use-agentic/Compaction.d.ts +48 -0
- package/types/vendor/use-agentic/ToolOutput.d.ts +21 -0
- package/types/vendor/use-agentic/Transcript.d.ts +18 -0
- package/types/vendor/use-agentic/httpRunner.d.ts +15 -0
- package/types/vendor/use-agentic/index.d.ts +19 -0
- package/types/vendor/use-agentic/sharedContext.d.ts +15 -0
- package/types/vendor/use-agentic/surfaceContext.d.ts +5 -0
- package/types/vendor/use-agentic/types.d.ts +182 -0
- package/types/vendor/use-agentic/useAgent.d.ts +4 -0
- package/types/vendor/use-agentic/useAgentGuide.d.ts +6 -0
- package/types/vendor/use-agentic/useAgentResource.d.ts +12 -0
- package/types/vendor/use-agentic/useAgentState.d.ts +16 -0
- package/types/vendor/use-agentic/useAgentTool.d.ts +16 -0
- package/types/vendor/use-agentic.d.ts +1 -0
- package/types/webkit/index.d.ts +4 -0
- package/types/webkit/useBodyScrollLock.d.ts +2 -0
- package/types/webkit/useCamera.d.ts +10 -1
- package/types/webkit/usePageTool.d.ts +19 -0
- package/types/webkit/usePurchase.d.ts +4 -0
- package/types/webkit/useScreenScope.d.ts +25 -0
- package/ui/Agent/Approval.tsx +32 -0
- package/ui/Agent/Attach.tsx +77 -0
- package/ui/Agent/Bubble.tsx +192 -0
- package/ui/Agent/Chat.tsx +554 -0
- package/ui/Agent/ChatCommands.ts +141 -0
- package/ui/Agent/Composer.tsx +107 -0
- package/ui/Agent/Context.tsx +49 -0
- package/ui/Agent/Dock.tsx +77 -0
- package/ui/Agent/Guide.tsx +16 -0
- package/ui/Agent/History.tsx +49 -0
- package/ui/Agent/Launcher.tsx +60 -0
- package/ui/Agent/Markdown.tsx +142 -0
- package/ui/Agent/Menu.tsx +55 -0
- package/ui/Agent/Mic.tsx +27 -0
- package/ui/Agent/Question.tsx +63 -0
- package/ui/Agent/Queued.tsx +58 -0
- package/ui/Agent/Section.tsx +24 -0
- package/ui/Agent/Skip.tsx +30 -0
- package/ui/Agent/StateKey.tsx +46 -0
- package/ui/Agent/Tool.tsx +59 -0
- package/ui/Agent/Transcript.tsx +33 -0
- package/ui/Agent/Zone.tsx +116 -0
- package/ui/Agent/agentSessionOf.ts +60 -0
- package/ui/Agent/attachment.ts +80 -0
- package/ui/Agent/fetchRunner.ts +44 -0
- package/ui/Agent/index.ts +27 -0
- package/ui/Agent/index_.tsx +4 -0
- package/ui/Agent/markdownBlocks.ts +137 -0
- package/ui/Agent/markdownSpans.tsx +49 -0
- package/ui/Agent/markdownTable.ts +54 -0
- package/ui/Agent/sessionHistory.ts +62 -0
- package/ui/Agent/sessionView.ts +38 -0
- package/ui/Agent/tokenCount.ts +10 -0
- package/ui/Agent/useChatAttachments.ts +95 -0
- package/ui/Agent/useChatQueue.ts +68 -0
- package/ui/Agent/useChatVoice.ts +139 -0
- package/ui/Agent/useDraftRecall.ts +42 -0
- package/ui/Agent/useKeyboardInset.ts +26 -0
- package/ui/Agent/useSlashMenu.ts +58 -0
- package/ui/Agent/voice.ts +177 -0
- package/ui/Badge.tsx +1 -1
- package/ui/BottomSheet.tsx +32 -36
- package/ui/Button.tsx +3 -1
- package/ui/Clipboard.tsx +3 -6
- package/ui/Constant/Doc.tsx +265 -254
- package/ui/Constant/Graph.tsx +151 -0
- package/ui/Constant/index.ts +3 -2
- package/ui/Constant/schemaGraph.ts +232 -0
- package/ui/Data/CardList.tsx +14 -3
- package/ui/Data/Dashboard.tsx +70 -52
- package/ui/Data/Insight.tsx +18 -12
- package/ui/Data/Item.tsx +42 -56
- package/ui/Data/ListContainer.tsx +246 -132
- package/ui/Data/Pagination.tsx +10 -3
- package/ui/Data/QueryMaker.tsx +160 -11
- package/ui/Data/RefPicker.tsx +202 -0
- package/ui/Data/TableList.tsx +22 -13
- package/ui/Data/dataExport.ts +54 -0
- package/ui/Data/dataText.ts +22 -0
- package/ui/Data/index.ts +13 -1
- package/ui/Data/index_.tsx +1 -0
- package/ui/DatePicker.tsx +110 -128
- package/ui/Dialog/Close.tsx +3 -7
- package/ui/Dialog/LegacyModal.tsx +241 -0
- package/ui/Dialog/Modal.tsx +62 -195
- package/ui/Dialog/Provider.tsx +47 -3
- package/ui/Dialog/Trigger.tsx +3 -7
- package/ui/Dialog/context.ts +14 -2
- package/ui/Dialog/index.tsx +2 -0
- package/ui/DragAction.tsx +3 -2
- package/ui/DraggableList.tsx +10 -6
- package/ui/Dropdown.tsx +89 -27
- package/ui/Empty.tsx +6 -4
- package/ui/Field/Choice.tsx +172 -0
- package/ui/Field/Collection.tsx +290 -0
- package/ui/Field/DateField.tsx +138 -0
- package/ui/Field/Label.tsx +31 -0
- package/ui/Field/NumberField.tsx +162 -0
- package/ui/Field/Relation.tsx +387 -0
- package/ui/Field/Text.tsx +345 -0
- package/ui/Field/index.tsx +70 -0
- package/ui/Input.tsx +31 -69
- package/ui/KeyboardAvoiding.tsx +2 -2
- package/ui/Layout/BottomTab.tsx +32 -37
- package/ui/Layout/Sider.tsx +37 -14
- package/ui/LegacyModal.tsx +53 -0
- package/ui/Link/CsrLink.tsx +1 -1
- package/ui/Load/Edit.tsx +2 -2
- package/ui/Load/Edit_Client.tsx +18 -3
- package/ui/Load/Pagination.tsx +35 -28
- package/ui/Load/Stream.tsx +38 -0
- package/ui/Load/Units.tsx +101 -53
- package/ui/Load/View.tsx +44 -19
- package/ui/Load/index.ts +2 -0
- package/ui/Loading/Area.tsx +7 -6
- package/ui/Loading/Button.tsx +7 -9
- package/ui/Loading/Input.tsx +7 -9
- package/ui/Loading/ProgressBar.tsx +16 -7
- package/ui/Loading/Skeleton.tsx +8 -13
- package/ui/Loading/Spin.tsx +20 -14
- package/ui/Loading/index.ts +15 -0
- package/ui/Loading/index_.tsx +22 -0
- package/ui/Menu.tsx +1 -1
- package/ui/Model/AdminPanel.tsx +52 -12
- package/ui/Model/DraftBar.tsx +84 -0
- package/ui/Model/EditModal.tsx +61 -17
- package/ui/Model/EditWrapper.tsx +20 -4
- package/ui/Model/New.tsx +10 -1
- package/ui/Model/NewWrapper.tsx +5 -0
- package/ui/Model/NewWrapper_Client.tsx +31 -7
- package/ui/Model/Remove.tsx +18 -6
- package/ui/Model/RemoveWrapper.tsx +12 -2
- package/ui/Model/SureToRemove.tsx +18 -6
- package/ui/Model/ViewEditModal.tsx +64 -15
- package/ui/Model/ViewModal.tsx +25 -11
- package/ui/Model/ViewWrapper.tsx +15 -4
- package/ui/Model/draftScope.ts +27 -0
- package/ui/Model/index_.tsx +1 -1
- package/ui/Pagination.tsx +51 -66
- package/ui/Popconfirm.tsx +88 -78
- package/ui/Radio.tsx +53 -24
- package/ui/RecentTime.tsx +83 -35
- package/ui/Reference/Collapse.tsx +26 -0
- package/ui/Reference/Panel.tsx +79 -0
- package/ui/Reference/Segmented.tsx +41 -0
- package/ui/Reference/Summary.tsx +25 -0
- package/ui/Reference/Toolbar.tsx +44 -0
- package/ui/Reference/dictText.ts +9 -0
- package/ui/Reference/index.ts +7 -0
- package/ui/Reference/style.ts +45 -0
- package/ui/ScreenNavigator.tsx +17 -2
- package/ui/Select.tsx +96 -57
- package/ui/Signal/Arg.tsx +83 -68
- package/ui/Signal/Doc.tsx +163 -129
- package/ui/Signal/Listener.tsx +40 -29
- package/ui/Signal/Message.tsx +94 -142
- package/ui/Signal/Object.tsx +79 -57
- package/ui/Signal/PubSub.tsx +76 -114
- package/ui/Signal/Request.tsx +2 -22
- package/ui/Signal/Response.tsx +19 -45
- package/ui/Signal/RestApi.tsx +170 -200
- package/ui/Signal/WebSocket.tsx +29 -26
- package/ui/Signal/endpointEntries.ts +59 -0
- package/ui/Signal/makeExample.ts +10 -3
- package/ui/Signal/style.ts +34 -29
- package/ui/Switch.tsx +4 -0
- package/ui/System/CSR.tsx +1 -1
- package/ui/System/Client.tsx +36 -18
- package/ui/System/Common.tsx +3 -4
- package/ui/System/DevModeToggle.tsx +1 -1
- package/ui/System/Gtag.tsx +3 -3
- package/ui/System/Messages.tsx +52 -31
- package/ui/System/Reconnect.tsx +22 -56
- package/ui/System/Root.tsx +4 -0
- package/ui/System/SelectLanguage.tsx +47 -17
- package/ui/System/ThemeToggle.tsx +25 -13
- package/ui/Tab/Menu.tsx +24 -12
- package/ui/Tab/Menus.tsx +6 -3
- package/ui/Tab/Provider.tsx +30 -3
- package/ui/Tab/context.ts +8 -4
- package/ui/Table.tsx +66 -60
- package/ui/ToggleSelect.tsx +8 -7
- package/ui/Tooltip.tsx +15 -1
- package/ui/UiOverride/context.ts +23 -2
- package/ui/Unauthorized.tsx +6 -4
- package/ui/agentAttrs.ts +19 -0
- package/ui/index.ts +51 -1
- package/ui/overlayLayer.ts +12 -2
- package/ui/overlayPosition.ts +103 -0
- package/ui/recipe/buttonRecipe.ts +2 -2
- package/ui/styles.css +31 -0
- package/vendor/use-agentic/AgentAbort.ts +29 -0
- package/vendor/use-agentic/AgentProgress.ts +40 -0
- package/vendor/use-agentic/AgentProvider.tsx +39 -0
- package/vendor/use-agentic/AgentScope.tsx +20 -0
- package/vendor/use-agentic/AgentSession.ts +750 -0
- package/vendor/use-agentic/Agentic.tsx +44 -0
- package/vendor/use-agentic/AgenticSurface.ts +333 -0
- package/vendor/use-agentic/Compaction.ts +120 -0
- package/vendor/use-agentic/ToolOutput.ts +60 -0
- package/vendor/use-agentic/Transcript.ts +50 -0
- package/vendor/use-agentic/WIRE.md +86 -0
- package/vendor/use-agentic/httpRunner.ts +131 -0
- package/vendor/use-agentic/index.ts +20 -0
- package/vendor/use-agentic/sharedContext.ts +25 -0
- package/vendor/use-agentic/surfaceContext.ts +10 -0
- package/vendor/use-agentic/types.ts +192 -0
- package/vendor/use-agentic/useAgent.ts +18 -0
- package/vendor/use-agentic/useAgentGuide.ts +16 -0
- package/vendor/use-agentic/useAgentResource.ts +36 -0
- package/vendor/use-agentic/useAgentState.ts +64 -0
- package/vendor/use-agentic/useAgentTool.ts +55 -0
- package/webkit/bootCsr.tsx +12 -10
- package/webkit/index.ts +4 -0
- package/webkit/lazy.tsx +5 -1
- package/webkit/useBodyScrollLock.tsx +29 -0
- package/webkit/useCamera.tsx +22 -6
- package/webkit/useCodepush.tsx +2 -2
- package/webkit/useCsrValues.ts +1 -3
- package/webkit/useFetch.ts +4 -3
- package/webkit/useFrameRuntime.ts +15 -8
- package/webkit/usePageTool.tsx +37 -0
- package/webkit/usePurchase.tsx +4 -1
- package/webkit/useScreenScope.tsx +60 -0
- package/fetch/serializer/fetch.serializer.ts +0 -142
- package/fetch/serializer/index.ts +0 -1
- package/types/common/httpClient.d.ts +0 -20
- package/types/fetch/serializer/fetch.serializer.d.ts +0 -14
- package/types/fetch/serializer/index.d.ts +0 -1
- package/types/fetch/serializer.d.ts +0 -1
- package/types/ui/Constant/Mermaid.d.ts +0 -8
- package/types/ui/Signal/Collapse.d.ts +0 -12
- package/ui/Constant/Mermaid.tsx +0 -149
- package/ui/Field.tsx +0 -1569
- package/ui/Loading/index.tsx +0 -22
- package/ui/Signal/Collapse.tsx +0 -29
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,108 @@
|
|
|
1
1
|
# akanjs
|
|
2
2
|
|
|
3
|
+
## 2.4.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 11aa655: feat(constant): remove a relation's target with its owner via `cascade: "remove"`
|
|
8
|
+
|
|
9
|
+
A relation field can now take its target down with it: `image: field(File, { cascade: "remove" })`, arrays
|
|
10
|
+
included. The removal runs through the **target's service**, so the target's own `_postRemove` runs with it —
|
|
11
|
+
that is how removing a model also deletes the file's stored blob or object, with no extra wiring in the owning
|
|
12
|
+
module.
|
|
13
|
+
|
|
14
|
+
Only a relation accepts the option. A `String`, an `ID`, a scalar, and a nested array each fail while the class
|
|
15
|
+
is being built, naming the field: none of them points at a document the framework could remove.
|
|
16
|
+
|
|
17
|
+
Target services resolve lazily, at removal time, so a cascade adds no boot-order edge between two services and a
|
|
18
|
+
cascade cycle cannot fail the boot. They resolve _before_ the parent is touched, so a model cascading into a
|
|
19
|
+
module the app never mounted fails with nothing half-removed.
|
|
20
|
+
|
|
21
|
+
Two limits worth knowing. Nothing checks whether another document still references the same target, so declaring
|
|
22
|
+
`cascade` asserts that the field owns its target exclusively. And query-level removal (`deleteManyByQuery` /
|
|
23
|
+
`updateManyByQuery`) stamps `removedAt` in one atomic update that fires no hooks and therefore no cascade —
|
|
24
|
+
remove documents one at a time when they cascade.
|
|
25
|
+
|
|
26
|
+
- 11aa655: feat(store): invalidate sibling slices on create and refetch them in `Load.Units`
|
|
27
|
+
|
|
28
|
+
A model with more than one parent is listed by more than one slice, and a create could only ever be spliced
|
|
29
|
+
into the slice it was issued from. Creating a `bizDoc` from `bizDocInOrg` left `bizDocListInProject` without
|
|
30
|
+
it, and an RSC navigation back to that page replayed a cached payload whose server-stamped
|
|
31
|
+
`bizDocInitAtInProject` still satisfied `Load.Units`' cache check — so the new document stayed invisible until
|
|
32
|
+
a full reload.
|
|
33
|
+
|
|
34
|
+
`create<Model>` and `create<Model>InForm` now stamp a new per-slice `<model>StaleAt<Suffix>` on every slice
|
|
35
|
+
_except_ the one named by `sliceName`. Whether the new document belongs to a sibling slice is a server-side
|
|
36
|
+
filter decision, so the siblings are marked for revalidation rather than patched optimistically. `Load.Units`
|
|
37
|
+
refetches through `refresh<Model><Suffix>` when its slice's `StaleAt` is newer than its `InitAt`, and a
|
|
38
|
+
completed refresh restamps `InitAt` past `StaleAt` to end the stale state. The refetch is skipped while the
|
|
39
|
+
list is already loading, which also dedups several `Load.Units` mounted on one slice.
|
|
40
|
+
|
|
41
|
+
`Load.Units` also takes a `staleTime` prop, in milliseconds, for age-based revalidation independent of any
|
|
42
|
+
create: `staleTime={0}` always refetches on mount, `staleTime={30_000}` refetches only when the cached data is
|
|
43
|
+
older than 30s. Omitting it leaves the component purely invalidation-driven.
|
|
44
|
+
|
|
45
|
+
Update and remove are unchanged — they already walk every slice, because a document they touch is one the
|
|
46
|
+
cached lists can be searched for by id.
|
|
47
|
+
|
|
48
|
+
- 11aa655: feat(server): add subRoute hosts at runtime with `AKAN_SUB_ROUTE_HOSTS`
|
|
49
|
+
|
|
50
|
+
An app resolved a request Host to a basePath through a map fixed at build time — the domains written into
|
|
51
|
+
`akan.config.ts` plus the generated `<basePath>-<branch>.<serveDomain>`. A platform that mints its hostnames when
|
|
52
|
+
a project is created cannot write either one into the repo, so its subRoute hosts fell through to the root app.
|
|
53
|
+
|
|
54
|
+
`AKAN_SUB_ROUTE_HOSTS` adds to that map at boot, in the same spirit as `AKAN_PUBLIC_BASE_PATHS`:
|
|
55
|
+
|
|
56
|
+
```
|
|
57
|
+
AKAN_SUB_ROUTE_HOSTS="soft=soft-abc.try.akanjs.com,soft.acme.com;office=office-abc.try.akanjs.com"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Hosts are matched lowercased and without a port, exactly as the built-in ones are. The env mapping is a union with
|
|
61
|
+
the built one, never a replacement, so a tenant's own domains keep working and removing the env restores the
|
|
62
|
+
previous behaviour byte for byte.
|
|
63
|
+
|
|
64
|
+
A basePath the build does not serve is dropped with a warning rather than honoured — the route tree is a build
|
|
65
|
+
output, so accepting one would answer every request under it with a 404 and nothing to explain why. A malformed
|
|
66
|
+
entry is skipped the same way: the value is rendered by a deployment platform, and one bad character must not turn
|
|
67
|
+
into a boot loop across every pod.
|
|
68
|
+
|
|
69
|
+
`x-base-path` is now checked against the basePaths the build serves before it is trusted, matching the check
|
|
70
|
+
`getBasePathFromPathname` already applied to it. An unrecognised value falls through to host matching instead of
|
|
71
|
+
selecting a basePath that resolves to nothing.
|
|
72
|
+
|
|
73
|
+
- 25d5b15: feat(devkit): sync lib `page` trees into apps and honor `pageConfig.devOnly`
|
|
74
|
+
|
|
75
|
+
Apps can opt in with `syncPageLibs` (`true` / lib list) so `akan sync` links each lib's routes under
|
|
76
|
+
`page/(libs)/(<lib>)` — once per basePath when the app has subRoutes. The link is generated and
|
|
77
|
+
gitignored; the lib source stays the edit target. Collision on the resolved route pattern is a
|
|
78
|
+
sync-time error.
|
|
79
|
+
|
|
80
|
+
`pageConfig.devOnly: true` (literal only) keeps a route out of `akan build` while `akan start` still
|
|
81
|
+
serves it. On a `_layout` it excludes the whole subtree. Symlink-aware file ops avoid wiping a synced
|
|
82
|
+
lib when cleaning an app link, and dangling lib links no longer break `getApps`.
|
|
83
|
+
|
|
84
|
+
- 25d5b15: feat(signal): refresh websocket credentials in-session and re-check pubsub rooms
|
|
85
|
+
|
|
86
|
+
Handshake credentials now live on `AppWsData` (headers/cookies only). Clients that hold the token in
|
|
87
|
+
memory send it with `fetch.setJwt(...)`, which forwards an `__auth` frame; the server swaps the
|
|
88
|
+
snapshot synchronously and re-runs each subscribed room's guards, unsubscribing the ones that fail.
|
|
89
|
+
|
|
90
|
+
Guards should read the caller with `context.get("account")` instead of branching on HTTP vs websocket
|
|
91
|
+
transport. Slice-level guards still only wrap generated query/mutation endpoints — a pubsub endpoint
|
|
92
|
+
needs its own `guards` if the room itself must be protected.
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- 6d58c7e: add search feature for sqlit database with fts5
|
|
97
|
+
- 25d5b15: fix(ui): refresh EditModal when the hydrated edit payload is stale
|
|
98
|
+
|
|
99
|
+
RSC navigation can replay a cached page tree, and an edit shell hydrated from that payload can show
|
|
100
|
+
arbitrarily old form data. EditModal now treats a cache replay (or a `modelViewAt` older than 60s) as
|
|
101
|
+
stale and refetches via `edit<Model>` while keeping the modal open on the last known id.
|
|
102
|
+
|
|
103
|
+
- 42cf7a2: Normalize unsendable relayed WebSocket close codes to 1001 so Bun's global client WebSocket.close no longer throws InvalidAccessError at the gateway's client-to-upstream relay when a peer disappears without a close frame (code 1006). The upstream-to-client relay applies the same normalization defensively.
|
|
104
|
+
- 04cb46d: Allow the documented wsConnect export during source validation for root layouts, including base-path and grouped root boundaries, while continuing to reject it on nested layouts.
|
|
105
|
+
|
|
3
106
|
## 2.4.1
|
|
4
107
|
|
|
5
108
|
### Patch Changes
|
package/README.ko.md
CHANGED
package/README.md
CHANGED
package/base/baseEnv.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface BaseEnv {
|
|
|
15
15
|
operationMode: "local" | "edge" | "cloud" | "module";
|
|
16
16
|
databaseMode?: DatabaseMode;
|
|
17
17
|
}
|
|
18
|
-
export type BackendEnv =
|
|
18
|
+
export type BackendEnv = {
|
|
19
19
|
hostname?: string | null;
|
|
20
20
|
port?: number;
|
|
21
21
|
database?: {
|
|
@@ -59,6 +59,8 @@ export type ClientEnv = BaseEnv & {
|
|
|
59
59
|
side: "server" | "client";
|
|
60
60
|
renderMode: "ssr" | "csr";
|
|
61
61
|
websocket: boolean;
|
|
62
|
+
apiPrefix: string;
|
|
63
|
+
wsPrefix: string;
|
|
62
64
|
clientHost: string;
|
|
63
65
|
clientPort: number;
|
|
64
66
|
clientHttpProtocol: "http:" | "https:";
|
|
@@ -73,15 +75,55 @@ export type ClientEnv = BaseEnv & {
|
|
|
73
75
|
|
|
74
76
|
let cachedEnv: ClientEnv | undefined;
|
|
75
77
|
|
|
78
|
+
type RoutePrefixOverride = { api?: string; ws?: string };
|
|
79
|
+
|
|
80
|
+
const globalWithPrefix = globalThis as typeof globalThis & { __AKAN_PREFIX__?: RoutePrefixOverride };
|
|
81
|
+
|
|
82
|
+
/** Leading slash, no trailing slash. A blank value — or a bare `/`, which would swallow every page route — is no prefix at all and falls through to the next source. */
|
|
83
|
+
export const normalizeRoutePrefix = (value: string | undefined | null): string | undefined => {
|
|
84
|
+
const trimmed = value?.trim();
|
|
85
|
+
if (!trimmed) return undefined;
|
|
86
|
+
const normalized = `/${trimmed.replace(/^\/+|\/+$/g, "")}`;
|
|
87
|
+
return normalized === "/" ? undefined : normalized;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Three sources, narrowest first. The global is what a server-rendered page's bootstrap script writes, so the
|
|
92
|
+
* browser follows the process that rendered it. `AKAN_API_PREFIX` is deliberately outside the `AKAN_PUBLIC_*`
|
|
93
|
+
* namespace: only that namespace is inlined into client bundles at build time, so a name inside it could never
|
|
94
|
+
* act as a runtime override. `AKAN_PUBLIC_API_PREFIX` is the build-time default, and the only one a prebuilt CSR
|
|
95
|
+
* or mobile bundle can read. Written out rather than looked up by key — a computed `process.env[...]` is opaque
|
|
96
|
+
* to the bundler's define pass, and the public value would stop being inlined.
|
|
97
|
+
*/
|
|
98
|
+
export const getApiPrefix = (): string =>
|
|
99
|
+
normalizeRoutePrefix(globalWithPrefix.__AKAN_PREFIX__?.api) ??
|
|
100
|
+
normalizeRoutePrefix(process.env.AKAN_API_PREFIX) ??
|
|
101
|
+
normalizeRoutePrefix(process.env.AKAN_PUBLIC_API_PREFIX) ??
|
|
102
|
+
"/api";
|
|
103
|
+
|
|
104
|
+
export const getWsPrefix = (): string =>
|
|
105
|
+
normalizeRoutePrefix(globalWithPrefix.__AKAN_PREFIX__?.ws) ??
|
|
106
|
+
normalizeRoutePrefix(process.env.AKAN_WS_PREFIX) ??
|
|
107
|
+
normalizeRoutePrefix(process.env.AKAN_PUBLIC_WS_PREFIX) ??
|
|
108
|
+
"/ws";
|
|
109
|
+
|
|
110
|
+
/** `AkanApp` rewrites `process.env` for the replica it runs in-process, after this module may already have cached. */
|
|
111
|
+
export const resetEnvCache = () => {
|
|
112
|
+
cachedEnv = undefined;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const missingPublicEnv = (key: string) =>
|
|
116
|
+
`getEnv() cannot run at build time: akan build does not inject ${key}. Call it from a runtime function instead of at module scope (e.g. env(() => getEnv()) in adapt(), a method body, or a default thunk).`;
|
|
117
|
+
|
|
76
118
|
/** Reads and caches Akan runtime environment values from process/browser environment settings. */
|
|
77
119
|
export const getEnv = (): ClientEnv => {
|
|
78
120
|
if (cachedEnv) return cachedEnv;
|
|
79
121
|
const appName = process.env.AKAN_PUBLIC_APP_NAME ?? "unknown";
|
|
80
122
|
const repoName = process.env.AKAN_PUBLIC_REPO_NAME ?? "unknown";
|
|
81
123
|
const serveDomain = process.env.AKAN_PUBLIC_SERVE_DOMAIN ?? "unknown";
|
|
82
|
-
if (appName === "unknown") throw new Error("
|
|
83
|
-
if (repoName === "unknown") throw new Error("
|
|
84
|
-
if (serveDomain === "unknown") throw new Error("
|
|
124
|
+
if (appName === "unknown") throw new Error(missingPublicEnv("AKAN_PUBLIC_APP_NAME"));
|
|
125
|
+
if (repoName === "unknown") throw new Error(missingPublicEnv("AKAN_PUBLIC_REPO_NAME"));
|
|
126
|
+
if (serveDomain === "unknown") throw new Error(missingPublicEnv("AKAN_PUBLIC_SERVE_DOMAIN"));
|
|
85
127
|
const environment = (process.env.AKAN_PUBLIC_ENV ?? "debug") as BaseEnv["environment"];
|
|
86
128
|
const operationMode = (process.env.AKAN_PUBLIC_OPERATION_MODE ??
|
|
87
129
|
(environment === "local" ? "local" : "cloud")) as BaseEnv["operationMode"];
|
|
@@ -138,7 +180,9 @@ export const getEnv = (): ClientEnv => {
|
|
|
138
180
|
: side === "client"
|
|
139
181
|
? (window.location.protocol as "http:" | "https:")
|
|
140
182
|
: ("http:" as const));
|
|
141
|
-
const
|
|
183
|
+
const apiPrefix = getApiPrefix();
|
|
184
|
+
const wsPrefix = getWsPrefix();
|
|
185
|
+
const serverHttpUri = `${serverHttpProtocol}//${serverHost}${serverPort === 443 ? "" : `:${serverPort}`}${apiPrefix}`;
|
|
142
186
|
const serverWsProtocol = serverHttpProtocol === "http:" ? "ws:" : "wss:";
|
|
143
187
|
const serverWsUri = `${serverWsProtocol}//${serverHost}${serverPort === 443 ? "" : `:${serverPort}`}`;
|
|
144
188
|
|
|
@@ -147,6 +191,8 @@ export const getEnv = (): ClientEnv => {
|
|
|
147
191
|
side,
|
|
148
192
|
renderMode,
|
|
149
193
|
websocket: true,
|
|
194
|
+
apiPrefix,
|
|
195
|
+
wsPrefix,
|
|
150
196
|
clientHost,
|
|
151
197
|
clientPort,
|
|
152
198
|
clientHttpProtocol,
|
|
@@ -44,7 +44,7 @@ export class PrimitiveRegistry {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
export type PrimitiveValue = string | number | boolean | Dayjs | Date | null | undefined;
|
|
47
|
+
export type PrimitiveValue = string | number | boolean | Dayjs | Date | Uint8Array | null | undefined;
|
|
48
48
|
export class PrimitiveScalar {
|
|
49
49
|
static refName: string;
|
|
50
50
|
static [SERVER_VALUE]: unknown;
|
|
@@ -176,6 +176,49 @@ export class Any extends PrimitiveScalar {
|
|
|
176
176
|
}
|
|
177
177
|
PrimitiveRegistry.register(Any);
|
|
178
178
|
|
|
179
|
+
type NodeBuffer = Uint8Array & { toString(encoding: string): string };
|
|
180
|
+
interface BufferCtor {
|
|
181
|
+
from(buffer: ArrayBufferLike, byteOffset: number, length: number): NodeBuffer;
|
|
182
|
+
from(text: string, encoding: string): NodeBuffer;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export class Binary extends PrimitiveScalar {
|
|
186
|
+
static override refName: "Binary" = "Binary";
|
|
187
|
+
static override [SERVER_VALUE]: Uint8Array;
|
|
188
|
+
static override [CLIENT_VALUE]: Uint8Array;
|
|
189
|
+
static override [DEFAULT_VALUE]: Uint8Array | null = null;
|
|
190
|
+
static override [PURIFIED_VALUE]: Uint8Array | null = null;
|
|
191
|
+
static override [EXAMPLE_VALUE]: string = "AAEC";
|
|
192
|
+
|
|
193
|
+
static override validate(value: Uint8Array | string): boolean {
|
|
194
|
+
return value instanceof Uint8Array || typeof value === "string";
|
|
195
|
+
}
|
|
196
|
+
static override parseValue(input: Uint8Array | string): Uint8Array {
|
|
197
|
+
return typeof input === "string" ? Binary.#fromBase64(input) : input;
|
|
198
|
+
}
|
|
199
|
+
static override serializeValue(value: Uint8Array | string): string {
|
|
200
|
+
return typeof value === "string" ? value : Binary.#toBase64(value);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static #toBase64(bytes: Uint8Array): string {
|
|
204
|
+
const buffer = (globalThis as { Buffer?: BufferCtor }).Buffer;
|
|
205
|
+
if (buffer) return buffer.from(bytes.buffer, bytes.byteOffset, bytes.byteLength).toString("base64");
|
|
206
|
+
let binary = "";
|
|
207
|
+
for (let idx = 0; idx < bytes.length; idx += 0x8000)
|
|
208
|
+
binary += String.fromCharCode(...bytes.subarray(idx, idx + 0x8000));
|
|
209
|
+
return btoa(binary);
|
|
210
|
+
}
|
|
211
|
+
static #fromBase64(text: string): Uint8Array {
|
|
212
|
+
const buffer = (globalThis as { Buffer?: BufferCtor }).Buffer;
|
|
213
|
+
if (buffer) return buffer.from(text, "base64");
|
|
214
|
+
const binary = atob(text);
|
|
215
|
+
const bytes = new Uint8Array(binary.length);
|
|
216
|
+
for (let idx = 0; idx < binary.length; idx += 1) bytes[idx] = binary.charCodeAt(idx);
|
|
217
|
+
return bytes;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
PrimitiveRegistry.register(Binary);
|
|
221
|
+
|
|
179
222
|
export class Upload extends PrimitiveScalar {
|
|
180
223
|
static override refName: "Upload" = "Upload";
|
|
181
224
|
static override [SERVER_VALUE]: File;
|
|
@@ -209,12 +252,12 @@ declare global {
|
|
|
209
252
|
[DEFAULT_VALUE]: boolean;
|
|
210
253
|
[PURIFIED_VALUE]: boolean;
|
|
211
254
|
[EXAMPLE_VALUE]: boolean;
|
|
212
|
-
validate(value: boolean | number): boolean;
|
|
213
|
-
parseValue(input: boolean | number): boolean | number;
|
|
214
|
-
serializeValue(value: boolean | number): boolean | number;
|
|
215
|
-
_parse(input: boolean | number): boolean;
|
|
216
|
-
_serialize(value: boolean | number): boolean;
|
|
217
|
-
_checkValue(value: boolean | number): void;
|
|
255
|
+
validate(value: boolean | number | string): boolean;
|
|
256
|
+
parseValue(input: boolean | number | string): boolean | number | string;
|
|
257
|
+
serializeValue(value: boolean | number | string): boolean | number | string;
|
|
258
|
+
_parse(input: boolean | number | string): boolean;
|
|
259
|
+
_serialize(value: boolean | number | string): boolean;
|
|
260
|
+
_checkValue(value: boolean | number | string): void;
|
|
218
261
|
}
|
|
219
262
|
interface DateConstructor {
|
|
220
263
|
refName: "Date";
|
|
@@ -305,10 +348,14 @@ Object.assign(String, scalarPrimitiveStatics, {
|
|
|
305
348
|
});
|
|
306
349
|
PrimitiveRegistry.register(String);
|
|
307
350
|
|
|
308
|
-
const normalizeBooleanPrimitiveValue = (value: boolean | number): boolean | null => {
|
|
351
|
+
const normalizeBooleanPrimitiveValue = (value: boolean | number | string): boolean | null => {
|
|
309
352
|
if (typeof value === "boolean") return value;
|
|
310
353
|
if (value === 1) return true;
|
|
311
354
|
if (value === 0) return false;
|
|
355
|
+
if (typeof value !== "string") return null;
|
|
356
|
+
const text = value.trim().toLowerCase();
|
|
357
|
+
if (text === "true" || text === "1") return true;
|
|
358
|
+
if (text === "false" || text === "0") return false;
|
|
312
359
|
return null;
|
|
313
360
|
};
|
|
314
361
|
|
|
@@ -317,13 +364,13 @@ Object.assign(Boolean, {
|
|
|
317
364
|
refName: "Boolean",
|
|
318
365
|
[DEFAULT_VALUE]: false,
|
|
319
366
|
[EXAMPLE_VALUE]: true,
|
|
320
|
-
validate(value: boolean | number) {
|
|
367
|
+
validate(value: boolean | number | string) {
|
|
321
368
|
return normalizeBooleanPrimitiveValue(value) !== null;
|
|
322
369
|
},
|
|
323
|
-
parseValue(input: boolean | number) {
|
|
370
|
+
parseValue(input: boolean | number | string) {
|
|
324
371
|
return normalizeBooleanPrimitiveValue(input) ?? input;
|
|
325
372
|
},
|
|
326
|
-
serializeValue(value: boolean | number) {
|
|
373
|
+
serializeValue(value: boolean | number | string) {
|
|
327
374
|
return normalizeBooleanPrimitiveValue(value) ?? value;
|
|
328
375
|
},
|
|
329
376
|
});
|
|
@@ -350,4 +397,4 @@ Object.assign(Date, {
|
|
|
350
397
|
});
|
|
351
398
|
PrimitiveRegistry.register(Date);
|
|
352
399
|
|
|
353
|
-
export type DefaultPrimitiveName = "String" | "Boolean" | "Date" | "Int" | "Float" | "ID" | "Any" | "Upload";
|
|
400
|
+
export type DefaultPrimitiveName = "String" | "Boolean" | "Date" | "Int" | "Float" | "ID" | "Any" | "Binary" | "Upload";
|
package/base/symbols.ts
CHANGED
|
@@ -13,6 +13,10 @@ export const STATE_META = Symbol.for("akan.state");
|
|
|
13
13
|
export const STATE_INIT_META = Symbol.for("akan.state.init");
|
|
14
14
|
export const STATE_DERIVED_META = Symbol.for("akan.state.derived");
|
|
15
15
|
export const ACTION_META = Symbol.for("akan.action");
|
|
16
|
+
/** Which module declared each action. See `ActionOwner`. */
|
|
17
|
+
export const ACTION_OWNER_META = Symbol.for("akan.action.owner");
|
|
18
|
+
/** What a dispatcher does, carried on the function so a component handed one can annotate the DOM with it. */
|
|
19
|
+
export const ACTION_TAG = Symbol.for("akan.action.tag");
|
|
16
20
|
export const SERVER_VALUE = Symbol.for("akan.value.server");
|
|
17
21
|
export const CLIENT_VALUE = Symbol.for("akan.value.client");
|
|
18
22
|
export const DEFAULT_VALUE = Symbol.for("akan.value.default");
|
package/client/capacitor.ts
CHANGED
|
@@ -46,6 +46,28 @@ export type CapacitorContactsModule = {
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
export type CapacitorSpeechRecognitionModule = {
|
|
50
|
+
SpeechRecognition: {
|
|
51
|
+
available: () => Promise<{ available: boolean }>;
|
|
52
|
+
checkPermissions: () => Promise<{ speechRecognition: CapacitorPermissionState }>;
|
|
53
|
+
requestPermissions: () => Promise<{ speechRecognition: CapacitorPermissionState }>;
|
|
54
|
+
start: (options: Record<string, unknown>) => Promise<{ matches?: string[] }>;
|
|
55
|
+
stop: () => Promise<void>;
|
|
56
|
+
removeAllListeners: () => Promise<void> | void;
|
|
57
|
+
addListener: (
|
|
58
|
+
eventName: string,
|
|
59
|
+
listenerFunc: (data: { matches?: string[] }) => void,
|
|
60
|
+
) => Promise<{ remove: () => Promise<void> | void }> | { remove: () => Promise<void> | void };
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export type CapacitorTextToSpeechModule = {
|
|
65
|
+
TextToSpeech: {
|
|
66
|
+
speak: (options: { text: string; lang?: string; rate?: number }) => Promise<void>;
|
|
67
|
+
stop: () => Promise<void>;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
49
71
|
export type CapacitorCoreModule = {
|
|
50
72
|
CapacitorCookies: {
|
|
51
73
|
setCookie: (options: { key: string; value: string; path?: string }) => Promise<void> | void;
|
|
@@ -155,6 +177,8 @@ type CapacitorModuleMap = {
|
|
|
155
177
|
preferences: CapacitorPreferencesModule;
|
|
156
178
|
pushNotifications: CapacitorPushNotificationsModule;
|
|
157
179
|
safeArea: CapacitorSafeAreaModule;
|
|
180
|
+
speechRecognition: CapacitorSpeechRecognitionModule;
|
|
181
|
+
textToSpeech: CapacitorTextToSpeechModule;
|
|
158
182
|
updater: CapacitorUpdaterModule;
|
|
159
183
|
};
|
|
160
184
|
|
|
@@ -257,6 +281,16 @@ export const loadCapacitorSafeArea = () =>
|
|
|
257
281
|
SafeArea: getCapacitorPlugin<CapacitorSafeAreaModule["SafeArea"]>("SafeArea"),
|
|
258
282
|
}));
|
|
259
283
|
|
|
284
|
+
export const loadCapacitorSpeechRecognition = () =>
|
|
285
|
+
loadCapacitorModule("speechRecognition", async () => ({
|
|
286
|
+
SpeechRecognition: getCapacitorPlugin<CapacitorSpeechRecognitionModule["SpeechRecognition"]>("SpeechRecognition"),
|
|
287
|
+
}));
|
|
288
|
+
|
|
289
|
+
export const loadCapacitorTextToSpeech = () =>
|
|
290
|
+
loadCapacitorModule("textToSpeech", async () => ({
|
|
291
|
+
TextToSpeech: getCapacitorPlugin<CapacitorTextToSpeechModule["TextToSpeech"]>("TextToSpeech"),
|
|
292
|
+
}));
|
|
293
|
+
|
|
260
294
|
export const loadCapacitorUpdater = () =>
|
|
261
295
|
loadCapacitorModule("updater", async () => ({
|
|
262
296
|
CapacitorUpdater: getCapacitorPlugin<CapacitorUpdaterModule["CapacitorUpdater"]>("CapacitorUpdater"),
|
package/client/clientRuntime.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SliceMeta } from "akanjs/fetch";
|
|
2
|
+
import type { SerializedArg } from "akanjs/signal";
|
|
2
3
|
import type { ReactNode } from "react";
|
|
3
4
|
import type { TransMessageOption } from "./makePageProto";
|
|
4
5
|
|
|
@@ -47,6 +48,10 @@ type RuntimeFetch = typeof globalThis.fetch & {
|
|
|
47
48
|
serializedSignal: Record<string, unknown>;
|
|
48
49
|
setJwt: (jwt: string | null) => void;
|
|
49
50
|
slice: Record<string, SliceMeta>;
|
|
51
|
+
/** Sort keys per model refName, registered from each serialized signal's filter. */
|
|
52
|
+
sortKeyMap?: Map<string, string[]>;
|
|
53
|
+
/** Filter queries per model refName, with the args each one takes — what the root slice picks from. */
|
|
54
|
+
filterQueryMap?: Map<string, { [queryKey: string]: SerializedArg[] }>;
|
|
50
55
|
ws: RuntimeWs;
|
|
51
56
|
[key: string]: unknown;
|
|
52
57
|
};
|
package/client/cookie.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { getEnv } from "akanjs/base";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
authTokenKey,
|
|
4
|
+
decodeJwtPayload,
|
|
5
|
+
isOwnAuthToken,
|
|
6
|
+
Logger,
|
|
7
|
+
legacyAuthTokenKey,
|
|
8
|
+
readAuthToken,
|
|
9
|
+
} from "akanjs/common";
|
|
3
10
|
import type { Account } from "akanjs/fetch";
|
|
4
|
-
import { cookies as serverCookies, headers as serverHeaders } from "akanjs/fetch";
|
|
11
|
+
import { parseCookieHeader, cookies as serverCookies, headers as serverHeaders } from "akanjs/fetch";
|
|
5
12
|
import { loadCapacitorCore } from "./capacitor";
|
|
6
13
|
import { storage } from "./storage";
|
|
7
14
|
import { fetch } from "./useClient";
|
|
@@ -12,23 +19,6 @@ interface CookieOptions {
|
|
|
12
19
|
secure?: boolean;
|
|
13
20
|
}
|
|
14
21
|
|
|
15
|
-
function parseCookieHeader(cookieHeader: string): Map<string, { name: string; value: string }> {
|
|
16
|
-
const entries = cookieHeader
|
|
17
|
-
.split(";")
|
|
18
|
-
.map((c) => c.trim())
|
|
19
|
-
.filter(Boolean)
|
|
20
|
-
.map((c) => {
|
|
21
|
-
const eqIdx = c.indexOf("=");
|
|
22
|
-
if (eqIdx === -1) return null;
|
|
23
|
-
const name = c.slice(0, eqIdx).trim();
|
|
24
|
-
const raw = c.slice(eqIdx + 1).trim();
|
|
25
|
-
const value = typeof raw === "string" && raw.startsWith("j:") ? (JSON.parse(raw.slice(2)) as string) : raw;
|
|
26
|
-
return [name, { name, value }] as const;
|
|
27
|
-
})
|
|
28
|
-
.filter((e): e is NonNullable<typeof e> => e !== null);
|
|
29
|
-
return new Map(entries);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
22
|
export const cookies = (): Map<string, { name: string; value: string }> => {
|
|
33
23
|
if (getEnv().side === "server") return serverCookies();
|
|
34
24
|
return parseCookieHeader(document.cookie);
|
|
@@ -53,21 +43,18 @@ export const setCookie = (
|
|
|
53
43
|
.catch(() => undefined);
|
|
54
44
|
};
|
|
55
45
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
?.split("=")[1];
|
|
63
|
-
};
|
|
46
|
+
/**
|
|
47
|
+
* Reads through `cookies()` on both sides, which is the only way the two agree: a hand-rolled
|
|
48
|
+
* `split("=")[1]` truncates a value at its first `=` (base64 padding) and never decodes the `j:` form the
|
|
49
|
+
* server branch does. Capacitor's own docs say to read `document.cookie`, and `cookies()` does.
|
|
50
|
+
*/
|
|
51
|
+
export const getCookie = (key: string): string | undefined => cookies().get(key)?.value;
|
|
64
52
|
|
|
65
53
|
export const removeCookie = (key: string, options: { path: string } = { path: "/" }) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
54
|
+
|
|
55
|
+
if (getEnv().side === "server") return;
|
|
56
|
+
|
|
57
|
+
document.cookie = `${key}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${options.path};`;
|
|
71
58
|
};
|
|
72
59
|
export const headers = (): Map<string, string> => {
|
|
73
60
|
if (getEnv().side !== "server") return new Map();
|
|
@@ -77,9 +64,29 @@ export const headers = (): Map<string, string> => {
|
|
|
77
64
|
export const getHeader = (key: string): string | undefined => {
|
|
78
65
|
return headers().get(key);
|
|
79
66
|
};
|
|
80
|
-
|
|
67
|
+
|
|
68
|
+
export { authTokenKey };
|
|
69
|
+
|
|
70
|
+
/** The auth token this app holds in the cookie jar, under the app-scoped key or a legacy global one. */
|
|
71
|
+
export const getAuthToken = (): string | undefined => readAuthToken(getCookie);
|
|
72
|
+
|
|
73
|
+
/** The auth token this app holds in client storage — localStorage under SSR, Capacitor Preferences on CSR. */
|
|
74
|
+
export const getStoredAuthToken = async (): Promise<string | undefined> => {
|
|
75
|
+
const scoped = await storage.getItem(authTokenKey());
|
|
76
|
+
if (scoped) return scoped;
|
|
77
|
+
const legacy = await storage.getItem(legacyAuthTokenKey);
|
|
78
|
+
return legacy && isOwnAuthToken(legacy) ? legacy : undefined;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Decodes the current JWT into account data when it belongs to this app/environment.
|
|
83
|
+
*
|
|
84
|
+
* The two credentials read here are exactly the two the server honours — the app-scoped auth cookie and
|
|
85
|
+
* `Authorization: Bearer` (`AccountMiddleware`). It used to fall back to a bare `jwt` *header*, which nothing
|
|
86
|
+
* sends and no guard accepts, so a request carrying one read as signed in here and anonymous at the endpoint.
|
|
87
|
+
*/
|
|
81
88
|
export const getAccount = <AddData = unknown>(): Account<AddData> => {
|
|
82
|
-
const jwt =
|
|
89
|
+
const jwt = getAuthToken() ?? getHeader("authorization")?.replace(/^Bearer\s+/i, "");
|
|
83
90
|
const defaultAccount = { appName: getEnv().appName, environment: getEnv().environment } as Account<AddData>;
|
|
84
91
|
if (!jwt) return defaultAccount;
|
|
85
92
|
const account = decodeJwtPayload<Account<AddData>>(jwt);
|
|
@@ -95,21 +102,34 @@ interface SetAuthOption {
|
|
|
95
102
|
/** Sets the active auth token on fetch, cookie storage, and client storage. */
|
|
96
103
|
export const setAuth = ({ jwt }: SetAuthOption) => {
|
|
97
104
|
fetch.setJwt(jwt);
|
|
98
|
-
setCookie(
|
|
99
|
-
void storage.setItem(
|
|
105
|
+
setCookie(authTokenKey(), jwt);
|
|
106
|
+
void storage.setItem(authTokenKey(), jwt);
|
|
107
|
+
|
|
108
|
+
removeCookie(legacyAuthTokenKey);
|
|
109
|
+
void storage.removeItem(legacyAuthTokenKey);
|
|
100
110
|
};
|
|
101
111
|
|
|
102
112
|
interface InitAuthOption {
|
|
103
113
|
jwt?: string;
|
|
104
114
|
}
|
|
105
115
|
export const initAuth = ({ jwt }: InitAuthOption = {}) => {
|
|
106
|
-
const
|
|
116
|
+
const stored = getAuthToken();
|
|
117
|
+
const token = jwt ?? stored;
|
|
118
|
+
if (token && !isOwnAuthToken(token)) {
|
|
119
|
+
|
|
120
|
+
Logger.warn("JWT ignored: it was minted for another app or environment");
|
|
121
|
+
if (token === stored) resetAuth();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
107
124
|
if (token) setAuth({ jwt: token });
|
|
108
|
-
|
|
125
|
+
|
|
126
|
+
Logger.verbose(`JWT ${token ? "restored from cookie" : "not found in cookie"}`);
|
|
109
127
|
};
|
|
110
128
|
|
|
111
129
|
export const resetAuth = () => {
|
|
112
130
|
fetch.setJwt(null);
|
|
113
|
-
removeCookie(
|
|
114
|
-
|
|
131
|
+
removeCookie(authTokenKey());
|
|
132
|
+
removeCookie(legacyAuthTokenKey);
|
|
133
|
+
void storage.removeItem(authTokenKey());
|
|
134
|
+
void storage.removeItem(legacyAuthTokenKey);
|
|
115
135
|
};
|
package/client/csrTypes.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import type { ReactDOMAttributes } from "@use-gesture/react/dist/declarations/src/types";
|
|
3
3
|
import type { PromiseOrObject } from "akanjs/base";
|
|
4
|
-
import {
|
|
4
|
+
import { type ForwardRefExoticComponent, type ReactNode, type RefObject, useContext } from "react";
|
|
5
5
|
import type { AnimatedComponent, AnimatedProps, Interpolation, SpringValue } from "react-spring";
|
|
6
6
|
import type { RouterInstance } from "./router";
|
|
7
|
+
import { sharedContext } from "./sharedContext";
|
|
7
8
|
import type { ReactFont } from "./types";
|
|
8
9
|
|
|
9
10
|
export type TransitionType = "none" | "fade" | "bottomUp" | "stack" | "scaleOut";
|
|
@@ -261,18 +262,6 @@ export type PageState = CsrState & {
|
|
|
261
262
|
topInset: number;
|
|
262
263
|
bottomInset: number;
|
|
263
264
|
};
|
|
264
|
-
export const defaultPageState: PageState = {
|
|
265
|
-
transition: "none",
|
|
266
|
-
topSafeArea: 0,
|
|
267
|
-
bottomSafeArea: 0,
|
|
268
|
-
topInset: 0,
|
|
269
|
-
bottomInset: 0,
|
|
270
|
-
gesture: true,
|
|
271
|
-
cache: false,
|
|
272
|
-
ssr: "stream",
|
|
273
|
-
topSafeAreaColor: "var(--color-background, Canvas)",
|
|
274
|
-
bottomSafeAreaColor: "var(--color-background, Canvas)",
|
|
275
|
-
};
|
|
276
265
|
|
|
277
266
|
export interface Location {
|
|
278
267
|
href: string;
|
|
@@ -349,7 +338,7 @@ export type UseCsrTransition = CsrTransitionStyles & {
|
|
|
349
338
|
};
|
|
350
339
|
|
|
351
340
|
export type CsrContextType = RouteState & UseCsrTransition;
|
|
352
|
-
export const csrContext =
|
|
341
|
+
export const csrContext = sharedContext<CsrContextType>("csr", {} as unknown as CsrContextType);
|
|
353
342
|
export const useCsr = () => {
|
|
354
343
|
const contextValues = useContext(csrContext);
|
|
355
344
|
return contextValues;
|
|
@@ -363,7 +352,7 @@ export interface PathContextType {
|
|
|
363
352
|
setGestureEnabled: (enabled: boolean) => void;
|
|
364
353
|
registerFrameSlot: (slot: FrameSlotRegistration) => () => void;
|
|
365
354
|
}
|
|
366
|
-
export const pathContext =
|
|
355
|
+
export const pathContext = sharedContext<PathContextType>("path", {} as unknown as PathContextType);
|
|
367
356
|
export const usePathCtx = () => {
|
|
368
357
|
const contextValues = useContext(pathContext);
|
|
369
358
|
return contextValues;
|
package/client/frameConfig.ts
CHANGED
|
@@ -120,6 +120,19 @@ export function getExplicitPageConfigKeys(configChain: PageConfig[] = []): Parti
|
|
|
120
120
|
return explicitKeys;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
export const defaultPageState: PageState = {
|
|
124
|
+
transition: "none",
|
|
125
|
+
topSafeArea: 0,
|
|
126
|
+
bottomSafeArea: 0,
|
|
127
|
+
topInset: 0,
|
|
128
|
+
bottomInset: 0,
|
|
129
|
+
gesture: true,
|
|
130
|
+
cache: false,
|
|
131
|
+
ssr: "stream",
|
|
132
|
+
topSafeAreaColor: "var(--color-background, Canvas)",
|
|
133
|
+
bottomSafeAreaColor: "var(--color-background, Canvas)",
|
|
134
|
+
};
|
|
135
|
+
|
|
123
136
|
export function resolvePageState({
|
|
124
137
|
configChain = [],
|
|
125
138
|
path,
|
package/client/index.ts
CHANGED
package/client/locale.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { sharedContext } from "./sharedContext";
|
|
3
3
|
|
|
4
|
-
export const dictionaryContext =
|
|
4
|
+
export const dictionaryContext = sharedContext<{ [key: string]: { [key: string]: string } }>("dictionary", {});
|