akanjs 3.0.0-alpha.7 → 3.0.0-alpha.71
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 +7 -4
- 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/csrTypes.ts +4 -3
- package/client/index.ts +1 -0
- package/client/locale.ts +2 -2
- package/client/router.ts +7 -7
- package/client/sharedContext.ts +31 -0
- package/client/translator.ts +2 -2
- package/client/types.ts +3 -3
- package/common/Logger.ts +280 -67
- package/common/clientAddress.ts +40 -0
- package/common/deepObjectify.ts +24 -9
- package/common/index.ts +42 -1
- package/common/logContext.ts +27 -0
- package/common/mcpExposure.ts +114 -0
- package/common/pathGetLoose.ts +31 -0
- package/common/pathSet.ts +17 -5
- package/common/plainFieldsOf.ts +13 -0
- package/common/routeConvention.ts +22 -12
- package/common/websocketBinaryFrame.ts +46 -0
- package/constant/crystalize.ts +94 -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 +67 -0
- package/constant/purify.ts +17 -11
- package/constant/textFieldPaths.ts +13 -7
- package/constant/types.ts +19 -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 +81 -0
- package/dictionary/dictInfo.ts +11 -2
- package/dictionary/dictionary.ts +9 -3
- package/dictionary/index.ts +1 -0
- package/dictionary/trans.ts +2 -2
- package/document/documentQuery.ts +1 -0
- package/document/filterMeta.ts +77 -12
- package/document/index.ts +1 -0
- package/document/noDocumentError.ts +12 -0
- package/document/types.ts +0 -1
- package/fetch/agentTurn.ts +19 -0
- package/fetch/client/fetchClient.ts +137 -37
- package/fetch/client/httpClient.ts +95 -20
- package/fetch/client/wsClient.ts +27 -12
- package/fetch/fetchType/appliedReturn.type.ts +65 -44
- package/fetch/fetchType/endpointFetch.type.ts +17 -8
- package/fetch/fetchType/sliceFetch.type.ts +27 -50
- package/fetch/index.ts +1 -0
- package/index.ts +80 -6
- 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 +278 -138
- package/server/akanAppHeaders.ts +16 -2
- package/server/akanOption.ts +63 -8
- package/server/akanServer.ts +387 -32
- package/server/animatedImage.ts +83 -0
- package/server/assetEncoding.ts +4 -24
- package/server/binaryPubsub.ts +55 -0
- 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/devtools/signalSerializer.ts +2 -2
- package/server/devtools/types.ts +4 -4
- package/server/di/diLifecycle.ts +123 -13
- package/server/di/predefinedAdaptor.ts +6 -0
- package/server/di/utils.ts +40 -0
- package/server/imageOptimizer.ts +154 -57
- package/server/lifecycle/runtimeDir.ts +14 -0
- package/server/lifecycle/shutdownManager.ts +1 -1
- 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 +289 -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/resolver/database.resolver.ts +5 -4
- package/server/resolver/signal.resolver.ts +208 -86
- package/server/routeTreeBuilder.ts +10 -8
- package/server/routing/apiRouter.ts +44 -14
- package/server/routing/appWsData.ts +24 -2
- package/server/routing/eventStream.ts +93 -0
- package/server/routing/soloAppRoutes.ts +50 -0
- package/server/rscWorker.tsx +36 -22
- package/server/rscWorkerHost.ts +59 -8
- package/server/semaphore.ts +22 -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 +96 -39
- package/service/adapt.ts +4 -4
- package/service/agent.service.ts +81 -0
- package/service/base.service.ts +2 -1
- package/service/index.ts +1 -0
- package/service/injectInfo.ts +8 -3
- package/service/ipcTypes.ts +6 -0
- package/service/predefinedAdaptor/compress.adaptor.ts +5 -1
- package/service/predefinedAdaptor/database.adaptor.ts +68 -37
- 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/websocket.adaptor.ts +6 -1
- package/service/serve.ts +16 -9
- package/service/toolNames.ts +119 -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/endpointInfo.ts +38 -2
- package/signal/guard.ts +28 -1
- package/signal/guards.ts +49 -1
- package/signal/index.ts +6 -0
- package/signal/intercept.ts +4 -4
- 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 +51 -0
- package/signal/signalContext.ts +324 -76
- package/signal/slice.ts +62 -27
- package/signal/trace.ts +268 -9
- package/signal/types.ts +55 -4
- package/store/action.ts +34 -41
- package/store/actionTag.ts +33 -0
- package/store/agent/AgentBridge.ts +87 -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 +47 -0
- package/store/agentic/StExposeDraft.ts +24 -0
- package/store/agentic/StStateBuilder.ts +85 -0
- package/store/agentic/StStateDraft.ts +23 -0
- package/store/agentic/StToolBuilder.ts +279 -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 +31 -0
- package/store/formSetterNames.ts +35 -0
- package/store/index.ts +8 -0
- package/store/rootStore.ts +3 -1
- package/store/sliceRole.ts +36 -0
- package/store/state.ts +2 -12
- package/store/store.ts +9 -0
- package/store/storeInstance.ts +185 -20
- package/store/storeRegistry.ts +39 -1
- 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 +1 -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/index.d.ts +1 -0
- package/types/client/sharedContext.d.ts +21 -0
- package/types/client/types.d.ts +5 -3
- package/types/common/Logger.d.ts +88 -6
- package/types/common/clientAddress.d.ts +19 -0
- package/types/common/deepObjectify.d.ts +4 -2
- package/types/common/index.d.ts +8 -2
- 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/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 +41 -0
- package/types/constant/purify.d.ts +2 -2
- package/types/constant/types.d.ts +5 -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/index.d.ts +1 -0
- package/types/document/filterMeta.d.ts +24 -4
- package/types/document/index.d.ts +1 -0
- package/types/document/noDocumentError.d.ts +12 -0
- package/types/document/types.d.ts +0 -1
- package/types/fetch/agentTurn.d.ts +475 -0
- package/types/fetch/client/fetchClient.d.ts +12 -0
- package/types/fetch/client/httpClient.d.ts +2 -1
- package/types/fetch/fetchType/appliedReturn.type.d.ts +37 -18
- package/types/fetch/fetchType/endpointFetch.type.d.ts +8 -5
- package/types/fetch/fetchType/sliceFetch.type.d.ts +11 -15
- package/types/fetch/index.d.ts +1 -0
- package/types/index.d.ts +74 -10
- package/types/server/akanApp.d.ts +12 -0
- package/types/server/akanAppHeaders.d.ts +7 -1
- package/types/server/akanOption.d.ts +36 -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/devtools/types.d.ts +4 -4
- package/types/server/di/diLifecycle.d.ts +10 -2
- 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/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 +7 -4
- package/types/server/routing/apiRouter.d.ts +2 -1
- package/types/server/routing/appWsData.d.ts +13 -1
- 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/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 +2 -2
- package/types/service/agent.service.d.ts +32 -0
- package/types/service/base.service.d.ts +4 -0
- package/types/service/index.d.ts +1 -0
- package/types/service/injectInfo.d.ts +2 -2
- package/types/service/ipcTypes.d.ts +12 -0
- package/types/service/predefinedAdaptor/compress.adaptor.d.ts +1 -1
- package/types/service/predefinedAdaptor/database.adaptor.d.ts +9 -3
- 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/serve.d.ts +3 -3
- package/types/service/toolNames.d.ts +35 -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/guard.d.ts +12 -0
- package/types/signal/guards.d.ts +23 -1
- package/types/signal/index.d.ts +6 -0
- package/types/signal/intercept.d.ts +2 -2
- 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/signalContext.d.ts +67 -8
- package/types/signal/slice.d.ts +42 -15
- package/types/signal/trace.d.ts +52 -2
- package/types/signal/types.d.ts +53 -4
- package/types/store/action.d.ts +7 -5
- 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 +56 -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 +25 -0
- package/types/store/formSetterNames.d.ts +30 -0
- package/types/store/index.d.ts +7 -0
- package/types/store/rootStore.d.ts +5 -1
- package/types/store/sliceRole.d.ts +25 -0
- package/types/store/store.d.ts +5 -1
- package/types/store/storeInstance.d.ts +33 -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/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 +34 -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 +24 -0
- package/types/ui/Agent/useChatVoice.d.ts +30 -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.d.ts +13 -12
- package/types/ui/Layout/BottomTab.d.ts +3 -2
- package/types/ui/LegacyModal.d.ts +24 -0
- package/types/ui/Loading/ProgressBar.d.ts +4 -0
- package/types/ui/Loading/Spin.d.ts +2 -1
- package/types/ui/Model/AdminPanel.d.ts +15 -3
- package/types/ui/Model/EditModal.d.ts +1 -1
- package/types/ui/Model/New.d.ts +3 -1
- package/types/ui/Model/NewWrapper.d.ts +2 -0
- package/types/ui/Model/NewWrapper_Client.d.ts +2 -1
- 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/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 +18 -1
- package/types/ui/agentAttrs.d.ts +14 -0
- package/types/ui/index.d.ts +22 -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/usePageTool.d.ts +19 -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 +525 -0
- package/ui/Agent/ChatCommands.ts +141 -0
- package/ui/Agent/Composer.tsx +94 -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/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 +73 -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 +84 -0
- package/ui/Agent/useChatVoice.ts +129 -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 +9 -4
- package/ui/Dropdown.tsx +89 -27
- package/ui/Empty.tsx +6 -4
- package/ui/Field.tsx +128 -58
- package/ui/Input.tsx +27 -5
- 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/Pagination.tsx +15 -8
- package/ui/Load/Units.tsx +30 -7
- package/ui/Load/View.tsx +10 -3
- 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/Menu.tsx +1 -1
- package/ui/Model/AdminPanel.tsx +52 -12
- package/ui/Model/EditModal.tsx +28 -6
- package/ui/Model/EditWrapper.tsx +16 -4
- package/ui/Model/New.tsx +4 -0
- package/ui/Model/NewWrapper.tsx +2 -0
- package/ui/Model/NewWrapper_Client.tsx +20 -6
- 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/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 +87 -135
- package/ui/Signal/Object.tsx +79 -57
- package/ui/Signal/PubSub.tsx +72 -113
- 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 +31 -15
- package/ui/System/Common.tsx +3 -4
- package/ui/System/DevModeToggle.tsx +1 -1
- package/ui/System/Gtag.tsx +2 -2
- package/ui/System/Messages.tsx +52 -31
- package/ui/System/Reconnect.tsx +22 -56
- package/ui/System/SelectLanguage.tsx +24 -15
- 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 +21 -2
- package/ui/Unauthorized.tsx +6 -4
- package/ui/agentAttrs.ts +19 -0
- package/ui/index.ts +49 -1
- package/ui/overlayLayer.ts +12 -2
- package/ui/overlayPosition.ts +104 -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 +10 -8
- package/webkit/index.ts +4 -0
- package/webkit/lazy.tsx +5 -1
- package/webkit/useBodyScrollLock.tsx +29 -0
- package/webkit/useFrameRuntime.ts +1 -1
- package/webkit/usePageTool.tsx +37 -0
- package/webkit/useScreenScope.tsx +60 -0
- 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/Signal/Collapse.tsx +0 -29
package/store/action.ts
CHANGED
|
@@ -5,8 +5,8 @@ import {
|
|
|
5
5
|
type FetchPolicy,
|
|
6
6
|
isQueryEqual,
|
|
7
7
|
Logger,
|
|
8
|
-
lowerlize,
|
|
9
8
|
pathSet,
|
|
9
|
+
plainFieldsOf,
|
|
10
10
|
resolveFileUploadCapability,
|
|
11
11
|
} from "akanjs/common";
|
|
12
12
|
import {
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
type FieldState,
|
|
18
18
|
immerify,
|
|
19
19
|
type ProtoFile,
|
|
20
|
+
withSharedInstances,
|
|
20
21
|
} from "akanjs/constant";
|
|
21
22
|
import type { BaseFilterSortKey, ExtractSort, FilterInstance } from "akanjs/document";
|
|
22
23
|
import type { FetchInitForm, FetchProxy } from "akanjs/fetch";
|
|
@@ -33,18 +34,12 @@ import type {
|
|
|
33
34
|
SlceDbSort,
|
|
34
35
|
SliceCls,
|
|
35
36
|
} from "akanjs/signal";
|
|
37
|
+
import { tagAction } from "./actionTag";
|
|
38
|
+
import { formSetterNames } from "./formSetterNames";
|
|
39
|
+
import type { SliceActionKey } from "./sliceRole";
|
|
36
40
|
import type { SliceStateKey } from "./state";
|
|
37
41
|
import type { SetGet, StoreSliceArgs, StoreSliceMap, StoreSliceSuffixCap } from "./types";
|
|
38
42
|
|
|
39
|
-
type SliceActionKey =
|
|
40
|
-
| "initModel"
|
|
41
|
-
| "refreshModel"
|
|
42
|
-
| "selectModel"
|
|
43
|
-
| "setPageOfModel"
|
|
44
|
-
| "addPageOfModel"
|
|
45
|
-
| "setLimitOfModel"
|
|
46
|
-
| "setQueryArgsOfModel"
|
|
47
|
-
| "setSortOfModel";
|
|
48
43
|
type _SliceMap<S extends SliceCls> = StoreSliceMap<S>;
|
|
49
44
|
type _ActionRefName<S extends SliceCls> = SlceCnstRefName<S>;
|
|
50
45
|
type _ActionCap<S extends SliceCls> = SlceCnstCapitalizedRefName<S>;
|
|
@@ -55,6 +50,10 @@ type _ActionDefault<S extends SliceCls> = SlceCnstDefault<S>;
|
|
|
55
50
|
type _ActionDefaultInput<S extends SliceCls> = SlceCnstDefaultInput<S>;
|
|
56
51
|
type _ActionFilter<S extends SliceCls> = SlceDbFilter<S>;
|
|
57
52
|
type _ActionSort<S extends SliceCls> = SlceDbSort<S>;
|
|
53
|
+
type SliceInitForm<S extends SliceCls> = FetchInitForm<_ActionInput<S>, _ActionFilter<S>> & FetchPolicy;
|
|
54
|
+
type SliceRefreshForm<S extends SliceCls, Suffix extends keyof _SliceMap<S>> = SliceInitForm<S> & {
|
|
55
|
+
queryArgs?: StoreSliceArgs<S, Suffix>;
|
|
56
|
+
};
|
|
58
57
|
|
|
59
58
|
const isNullableSliceArg = (arg: SerializedSlice["args"][number]) => arg.nullable ?? arg.type === "search";
|
|
60
59
|
|
|
@@ -139,7 +138,7 @@ export type SliceAction<
|
|
|
139
138
|
_CapitalizedRefName extends string = Capitalize<RefName>,
|
|
140
139
|
_CapitalizedSuffix extends string = Capitalize<Suffix>,
|
|
141
140
|
_Sort = ExtractSort<Filter>,
|
|
142
|
-
_FetchInitFormWithFetchPolicy = FetchInitForm<Input, Filter
|
|
141
|
+
_FetchInitFormWithFetchPolicy = FetchInitForm<Input, Filter> & FetchPolicy,
|
|
143
142
|
> = {
|
|
144
143
|
[KDefaultOf in `init${_CapitalizedRefName}${_CapitalizedSuffix}`]: (
|
|
145
144
|
...args: [...args: QueryArgs, initForm?: _FetchInitFormWithFetchPolicy]
|
|
@@ -242,7 +241,7 @@ type DefaultSliceActionFields<
|
|
|
242
241
|
) => Promise<void>;
|
|
243
242
|
} & {
|
|
244
243
|
[Suffix in _Suffixes as `refresh${_CapRef}${StoreSliceSuffixCap<SlceCls, Suffix>}`]: (
|
|
245
|
-
initForm?:
|
|
244
|
+
initForm?: SliceRefreshForm<SlceCls, Suffix>,
|
|
246
245
|
) => Promise<void>;
|
|
247
246
|
} & {
|
|
248
247
|
[Suffix in _Suffixes as `select${_CapRef}${StoreSliceSuffixCap<SlceCls, Suffix>}`]: (
|
|
@@ -285,7 +284,7 @@ export type DefaultAction<
|
|
|
285
284
|
_DefaultInput = _ActionDefaultInput<SlceCls>,
|
|
286
285
|
_Sort = _ActionSort<SlceCls>,
|
|
287
286
|
_CreateOption = CreateOption<_Full>,
|
|
288
|
-
_FetchInitFormWithFetchPolicy =
|
|
287
|
+
_FetchInitFormWithFetchPolicy = SliceInitForm<SlceCls>,
|
|
289
288
|
> = BaseAction<_RefName, _Input, _Full, _Light, _CapitalizedRefName, _CreateOption> &
|
|
290
289
|
FormSetter<_Full, _RefName, _CapitalizedRefName, _Default> &
|
|
291
290
|
DefaultSliceActionFields<SlceCls, _CapitalizedRefName, _FetchInitFormWithFetchPolicy, _Light, _Sort>;
|
|
@@ -311,16 +310,7 @@ export const makeFormSetter = (refName: string, fetch: FetchProxy<any>) => {
|
|
|
311
310
|
},
|
|
312
311
|
};
|
|
313
312
|
const fieldSetAction = Object.entries(modelRef[FIELD_META]).reduce((acc, [key, field]) => {
|
|
314
|
-
const
|
|
315
|
-
const namesOfField = {
|
|
316
|
-
field: fieldKeyName,
|
|
317
|
-
Field: classKeyName,
|
|
318
|
-
setFieldOnModel: `set${classKeyName}On${className}`,
|
|
319
|
-
addFieldOnModel: `add${classKeyName}On${className}`,
|
|
320
|
-
subFieldOnModel: `sub${classKeyName}On${className}`,
|
|
321
|
-
addOrSubFieldOnModel: `addOrSub${classKeyName}On${className}`,
|
|
322
|
-
uploadFieldOnModel: `upload${classKeyName}On${className}`,
|
|
323
|
-
};
|
|
313
|
+
const namesOfField = formSetterNames(className, key);
|
|
324
314
|
const singleFieldSetAction = {
|
|
325
315
|
[namesOfField.setFieldOnModel]: function (this: SetGet, value: any | null) {
|
|
326
316
|
this.set((state: { [key: string]: any }) => {
|
|
@@ -332,6 +322,11 @@ export const makeFormSetter = (refName: string, fetch: FetchProxy<any>) => {
|
|
|
332
322
|
: (value as object);
|
|
333
323
|
(state[names.modelForm] as { [key: string]: any })[namesOfField.field] = setValue;
|
|
334
324
|
});
|
|
325
|
+
|
|
326
|
+
const postSet = (this as unknown as { [key: string]: ((value: unknown) => unknown) | undefined })[
|
|
327
|
+
namesOfField.postSetField
|
|
328
|
+
];
|
|
329
|
+
if (postSet) void postSet.call(this, value);
|
|
335
330
|
},
|
|
336
331
|
...(field.isArray
|
|
337
332
|
? {
|
|
@@ -374,7 +369,7 @@ export const makeFormSetter = (refName: string, fetch: FetchProxy<any>) => {
|
|
|
374
369
|
},
|
|
375
370
|
}
|
|
376
371
|
: {}),
|
|
377
|
-
...(field.isClass &&
|
|
372
|
+
...(field.isClass && fileUploadRefName && ConstantRegistry.getRefName(field.modelRef) === fileUploadRefName
|
|
378
373
|
? {
|
|
379
374
|
[namesOfField.uploadFieldOnModel]: async function (
|
|
380
375
|
this: SetGet,
|
|
@@ -427,6 +422,11 @@ export const makeFormSetter = (refName: string, fetch: FetchProxy<any>) => {
|
|
|
427
422
|
}
|
|
428
423
|
: {}),
|
|
429
424
|
};
|
|
425
|
+
|
|
426
|
+
tagAction(singleFieldSetAction[namesOfField.setFieldOnModel] as (...args: never[]) => unknown, {
|
|
427
|
+
action: namesOfField.setFieldOnModel,
|
|
428
|
+
state: `${names.modelForm}.${namesOfField.field}`,
|
|
429
|
+
});
|
|
430
430
|
return Object.assign(acc, singleFieldSetAction);
|
|
431
431
|
}, {});
|
|
432
432
|
return Object.assign(fieldSetAction, baseSetAction);
|
|
@@ -735,9 +735,10 @@ export const makeActions = (refName: string, slice: { [key: string]: SerializedS
|
|
|
735
735
|
};
|
|
736
736
|
const currentState = this.get() as { [key: string]: any };
|
|
737
737
|
const defaultModel = currentState[namesOfSlice.defaultModel] as Full;
|
|
738
|
+
const merged = { ...plainFieldsOf(defaultModel), ...partial };
|
|
738
739
|
this.set({
|
|
739
|
-
[names.modelForm]: immerify(modelRef,
|
|
740
|
-
[namesOfSlice.defaultModel]: setDefault ? immerify(modelRef,
|
|
740
|
+
[names.modelForm]: immerify(modelRef, merged),
|
|
741
|
+
[namesOfSlice.defaultModel]: setDefault ? immerify(modelRef, merged) : defaultModel,
|
|
741
742
|
[names.model]: null,
|
|
742
743
|
[names.modelModal]: modal ?? "edit",
|
|
743
744
|
[names.modelFormLoading]: false,
|
|
@@ -751,7 +752,7 @@ export const makeActions = (refName: string, slice: { [key: string]: SerializedS
|
|
|
751
752
|
const id = typeof modelOrId === "string" ? modelOrId : modelOrId.id;
|
|
752
753
|
this.set({ [names.modelFormLoading]: id, [names.modelModal]: modal ?? "edit" });
|
|
753
754
|
const model = await (fetch[names.model] as (...args: any[]) => Promise<Full>)(id, { onError });
|
|
754
|
-
const modelForm = deepObjectify<Input>(model as unknown as Input);
|
|
755
|
+
const modelForm = immerify(modelRef, deepObjectify<Input>(model as unknown as Input) as object) as Input;
|
|
755
756
|
this.set({
|
|
756
757
|
[names.model]: model,
|
|
757
758
|
[names.modelFormLoading]: false,
|
|
@@ -813,15 +814,12 @@ export const makeActions = (refName: string, slice: { [key: string]: SerializedS
|
|
|
813
814
|
const crystalizedModel = new cnst.full().set(firstModel) as unknown as Full;
|
|
814
815
|
this.set({ [names.model]: crystalizedModel });
|
|
815
816
|
} else if (model?.id === firstModel.id) {
|
|
816
|
-
const crystalizedModel = new cnst.full().set(
|
|
817
|
-
...model,
|
|
818
|
-
...firstModel,
|
|
819
|
-
}) as unknown as Full;
|
|
817
|
+
const crystalizedModel = new cnst.full().set(model).set(firstModel) as unknown as Full;
|
|
820
818
|
this.set({ [names.model]: crystalizedModel });
|
|
821
819
|
}
|
|
822
820
|
|
|
823
|
-
const lightModels =
|
|
824
|
-
(fullOrLightModel) => new cnst.light().set(fullOrLightModel) as unknown as Light,
|
|
821
|
+
const lightModels = withSharedInstances(() =>
|
|
822
|
+
fullOrLightModels.map((fullOrLightModel) => new cnst.light().set(fullOrLightModel) as unknown as Light),
|
|
825
823
|
);
|
|
826
824
|
slices.forEach(({ sliceName }) => {
|
|
827
825
|
const namesOfSlice = {
|
|
@@ -878,15 +876,10 @@ export const makeActions = (refName: string, slice: { [key: string]: SerializedS
|
|
|
878
876
|
const singleSliceAction = {
|
|
879
877
|
[namesOfSlice.initModel]: async function (
|
|
880
878
|
this: SetGet,
|
|
881
|
-
...args: [...args: any[], initForm: FetchInitForm<Input, Filter
|
|
879
|
+
...args: [...args: any[], initForm: FetchInitForm<Input, Filter> & FetchPolicy]
|
|
882
880
|
) {
|
|
883
881
|
const initArgLength = Math.min(args.length, slice.args.length);
|
|
884
|
-
const initForm = { invalidate: false, ...(args[slice.args.length] ?? {}) } as FetchInitForm<
|
|
885
|
-
Input,
|
|
886
|
-
Filter,
|
|
887
|
-
DefaultOf<Input>,
|
|
888
|
-
Sort
|
|
889
|
-
> &
|
|
882
|
+
const initForm = { invalidate: false, ...(args[slice.args.length] ?? {}) } as FetchInitForm<Input, Filter> &
|
|
890
883
|
FetchPolicy;
|
|
891
884
|
const queryArgs = new Array(initArgLength).fill(null).map((_, i) => args[i] as object);
|
|
892
885
|
const defaultModel = new cnst.full().set(initForm.default ?? {}) as unknown as Full;
|
|
@@ -898,7 +891,7 @@ export const makeActions = (refName: string, slice: { [key: string]: SerializedS
|
|
|
898
891
|
},
|
|
899
892
|
[namesOfSlice.refreshModel]: async function (
|
|
900
893
|
this: SetGet,
|
|
901
|
-
initForm: FetchInitForm<Input, Filter
|
|
894
|
+
initForm: FetchInitForm<Input, Filter> & FetchPolicy & { queryArgs?: any[] } = {},
|
|
902
895
|
) {
|
|
903
896
|
const args = initForm.queryArgs ?? [];
|
|
904
897
|
const refreshArgLength = Math.min(args.length, slice.args.length);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ACTION_TAG } from "akanjs/base";
|
|
2
|
+
|
|
3
|
+
/** Which module declared an action. The dictionary node its words live in is named after it. */
|
|
4
|
+
export interface ActionOwner {
|
|
5
|
+
refName: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface ActionTag {
|
|
9
|
+
/** The `st.do` key this function is. */
|
|
10
|
+
action: string;
|
|
11
|
+
/** The state path it writes, when it writes exactly one — `userForm.name` for a field setter. */
|
|
12
|
+
state?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Marks a dispatcher with what it does, so a component handed one by reference can say so in the DOM.
|
|
17
|
+
*
|
|
18
|
+
* `onChange={st.do.setNameOnUser}` is the house form for every model field, which means the component already holds
|
|
19
|
+
* everything an annotation needs — it just has no way to read it off a function. This is that way, and it is why
|
|
20
|
+
* `data-akan-*` costs an app no code at all: nobody writes the attribute, the setter carries its own name.
|
|
21
|
+
*
|
|
22
|
+
* Non-enumerable, so it survives neither `{...fn}` nor `JSON.stringify` and shows up in no spread.
|
|
23
|
+
*/
|
|
24
|
+
export const tagAction = <T extends (...args: never[]) => unknown>(fn: T, tag: ActionTag): T => {
|
|
25
|
+
Object.defineProperty(fn, ACTION_TAG, { value: tag, configurable: true });
|
|
26
|
+
return fn;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const actionTagOf = (value: unknown): ActionTag | undefined => {
|
|
30
|
+
if (typeof value !== "function") return undefined;
|
|
31
|
+
const tag = (value as unknown as { [key: symbol]: unknown })[ACTION_TAG];
|
|
32
|
+
return tag && typeof tag === "object" ? (tag as ActionTag) : undefined;
|
|
33
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { DataList } from "akanjs/base";
|
|
2
|
+
import { ConstantRegistry, type MaskModel, mask } from "akanjs/constant";
|
|
3
|
+
import type { AgentRefusal } from "akanjs/signal";
|
|
4
|
+
import type { StoreInstance } from "../storeInstance";
|
|
5
|
+
import { StoreRegistry } from "../storeRegistry";
|
|
6
|
+
import { StoreCatalogue } from "./StoreCatalogue";
|
|
7
|
+
import type { SerializedStoreState } from "./types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* What an in-page agent may read out of the store the user is looking at.
|
|
11
|
+
*
|
|
12
|
+
* Reads only. Driving the app is a component's declaration to make: `st.tool` binds a name and a schema to the
|
|
13
|
+
* same handler the control on screen calls, so what an agent can do is what the screen offers the user and nothing
|
|
14
|
+
* else. A store method that no component declared is not a lever this screen has — publishing one made the surface
|
|
15
|
+
* the bundle rather than the screen, and gave the model levers whose effect it could not see.
|
|
16
|
+
*
|
|
17
|
+
* A key is readable while a mounted component subscribes it through `st.use` / `st.sel` / `st.ref`, and its value
|
|
18
|
+
* is masked by the model that key declares. Masking is not optional even though the data mostly came from the
|
|
19
|
+
* server already masked: `<model>Form` holds what the *user* typed, credentials included, and an in-page agent
|
|
20
|
+
* ships what it reads to a remote model. The mask is by the declared model rather than by the value's class,
|
|
21
|
+
* because `immerify` copies a form into a plain object and the class is gone by the time anyone can ask.
|
|
22
|
+
*/
|
|
23
|
+
export class AgentBridge {
|
|
24
|
+
readonly refusals: AgentRefusal[];
|
|
25
|
+
|
|
26
|
+
readonly #instance: StoreInstance;
|
|
27
|
+
readonly #state: { [key: string]: SerializedStoreState };
|
|
28
|
+
|
|
29
|
+
/** The bridge for the app running in this process: the one store every `st.use` goes through. */
|
|
30
|
+
static of() {
|
|
31
|
+
return new AgentBridge(StoreRegistry.instance);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
constructor(instance: StoreInstance) {
|
|
35
|
+
this.#instance = instance;
|
|
36
|
+
const catalogue = new StoreCatalogue(instance);
|
|
37
|
+
this.#state = catalogue.state;
|
|
38
|
+
this.refusals = catalogue.refusals;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get state(): { [key: string]: SerializedStoreState } {
|
|
42
|
+
return this.#state;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
subscribe(listener: () => void) {
|
|
46
|
+
return this.#instance.subscribe(listener);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** The keys one view may read right now: subscribed by a mounted component and catalogued. */
|
|
50
|
+
readableKeys(viewKey = ""): string[] {
|
|
51
|
+
return [...this.#instance.liveKeysIn(viewKey).keys()].filter((key) => !!this.#state[key]).sort();
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The value behind a state key, stripped of what the model marks `hidden` or `secret`.
|
|
56
|
+
*
|
|
57
|
+
* The key itself has to be one the screen reads, not merely one its store owns: a component subscribing
|
|
58
|
+
* `userList` says the screen shows a user list, and says nothing about `userForm` sitting in the same store.
|
|
59
|
+
*/
|
|
60
|
+
read(key: string, viewKey = ""): unknown {
|
|
61
|
+
const entry = this.#state[key];
|
|
62
|
+
if (!entry) throw new Error(`Unknown state key: ${key}`);
|
|
63
|
+
if (!this.#instance.liveKeysIn(viewKey).has(key))
|
|
64
|
+
throw new Error(`State key "${key}" is not read by this screen, so it is not part of its surface.`);
|
|
65
|
+
const value = AgentBridge.#unwrap(this.#instance.get()[key]);
|
|
66
|
+
if (entry.refName && entry.modelType) {
|
|
67
|
+
const model = ConstantRegistry.getModelRef(entry.refName, entry.modelType) as MaskModel;
|
|
68
|
+
return mask(model, value);
|
|
69
|
+
}
|
|
70
|
+
if (AgentBridge.#isPlainValue(value)) return value;
|
|
71
|
+
throw new Error(
|
|
72
|
+
`State key "${key}" holds an object that belongs to no model, so there is nothing to mask it by and it is not published. Read the model's own keys instead.`,
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
static #unwrap(value: unknown) {
|
|
77
|
+
return value instanceof DataList ? value.values : value;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** True when nothing inside could be carrying a model's fields, so there is nothing a mask would have to strip. */
|
|
81
|
+
static #isPlainValue(value: unknown): boolean {
|
|
82
|
+
if (value === null || value === undefined) return true;
|
|
83
|
+
if (Array.isArray(value)) return value.every((item) => AgentBridge.#isPlainValue(item));
|
|
84
|
+
if (value instanceof Date) return true;
|
|
85
|
+
return typeof value !== "object";
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { ContextBlock, SurfaceView } from "../../vendor/use-agentic";
|
|
2
|
+
import type { StoreInstance } from "../storeInstance";
|
|
3
|
+
import { StoreRegistry } from "../storeRegistry";
|
|
4
|
+
import type { AgentBridge } from "./AgentBridge";
|
|
5
|
+
import { ensureStoreSurface } from "./storeSurface";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The akan default context for a turn: where the user is (route), what is on screen (scopes and their curated
|
|
9
|
+
* resources), and which store keys the mounted components are reading (live keys). Live entries carry names and
|
|
10
|
+
* small primitives only — anything bigger is one `readState` call away, masked — so the block cannot bloat with
|
|
11
|
+
* what happens to be in the store. Base-store plumbing is kept off the surface by `st.use.x({ agent: false })`
|
|
12
|
+
* at each call site, and the route block carries the three of them that matter.
|
|
13
|
+
*/
|
|
14
|
+
export class AgentContext {
|
|
15
|
+
static of(): AgentContext {
|
|
16
|
+
return new AgentContext(StoreRegistry.instance, ensureStoreSurface().bridge);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
readonly #instance: StoreInstance;
|
|
20
|
+
readonly #bridge: AgentBridge;
|
|
21
|
+
|
|
22
|
+
constructor(instance: StoreInstance, bridge: AgentBridge) {
|
|
23
|
+
this.#instance = instance;
|
|
24
|
+
this.#bridge = bridge;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
blocks(surface: SurfaceView, view: string[] = []): ContextBlock[] {
|
|
28
|
+
const state = this.#instance.get();
|
|
29
|
+
const { scopes, resources } = surface.snapshot();
|
|
30
|
+
return [
|
|
31
|
+
{
|
|
32
|
+
kind: "route",
|
|
33
|
+
path: String(state.pathname ?? ""),
|
|
34
|
+
params: state.params ?? {},
|
|
35
|
+
searchParams: state.searchParams ?? {},
|
|
36
|
+
},
|
|
37
|
+
...(scopes.length || resources.length ? [{ kind: "screen", scopes, resources }] : []),
|
|
38
|
+
...this.#liveBlock(view.join(".")),
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#liveBlock(viewKey: string): ContextBlock[] {
|
|
43
|
+
const live = this.#bridge.readableKeys(viewKey).map((key) => this.#liveEntry(key));
|
|
44
|
+
return live.length ? [{ kind: "state", live, note: "Call readState(key) to read a value." }] : [];
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
#liveEntry(key: string) {
|
|
48
|
+
const meta = this.#bridge.state[key];
|
|
49
|
+
const value = AgentContext.#inlineValue(this.#instance.get()[key]);
|
|
50
|
+
return {
|
|
51
|
+
key,
|
|
52
|
+
...(meta?.refName ? { model: meta.refName } : {}),
|
|
53
|
+
...(meta ? { type: meta.type } : {}),
|
|
54
|
+
...(value !== undefined ? { value } : {}),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** Primitives ride inline; anything bigger stays a name the agent pulls with `readState`. */
|
|
59
|
+
static #inlineValue(value: unknown): unknown {
|
|
60
|
+
if (value === null) return null;
|
|
61
|
+
switch (typeof value) {
|
|
62
|
+
case "string":
|
|
63
|
+
return value.length <= 200 ? value : `${value.slice(0, 200)}…`;
|
|
64
|
+
case "number":
|
|
65
|
+
case "boolean":
|
|
66
|
+
return value;
|
|
67
|
+
default:
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { Translator } from "akanjs/client";
|
|
2
|
+
import { parseAkanI18nEnv } from "akanjs/common";
|
|
3
|
+
import { FetchClient } from "akanjs/fetch";
|
|
4
|
+
import type { PromptContent, PromptMessage, PromptResult, SerializedSignal } from "akanjs/signal";
|
|
5
|
+
import type { ChatMessage } from "../../vendor/use-agentic";
|
|
6
|
+
|
|
7
|
+
export interface AgentPrompt {
|
|
8
|
+
name: string;
|
|
9
|
+
refName: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
args: { name: string; required: boolean }[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The user-invokable `prompt()` endpoints of the mounted app, read off the serialized signals the client already
|
|
16
|
+
* holds — the same catalogue MCP lists them from, so a chat needs no listing endpoint. Guards are not evaluated
|
|
17
|
+
* here: a prompt's own GET enforces them at call time, and the refusal lands in the transcript like any failure.
|
|
18
|
+
*/
|
|
19
|
+
export class AgentPrompts {
|
|
20
|
+
static of(): AgentPrompts {
|
|
21
|
+
return new AgentPrompts(FetchClient.sharedSerializedSignal);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
readonly #signals: Record<string, SerializedSignal>;
|
|
25
|
+
|
|
26
|
+
constructor(signals: Record<string, SerializedSignal>) {
|
|
27
|
+
this.#signals = signals;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
list(): AgentPrompt[] {
|
|
31
|
+
const prompts: AgentPrompt[] = [];
|
|
32
|
+
for (const [refName, signal] of Object.entries(this.#signals))
|
|
33
|
+
for (const [name, endpoint] of Object.entries(signal.endpoint)) {
|
|
34
|
+
if (endpoint.type !== "prompt") continue;
|
|
35
|
+
prompts.push({
|
|
36
|
+
name,
|
|
37
|
+
refName,
|
|
38
|
+
...(this.#description(refName, name) ? { description: this.#description(refName, name) } : {}),
|
|
39
|
+
args: (endpoint.args ?? []).map((arg) => ({
|
|
40
|
+
name: arg.name,
|
|
41
|
+
required: !(arg.nullable ?? arg.type === "search"),
|
|
42
|
+
})),
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return prompts.sort((a, b) => (a.name < b.name ? -1 : 1));
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
find(name: string): AgentPrompt | null {
|
|
49
|
+
return this.list().find((prompt) => prompt.name === name) ?? null;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** `/name arg1 "an arg with spaces"` — positional because a prompt's arguments are flat strings by protocol. */
|
|
53
|
+
static parseCommand(draft: string): { name: string; args: string[] } | null {
|
|
54
|
+
const match = /^\/([A-Za-z0-9_-]+)(?:\s+([\s\S]*))?$/.exec(draft.trim());
|
|
55
|
+
if (!match) return null;
|
|
56
|
+
return { name: match[1], args: AgentPrompts.#args(match[2] ?? "") };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whitespace separates arguments, and quotes are how a sentence stays one of them — a prompt taking a single
|
|
61
|
+
* `String` is the common case, and splitting "plan the week" into three arguments fills the second parameter
|
|
62
|
+
* with the second word.
|
|
63
|
+
*/
|
|
64
|
+
static #args(rest: string): string[] {
|
|
65
|
+
const args: string[] = [];
|
|
66
|
+
for (const token of rest.matchAll(/"([^"]*)"|'([^']*)'|(\S+)/g)) args.push(token[1] ?? token[2] ?? token[3]);
|
|
67
|
+
return args;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** The messages a prompt returns become the user's turn, the way an MCP client sends a `prompts/get` result. */
|
|
71
|
+
static messagesOf(result: PromptResult): ChatMessage[] {
|
|
72
|
+
if (typeof result === "string") return [{ role: "user", text: result }];
|
|
73
|
+
return result.map((message) => AgentPrompts.#messageOf(message));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* A binary block becomes an attachment. It used to become the string `[image]`, which a model reads as having
|
|
78
|
+
* been shown a picture — so a prompt built with `Msg.imageOf` produced confident answers about bytes that never
|
|
79
|
+
* left the server. The other block types are text already and stay text.
|
|
80
|
+
*/
|
|
81
|
+
static #messageOf(message: PromptMessage): ChatMessage {
|
|
82
|
+
const { role, content } = message;
|
|
83
|
+
if (content.type !== "image" && content.type !== "audio") return { role, text: AgentPrompts.textOf(content) };
|
|
84
|
+
const name = AgentPrompts.#binaryName(content.mimeType);
|
|
85
|
+
return { role, attachments: [{ name, mimeType: content.mimeType, data: content.data }] };
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** `Msg.image` carries no filename — the protocol has nowhere to put one — so the type is the label. */
|
|
89
|
+
static #binaryName(mimeType: string) {
|
|
90
|
+
const [kind, subtype] = mimeType.split("/");
|
|
91
|
+
return subtype ? `${kind}.${subtype.split("+")[0]}` : mimeType;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static textOf(content: PromptContent): string {
|
|
95
|
+
if (content.type === "text") return content.text;
|
|
96
|
+
if (content.type === "resource") return `[resource ${content.resource.uri}]\n${content.resource.text}`;
|
|
97
|
+
if (content.type === "resource_link") return `[link ${content.name}: ${content.uri}]`;
|
|
98
|
+
return `[${content.type}]`;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
#description(refName: string, name: string) {
|
|
102
|
+
return this.#text(`${refName}.signal.${name}.desc`) ?? this.#text(`${refName}.signal.${name}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
#text(key: string) {
|
|
106
|
+
const locale = Translator.getActiveLocale() ?? parseAkanI18nEnv().defaultLocale;
|
|
107
|
+
const text = Translator.translateByLocale(locale, key);
|
|
108
|
+
|
|
109
|
+
return text === key ? undefined : text;
|
|
110
|
+
}
|
|
111
|
+
}
|