@downcity/plugins 1.0.4
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/bin/BuiltinPlugins.d.ts +23 -0
- package/bin/BuiltinPlugins.d.ts.map +1 -0
- package/bin/BuiltinPlugins.js +42 -0
- package/bin/BuiltinPlugins.js.map +1 -0
- package/bin/asr/Config.d.ts +43 -0
- package/bin/asr/Config.d.ts.map +1 -0
- package/bin/asr/Config.js +107 -0
- package/bin/asr/Config.js.map +1 -0
- package/bin/asr/Dependency.d.ts +77 -0
- package/bin/asr/Dependency.d.ts.map +1 -0
- package/bin/asr/Dependency.js +238 -0
- package/bin/asr/Dependency.js.map +1 -0
- package/bin/asr/InboundAugment.d.ts +17 -0
- package/bin/asr/InboundAugment.d.ts.map +1 -0
- package/bin/asr/InboundAugment.js +47 -0
- package/bin/asr/InboundAugment.js.map +1 -0
- package/bin/asr/ModelCatalog.d.ts +29 -0
- package/bin/asr/ModelCatalog.d.ts.map +1 -0
- package/bin/asr/ModelCatalog.js +25 -0
- package/bin/asr/ModelCatalog.js.map +1 -0
- package/bin/asr/Plugin.d.ts +18 -0
- package/bin/asr/Plugin.d.ts.map +1 -0
- package/bin/asr/Plugin.js +481 -0
- package/bin/asr/Plugin.js.map +1 -0
- package/bin/auth/Plugin.d.ts +18 -0
- package/bin/auth/Plugin.d.ts.map +1 -0
- package/bin/auth/Plugin.js +190 -0
- package/bin/auth/Plugin.js.map +1 -0
- package/bin/auth/runtime/AuthorizationConfig.d.ts +41 -0
- package/bin/auth/runtime/AuthorizationConfig.d.ts.map +1 -0
- package/bin/auth/runtime/AuthorizationConfig.js +185 -0
- package/bin/auth/runtime/AuthorizationConfig.js.map +1 -0
- package/bin/auth/runtime/AuthorizationPolicy.d.ts +28 -0
- package/bin/auth/runtime/AuthorizationPolicy.d.ts.map +1 -0
- package/bin/auth/runtime/AuthorizationPolicy.js +124 -0
- package/bin/auth/runtime/AuthorizationPolicy.js.map +1 -0
- package/bin/auth/runtime/AuthorizationStore.d.ts +29 -0
- package/bin/auth/runtime/AuthorizationStore.d.ts.map +1 -0
- package/bin/auth/runtime/AuthorizationStore.js +179 -0
- package/bin/auth/runtime/AuthorizationStore.js.map +1 -0
- package/bin/auth/types/AuthPlugin.d.ts +407 -0
- package/bin/auth/types/AuthPlugin.d.ts.map +1 -0
- package/bin/auth/types/AuthPlugin.js +115 -0
- package/bin/auth/types/AuthPlugin.js.map +1 -0
- package/bin/chat/Action.d.ts +125 -0
- package/bin/chat/Action.d.ts.map +1 -0
- package/bin/chat/Action.js +376 -0
- package/bin/chat/Action.js.map +1 -0
- package/bin/chat/ChatPlugin.d.ts +89 -0
- package/bin/chat/ChatPlugin.d.ts.map +1 -0
- package/bin/chat/ChatPlugin.js +208 -0
- package/bin/chat/ChatPlugin.js.map +1 -0
- package/bin/chat/ChatPluginTypes.d.ts +122 -0
- package/bin/chat/ChatPluginTypes.d.ts.map +1 -0
- package/bin/chat/ChatPluginTypes.js +10 -0
- package/bin/chat/ChatPluginTypes.js.map +1 -0
- package/bin/chat/Index.d.ts +9 -0
- package/bin/chat/Index.d.ts.map +1 -0
- package/bin/chat/Index.js +9 -0
- package/bin/chat/Index.js.map +1 -0
- package/bin/chat/PROMPT.direct.d.ts +7 -0
- package/bin/chat/PROMPT.direct.d.ts.map +1 -0
- package/bin/chat/PROMPT.direct.js +8 -0
- package/bin/chat/PROMPT.direct.js.map +1 -0
- package/bin/chat/accounts/ChannelAccountManager.d.ts +61 -0
- package/bin/chat/accounts/ChannelAccountManager.d.ts.map +1 -0
- package/bin/chat/accounts/ChannelAccountManager.js +264 -0
- package/bin/chat/accounts/ChannelAccountManager.js.map +1 -0
- package/bin/chat/accounts/Crypto.d.ts +20 -0
- package/bin/chat/accounts/Crypto.d.ts.map +1 -0
- package/bin/chat/accounts/Crypto.js +75 -0
- package/bin/chat/accounts/Crypto.js.map +1 -0
- package/bin/chat/accounts/Store.d.ts +38 -0
- package/bin/chat/accounts/Store.d.ts.map +1 -0
- package/bin/chat/accounts/Store.js +220 -0
- package/bin/chat/accounts/Store.js.map +1 -0
- package/bin/chat/channels/BaseChatChannel.d.ts +201 -0
- package/bin/chat/channels/BaseChatChannel.d.ts.map +1 -0
- package/bin/chat/channels/BaseChatChannel.js +294 -0
- package/bin/chat/channels/BaseChatChannel.js.map +1 -0
- package/bin/chat/channels/BaseChatChannelQueue.d.ts +73 -0
- package/bin/chat/channels/BaseChatChannelQueue.d.ts.map +1 -0
- package/bin/chat/channels/BaseChatChannelQueue.js +237 -0
- package/bin/chat/channels/BaseChatChannelQueue.js.map +1 -0
- package/bin/chat/channels/BaseChatChannelSupport.d.ts +189 -0
- package/bin/chat/channels/BaseChatChannelSupport.d.ts.map +1 -0
- package/bin/chat/channels/BaseChatChannelSupport.js +141 -0
- package/bin/chat/channels/BaseChatChannelSupport.js.map +1 -0
- package/bin/chat/channels/BotInfoProvider.d.ts +18 -0
- package/bin/chat/channels/BotInfoProvider.d.ts.map +1 -0
- package/bin/chat/channels/BotInfoProvider.js +32 -0
- package/bin/chat/channels/BotInfoProvider.js.map +1 -0
- package/bin/chat/channels/Configuration.d.ts +27 -0
- package/bin/chat/channels/Configuration.d.ts.map +1 -0
- package/bin/chat/channels/Configuration.js +19 -0
- package/bin/chat/channels/Configuration.js.map +1 -0
- package/bin/chat/channels/ConfigurationRegistry.d.ts +18 -0
- package/bin/chat/channels/ConfigurationRegistry.d.ts.map +1 -0
- package/bin/chat/channels/ConfigurationRegistry.js +31 -0
- package/bin/chat/channels/ConfigurationRegistry.js.map +1 -0
- package/bin/chat/channels/feishu/BotInfo.d.ts +20 -0
- package/bin/chat/channels/feishu/BotInfo.d.ts.map +1 -0
- package/bin/chat/channels/feishu/BotInfo.js +147 -0
- package/bin/chat/channels/feishu/BotInfo.js.map +1 -0
- package/bin/chat/channels/feishu/Configuration.d.ts +17 -0
- package/bin/chat/channels/feishu/Configuration.d.ts.map +1 -0
- package/bin/chat/channels/feishu/Configuration.js +59 -0
- package/bin/chat/channels/feishu/Configuration.js.map +1 -0
- package/bin/chat/channels/feishu/Feishu.d.ts +116 -0
- package/bin/chat/channels/feishu/Feishu.d.ts.map +1 -0
- package/bin/chat/channels/feishu/Feishu.js +326 -0
- package/bin/chat/channels/feishu/Feishu.js.map +1 -0
- package/bin/chat/channels/feishu/FeishuInbound.d.ts +21 -0
- package/bin/chat/channels/feishu/FeishuInbound.d.ts.map +1 -0
- package/bin/chat/channels/feishu/FeishuInbound.js +43 -0
- package/bin/chat/channels/feishu/FeishuInbound.js.map +1 -0
- package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts +155 -0
- package/bin/chat/channels/feishu/FeishuMessageHandler.d.ts.map +1 -0
- package/bin/chat/channels/feishu/FeishuMessageHandler.js +247 -0
- package/bin/chat/channels/feishu/FeishuMessageHandler.js.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts +130 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.js +316 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.js.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts +102 -0
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js +299 -0
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts +49 -0
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.d.ts.map +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.js +139 -0
- package/bin/chat/channels/feishu/FeishuPlatformMessaging.js.map +1 -0
- package/bin/chat/channels/feishu/InboundAttachment.d.ts +31 -0
- package/bin/chat/channels/feishu/InboundAttachment.d.ts.map +1 -0
- package/bin/chat/channels/feishu/InboundAttachment.js +222 -0
- package/bin/chat/channels/feishu/InboundAttachment.js.map +1 -0
- package/bin/chat/channels/feishu/PROMPT.direct.d.ts +7 -0
- package/bin/chat/channels/feishu/PROMPT.direct.d.ts.map +1 -0
- package/bin/chat/channels/feishu/PROMPT.direct.js +8 -0
- package/bin/chat/channels/feishu/PROMPT.direct.js.map +1 -0
- package/bin/chat/channels/feishu/PostMessage.d.ts +48 -0
- package/bin/chat/channels/feishu/PostMessage.d.ts.map +1 -0
- package/bin/chat/channels/feishu/PostMessage.js +413 -0
- package/bin/chat/channels/feishu/PostMessage.js.map +1 -0
- package/bin/chat/channels/feishu/ReplyContext.d.ts +18 -0
- package/bin/chat/channels/feishu/ReplyContext.d.ts.map +1 -0
- package/bin/chat/channels/feishu/ReplyContext.js +56 -0
- package/bin/chat/channels/feishu/ReplyContext.js.map +1 -0
- package/bin/chat/channels/feishu/Shared.d.ts +21 -0
- package/bin/chat/channels/feishu/Shared.d.ts.map +1 -0
- package/bin/chat/channels/feishu/Shared.js +69 -0
- package/bin/chat/channels/feishu/Shared.js.map +1 -0
- package/bin/chat/channels/feishu/types/FeishuChannel.d.ts +127 -0
- package/bin/chat/channels/feishu/types/FeishuChannel.d.ts.map +1 -0
- package/bin/chat/channels/feishu/types/FeishuChannel.js +9 -0
- package/bin/chat/channels/feishu/types/FeishuChannel.js.map +1 -0
- package/bin/chat/channels/qq/BotInfo.d.ts +19 -0
- package/bin/chat/channels/qq/BotInfo.d.ts.map +1 -0
- package/bin/chat/channels/qq/BotInfo.js +112 -0
- package/bin/chat/channels/qq/BotInfo.js.map +1 -0
- package/bin/chat/channels/qq/Configuration.d.ts +17 -0
- package/bin/chat/channels/qq/Configuration.d.ts.map +1 -0
- package/bin/chat/channels/qq/Configuration.js +59 -0
- package/bin/chat/channels/qq/Configuration.js.map +1 -0
- package/bin/chat/channels/qq/PROMPT.direct.d.ts +7 -0
- package/bin/chat/channels/qq/PROMPT.direct.d.ts.map +1 -0
- package/bin/chat/channels/qq/PROMPT.direct.js +8 -0
- package/bin/chat/channels/qq/PROMPT.direct.js.map +1 -0
- package/bin/chat/channels/qq/QQ.d.ts +92 -0
- package/bin/chat/channels/qq/QQ.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQ.js +287 -0
- package/bin/chat/channels/qq/QQ.js.map +1 -0
- package/bin/chat/channels/qq/QQEventCapture.d.ts +22 -0
- package/bin/chat/channels/qq/QQEventCapture.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQEventCapture.js +67 -0
- package/bin/chat/channels/qq/QQEventCapture.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewayAuth.d.ts +119 -0
- package/bin/chat/channels/qq/QQGatewayAuth.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewayAuth.js +186 -0
- package/bin/chat/channels/qq/QQGatewayAuth.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewayClient.d.ts +155 -0
- package/bin/chat/channels/qq/QQGatewayClient.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewayClient.js +381 -0
- package/bin/chat/channels/qq/QQGatewayClient.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewayConnection.d.ts +65 -0
- package/bin/chat/channels/qq/QQGatewayConnection.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewayConnection.js +110 -0
- package/bin/chat/channels/qq/QQGatewayConnection.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewayHeartbeat.d.ts +59 -0
- package/bin/chat/channels/qq/QQGatewayHeartbeat.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewayHeartbeat.js +58 -0
- package/bin/chat/channels/qq/QQGatewayHeartbeat.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewayProtocol.d.ts +86 -0
- package/bin/chat/channels/qq/QQGatewayProtocol.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewayProtocol.js +93 -0
- package/bin/chat/channels/qq/QQGatewayProtocol.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewaySend.d.ts +84 -0
- package/bin/chat/channels/qq/QQGatewaySend.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewaySend.js +120 -0
- package/bin/chat/channels/qq/QQGatewaySend.js.map +1 -0
- package/bin/chat/channels/qq/QQGatewaySupport.d.ts +39 -0
- package/bin/chat/channels/qq/QQGatewaySupport.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQGatewaySupport.js +137 -0
- package/bin/chat/channels/qq/QQGatewaySupport.js.map +1 -0
- package/bin/chat/channels/qq/QQInbound.d.ts +47 -0
- package/bin/chat/channels/qq/QQInbound.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQInbound.js +235 -0
- package/bin/chat/channels/qq/QQInbound.js.map +1 -0
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts +48 -0
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQInboundDedupe.js +108 -0
- package/bin/chat/channels/qq/QQInboundDedupe.js.map +1 -0
- package/bin/chat/channels/qq/QQMessageHandler.d.ts +129 -0
- package/bin/chat/channels/qq/QQMessageHandler.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQMessageHandler.js +284 -0
- package/bin/chat/channels/qq/QQMessageHandler.js.map +1 -0
- package/bin/chat/channels/qq/QQSendSupport.d.ts +20 -0
- package/bin/chat/channels/qq/QQSendSupport.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQSendSupport.js +86 -0
- package/bin/chat/channels/qq/QQSendSupport.js.map +1 -0
- package/bin/chat/channels/qq/QQSupport.d.ts +102 -0
- package/bin/chat/channels/qq/QQSupport.d.ts.map +1 -0
- package/bin/chat/channels/qq/QQSupport.js +172 -0
- package/bin/chat/channels/qq/QQSupport.js.map +1 -0
- package/bin/chat/channels/qq/VoiceInput.d.ts +64 -0
- package/bin/chat/channels/qq/VoiceInput.d.ts.map +1 -0
- package/bin/chat/channels/qq/VoiceInput.js +299 -0
- package/bin/chat/channels/qq/VoiceInput.js.map +1 -0
- package/bin/chat/channels/qq/types/QqChannel.d.ts +485 -0
- package/bin/chat/channels/qq/types/QqChannel.d.ts.map +1 -0
- package/bin/chat/channels/qq/types/QqChannel.js +42 -0
- package/bin/chat/channels/qq/types/QqChannel.js.map +1 -0
- package/bin/chat/channels/qq/types/QqGatewaySupport.d.ts +82 -0
- package/bin/chat/channels/qq/types/QqGatewaySupport.d.ts.map +1 -0
- package/bin/chat/channels/qq/types/QqGatewaySupport.js +9 -0
- package/bin/chat/channels/qq/types/QqGatewaySupport.js.map +1 -0
- package/bin/chat/channels/telegram/ApiClient.d.ts +99 -0
- package/bin/chat/channels/telegram/ApiClient.d.ts.map +1 -0
- package/bin/chat/channels/telegram/ApiClient.js +306 -0
- package/bin/chat/channels/telegram/ApiClient.js.map +1 -0
- package/bin/chat/channels/telegram/Bot.d.ts +97 -0
- package/bin/chat/channels/telegram/Bot.d.ts.map +1 -0
- package/bin/chat/channels/telegram/Bot.js +246 -0
- package/bin/chat/channels/telegram/Bot.js.map +1 -0
- package/bin/chat/channels/telegram/BotInfo.d.ts +19 -0
- package/bin/chat/channels/telegram/BotInfo.d.ts.map +1 -0
- package/bin/chat/channels/telegram/BotInfo.js +71 -0
- package/bin/chat/channels/telegram/BotInfo.js.map +1 -0
- package/bin/chat/channels/telegram/Configuration.d.ts +17 -0
- package/bin/chat/channels/telegram/Configuration.d.ts.map +1 -0
- package/bin/chat/channels/telegram/Configuration.js +59 -0
- package/bin/chat/channels/telegram/Configuration.js.map +1 -0
- package/bin/chat/channels/telegram/Handlers.d.ts +42 -0
- package/bin/chat/channels/telegram/Handlers.d.ts.map +1 -0
- package/bin/chat/channels/telegram/Handlers.js +45 -0
- package/bin/chat/channels/telegram/Handlers.js.map +1 -0
- package/bin/chat/channels/telegram/PROMPT.direct.d.ts +7 -0
- package/bin/chat/channels/telegram/PROMPT.direct.d.ts.map +1 -0
- package/bin/chat/channels/telegram/PROMPT.direct.js +8 -0
- package/bin/chat/channels/telegram/PROMPT.direct.js.map +1 -0
- package/bin/chat/channels/telegram/ReplyContext.d.ts +14 -0
- package/bin/chat/channels/telegram/ReplyContext.d.ts.map +1 -0
- package/bin/chat/channels/telegram/ReplyContext.js +57 -0
- package/bin/chat/channels/telegram/ReplyContext.js.map +1 -0
- package/bin/chat/channels/telegram/Shared.d.ts +221 -0
- package/bin/chat/channels/telegram/Shared.d.ts.map +1 -0
- package/bin/chat/channels/telegram/Shared.js +171 -0
- package/bin/chat/channels/telegram/Shared.js.map +1 -0
- package/bin/chat/channels/telegram/StateStore.d.ts +27 -0
- package/bin/chat/channels/telegram/StateStore.d.ts.map +1 -0
- package/bin/chat/channels/telegram/StateStore.js +53 -0
- package/bin/chat/channels/telegram/StateStore.js.map +1 -0
- package/bin/chat/channels/telegram/TelegramInbound.d.ts +46 -0
- package/bin/chat/channels/telegram/TelegramInbound.d.ts.map +1 -0
- package/bin/chat/channels/telegram/TelegramInbound.js +148 -0
- package/bin/chat/channels/telegram/TelegramInbound.js.map +1 -0
- package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts +142 -0
- package/bin/chat/channels/telegram/TelegramMessageHandler.d.ts.map +1 -0
- package/bin/chat/channels/telegram/TelegramMessageHandler.js +267 -0
- package/bin/chat/channels/telegram/TelegramMessageHandler.js.map +1 -0
- package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts +55 -0
- package/bin/chat/channels/telegram/TelegramPendingUpdates.d.ts.map +1 -0
- package/bin/chat/channels/telegram/TelegramPendingUpdates.js +125 -0
- package/bin/chat/channels/telegram/TelegramPendingUpdates.js.map +1 -0
- package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts +161 -0
- package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -0
- package/bin/chat/channels/telegram/TelegramPlatformClient.js +366 -0
- package/bin/chat/channels/telegram/TelegramPlatformClient.js.map +1 -0
- package/bin/chat/runtime/ChannelContextStore.d.ts +78 -0
- package/bin/chat/runtime/ChannelContextStore.d.ts.map +1 -0
- package/bin/chat/runtime/ChannelContextStore.js +336 -0
- package/bin/chat/runtime/ChannelContextStore.js.map +1 -0
- package/bin/chat/runtime/ChatActionExecution.d.ts +145 -0
- package/bin/chat/runtime/ChatActionExecution.d.ts.map +1 -0
- package/bin/chat/runtime/ChatActionExecution.js +287 -0
- package/bin/chat/runtime/ChatActionExecution.js.map +1 -0
- package/bin/chat/runtime/ChatActionInput.d.ts +22 -0
- package/bin/chat/runtime/ChatActionInput.d.ts.map +1 -0
- package/bin/chat/runtime/ChatActionInput.js +114 -0
- package/bin/chat/runtime/ChatActionInput.js.map +1 -0
- package/bin/chat/runtime/ChatActionInputSupport.d.ts +33 -0
- package/bin/chat/runtime/ChatActionInputSupport.d.ts.map +1 -0
- package/bin/chat/runtime/ChatActionInputSupport.js +66 -0
- package/bin/chat/runtime/ChatActionInputSupport.js.map +1 -0
- package/bin/chat/runtime/ChatChannelActions.d.ts +122 -0
- package/bin/chat/runtime/ChatChannelActions.d.ts.map +1 -0
- package/bin/chat/runtime/ChatChannelActions.js +231 -0
- package/bin/chat/runtime/ChatChannelActions.js.map +1 -0
- package/bin/chat/runtime/ChatChannelConfig.d.ts +61 -0
- package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -0
- package/bin/chat/runtime/ChatChannelConfig.js +260 -0
- package/bin/chat/runtime/ChatChannelConfig.js.map +1 -0
- package/bin/chat/runtime/ChatChannelCore.d.ts +49 -0
- package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -0
- package/bin/chat/runtime/ChatChannelCore.js +109 -0
- package/bin/chat/runtime/ChatChannelCore.js.map +1 -0
- package/bin/chat/runtime/ChatChannelFacade.d.ts +12 -0
- package/bin/chat/runtime/ChatChannelFacade.d.ts.map +1 -0
- package/bin/chat/runtime/ChatChannelFacade.js +12 -0
- package/bin/chat/runtime/ChatChannelFacade.js.map +1 -0
- package/bin/chat/runtime/ChatChannelLifecycle.d.ts +28 -0
- package/bin/chat/runtime/ChatChannelLifecycle.d.ts.map +1 -0
- package/bin/chat/runtime/ChatChannelLifecycle.js +132 -0
- package/bin/chat/runtime/ChatChannelLifecycle.js.map +1 -0
- package/bin/chat/runtime/ChatHistoryStore.d.ts +72 -0
- package/bin/chat/runtime/ChatHistoryStore.d.ts.map +1 -0
- package/bin/chat/runtime/ChatHistoryStore.js +219 -0
- package/bin/chat/runtime/ChatHistoryStore.js.map +1 -0
- package/bin/chat/runtime/ChatIngressStore.d.ts +44 -0
- package/bin/chat/runtime/ChatIngressStore.d.ts.map +1 -0
- package/bin/chat/runtime/ChatIngressStore.js +51 -0
- package/bin/chat/runtime/ChatIngressStore.js.map +1 -0
- package/bin/chat/runtime/ChatMetaStore.d.ts +68 -0
- package/bin/chat/runtime/ChatMetaStore.d.ts.map +1 -0
- package/bin/chat/runtime/ChatMetaStore.js +143 -0
- package/bin/chat/runtime/ChatMetaStore.js.map +1 -0
- package/bin/chat/runtime/ChatPluginActionRegistry.d.ts +17 -0
- package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -0
- package/bin/chat/runtime/ChatPluginActionRegistry.js +304 -0
- package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -0
- package/bin/chat/runtime/ChatPluginActions.d.ts +5 -0
- package/bin/chat/runtime/ChatPluginActions.d.ts.map +1 -0
- package/bin/chat/runtime/ChatPluginActions.js +5 -0
- package/bin/chat/runtime/ChatPluginActions.js.map +1 -0
- package/bin/chat/runtime/ChatPluginSystem.d.ts +22 -0
- package/bin/chat/runtime/ChatPluginSystem.d.ts.map +1 -0
- package/bin/chat/runtime/ChatPluginSystem.js +44 -0
- package/bin/chat/runtime/ChatPluginSystem.js.map +1 -0
- package/bin/chat/runtime/ChatPromptAssets.d.ts +24 -0
- package/bin/chat/runtime/ChatPromptAssets.d.ts.map +1 -0
- package/bin/chat/runtime/ChatPromptAssets.js +28 -0
- package/bin/chat/runtime/ChatPromptAssets.js.map +1 -0
- package/bin/chat/runtime/ChatQueue.d.ts +40 -0
- package/bin/chat/runtime/ChatQueue.d.ts.map +1 -0
- package/bin/chat/runtime/ChatQueue.js +52 -0
- package/bin/chat/runtime/ChatQueue.js.map +1 -0
- package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts +31 -0
- package/bin/chat/runtime/ChatQueueReplyDispatch.d.ts.map +1 -0
- package/bin/chat/runtime/ChatQueueReplyDispatch.js +168 -0
- package/bin/chat/runtime/ChatQueueReplyDispatch.js.map +1 -0
- package/bin/chat/runtime/ChatQueueStore.d.ts +85 -0
- package/bin/chat/runtime/ChatQueueStore.d.ts.map +1 -0
- package/bin/chat/runtime/ChatQueueStore.js +130 -0
- package/bin/chat/runtime/ChatQueueStore.js.map +1 -0
- package/bin/chat/runtime/ChatQueueWorker.d.ts +83 -0
- package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -0
- package/bin/chat/runtime/ChatQueueWorker.js +406 -0
- package/bin/chat/runtime/ChatQueueWorker.js.map +1 -0
- package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts +36 -0
- package/bin/chat/runtime/ChatQueueWorkerSupport.d.ts.map +1 -0
- package/bin/chat/runtime/ChatQueueWorkerSupport.js +101 -0
- package/bin/chat/runtime/ChatQueueWorkerSupport.js.map +1 -0
- package/bin/chat/runtime/ChatSendActionInput.d.ts +23 -0
- package/bin/chat/runtime/ChatSendActionInput.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSendActionInput.js +205 -0
- package/bin/chat/runtime/ChatSendActionInput.js.map +1 -0
- package/bin/chat/runtime/ChatSendMetadata.d.ts +20 -0
- package/bin/chat/runtime/ChatSendMetadata.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSendMetadata.js +130 -0
- package/bin/chat/runtime/ChatSendMetadata.js.map +1 -0
- package/bin/chat/runtime/ChatSendRegistry.d.ts +27 -0
- package/bin/chat/runtime/ChatSendRegistry.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSendRegistry.js +26 -0
- package/bin/chat/runtime/ChatSendRegistry.js.map +1 -0
- package/bin/chat/runtime/ChatSession.d.ts +97 -0
- package/bin/chat/runtime/ChatSession.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSession.js +84 -0
- package/bin/chat/runtime/ChatSession.js.map +1 -0
- package/bin/chat/runtime/ChatSessionContextComposer.d.ts +45 -0
- package/bin/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSessionContextComposer.js +60 -0
- package/bin/chat/runtime/ChatSessionContextComposer.js.map +1 -0
- package/bin/chat/runtime/ChatSessionDelete.d.ts +29 -0
- package/bin/chat/runtime/ChatSessionDelete.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSessionDelete.js +76 -0
- package/bin/chat/runtime/ChatSessionDelete.js.map +1 -0
- package/bin/chat/runtime/ChatSessionTypes.d.ts +30 -0
- package/bin/chat/runtime/ChatSessionTypes.d.ts.map +1 -0
- package/bin/chat/runtime/ChatSessionTypes.js +9 -0
- package/bin/chat/runtime/ChatSessionTypes.js.map +1 -0
- package/bin/chat/runtime/ChatkeySend.d.ts +67 -0
- package/bin/chat/runtime/ChatkeySend.d.ts.map +1 -0
- package/bin/chat/runtime/ChatkeySend.js +147 -0
- package/bin/chat/runtime/ChatkeySend.js.map +1 -0
- package/bin/chat/runtime/DirectDispatchParser.d.ts +22 -0
- package/bin/chat/runtime/DirectDispatchParser.d.ts.map +1 -0
- package/bin/chat/runtime/DirectDispatchParser.js +133 -0
- package/bin/chat/runtime/DirectDispatchParser.js.map +1 -0
- package/bin/chat/runtime/EnqueueDispatch.d.ts +24 -0
- package/bin/chat/runtime/EnqueueDispatch.d.ts.map +1 -0
- package/bin/chat/runtime/EnqueueDispatch.js +28 -0
- package/bin/chat/runtime/EnqueueDispatch.js.map +1 -0
- package/bin/chat/runtime/InboundAugment.d.ts +21 -0
- package/bin/chat/runtime/InboundAugment.d.ts.map +1 -0
- package/bin/chat/runtime/InboundAugment.js +50 -0
- package/bin/chat/runtime/InboundAugment.js.map +1 -0
- package/bin/chat/runtime/PluginDispatch.d.ts +43 -0
- package/bin/chat/runtime/PluginDispatch.d.ts.map +1 -0
- package/bin/chat/runtime/PluginDispatch.js +57 -0
- package/bin/chat/runtime/PluginDispatch.js.map +1 -0
- package/bin/chat/runtime/PluginPoints.d.ts +78 -0
- package/bin/chat/runtime/PluginPoints.d.ts.map +1 -0
- package/bin/chat/runtime/PluginPoints.js +78 -0
- package/bin/chat/runtime/PluginPoints.js.map +1 -0
- package/bin/chat/runtime/QueuedUserMessage.d.ts +20 -0
- package/bin/chat/runtime/QueuedUserMessage.d.ts.map +1 -0
- package/bin/chat/runtime/QueuedUserMessage.js +40 -0
- package/bin/chat/runtime/QueuedUserMessage.js.map +1 -0
- package/bin/chat/runtime/ReplyContextFormatter.d.ts +29 -0
- package/bin/chat/runtime/ReplyContextFormatter.d.ts.map +1 -0
- package/bin/chat/runtime/ReplyContextFormatter.js +74 -0
- package/bin/chat/runtime/ReplyContextFormatter.js.map +1 -0
- package/bin/chat/runtime/ReplyDispatch.d.ts +36 -0
- package/bin/chat/runtime/ReplyDispatch.d.ts.map +1 -0
- package/bin/chat/runtime/ReplyDispatch.js +51 -0
- package/bin/chat/runtime/ReplyDispatch.js.map +1 -0
- package/bin/chat/runtime/SystemPrompt.d.ts +26 -0
- package/bin/chat/runtime/SystemPrompt.d.ts.map +1 -0
- package/bin/chat/runtime/SystemPrompt.js +70 -0
- package/bin/chat/runtime/SystemPrompt.js.map +1 -0
- package/bin/chat/types/BotInfo.d.ts +97 -0
- package/bin/chat/types/BotInfo.d.ts.map +1 -0
- package/bin/chat/types/BotInfo.js +9 -0
- package/bin/chat/types/BotInfo.js.map +1 -0
- package/bin/chat/types/ChannelAccount.d.ts +226 -0
- package/bin/chat/types/ChannelAccount.d.ts.map +1 -0
- package/bin/chat/types/ChannelAccount.js +9 -0
- package/bin/chat/types/ChannelAccount.js.map +1 -0
- package/bin/chat/types/ChannelConfiguration.d.ts +146 -0
- package/bin/chat/types/ChannelConfiguration.d.ts.map +1 -0
- package/bin/chat/types/ChannelConfiguration.js +9 -0
- package/bin/chat/types/ChannelConfiguration.js.map +1 -0
- package/bin/chat/types/ChannelContext.d.ts +107 -0
- package/bin/chat/types/ChannelContext.d.ts.map +1 -0
- package/bin/chat/types/ChannelContext.js +9 -0
- package/bin/chat/types/ChannelContext.js.map +1 -0
- package/bin/chat/types/ChannelStatus.d.ts +88 -0
- package/bin/chat/types/ChannelStatus.d.ts.map +1 -0
- package/bin/chat/types/ChannelStatus.js +9 -0
- package/bin/chat/types/ChannelStatus.js.map +1 -0
- package/bin/chat/types/ChatCommand.d.ts +163 -0
- package/bin/chat/types/ChatCommand.d.ts.map +1 -0
- package/bin/chat/types/ChatCommand.js +9 -0
- package/bin/chat/types/ChatCommand.js.map +1 -0
- package/bin/chat/types/ChatDispatcher.d.ts +37 -0
- package/bin/chat/types/ChatDispatcher.d.ts.map +1 -0
- package/bin/chat/types/ChatDispatcher.js +9 -0
- package/bin/chat/types/ChatDispatcher.js.map +1 -0
- package/bin/chat/types/ChatHistory.d.ts +36 -0
- package/bin/chat/types/ChatHistory.d.ts.map +1 -0
- package/bin/chat/types/ChatHistory.js +9 -0
- package/bin/chat/types/ChatHistory.js.map +1 -0
- package/bin/chat/types/ChatMeta.d.ts +34 -0
- package/bin/chat/types/ChatMeta.d.ts.map +1 -0
- package/bin/chat/types/ChatMeta.js +10 -0
- package/bin/chat/types/ChatMeta.js.map +1 -0
- package/bin/chat/types/ChatPlugin.d.ts +238 -0
- package/bin/chat/types/ChatPlugin.d.ts.map +1 -0
- package/bin/chat/types/ChatPlugin.js +10 -0
- package/bin/chat/types/ChatPlugin.js.map +1 -0
- package/bin/chat/types/ChatPluginActionPayload.d.ts +145 -0
- package/bin/chat/types/ChatPluginActionPayload.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginActionPayload.js +10 -0
- package/bin/chat/types/ChatPluginActionPayload.js.map +1 -0
- package/bin/chat/types/ChatPromptContext.d.ts +125 -0
- package/bin/chat/types/ChatPromptContext.d.ts.map +1 -0
- package/bin/chat/types/ChatPromptContext.js +10 -0
- package/bin/chat/types/ChatPromptContext.js.map +1 -0
- package/bin/chat/types/ChatQueue.d.ts +36 -0
- package/bin/chat/types/ChatQueue.d.ts.map +1 -0
- package/bin/chat/types/ChatQueue.js +9 -0
- package/bin/chat/types/ChatQueue.js.map +1 -0
- package/bin/chat/types/ChatQueueWorker.d.ts +25 -0
- package/bin/chat/types/ChatQueueWorker.d.ts.map +1 -0
- package/bin/chat/types/ChatQueueWorker.js +9 -0
- package/bin/chat/types/ChatQueueWorker.js.map +1 -0
- package/bin/chat/types/ChatRuntime.d.ts +32 -0
- package/bin/chat/types/ChatRuntime.d.ts.map +1 -0
- package/bin/chat/types/ChatRuntime.js +9 -0
- package/bin/chat/types/ChatRuntime.js.map +1 -0
- package/bin/chat/types/DirectDispatch.d.ts +115 -0
- package/bin/chat/types/DirectDispatch.d.ts.map +1 -0
- package/bin/chat/types/DirectDispatch.js +9 -0
- package/bin/chat/types/DirectDispatch.js.map +1 -0
- package/bin/chat/types/FeishuAttachment.d.ts +42 -0
- package/bin/chat/types/FeishuAttachment.d.ts.map +1 -0
- package/bin/chat/types/FeishuAttachment.js +9 -0
- package/bin/chat/types/FeishuAttachment.js.map +1 -0
- package/bin/chat/types/FeishuInboundAttachment.d.ts +114 -0
- package/bin/chat/types/FeishuInboundAttachment.d.ts.map +1 -0
- package/bin/chat/types/FeishuInboundAttachment.js +9 -0
- package/bin/chat/types/FeishuInboundAttachment.js.map +1 -0
- package/bin/chat/types/FeishuPost.d.ts +287 -0
- package/bin/chat/types/FeishuPost.d.ts.map +1 -0
- package/bin/chat/types/FeishuPost.js +9 -0
- package/bin/chat/types/FeishuPost.js.map +1 -0
- package/bin/chat/types/QqInboundDedupe.d.ts +12 -0
- package/bin/chat/types/QqInboundDedupe.d.ts.map +1 -0
- package/bin/chat/types/QqInboundDedupe.js +2 -0
- package/bin/chat/types/QqInboundDedupe.js.map +1 -0
- package/bin/chat/types/QqVoice.d.ts +118 -0
- package/bin/chat/types/QqVoice.d.ts.map +1 -0
- package/bin/chat/types/QqVoice.js +9 -0
- package/bin/chat/types/QqVoice.js.map +1 -0
- package/bin/chat/types/ReplyContext.d.ts +46 -0
- package/bin/chat/types/ReplyContext.d.ts.map +1 -0
- package/bin/chat/types/ReplyContext.js +10 -0
- package/bin/chat/types/ReplyContext.js.map +1 -0
- package/bin/contact/Action.d.ts +62 -0
- package/bin/contact/Action.d.ts.map +1 -0
- package/bin/contact/Action.js +221 -0
- package/bin/contact/Action.js.map +1 -0
- package/bin/contact/ContactPlugin.d.ts +39 -0
- package/bin/contact/ContactPlugin.d.ts.map +1 -0
- package/bin/contact/ContactPlugin.js +407 -0
- package/bin/contact/ContactPlugin.js.map +1 -0
- package/bin/contact/Index.d.ts +8 -0
- package/bin/contact/Index.d.ts.map +1 -0
- package/bin/contact/Index.js +8 -0
- package/bin/contact/Index.js.map +1 -0
- package/bin/contact/PROMPT.d.ts +7 -0
- package/bin/contact/PROMPT.d.ts.map +1 -0
- package/bin/contact/PROMPT.js +8 -0
- package/bin/contact/PROMPT.js.map +1 -0
- package/bin/contact/runtime/ApproveCallback.d.ts +23 -0
- package/bin/contact/runtime/ApproveCallback.d.ts.map +1 -0
- package/bin/contact/runtime/ApproveCallback.js +83 -0
- package/bin/contact/runtime/ApproveCallback.js.map +1 -0
- package/bin/contact/runtime/ChatRuntime.d.ts +27 -0
- package/bin/contact/runtime/ChatRuntime.d.ts.map +1 -0
- package/bin/contact/runtime/ChatRuntime.js +60 -0
- package/bin/contact/runtime/ChatRuntime.js.map +1 -0
- package/bin/contact/runtime/ContactPayload.d.ts +17 -0
- package/bin/contact/runtime/ContactPayload.d.ts.map +1 -0
- package/bin/contact/runtime/ContactPayload.js +23 -0
- package/bin/contact/runtime/ContactPayload.js.map +1 -0
- package/bin/contact/runtime/ContactPromptAssets.d.ts +12 -0
- package/bin/contact/runtime/ContactPromptAssets.d.ts.map +1 -0
- package/bin/contact/runtime/ContactPromptAssets.js +13 -0
- package/bin/contact/runtime/ContactPromptAssets.js.map +1 -0
- package/bin/contact/runtime/ContactStore.d.ts +49 -0
- package/bin/contact/runtime/ContactStore.d.ts.map +1 -0
- package/bin/contact/runtime/ContactStore.js +255 -0
- package/bin/contact/runtime/ContactStore.js.map +1 -0
- package/bin/contact/runtime/EndpointNotice.d.ts +39 -0
- package/bin/contact/runtime/EndpointNotice.d.ts.map +1 -0
- package/bin/contact/runtime/EndpointNotice.js +98 -0
- package/bin/contact/runtime/EndpointNotice.js.map +1 -0
- package/bin/contact/runtime/EndpointResolver.d.ts +36 -0
- package/bin/contact/runtime/EndpointResolver.d.ts.map +1 -0
- package/bin/contact/runtime/EndpointResolver.js +113 -0
- package/bin/contact/runtime/EndpointResolver.js.map +1 -0
- package/bin/contact/runtime/InboxStore.d.ts +33 -0
- package/bin/contact/runtime/InboxStore.d.ts.map +1 -0
- package/bin/contact/runtime/InboxStore.js +142 -0
- package/bin/contact/runtime/InboxStore.js.map +1 -0
- package/bin/contact/runtime/LinkApproval.d.ts +20 -0
- package/bin/contact/runtime/LinkApproval.d.ts.map +1 -0
- package/bin/contact/runtime/LinkApproval.js +317 -0
- package/bin/contact/runtime/LinkApproval.js.map +1 -0
- package/bin/contact/runtime/LinkCode.d.ts +21 -0
- package/bin/contact/runtime/LinkCode.d.ts.map +1 -0
- package/bin/contact/runtime/LinkCode.js +61 -0
- package/bin/contact/runtime/LinkCode.js.map +1 -0
- package/bin/contact/runtime/LinkStore.d.ts +17 -0
- package/bin/contact/runtime/LinkStore.d.ts.map +1 -0
- package/bin/contact/runtime/LinkStore.js +39 -0
- package/bin/contact/runtime/LinkStore.js.map +1 -0
- package/bin/contact/runtime/Paths.d.ts +64 -0
- package/bin/contact/runtime/Paths.d.ts.map +1 -0
- package/bin/contact/runtime/Paths.js +103 -0
- package/bin/contact/runtime/Paths.js.map +1 -0
- package/bin/contact/runtime/RemoteClient.d.ts +46 -0
- package/bin/contact/runtime/RemoteClient.d.ts.map +1 -0
- package/bin/contact/runtime/RemoteClient.js +120 -0
- package/bin/contact/runtime/RemoteClient.js.map +1 -0
- package/bin/contact/runtime/ShareBundle.d.ts +65 -0
- package/bin/contact/runtime/ShareBundle.d.ts.map +1 -0
- package/bin/contact/runtime/ShareBundle.js +185 -0
- package/bin/contact/runtime/ShareBundle.js.map +1 -0
- package/bin/contact/runtime/SystemProvider.d.ts +5 -0
- package/bin/contact/runtime/SystemProvider.d.ts.map +1 -0
- package/bin/contact/runtime/SystemProvider.js +15 -0
- package/bin/contact/runtime/SystemProvider.js.map +1 -0
- package/bin/contact/runtime/Token.d.ts +24 -0
- package/bin/contact/runtime/Token.d.ts.map +1 -0
- package/bin/contact/runtime/Token.js +36 -0
- package/bin/contact/runtime/Token.js.map +1 -0
- package/bin/contact/types/Contact.d.ts +78 -0
- package/bin/contact/types/Contact.d.ts.map +1 -0
- package/bin/contact/types/Contact.js +9 -0
- package/bin/contact/types/Contact.js.map +1 -0
- package/bin/contact/types/ContactApproval.d.ts +145 -0
- package/bin/contact/types/ContactApproval.d.ts.map +1 -0
- package/bin/contact/types/ContactApproval.js +9 -0
- package/bin/contact/types/ContactApproval.js.map +1 -0
- package/bin/contact/types/ContactChat.d.ts +46 -0
- package/bin/contact/types/ContactChat.d.ts.map +1 -0
- package/bin/contact/types/ContactChat.js +9 -0
- package/bin/contact/types/ContactChat.js.map +1 -0
- package/bin/contact/types/ContactCheck.d.ts +66 -0
- package/bin/contact/types/ContactCheck.d.ts.map +1 -0
- package/bin/contact/types/ContactCheck.js +9 -0
- package/bin/contact/types/ContactCheck.js.map +1 -0
- package/bin/contact/types/ContactCommand.d.ts +93 -0
- package/bin/contact/types/ContactCommand.d.ts.map +1 -0
- package/bin/contact/types/ContactCommand.js +8 -0
- package/bin/contact/types/ContactCommand.js.map +1 -0
- package/bin/contact/types/ContactEndpoint.d.ts +12 -0
- package/bin/contact/types/ContactEndpoint.d.ts.map +1 -0
- package/bin/contact/types/ContactEndpoint.js +9 -0
- package/bin/contact/types/ContactEndpoint.js.map +1 -0
- package/bin/contact/types/ContactLink.d.ts +160 -0
- package/bin/contact/types/ContactLink.d.ts.map +1 -0
- package/bin/contact/types/ContactLink.js +9 -0
- package/bin/contact/types/ContactLink.js.map +1 -0
- package/bin/contact/types/ContactShare.d.ts +163 -0
- package/bin/contact/types/ContactShare.d.ts.map +1 -0
- package/bin/contact/types/ContactShare.js +9 -0
- package/bin/contact/types/ContactShare.js.map +1 -0
- package/bin/index.d.ts +25 -0
- package/bin/index.d.ts.map +1 -0
- package/bin/index.js +21 -0
- package/bin/index.js.map +1 -0
- package/bin/memory/Action.d.ts +37 -0
- package/bin/memory/Action.d.ts.map +1 -0
- package/bin/memory/Action.js +111 -0
- package/bin/memory/Action.js.map +1 -0
- package/bin/memory/Index.d.ts +9 -0
- package/bin/memory/Index.d.ts.map +1 -0
- package/bin/memory/Index.js +9 -0
- package/bin/memory/Index.js.map +1 -0
- package/bin/memory/MemoryPlugin.d.ts +45 -0
- package/bin/memory/MemoryPlugin.d.ts.map +1 -0
- package/bin/memory/MemoryPlugin.js +242 -0
- package/bin/memory/MemoryPlugin.js.map +1 -0
- package/bin/memory/runtime/Flush.d.ts +15 -0
- package/bin/memory/runtime/Flush.d.ts.map +1 -0
- package/bin/memory/runtime/Flush.js +63 -0
- package/bin/memory/runtime/Flush.js.map +1 -0
- package/bin/memory/runtime/Search.d.ts +19 -0
- package/bin/memory/runtime/Search.d.ts.map +1 -0
- package/bin/memory/runtime/Search.js +268 -0
- package/bin/memory/runtime/Search.js.map +1 -0
- package/bin/memory/runtime/Store.d.ts +65 -0
- package/bin/memory/runtime/Store.d.ts.map +1 -0
- package/bin/memory/runtime/Store.js +142 -0
- package/bin/memory/runtime/Store.js.map +1 -0
- package/bin/memory/runtime/SystemProvider.d.ts +22 -0
- package/bin/memory/runtime/SystemProvider.d.ts.map +1 -0
- package/bin/memory/runtime/SystemProvider.js +126 -0
- package/bin/memory/runtime/SystemProvider.js.map +1 -0
- package/bin/memory/runtime/Writer.d.ts +23 -0
- package/bin/memory/runtime/Writer.d.ts.map +1 -0
- package/bin/memory/runtime/Writer.js +139 -0
- package/bin/memory/runtime/Writer.js.map +1 -0
- package/bin/memory/types/Memory.d.ts +264 -0
- package/bin/memory/types/Memory.d.ts.map +1 -0
- package/bin/memory/types/Memory.js +9 -0
- package/bin/memory/types/Memory.js.map +1 -0
- package/bin/shell/Index.d.ts +9 -0
- package/bin/shell/Index.d.ts.map +1 -0
- package/bin/shell/Index.js +9 -0
- package/bin/shell/Index.js.map +1 -0
- package/bin/shell/ShellPlugin.d.ts +65 -0
- package/bin/shell/ShellPlugin.d.ts.map +1 -0
- package/bin/shell/ShellPlugin.js +138 -0
- package/bin/shell/ShellPlugin.js.map +1 -0
- package/bin/shell/ShellRuntimeTypes.d.ts +91 -0
- package/bin/shell/ShellRuntimeTypes.d.ts.map +1 -0
- package/bin/shell/ShellRuntimeTypes.js +10 -0
- package/bin/shell/ShellRuntimeTypes.js.map +1 -0
- package/bin/shell/runtime/Paths.d.ts +12 -0
- package/bin/shell/runtime/Paths.d.ts.map +1 -0
- package/bin/shell/runtime/Paths.js +21 -0
- package/bin/shell/runtime/Paths.js.map +1 -0
- package/bin/shell/runtime/ShellActionResponse.d.ts +52 -0
- package/bin/shell/runtime/ShellActionResponse.d.ts.map +1 -0
- package/bin/shell/runtime/ShellActionResponse.js +73 -0
- package/bin/shell/runtime/ShellActionResponse.js.map +1 -0
- package/bin/shell/runtime/ShellActionRuntime.d.ts +49 -0
- package/bin/shell/runtime/ShellActionRuntime.d.ts.map +1 -0
- package/bin/shell/runtime/ShellActionRuntime.js +441 -0
- package/bin/shell/runtime/ShellActionRuntime.js.map +1 -0
- package/bin/shell/runtime/ShellActionRuntimeSupport.d.ts +79 -0
- package/bin/shell/runtime/ShellActionRuntimeSupport.d.ts.map +1 -0
- package/bin/shell/runtime/ShellActionRuntimeSupport.js +314 -0
- package/bin/shell/runtime/ShellActionRuntimeSupport.js.map +1 -0
- package/bin/shell/runtime/ShellProcessEvents.d.ts +22 -0
- package/bin/shell/runtime/ShellProcessEvents.d.ts.map +1 -0
- package/bin/shell/runtime/ShellProcessEvents.js +41 -0
- package/bin/shell/runtime/ShellProcessEvents.js.map +1 -0
- package/bin/shell/runtime/ShellRuntimeEnvironment.d.ts +21 -0
- package/bin/shell/runtime/ShellRuntimeEnvironment.d.ts.map +1 -0
- package/bin/shell/runtime/ShellRuntimeEnvironment.js +67 -0
- package/bin/shell/runtime/ShellRuntimeEnvironment.js.map +1 -0
- package/bin/skill/Action.d.ts +34 -0
- package/bin/skill/Action.d.ts.map +1 -0
- package/bin/skill/Action.js +122 -0
- package/bin/skill/Action.js.map +1 -0
- package/bin/skill/Command.d.ts +37 -0
- package/bin/skill/Command.d.ts.map +1 -0
- package/bin/skill/Command.js +70 -0
- package/bin/skill/Command.js.map +1 -0
- package/bin/skill/Config.d.ts +18 -0
- package/bin/skill/Config.d.ts.map +1 -0
- package/bin/skill/Config.js +37 -0
- package/bin/skill/Config.js.map +1 -0
- package/bin/skill/PROMPT.d.ts +7 -0
- package/bin/skill/PROMPT.d.ts.map +1 -0
- package/bin/skill/PROMPT.js +8 -0
- package/bin/skill/PROMPT.js.map +1 -0
- package/bin/skill/Plugin.d.ts +18 -0
- package/bin/skill/Plugin.d.ts.map +1 -0
- package/bin/skill/Plugin.js +311 -0
- package/bin/skill/Plugin.js.map +1 -0
- package/bin/skill/SkillPromptAssets.d.ts +12 -0
- package/bin/skill/SkillPromptAssets.d.ts.map +1 -0
- package/bin/skill/SkillPromptAssets.js +13 -0
- package/bin/skill/SkillPromptAssets.js.map +1 -0
- package/bin/skill/runtime/Discovery.d.ts +25 -0
- package/bin/skill/runtime/Discovery.d.ts.map +1 -0
- package/bin/skill/runtime/Discovery.js +130 -0
- package/bin/skill/runtime/Discovery.js.map +1 -0
- package/bin/skill/runtime/Frontmatter.d.ts +6 -0
- package/bin/skill/runtime/Frontmatter.d.ts.map +1 -0
- package/bin/skill/runtime/Frontmatter.js +12 -0
- package/bin/skill/runtime/Frontmatter.js.map +1 -0
- package/bin/skill/runtime/Paths.d.ts +16 -0
- package/bin/skill/runtime/Paths.d.ts.map +1 -0
- package/bin/skill/runtime/Paths.js +111 -0
- package/bin/skill/runtime/Paths.js.map +1 -0
- package/bin/skill/runtime/Prompt.d.ts +19 -0
- package/bin/skill/runtime/Prompt.d.ts.map +1 -0
- package/bin/skill/runtime/Prompt.js +54 -0
- package/bin/skill/runtime/Prompt.js.map +1 -0
- package/bin/skill/runtime/Store.d.ts +25 -0
- package/bin/skill/runtime/Store.d.ts.map +1 -0
- package/bin/skill/runtime/Store.js +81 -0
- package/bin/skill/runtime/Store.js.map +1 -0
- package/bin/skill/runtime/SystemProvider.d.ts +24 -0
- package/bin/skill/runtime/SystemProvider.d.ts.map +1 -0
- package/bin/skill/runtime/SystemProvider.js +33 -0
- package/bin/skill/runtime/SystemProvider.js.map +1 -0
- package/bin/skill/runtime/Types.d.ts +21 -0
- package/bin/skill/runtime/Types.d.ts.map +1 -0
- package/bin/skill/runtime/Types.js +2 -0
- package/bin/skill/runtime/Types.js.map +1 -0
- package/bin/skill/runtime/Utils.d.ts +4 -0
- package/bin/skill/runtime/Utils.d.ts.map +1 -0
- package/bin/skill/runtime/Utils.js +29 -0
- package/bin/skill/runtime/Utils.js.map +1 -0
- package/bin/skill/types/ClaudeSkill.d.ts +63 -0
- package/bin/skill/types/ClaudeSkill.d.ts.map +1 -0
- package/bin/skill/types/ClaudeSkill.js +10 -0
- package/bin/skill/types/ClaudeSkill.js.map +1 -0
- package/bin/skill/types/SkillCommand.d.ts +87 -0
- package/bin/skill/types/SkillCommand.d.ts.map +1 -0
- package/bin/skill/types/SkillCommand.js +9 -0
- package/bin/skill/types/SkillCommand.js.map +1 -0
- package/bin/skill/types/SkillPlugin.d.ts +102 -0
- package/bin/skill/types/SkillPlugin.d.ts.map +1 -0
- package/bin/skill/types/SkillPlugin.js +29 -0
- package/bin/skill/types/SkillPlugin.js.map +1 -0
- package/bin/skill/types/SkillRoot.d.ts +48 -0
- package/bin/skill/types/SkillRoot.d.ts.map +1 -0
- package/bin/skill/types/SkillRoot.js +9 -0
- package/bin/skill/types/SkillRoot.js.map +1 -0
- package/bin/task/Action.d.ts +36 -0
- package/bin/task/Action.d.ts.map +1 -0
- package/bin/task/Action.js +407 -0
- package/bin/task/Action.js.map +1 -0
- package/bin/task/Index.d.ts +9 -0
- package/bin/task/Index.d.ts.map +1 -0
- package/bin/task/Index.js +9 -0
- package/bin/task/Index.js.map +1 -0
- package/bin/task/PROMPT.d.ts +7 -0
- package/bin/task/PROMPT.d.ts.map +1 -0
- package/bin/task/PROMPT.js +8 -0
- package/bin/task/PROMPT.js.map +1 -0
- package/bin/task/Scheduler.d.ts +17 -0
- package/bin/task/Scheduler.d.ts.map +1 -0
- package/bin/task/Scheduler.js +231 -0
- package/bin/task/Scheduler.js.map +1 -0
- package/bin/task/TaskPlugin.d.ts +57 -0
- package/bin/task/TaskPlugin.d.ts.map +1 -0
- package/bin/task/TaskPlugin.js +126 -0
- package/bin/task/TaskPlugin.js.map +1 -0
- package/bin/task/runtime/CronTrigger.d.ts +19 -0
- package/bin/task/runtime/CronTrigger.d.ts.map +1 -0
- package/bin/task/runtime/CronTrigger.js +93 -0
- package/bin/task/runtime/CronTrigger.js.map +1 -0
- package/bin/task/runtime/Frontmatter.d.ts +13 -0
- package/bin/task/runtime/Frontmatter.d.ts.map +1 -0
- package/bin/task/runtime/Frontmatter.js +19 -0
- package/bin/task/runtime/Frontmatter.js.map +1 -0
- package/bin/task/runtime/Model.d.ts +73 -0
- package/bin/task/runtime/Model.d.ts.map +1 -0
- package/bin/task/runtime/Model.js +312 -0
- package/bin/task/runtime/Model.js.map +1 -0
- package/bin/task/runtime/Paths.d.ts +32 -0
- package/bin/task/runtime/Paths.d.ts.map +1 -0
- package/bin/task/runtime/Paths.js +103 -0
- package/bin/task/runtime/Paths.js.map +1 -0
- package/bin/task/runtime/Runner.d.ts +43 -0
- package/bin/task/runtime/Runner.d.ts.map +1 -0
- package/bin/task/runtime/Runner.js +440 -0
- package/bin/task/runtime/Runner.js.map +1 -0
- package/bin/task/runtime/Store.d.ts +89 -0
- package/bin/task/runtime/Store.d.ts.map +1 -0
- package/bin/task/runtime/Store.js +206 -0
- package/bin/task/runtime/Store.js.map +1 -0
- package/bin/task/runtime/TaskActionExecution.d.ts +160 -0
- package/bin/task/runtime/TaskActionExecution.d.ts.map +1 -0
- package/bin/task/runtime/TaskActionExecution.js +192 -0
- package/bin/task/runtime/TaskActionExecution.js.map +1 -0
- package/bin/task/runtime/TaskActionInput.d.ts +19 -0
- package/bin/task/runtime/TaskActionInput.d.ts.map +1 -0
- package/bin/task/runtime/TaskActionInput.js +218 -0
- package/bin/task/runtime/TaskActionInput.js.map +1 -0
- package/bin/task/runtime/TaskPluginActionRegistry.d.ts +16 -0
- package/bin/task/runtime/TaskPluginActionRegistry.d.ts.map +1 -0
- package/bin/task/runtime/TaskPluginActionRegistry.js +167 -0
- package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -0
- package/bin/task/runtime/TaskPluginActions.d.ts +5 -0
- package/bin/task/runtime/TaskPluginActions.d.ts.map +1 -0
- package/bin/task/runtime/TaskPluginActions.js +5 -0
- package/bin/task/runtime/TaskPluginActions.js.map +1 -0
- package/bin/task/runtime/TaskPluginSystem.d.ts +9 -0
- package/bin/task/runtime/TaskPluginSystem.d.ts.map +1 -0
- package/bin/task/runtime/TaskPluginSystem.js +9 -0
- package/bin/task/runtime/TaskPluginSystem.js.map +1 -0
- package/bin/task/runtime/TaskPromptAssets.d.ts +12 -0
- package/bin/task/runtime/TaskPromptAssets.d.ts.map +1 -0
- package/bin/task/runtime/TaskPromptAssets.js +13 -0
- package/bin/task/runtime/TaskPromptAssets.js.map +1 -0
- package/bin/task/runtime/TaskRunArtifacts.d.ts +189 -0
- package/bin/task/runtime/TaskRunArtifacts.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunArtifacts.js +271 -0
- package/bin/task/runtime/TaskRunArtifacts.js.map +1 -0
- package/bin/task/runtime/TaskRunChatDispatch.d.ts +22 -0
- package/bin/task/runtime/TaskRunChatDispatch.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunChatDispatch.js +66 -0
- package/bin/task/runtime/TaskRunChatDispatch.js.map +1 -0
- package/bin/task/runtime/TaskRunnerProgress.d.ts +35 -0
- package/bin/task/runtime/TaskRunnerProgress.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunnerProgress.js +95 -0
- package/bin/task/runtime/TaskRunnerProgress.js.map +1 -0
- package/bin/task/runtime/TaskRunnerRound.d.ts +80 -0
- package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunnerRound.js +272 -0
- package/bin/task/runtime/TaskRunnerRound.js.map +1 -0
- package/bin/task/runtime/TaskRunnerScript.d.ts +81 -0
- package/bin/task/runtime/TaskRunnerScript.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunnerScript.js +96 -0
- package/bin/task/runtime/TaskRunnerScript.js.map +1 -0
- package/bin/task/runtime/TaskRunnerSession.d.ts +48 -0
- package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunnerSession.js +153 -0
- package/bin/task/runtime/TaskRunnerSession.js.map +1 -0
- package/bin/task/runtime/TaskRunnerTypes.d.ts +186 -0
- package/bin/task/runtime/TaskRunnerTypes.d.ts.map +1 -0
- package/bin/task/runtime/TaskRunnerTypes.js +9 -0
- package/bin/task/runtime/TaskRunnerTypes.js.map +1 -0
- package/bin/task/types/Cron.d.ts +16 -0
- package/bin/task/types/Cron.d.ts.map +1 -0
- package/bin/task/types/Cron.js +2 -0
- package/bin/task/types/Cron.js.map +1 -0
- package/bin/task/types/Task.d.ts +146 -0
- package/bin/task/types/Task.d.ts.map +1 -0
- package/bin/task/types/Task.js +9 -0
- package/bin/task/types/Task.js.map +1 -0
- package/bin/task/types/TaskCommand.d.ts +147 -0
- package/bin/task/types/TaskCommand.d.ts.map +1 -0
- package/bin/task/types/TaskCommand.js +9 -0
- package/bin/task/types/TaskCommand.js.map +1 -0
- package/bin/task/types/TaskPluginTypes.d.ts +52 -0
- package/bin/task/types/TaskPluginTypes.d.ts.map +1 -0
- package/bin/task/types/TaskPluginTypes.js +9 -0
- package/bin/task/types/TaskPluginTypes.js.map +1 -0
- package/bin/tts/Dependency.d.ts +90 -0
- package/bin/tts/Dependency.d.ts.map +1 -0
- package/bin/tts/Dependency.js +344 -0
- package/bin/tts/Dependency.js.map +1 -0
- package/bin/tts/Plugin.d.ts +17 -0
- package/bin/tts/Plugin.d.ts.map +1 -0
- package/bin/tts/Plugin.js +491 -0
- package/bin/tts/Plugin.js.map +1 -0
- package/bin/tts/PluginSupport.d.ts +25 -0
- package/bin/tts/PluginSupport.d.ts.map +1 -0
- package/bin/tts/PluginSupport.js +72 -0
- package/bin/tts/PluginSupport.js.map +1 -0
- package/bin/tts/runtime/Catalog.d.ts +21 -0
- package/bin/tts/runtime/Catalog.d.ts.map +1 -0
- package/bin/tts/runtime/Catalog.js +90 -0
- package/bin/tts/runtime/Catalog.js.map +1 -0
- package/bin/tts/runtime/DependencyInstaller.d.ts +143 -0
- package/bin/tts/runtime/DependencyInstaller.d.ts.map +1 -0
- package/bin/tts/runtime/DependencyInstaller.js +261 -0
- package/bin/tts/runtime/DependencyInstaller.js.map +1 -0
- package/bin/tts/runtime/Installer.d.ts +89 -0
- package/bin/tts/runtime/Installer.d.ts.map +1 -0
- package/bin/tts/runtime/Installer.js +188 -0
- package/bin/tts/runtime/Installer.js.map +1 -0
- package/bin/tts/runtime/Paths.d.ts +20 -0
- package/bin/tts/runtime/Paths.d.ts.map +1 -0
- package/bin/tts/runtime/Paths.js +32 -0
- package/bin/tts/runtime/Paths.js.map +1 -0
- package/bin/tts/runtime/Synthesizer.d.ts +44 -0
- package/bin/tts/runtime/Synthesizer.d.ts.map +1 -0
- package/bin/tts/runtime/Synthesizer.js +363 -0
- package/bin/tts/runtime/Synthesizer.js.map +1 -0
- package/bin/tts/types/Tts.d.ts +91 -0
- package/bin/tts/types/Tts.d.ts.map +1 -0
- package/bin/tts/types/Tts.js +9 -0
- package/bin/tts/types/Tts.js.map +1 -0
- package/bin/tts/types/TtsPlugin.d.ts +161 -0
- package/bin/tts/types/TtsPlugin.d.ts.map +1 -0
- package/bin/tts/types/TtsPlugin.js +9 -0
- package/bin/tts/types/TtsPlugin.js.map +1 -0
- package/bin/voice/Config.d.ts +43 -0
- package/bin/voice/Config.d.ts.map +1 -0
- package/bin/voice/Config.js +104 -0
- package/bin/voice/Config.js.map +1 -0
- package/bin/voice/Dependency.d.ts +77 -0
- package/bin/voice/Dependency.d.ts.map +1 -0
- package/bin/voice/Dependency.js +237 -0
- package/bin/voice/Dependency.js.map +1 -0
- package/bin/voice/InboundAugment.d.ts +17 -0
- package/bin/voice/InboundAugment.d.ts.map +1 -0
- package/bin/voice/InboundAugment.js +47 -0
- package/bin/voice/InboundAugment.js.map +1 -0
- package/bin/voice/ModelCatalog.d.ts +29 -0
- package/bin/voice/ModelCatalog.d.ts.map +1 -0
- package/bin/voice/ModelCatalog.js +25 -0
- package/bin/voice/ModelCatalog.js.map +1 -0
- package/bin/voice/runtime/Catalog.d.ts +18 -0
- package/bin/voice/runtime/Catalog.d.ts.map +1 -0
- package/bin/voice/runtime/Catalog.js +61 -0
- package/bin/voice/runtime/Catalog.js.map +1 -0
- package/bin/voice/runtime/DependencyInstaller.d.ts +145 -0
- package/bin/voice/runtime/DependencyInstaller.d.ts.map +1 -0
- package/bin/voice/runtime/DependencyInstaller.js +309 -0
- package/bin/voice/runtime/DependencyInstaller.js.map +1 -0
- package/bin/voice/runtime/Installer.d.ts +94 -0
- package/bin/voice/runtime/Installer.d.ts.map +1 -0
- package/bin/voice/runtime/Installer.js +200 -0
- package/bin/voice/runtime/Installer.js.map +1 -0
- package/bin/voice/runtime/Paths.d.ts +8 -0
- package/bin/voice/runtime/Paths.d.ts.map +1 -0
- package/bin/voice/runtime/Paths.js +26 -0
- package/bin/voice/runtime/Paths.js.map +1 -0
- package/bin/voice/runtime/Transcriber.d.ts +57 -0
- package/bin/voice/runtime/Transcriber.d.ts.map +1 -0
- package/bin/voice/runtime/Transcriber.js +329 -0
- package/bin/voice/runtime/Transcriber.js.map +1 -0
- package/bin/voice/types/Voice.d.ts +58 -0
- package/bin/voice/types/Voice.d.ts.map +1 -0
- package/bin/voice/types/Voice.js +9 -0
- package/bin/voice/types/Voice.js.map +1 -0
- package/bin/voice/types/VoicePlugin.d.ts +190 -0
- package/bin/voice/types/VoicePlugin.d.ts.map +1 -0
- package/bin/voice/types/VoicePlugin.js +9 -0
- package/bin/voice/types/VoicePlugin.js.map +1 -0
- package/bin/web/Dependency.d.ts +10 -0
- package/bin/web/Dependency.d.ts.map +1 -0
- package/bin/web/Dependency.js +10 -0
- package/bin/web/Dependency.js.map +1 -0
- package/bin/web/PROMPT.agent-browser.d.ts +7 -0
- package/bin/web/PROMPT.agent-browser.d.ts.map +1 -0
- package/bin/web/PROMPT.agent-browser.js +8 -0
- package/bin/web/PROMPT.agent-browser.js.map +1 -0
- package/bin/web/PROMPT.d.ts +7 -0
- package/bin/web/PROMPT.d.ts.map +1 -0
- package/bin/web/PROMPT.js +8 -0
- package/bin/web/PROMPT.js.map +1 -0
- package/bin/web/PROMPT.web-access.d.ts +7 -0
- package/bin/web/PROMPT.web-access.d.ts.map +1 -0
- package/bin/web/PROMPT.web-access.js +8 -0
- package/bin/web/PROMPT.web-access.js.map +1 -0
- package/bin/web/Plugin.d.ts +17 -0
- package/bin/web/Plugin.d.ts.map +1 -0
- package/bin/web/Plugin.js +478 -0
- package/bin/web/Plugin.js.map +1 -0
- package/bin/web/WebPromptAssets.d.ts +20 -0
- package/bin/web/WebPromptAssets.d.ts.map +1 -0
- package/bin/web/WebPromptAssets.js +23 -0
- package/bin/web/WebPromptAssets.js.map +1 -0
- package/bin/web/runtime/Config.d.ts +21 -0
- package/bin/web/runtime/Config.d.ts.map +1 -0
- package/bin/web/runtime/Config.js +79 -0
- package/bin/web/runtime/Config.js.map +1 -0
- package/bin/web/runtime/Source.d.ts +29 -0
- package/bin/web/runtime/Source.d.ts.map +1 -0
- package/bin/web/runtime/Source.js +209 -0
- package/bin/web/runtime/Source.js.map +1 -0
- package/bin/web/types/WebPlugin.d.ts +133 -0
- package/bin/web/types/WebPlugin.d.ts.map +1 -0
- package/bin/web/types/WebPlugin.js +12 -0
- package/bin/web/types/WebPlugin.js.map +1 -0
- package/bin/workboard/Plugin.d.ts +17 -0
- package/bin/workboard/Plugin.d.ts.map +1 -0
- package/bin/workboard/Plugin.js +81 -0
- package/bin/workboard/Plugin.js.map +1 -0
- package/bin/workboard/runtime/Collector.d.ts +14 -0
- package/bin/workboard/runtime/Collector.d.ts.map +1 -0
- package/bin/workboard/runtime/Collector.js +63 -0
- package/bin/workboard/runtime/Collector.js.map +1 -0
- package/bin/workboard/runtime/Normalizer.d.ts +61 -0
- package/bin/workboard/runtime/Normalizer.d.ts.map +1 -0
- package/bin/workboard/runtime/Normalizer.js +172 -0
- package/bin/workboard/runtime/Normalizer.js.map +1 -0
- package/bin/workboard/runtime/Store.d.ts +48 -0
- package/bin/workboard/runtime/Store.d.ts.map +1 -0
- package/bin/workboard/runtime/Store.js +84 -0
- package/bin/workboard/runtime/Store.js.map +1 -0
- package/bin/workboard/types/Workboard.d.ts +150 -0
- package/bin/workboard/types/Workboard.d.ts.map +1 -0
- package/bin/workboard/types/Workboard.js +9 -0
- package/bin/workboard/types/Workboard.js.map +1 -0
- package/package.json +42 -0
- package/src/BuiltinPlugins.ts +53 -0
- package/src/asr/Config.ts +138 -0
- package/src/asr/Dependency.ts +336 -0
- package/src/asr/InboundAugment.ts +59 -0
- package/src/asr/ModelCatalog.ts +43 -0
- package/src/asr/Plugin.ts +510 -0
- package/src/auth/Plugin.ts +221 -0
- package/src/auth/runtime/AuthorizationConfig.ts +247 -0
- package/src/auth/runtime/AuthorizationPolicy.ts +167 -0
- package/src/auth/runtime/AuthorizationStore.ts +220 -0
- package/src/auth/types/AuthPlugin.ts +545 -0
- package/src/chat/Action.ts +477 -0
- package/src/chat/ChatPlugin.ts +249 -0
- package/src/chat/ChatPluginTypes.ts +126 -0
- package/src/chat/Index.ts +8 -0
- package/src/chat/PROMPT.direct.ts +9 -0
- package/src/chat/PROMPT.direct.ts.txt +55 -0
- package/src/chat/accounts/ChannelAccountManager.ts +314 -0
- package/src/chat/accounts/Crypto.ts +83 -0
- package/src/chat/accounts/Store.ts +287 -0
- package/src/chat/channels/BaseChatChannel.ts +450 -0
- package/src/chat/channels/BaseChatChannelQueue.ts +320 -0
- package/src/chat/channels/BaseChatChannelSupport.ts +321 -0
- package/src/chat/channels/BotInfoProvider.ts +49 -0
- package/src/chat/channels/Configuration.ts +35 -0
- package/src/chat/channels/ConfigurationRegistry.ts +43 -0
- package/src/chat/channels/feishu/BotInfo.ts +199 -0
- package/src/chat/channels/feishu/Configuration.ts +65 -0
- package/src/chat/channels/feishu/Feishu.ts +467 -0
- package/src/chat/channels/feishu/FeishuInbound.ts +51 -0
- package/src/chat/channels/feishu/FeishuMessageHandler.ts +483 -0
- package/src/chat/channels/feishu/FeishuPlatformClient.ts +421 -0
- package/src/chat/channels/feishu/FeishuPlatformLookup.ts +523 -0
- package/src/chat/channels/feishu/FeishuPlatformMessaging.ts +219 -0
- package/src/chat/channels/feishu/InboundAttachment.ts +261 -0
- package/src/chat/channels/feishu/PROMPT.direct.ts +9 -0
- package/src/chat/channels/feishu/PROMPT.direct.ts.txt +5 -0
- package/src/chat/channels/feishu/PostMessage.ts +492 -0
- package/src/chat/channels/feishu/ReplyContext.ts +68 -0
- package/src/chat/channels/feishu/Shared.ts +94 -0
- package/src/chat/channels/feishu/types/FeishuChannel.ts +131 -0
- package/src/chat/channels/qq/BotInfo.ts +137 -0
- package/src/chat/channels/qq/Configuration.ts +64 -0
- package/src/chat/channels/qq/PROMPT.direct.ts +9 -0
- package/src/chat/channels/qq/PROMPT.direct.ts.txt +11 -0
- package/src/chat/channels/qq/QQ.ts +398 -0
- package/src/chat/channels/qq/QQEventCapture.ts +88 -0
- package/src/chat/channels/qq/QQGatewayAuth.ts +318 -0
- package/src/chat/channels/qq/QQGatewayClient.ts +467 -0
- package/src/chat/channels/qq/QQGatewayConnection.ts +175 -0
- package/src/chat/channels/qq/QQGatewayHeartbeat.ts +114 -0
- package/src/chat/channels/qq/QQGatewayProtocol.ts +176 -0
- package/src/chat/channels/qq/QQGatewaySend.ts +258 -0
- package/src/chat/channels/qq/QQGatewaySupport.ts +159 -0
- package/src/chat/channels/qq/QQInbound.ts +262 -0
- package/src/chat/channels/qq/QQInboundDedupe.ts +126 -0
- package/src/chat/channels/qq/QQMessageHandler.ts +465 -0
- package/src/chat/channels/qq/QQSendSupport.ts +91 -0
- package/src/chat/channels/qq/QQSupport.ts +263 -0
- package/src/chat/channels/qq/VoiceInput.ts +381 -0
- package/src/chat/channels/qq/types/QqChannel.ts +501 -0
- package/src/chat/channels/qq/types/QqGatewaySupport.ts +97 -0
- package/src/chat/channels/telegram/ApiClient.ts +373 -0
- package/src/chat/channels/telegram/Bot.ts +357 -0
- package/src/chat/channels/telegram/BotInfo.ts +92 -0
- package/src/chat/channels/telegram/Configuration.ts +65 -0
- package/src/chat/channels/telegram/Handlers.ts +91 -0
- package/src/chat/channels/telegram/PROMPT.direct.ts +9 -0
- package/src/chat/channels/telegram/PROMPT.direct.ts.txt +2 -0
- package/src/chat/channels/telegram/ReplyContext.ts +76 -0
- package/src/chat/channels/telegram/Shared.ts +404 -0
- package/src/chat/channels/telegram/StateStore.ts +58 -0
- package/src/chat/channels/telegram/TelegramInbound.ts +186 -0
- package/src/chat/channels/telegram/TelegramMessageHandler.ts +485 -0
- package/src/chat/channels/telegram/TelegramPendingUpdates.ts +204 -0
- package/src/chat/channels/telegram/TelegramPlatformClient.ts +482 -0
- package/src/chat/runtime/ChannelContextStore.ts +395 -0
- package/src/chat/runtime/ChatActionExecution.ts +362 -0
- package/src/chat/runtime/ChatActionInput.ts +167 -0
- package/src/chat/runtime/ChatActionInputSupport.ts +85 -0
- package/src/chat/runtime/ChatChannelActions.ts +308 -0
- package/src/chat/runtime/ChatChannelConfig.ts +330 -0
- package/src/chat/runtime/ChatChannelCore.ts +148 -0
- package/src/chat/runtime/ChatChannelFacade.ts +23 -0
- package/src/chat/runtime/ChatChannelLifecycle.ts +169 -0
- package/src/chat/runtime/ChatHistoryStore.ts +289 -0
- package/src/chat/runtime/ChatIngressStore.ts +68 -0
- package/src/chat/runtime/ChatMetaStore.ts +186 -0
- package/src/chat/runtime/ChatPluginActionRegistry.ts +367 -0
- package/src/chat/runtime/ChatPluginActions.ts +5 -0
- package/src/chat/runtime/ChatPluginSystem.ts +70 -0
- package/src/chat/runtime/ChatPromptAssets.ts +32 -0
- package/src/chat/runtime/ChatQueue.ts +77 -0
- package/src/chat/runtime/ChatQueueReplyDispatch.ts +191 -0
- package/src/chat/runtime/ChatQueueStore.ts +185 -0
- package/src/chat/runtime/ChatQueueWorker.ts +485 -0
- package/src/chat/runtime/ChatQueueWorkerSupport.ts +137 -0
- package/src/chat/runtime/ChatSendActionInput.ts +255 -0
- package/src/chat/runtime/ChatSendMetadata.ts +170 -0
- package/src/chat/runtime/ChatSendRegistry.ts +43 -0
- package/src/chat/runtime/ChatSession.ts +156 -0
- package/src/chat/runtime/ChatSessionContextComposer.ts +106 -0
- package/src/chat/runtime/ChatSessionDelete.ts +95 -0
- package/src/chat/runtime/ChatSessionTypes.ts +32 -0
- package/src/chat/runtime/ChatkeySend.ts +187 -0
- package/src/chat/runtime/DirectDispatchParser.ts +158 -0
- package/src/chat/runtime/EnqueueDispatch.ts +49 -0
- package/src/chat/runtime/InboundAugment.ts +63 -0
- package/src/chat/runtime/PluginDispatch.ts +89 -0
- package/src/chat/runtime/PluginPoints.ts +78 -0
- package/src/chat/runtime/QueuedUserMessage.ts +43 -0
- package/src/chat/runtime/ReplyContextFormatter.ts +85 -0
- package/src/chat/runtime/ReplyDispatch.ts +78 -0
- package/src/chat/runtime/SystemPrompt.ts +84 -0
- package/src/chat/types/BotInfo.ts +101 -0
- package/src/chat/types/ChannelAccount.ts +232 -0
- package/src/chat/types/ChannelConfiguration.ts +161 -0
- package/src/chat/types/ChannelContext.ts +110 -0
- package/src/chat/types/ChannelStatus.ts +98 -0
- package/src/chat/types/ChatCommand.ts +174 -0
- package/src/chat/types/ChatDispatcher.ts +42 -0
- package/src/chat/types/ChatHistory.ts +42 -0
- package/src/chat/types/ChatMeta.ts +35 -0
- package/src/chat/types/ChatPlugin.ts +251 -0
- package/src/chat/types/ChatPluginActionPayload.ts +165 -0
- package/src/chat/types/ChatPromptContext.ts +139 -0
- package/src/chat/types/ChatQueue.ts +41 -0
- package/src/chat/types/ChatQueueWorker.ts +25 -0
- package/src/chat/types/ChatRuntime.ts +33 -0
- package/src/chat/types/DirectDispatch.ts +133 -0
- package/src/chat/types/FeishuAttachment.ts +50 -0
- package/src/chat/types/FeishuInboundAttachment.ts +138 -0
- package/src/chat/types/FeishuPost.ts +338 -0
- package/src/chat/types/QqInboundDedupe.ts +12 -0
- package/src/chat/types/QqVoice.ts +126 -0
- package/src/chat/types/ReplyContext.ts +49 -0
- package/src/contact/Action.ts +316 -0
- package/src/contact/ContactPlugin.ts +503 -0
- package/src/contact/Index.ts +8 -0
- package/src/contact/PROMPT.ts +9 -0
- package/src/contact/PROMPT.ts.txt +25 -0
- package/src/contact/runtime/ApproveCallback.ts +97 -0
- package/src/contact/runtime/ChatRuntime.ts +83 -0
- package/src/contact/runtime/ContactPayload.ts +26 -0
- package/src/contact/runtime/ContactPromptAssets.ts +14 -0
- package/src/contact/runtime/ContactStore.ts +299 -0
- package/src/contact/runtime/EndpointNotice.ts +125 -0
- package/src/contact/runtime/EndpointResolver.ts +146 -0
- package/src/contact/runtime/InboxStore.ts +178 -0
- package/src/contact/runtime/LinkApproval.ts +387 -0
- package/src/contact/runtime/LinkCode.ts +70 -0
- package/src/contact/runtime/LinkStore.ts +50 -0
- package/src/contact/runtime/Paths.ts +139 -0
- package/src/contact/runtime/RemoteClient.ts +158 -0
- package/src/contact/runtime/ShareBundle.ts +286 -0
- package/src/contact/runtime/SystemProvider.ts +15 -0
- package/src/contact/runtime/Token.ts +40 -0
- package/src/contact/types/Contact.ts +82 -0
- package/src/contact/types/ContactApproval.ts +150 -0
- package/src/contact/types/ContactChat.ts +47 -0
- package/src/contact/types/ContactCheck.ts +67 -0
- package/src/contact/types/ContactCommand.ts +98 -0
- package/src/contact/types/ContactEndpoint.ts +16 -0
- package/src/contact/types/ContactLink.ts +169 -0
- package/src/contact/types/ContactShare.ts +172 -0
- package/src/index.ts +64 -0
- package/src/memory/Action.ts +147 -0
- package/src/memory/Index.ts +9 -0
- package/src/memory/MemoryPlugin.ts +270 -0
- package/src/memory/runtime/Flush.ts +83 -0
- package/src/memory/runtime/Search.ts +330 -0
- package/src/memory/runtime/Store.ts +198 -0
- package/src/memory/runtime/SystemProvider.ts +145 -0
- package/src/memory/runtime/Writer.ts +173 -0
- package/src/memory/types/Memory.ts +284 -0
- package/src/shell/Index.ts +9 -0
- package/src/shell/ShellPlugin.ts +199 -0
- package/src/shell/ShellRuntimeTypes.ts +94 -0
- package/src/shell/runtime/Paths.ts +28 -0
- package/src/shell/runtime/ShellActionResponse.ts +135 -0
- package/src/shell/runtime/ShellActionRuntime.ts +545 -0
- package/src/shell/runtime/ShellActionRuntimeSupport.ts +386 -0
- package/src/shell/runtime/ShellProcessEvents.ts +65 -0
- package/src/shell/runtime/ShellRuntimeEnvironment.ts +67 -0
- package/src/skill/Action.ts +159 -0
- package/src/skill/Command.ts +98 -0
- package/src/skill/Config.ts +51 -0
- package/src/skill/PROMPT.ts +9 -0
- package/src/skill/PROMPT.ts.txt +10 -0
- package/src/skill/Plugin.ts +347 -0
- package/src/skill/SkillPromptAssets.ts +14 -0
- package/src/skill/runtime/Discovery.ts +141 -0
- package/src/skill/runtime/Frontmatter.ts +17 -0
- package/src/skill/runtime/Paths.ts +130 -0
- package/src/skill/runtime/Prompt.ts +67 -0
- package/src/skill/runtime/Store.ts +95 -0
- package/src/skill/runtime/SystemProvider.ts +52 -0
- package/src/skill/runtime/Types.ts +22 -0
- package/src/skill/runtime/Utils.ts +28 -0
- package/src/skill/types/ClaudeSkill.ts +64 -0
- package/src/skill/types/SkillCommand.ts +90 -0
- package/src/skill/types/SkillPlugin.ts +107 -0
- package/src/skill/types/SkillRoot.ts +49 -0
- package/src/task/Action.ts +491 -0
- package/src/task/Index.ts +8 -0
- package/src/task/PROMPT.ts +9 -0
- package/src/task/PROMPT.ts.txt +237 -0
- package/src/task/Scheduler.ts +245 -0
- package/src/task/TaskPlugin.ts +167 -0
- package/src/task/runtime/CronTrigger.ts +110 -0
- package/src/task/runtime/Frontmatter.ts +24 -0
- package/src/task/runtime/Model.ts +347 -0
- package/src/task/runtime/Paths.ts +116 -0
- package/src/task/runtime/Runner.ts +519 -0
- package/src/task/runtime/Store.ts +253 -0
- package/src/task/runtime/TaskActionExecution.ts +276 -0
- package/src/task/runtime/TaskActionInput.ts +281 -0
- package/src/task/runtime/TaskPluginActionRegistry.ts +214 -0
- package/src/task/runtime/TaskPluginActions.ts +5 -0
- package/src/task/runtime/TaskPluginSystem.ts +8 -0
- package/src/task/runtime/TaskPromptAssets.ts +14 -0
- package/src/task/runtime/TaskRunArtifacts.ts +493 -0
- package/src/task/runtime/TaskRunChatDispatch.ts +81 -0
- package/src/task/runtime/TaskRunnerProgress.ts +112 -0
- package/src/task/runtime/TaskRunnerRound.ts +337 -0
- package/src/task/runtime/TaskRunnerScript.ts +175 -0
- package/src/task/runtime/TaskRunnerSession.ts +190 -0
- package/src/task/runtime/TaskRunnerTypes.ts +199 -0
- package/src/task/types/Cron.ts +16 -0
- package/src/task/types/Task.ts +157 -0
- package/src/task/types/TaskCommand.ts +165 -0
- package/src/task/types/TaskPluginTypes.ts +55 -0
- package/src/tts/Dependency.ts +473 -0
- package/src/tts/Plugin.ts +518 -0
- package/src/tts/PluginSupport.ts +85 -0
- package/src/tts/runtime/Catalog.ts +97 -0
- package/src/tts/runtime/DependencyInstaller.ts +436 -0
- package/src/tts/runtime/Installer.ts +297 -0
- package/src/tts/runtime/Paths.ts +39 -0
- package/src/tts/runtime/Synthesizer.ts +480 -0
- package/src/tts/types/Tts.ts +99 -0
- package/src/tts/types/TtsPlugin.ts +164 -0
- package/src/voice/Config.ts +135 -0
- package/src/voice/Dependency.ts +329 -0
- package/src/voice/InboundAugment.ts +59 -0
- package/src/voice/ModelCatalog.ts +43 -0
- package/src/voice/runtime/Catalog.ts +68 -0
- package/src/voice/runtime/DependencyInstaller.ts +505 -0
- package/src/voice/runtime/Installer.ts +324 -0
- package/src/voice/runtime/Paths.ts +26 -0
- package/src/voice/runtime/Transcriber.ts +467 -0
- package/src/voice/types/Voice.ts +68 -0
- package/src/voice/types/VoicePlugin.ts +194 -0
- package/src/web/Dependency.ts +17 -0
- package/src/web/PROMPT.agent-browser.ts +9 -0
- package/src/web/PROMPT.agent-browser.ts.txt +17 -0
- package/src/web/PROMPT.ts +9 -0
- package/src/web/PROMPT.ts.txt +33 -0
- package/src/web/PROMPT.web-access.ts +9 -0
- package/src/web/PROMPT.web-access.ts.txt +13 -0
- package/src/web/Plugin.ts +523 -0
- package/src/web/WebPromptAssets.ts +26 -0
- package/src/web/runtime/Config.ts +105 -0
- package/src/web/runtime/Source.ts +257 -0
- package/src/web/types/WebPlugin.ts +141 -0
- package/src/workboard/Plugin.ts +94 -0
- package/src/workboard/runtime/Collector.ts +79 -0
- package/src/workboard/runtime/Normalizer.ts +213 -0
- package/src/workboard/runtime/Store.ts +110 -0
- package/src/workboard/types/Workboard.ts +158 -0
- package/tsconfig.json +26 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat channel account 管理器。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 统一封装 agent 运行时下 chat channel account 的 CRUD 与探测。
|
|
6
|
+
* - 账号凭据只在写入路径接收明文;列表与读取路径返回脱敏结果。
|
|
7
|
+
* - city / vibecape 等上层产品都应直接复用这个实现,而不是各自维护副本。
|
|
8
|
+
*/
|
|
9
|
+
import crypto from "node:crypto";
|
|
10
|
+
import { resolveChatChannelBotInfo } from "../../chat/channels/BotInfoProvider.js";
|
|
11
|
+
import { getStoredChannelAccountSync, listStoredChannelAccountsSync, normalizeChannelAccountChannel, removeStoredChannelAccount, upsertStoredChannelAccount, } from "./Store.js";
|
|
12
|
+
const SUPPORTED_CHANNELS = [
|
|
13
|
+
"telegram",
|
|
14
|
+
"feishu",
|
|
15
|
+
"qq",
|
|
16
|
+
];
|
|
17
|
+
function maskSecret(value) {
|
|
18
|
+
const raw = String(value || "").trim();
|
|
19
|
+
if (!raw)
|
|
20
|
+
return "";
|
|
21
|
+
if (raw.length <= 8)
|
|
22
|
+
return "***";
|
|
23
|
+
return `${raw.slice(0, 4)}***${raw.slice(-4)}`;
|
|
24
|
+
}
|
|
25
|
+
function assertChannel(input) {
|
|
26
|
+
const channel = String(input || "").trim().toLowerCase();
|
|
27
|
+
if (!SUPPORTED_CHANNELS.includes(channel)) {
|
|
28
|
+
throw new Error(`Unsupported channel: ${input}. Supported: ${SUPPORTED_CHANNELS.join(", ")}`);
|
|
29
|
+
}
|
|
30
|
+
return channel;
|
|
31
|
+
}
|
|
32
|
+
function normalizeOptionalText(value) {
|
|
33
|
+
const text = String(value || "").trim();
|
|
34
|
+
return text || undefined;
|
|
35
|
+
}
|
|
36
|
+
function normalizeChannelAccountIdToken(value) {
|
|
37
|
+
const token = String(value || "")
|
|
38
|
+
.trim()
|
|
39
|
+
.toLowerCase()
|
|
40
|
+
.replace(/[^a-z0-9_-]+/g, "-")
|
|
41
|
+
.replace(/-+/g, "-")
|
|
42
|
+
.replace(/^-+/, "")
|
|
43
|
+
.replace(/-+$/, "");
|
|
44
|
+
return token || "bot";
|
|
45
|
+
}
|
|
46
|
+
function pickFirstNonEmpty(inputs) {
|
|
47
|
+
for (const input of inputs) {
|
|
48
|
+
const text = String(input || "").trim();
|
|
49
|
+
if (text)
|
|
50
|
+
return text;
|
|
51
|
+
}
|
|
52
|
+
return "";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* ChatChannelAccountManager。
|
|
56
|
+
*/
|
|
57
|
+
export class ChatChannelAccountManager {
|
|
58
|
+
constructor() { }
|
|
59
|
+
/**
|
|
60
|
+
* 生成唯一 channel account id。
|
|
61
|
+
*
|
|
62
|
+
* 关键点(中文)
|
|
63
|
+
* - 账号 id 统一由系统生成,避免用户手填导致冲突或命名不一致。
|
|
64
|
+
* - 若碰撞则自动追加随机后缀重试。
|
|
65
|
+
*/
|
|
66
|
+
async generateUniqueAccountId(params) {
|
|
67
|
+
const seed = normalizeChannelAccountIdToken(params.seed || "");
|
|
68
|
+
const prefix = `${params.channel}-${seed}`.slice(0, 36);
|
|
69
|
+
for (let index = 0; index < 8; index += 1) {
|
|
70
|
+
const suffix = crypto.randomBytes(3).toString("hex");
|
|
71
|
+
const candidate = `${prefix}-${suffix}`.slice(0, 64);
|
|
72
|
+
const existing = getStoredChannelAccountSync(candidate);
|
|
73
|
+
if (!existing)
|
|
74
|
+
return candidate;
|
|
75
|
+
}
|
|
76
|
+
return `${params.channel}-${Date.now().toString(36)}`;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* 探测 bot 凭据并返回自动填充信息。
|
|
80
|
+
*/
|
|
81
|
+
async probe(input) {
|
|
82
|
+
const channel = assertChannel(input.channel);
|
|
83
|
+
const botInfo = await resolveChatChannelBotInfo({
|
|
84
|
+
channel,
|
|
85
|
+
credentials: {
|
|
86
|
+
botToken: normalizeOptionalText(input.botToken),
|
|
87
|
+
appId: normalizeOptionalText(input.appId),
|
|
88
|
+
appSecret: normalizeOptionalText(input.appSecret),
|
|
89
|
+
domain: normalizeOptionalText(input.domain),
|
|
90
|
+
sandbox: input.sandbox === true,
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
const accountId = await this.generateUniqueAccountId({
|
|
94
|
+
channel,
|
|
95
|
+
seed: pickFirstNonEmpty([
|
|
96
|
+
botInfo.idSeed,
|
|
97
|
+
botInfo.botUserId,
|
|
98
|
+
botInfo.identity,
|
|
99
|
+
botInfo.name,
|
|
100
|
+
"bot",
|
|
101
|
+
]),
|
|
102
|
+
});
|
|
103
|
+
return {
|
|
104
|
+
channel,
|
|
105
|
+
accountId,
|
|
106
|
+
name: botInfo.name,
|
|
107
|
+
identity: botInfo.identity,
|
|
108
|
+
owner: botInfo.owner,
|
|
109
|
+
creator: botInfo.creator,
|
|
110
|
+
botUserId: botInfo.botUserId,
|
|
111
|
+
message: botInfo.message,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 使用凭据创建账号。
|
|
116
|
+
*
|
|
117
|
+
* 关键点(中文)
|
|
118
|
+
* - 默认先尝试探测 bot 信息,成功时自动填充名称与身份。
|
|
119
|
+
* - 探测失败但用户提供了名称时,仍允许先保存,便于后续排障。
|
|
120
|
+
*/
|
|
121
|
+
async create(input) {
|
|
122
|
+
const channel = assertChannel(input.channel);
|
|
123
|
+
let probeResult = null;
|
|
124
|
+
if (input.probe !== false) {
|
|
125
|
+
try {
|
|
126
|
+
probeResult = await this.probe({
|
|
127
|
+
channel,
|
|
128
|
+
botToken: input.botToken,
|
|
129
|
+
appId: input.appId,
|
|
130
|
+
appSecret: input.appSecret,
|
|
131
|
+
domain: input.domain,
|
|
132
|
+
sandbox: input.sandbox,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
catch (error) {
|
|
136
|
+
if (!normalizeOptionalText(input.name)) {
|
|
137
|
+
throw error;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
const id = probeResult?.accountId ||
|
|
142
|
+
(await this.generateUniqueAccountId({
|
|
143
|
+
channel,
|
|
144
|
+
seed: pickFirstNonEmpty([input.name, input.appId, "bot"]),
|
|
145
|
+
}));
|
|
146
|
+
const name = normalizeOptionalText(input.name) || probeResult?.name || `${channel} bot`;
|
|
147
|
+
await this.upsert({
|
|
148
|
+
id,
|
|
149
|
+
channel,
|
|
150
|
+
name,
|
|
151
|
+
identity: probeResult?.identity,
|
|
152
|
+
owner: probeResult?.owner,
|
|
153
|
+
creator: probeResult?.creator,
|
|
154
|
+
botToken: input.botToken,
|
|
155
|
+
appId: input.appId,
|
|
156
|
+
appSecret: input.appSecret,
|
|
157
|
+
domain: input.domain,
|
|
158
|
+
sandbox: input.sandbox,
|
|
159
|
+
});
|
|
160
|
+
return {
|
|
161
|
+
id,
|
|
162
|
+
probed: Boolean(probeResult),
|
|
163
|
+
message: probeResult?.message,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 列出账户池(脱敏)。
|
|
168
|
+
*/
|
|
169
|
+
async list() {
|
|
170
|
+
return {
|
|
171
|
+
items: listStoredChannelAccountsSync().map((account) => toChannelAccountListItem(account)),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* 新增或更新账号。
|
|
176
|
+
*/
|
|
177
|
+
async upsert(input) {
|
|
178
|
+
const id = String(input.id || "").trim();
|
|
179
|
+
if (!id)
|
|
180
|
+
throw new Error("channel account id cannot be empty");
|
|
181
|
+
const name = String(input.name || "").trim();
|
|
182
|
+
if (!name)
|
|
183
|
+
throw new Error("channel account name cannot be empty");
|
|
184
|
+
const channel = normalizeChannelAccountChannel(input.channel);
|
|
185
|
+
if (input.botToken !== undefined && input.clearBotToken === true) {
|
|
186
|
+
throw new Error("botToken and clearBotToken cannot be used together");
|
|
187
|
+
}
|
|
188
|
+
if (input.appId !== undefined && input.clearAppId === true) {
|
|
189
|
+
throw new Error("appId and clearAppId cannot be used together");
|
|
190
|
+
}
|
|
191
|
+
if (input.appSecret !== undefined && input.clearAppSecret === true) {
|
|
192
|
+
throw new Error("appSecret and clearAppSecret cannot be used together");
|
|
193
|
+
}
|
|
194
|
+
const current = getStoredChannelAccountSync(id);
|
|
195
|
+
const nextBotToken = input.clearBotToken
|
|
196
|
+
? undefined
|
|
197
|
+
: input.botToken !== undefined
|
|
198
|
+
? normalizeOptionalText(input.botToken)
|
|
199
|
+
: current?.botToken;
|
|
200
|
+
const nextAppId = input.clearAppId
|
|
201
|
+
? undefined
|
|
202
|
+
: input.appId !== undefined
|
|
203
|
+
? normalizeOptionalText(input.appId)
|
|
204
|
+
: current?.appId;
|
|
205
|
+
const nextAppSecret = input.clearAppSecret
|
|
206
|
+
? undefined
|
|
207
|
+
: input.appSecret !== undefined
|
|
208
|
+
? normalizeOptionalText(input.appSecret)
|
|
209
|
+
: current?.appSecret;
|
|
210
|
+
const nextIdentity = Object.prototype.hasOwnProperty.call(input, "identity")
|
|
211
|
+
? normalizeOptionalText(input.identity)
|
|
212
|
+
: current?.identity;
|
|
213
|
+
const nextOwner = Object.prototype.hasOwnProperty.call(input, "owner")
|
|
214
|
+
? normalizeOptionalText(input.owner)
|
|
215
|
+
: current?.owner;
|
|
216
|
+
const nextCreator = Object.prototype.hasOwnProperty.call(input, "creator")
|
|
217
|
+
? normalizeOptionalText(input.creator)
|
|
218
|
+
: current?.creator;
|
|
219
|
+
await upsertStoredChannelAccount({
|
|
220
|
+
id,
|
|
221
|
+
channel,
|
|
222
|
+
name,
|
|
223
|
+
identity: nextIdentity,
|
|
224
|
+
owner: nextOwner,
|
|
225
|
+
creator: nextCreator,
|
|
226
|
+
botToken: nextBotToken,
|
|
227
|
+
appId: nextAppId,
|
|
228
|
+
appSecret: nextAppSecret,
|
|
229
|
+
domain: normalizeOptionalText(input.domain),
|
|
230
|
+
sandbox: input.sandbox === true,
|
|
231
|
+
});
|
|
232
|
+
return { id };
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* 删除账号。
|
|
236
|
+
*/
|
|
237
|
+
async remove(idInput) {
|
|
238
|
+
const id = String(idInput || "").trim();
|
|
239
|
+
if (!id)
|
|
240
|
+
throw new Error("channel account id cannot be empty");
|
|
241
|
+
await removeStoredChannelAccount(id);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
function toChannelAccountListItem(account) {
|
|
245
|
+
return {
|
|
246
|
+
id: account.id,
|
|
247
|
+
channel: account.channel,
|
|
248
|
+
name: account.name,
|
|
249
|
+
identity: account.identity,
|
|
250
|
+
owner: account.owner,
|
|
251
|
+
creator: account.creator,
|
|
252
|
+
domain: account.domain,
|
|
253
|
+
sandbox: account.sandbox === true,
|
|
254
|
+
hasBotToken: !!String(account.botToken || "").trim(),
|
|
255
|
+
hasAppId: !!String(account.appId || "").trim(),
|
|
256
|
+
hasAppSecret: !!String(account.appSecret || "").trim(),
|
|
257
|
+
botTokenMasked: maskSecret(account.botToken),
|
|
258
|
+
appIdMasked: maskSecret(account.appId),
|
|
259
|
+
appSecretMasked: maskSecret(account.appSecret),
|
|
260
|
+
createdAt: account.createdAt,
|
|
261
|
+
updatedAt: account.updatedAt,
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
//# sourceMappingURL=ChannelAccountManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChannelAccountManager.js","sourceRoot":"","sources":["../../../src/chat/accounts/ChannelAccountManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC/E,OAAO,EACL,2BAA2B,EAC3B,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AAUpB,MAAM,kBAAkB,GAA2C;IACjE,UAAU;IACV,QAAQ;IACR,IAAI;CACL,CAAC;AAEF,SAAS,UAAU,CAAC,KAAyB;IAC3C,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACvC,IAAI,CAAC,GAAG;QAAE,OAAO,EAAE,CAAC;IACpB,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IAClC,OAAO,GAAG,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1
|
+
/**
|
|
2
|
+
* Channel account 默认存储加密工具。
|
|
3
|
+
*
|
|
4
|
+
* 职责说明(中文)
|
|
5
|
+
* - 负责默认 channel account 存储中的敏感字段加解密。
|
|
6
|
+
* - 默认复用平台级 `model-db.key`,保证和现有 `~/.downcity/downcity.db` 数据兼容。
|
|
7
|
+
*
|
|
8
|
+
* 边界说明(中文)
|
|
9
|
+
* - 这里只处理“字符串 <-> 密文”的转换,不负责数据库读写。
|
|
10
|
+
* - 加密算法与密钥文件路径属于默认实现细节,上层不直接感知。
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 同步加密字符串。
|
|
14
|
+
*/
|
|
15
|
+
export declare function encryptTextSync(plainText: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* 同步解密字符串。
|
|
18
|
+
*/
|
|
19
|
+
export declare function decryptTextSync(cipherText: string): string;
|
|
20
|
+
//# sourceMappingURL=Crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Crypto.d.ts","sourceRoot":"","sources":["../../../src/chat/accounts/Crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AA4CH;;GAEG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAOzD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAa1D"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel account 默认存储加密工具。
|
|
3
|
+
*
|
|
4
|
+
* 职责说明(中文)
|
|
5
|
+
* - 负责默认 channel account 存储中的敏感字段加解密。
|
|
6
|
+
* - 默认复用平台级 `model-db.key`,保证和现有 `~/.downcity/downcity.db` 数据兼容。
|
|
7
|
+
*
|
|
8
|
+
* 边界说明(中文)
|
|
9
|
+
* - 这里只处理“字符串 <-> 密文”的转换,不负责数据库读写。
|
|
10
|
+
* - 加密算法与密钥文件路径属于默认实现细节,上层不直接感知。
|
|
11
|
+
*/
|
|
12
|
+
import crypto from "node:crypto";
|
|
13
|
+
import fs from "fs-extra";
|
|
14
|
+
import path from "node:path";
|
|
15
|
+
import { getPlatformStoreKeyPath } from "@downcity/agent/internal/config/PlatformPaths.js";
|
|
16
|
+
const ENCRYPTION_ALGO = "aes-256-gcm";
|
|
17
|
+
let cachedKey = null;
|
|
18
|
+
function resolveKeyFilePathSync() {
|
|
19
|
+
const keyPath = getPlatformStoreKeyPath();
|
|
20
|
+
fs.ensureDirSync(path.dirname(keyPath));
|
|
21
|
+
return keyPath;
|
|
22
|
+
}
|
|
23
|
+
function loadOrCreateKeySync() {
|
|
24
|
+
if (cachedKey)
|
|
25
|
+
return cachedKey;
|
|
26
|
+
const envKey = String(process.env.DC_MODEL_DB_KEY || "").trim();
|
|
27
|
+
if (envKey) {
|
|
28
|
+
cachedKey = crypto.createHash("sha256").update(envKey, "utf8").digest();
|
|
29
|
+
return cachedKey;
|
|
30
|
+
}
|
|
31
|
+
const keyPath = resolveKeyFilePathSync();
|
|
32
|
+
if (fs.existsSync(keyPath)) {
|
|
33
|
+
const raw = String(fs.readFileSync(keyPath, "utf8")).trim();
|
|
34
|
+
if (raw) {
|
|
35
|
+
const parsed = Buffer.from(raw, "base64");
|
|
36
|
+
if (parsed.length === 32) {
|
|
37
|
+
cachedKey = parsed;
|
|
38
|
+
return cachedKey;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
const next = crypto.randomBytes(32);
|
|
43
|
+
fs.writeFileSync(keyPath, next.toString("base64"), { mode: 0o600 });
|
|
44
|
+
cachedKey = next;
|
|
45
|
+
return cachedKey;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* 同步加密字符串。
|
|
49
|
+
*/
|
|
50
|
+
export function encryptTextSync(plainText) {
|
|
51
|
+
const key = loadOrCreateKeySync();
|
|
52
|
+
const iv = crypto.randomBytes(12);
|
|
53
|
+
const cipher = crypto.createCipheriv(ENCRYPTION_ALGO, key, iv);
|
|
54
|
+
const encrypted = Buffer.concat([cipher.update(plainText, "utf8"), cipher.final()]);
|
|
55
|
+
const tag = cipher.getAuthTag();
|
|
56
|
+
return Buffer.concat([iv, tag, encrypted]).toString("base64");
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* 同步解密字符串。
|
|
60
|
+
*/
|
|
61
|
+
export function decryptTextSync(cipherText) {
|
|
62
|
+
const key = loadOrCreateKeySync();
|
|
63
|
+
const packed = Buffer.from(cipherText, "base64");
|
|
64
|
+
if (packed.length < 28) {
|
|
65
|
+
throw new Error("Invalid encrypted payload");
|
|
66
|
+
}
|
|
67
|
+
const iv = packed.subarray(0, 12);
|
|
68
|
+
const tag = packed.subarray(12, 28);
|
|
69
|
+
const body = packed.subarray(28);
|
|
70
|
+
const decipher = crypto.createDecipheriv(ENCRYPTION_ALGO, key, iv);
|
|
71
|
+
decipher.setAuthTag(tag);
|
|
72
|
+
const plain = Buffer.concat([decipher.update(body), decipher.final()]);
|
|
73
|
+
return plain.toString("utf8");
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=Crypto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Crypto.js","sourceRoot":"","sources":["../../../src/chat/accounts/Crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAE3F,MAAM,eAAe,GAAG,aAAa,CAAC;AAEtC,IAAI,SAAS,GAAkB,IAAI,CAAC;AAEpC,SAAS,sBAAsB;IAC7B,MAAM,OAAO,GAAG,uBAAuB,EAAE,CAAC;IAC1C,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IACx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,EAAE,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;IACvE,OAAO,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel account 默认存储实现。
|
|
3
|
+
*
|
|
4
|
+
* 职责说明(中文)
|
|
5
|
+
* - 提供 `chat` plugin 默认使用的全局 channel account 读写能力。
|
|
6
|
+
* - 默认直接操作 `~/.downcity/downcity.db` 里的 `channel_accounts` 表。
|
|
7
|
+
* - 对 `city` 而言,这里也是统一的默认账号池实现来源。
|
|
8
|
+
*
|
|
9
|
+
* 边界说明(中文)
|
|
10
|
+
* - 这里只负责 channel account 这一个表,不扩展成通用平台数据库门面。
|
|
11
|
+
* - 模型池、env、其他平台级配置仍由各自模块独立管理。
|
|
12
|
+
*/
|
|
13
|
+
import type { StoredChannelAccount, StoredChannelAccountChannel, UpsertChannelAccountInput } from "@downcity/agent/internal/types/runtime/host/Store.js";
|
|
14
|
+
/**
|
|
15
|
+
* 规范化 channel 类型。
|
|
16
|
+
*/
|
|
17
|
+
export declare function normalizeChannelAccountChannel(input: string): StoredChannelAccountChannel;
|
|
18
|
+
/**
|
|
19
|
+
* 同步列出全部 channel account。
|
|
20
|
+
*/
|
|
21
|
+
export declare function listStoredChannelAccountsSync(channelInput?: string): StoredChannelAccount[];
|
|
22
|
+
/**
|
|
23
|
+
* 同步按 ID 读取单个 channel account。
|
|
24
|
+
*/
|
|
25
|
+
export declare function getStoredChannelAccountSync(accountIdInput: string): StoredChannelAccount | null;
|
|
26
|
+
/**
|
|
27
|
+
* 新增或更新 channel account。
|
|
28
|
+
*
|
|
29
|
+
* 关键点(中文)
|
|
30
|
+
* - 这里保留和现有平台库一致的落盘结构,避免默认实现切换后出现数据断层。
|
|
31
|
+
* - 未显式传入的敏感字段会保留旧值,便于 CLI 局部更新。
|
|
32
|
+
*/
|
|
33
|
+
export declare function upsertStoredChannelAccount(input: UpsertChannelAccountInput): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* 删除单个 channel account。
|
|
36
|
+
*/
|
|
37
|
+
export declare function removeStoredChannelAccount(accountIdInput: string): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=Store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Store.d.ts","sourceRoot":"","sources":["../../../src/chat/accounts/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAOH,OAAO,KAAK,EACV,oBAAoB,EACpB,2BAA2B,EAC3B,yBAAyB,EAC1B,MAAM,sDAAsD,CAAC;AAmB9D;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,GACZ,2BAA2B,CAM7B;AAuFD;;GAEG;AACH,wBAAgB,6BAA6B,CAC3C,YAAY,CAAC,EAAE,MAAM,GACpB,oBAAoB,EAAE,CAiCxB;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,MAAM,GACrB,oBAAoB,GAAG,IAAI,CAgB7B;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,KAAK,EAAE,yBAAyB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA+Df;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC9C,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Channel account 默认存储实现。
|
|
3
|
+
*
|
|
4
|
+
* 职责说明(中文)
|
|
5
|
+
* - 提供 `chat` plugin 默认使用的全局 channel account 读写能力。
|
|
6
|
+
* - 默认直接操作 `~/.downcity/downcity.db` 里的 `channel_accounts` 表。
|
|
7
|
+
* - 对 `city` 而言,这里也是统一的默认账号池实现来源。
|
|
8
|
+
*
|
|
9
|
+
* 边界说明(中文)
|
|
10
|
+
* - 这里只负责 channel account 这一个表,不扩展成通用平台数据库门面。
|
|
11
|
+
* - 模型池、env、其他平台级配置仍由各自模块独立管理。
|
|
12
|
+
*/
|
|
13
|
+
import Database from "better-sqlite3";
|
|
14
|
+
import fs from "fs-extra";
|
|
15
|
+
import path from "node:path";
|
|
16
|
+
import { getPlatformStoreDbPath } from "@downcity/agent/internal/config/PlatformPaths.js";
|
|
17
|
+
import { decryptTextSync, encryptTextSync } from "./Crypto.js";
|
|
18
|
+
function nowIso() {
|
|
19
|
+
return new Date().toISOString();
|
|
20
|
+
}
|
|
21
|
+
function normalizeNonEmptyText(value, fieldName) {
|
|
22
|
+
const normalized = String(value || "").trim();
|
|
23
|
+
if (!normalized) {
|
|
24
|
+
throw new Error(`${fieldName} cannot be empty`);
|
|
25
|
+
}
|
|
26
|
+
return normalized;
|
|
27
|
+
}
|
|
28
|
+
function optionalTrimmedText(value) {
|
|
29
|
+
const normalized = String(value || "").trim();
|
|
30
|
+
return normalized || undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* 规范化 channel 类型。
|
|
34
|
+
*/
|
|
35
|
+
export function normalizeChannelAccountChannel(input) {
|
|
36
|
+
const channel = String(input || "").trim().toLowerCase();
|
|
37
|
+
if (channel === "telegram" || channel === "feishu" || channel === "qq") {
|
|
38
|
+
return channel;
|
|
39
|
+
}
|
|
40
|
+
throw new Error(`Unsupported channel account type: ${input}`);
|
|
41
|
+
}
|
|
42
|
+
function ensureChannelAccountSchema(database) {
|
|
43
|
+
database.exec(`
|
|
44
|
+
CREATE TABLE IF NOT EXISTS channel_accounts (
|
|
45
|
+
id TEXT PRIMARY KEY NOT NULL,
|
|
46
|
+
channel TEXT NOT NULL,
|
|
47
|
+
name TEXT NOT NULL,
|
|
48
|
+
identity TEXT,
|
|
49
|
+
owner TEXT,
|
|
50
|
+
creator TEXT,
|
|
51
|
+
bot_token_encrypted TEXT,
|
|
52
|
+
app_id_encrypted TEXT,
|
|
53
|
+
app_secret_encrypted TEXT,
|
|
54
|
+
domain TEXT,
|
|
55
|
+
sandbox INTEGER,
|
|
56
|
+
created_at TEXT NOT NULL,
|
|
57
|
+
updated_at TEXT NOT NULL
|
|
58
|
+
);
|
|
59
|
+
`);
|
|
60
|
+
database.exec(`
|
|
61
|
+
CREATE INDEX IF NOT EXISTS channel_accounts_channel_idx
|
|
62
|
+
ON channel_accounts(channel);
|
|
63
|
+
`);
|
|
64
|
+
const rows = database
|
|
65
|
+
.prepare("PRAGMA table_info(channel_accounts)")
|
|
66
|
+
.all();
|
|
67
|
+
const columns = new Set(rows.map((row) => String(row.name || "").trim()).filter(Boolean));
|
|
68
|
+
if (!columns.has("owner")) {
|
|
69
|
+
database.exec("ALTER TABLE channel_accounts ADD COLUMN owner TEXT;");
|
|
70
|
+
}
|
|
71
|
+
if (!columns.has("creator")) {
|
|
72
|
+
database.exec("ALTER TABLE channel_accounts ADD COLUMN creator TEXT;");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function withChannelAccountDb(callback) {
|
|
76
|
+
const dbPath = getPlatformStoreDbPath();
|
|
77
|
+
fs.ensureDirSync(path.dirname(dbPath));
|
|
78
|
+
const database = new Database(dbPath);
|
|
79
|
+
try {
|
|
80
|
+
database.pragma("journal_mode = WAL");
|
|
81
|
+
ensureChannelAccountSchema(database);
|
|
82
|
+
return callback(database);
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
database.close();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function buildChannelAccountFromRow(row) {
|
|
89
|
+
const id = String(row.id || "").trim();
|
|
90
|
+
if (!id)
|
|
91
|
+
return null;
|
|
92
|
+
const botTokenEncrypted = typeof row.bot_token_encrypted === "string" ? row.bot_token_encrypted : "";
|
|
93
|
+
const appIdEncrypted = typeof row.app_id_encrypted === "string" ? row.app_id_encrypted : "";
|
|
94
|
+
const appSecretEncrypted = typeof row.app_secret_encrypted === "string" ? row.app_secret_encrypted : "";
|
|
95
|
+
return {
|
|
96
|
+
id,
|
|
97
|
+
channel: normalizeChannelAccountChannel(String(row.channel || "")),
|
|
98
|
+
name: String(row.name || "").trim() || id,
|
|
99
|
+
identity: optionalTrimmedText(String(row.identity || "")),
|
|
100
|
+
owner: optionalTrimmedText(String(row.owner || "")),
|
|
101
|
+
creator: optionalTrimmedText(String(row.creator || "")),
|
|
102
|
+
botToken: optionalTrimmedText(botTokenEncrypted ? decryptTextSync(botTokenEncrypted) : undefined),
|
|
103
|
+
appId: optionalTrimmedText(appIdEncrypted ? decryptTextSync(appIdEncrypted) : undefined),
|
|
104
|
+
appSecret: optionalTrimmedText(appSecretEncrypted ? decryptTextSync(appSecretEncrypted) : undefined),
|
|
105
|
+
domain: optionalTrimmedText(String(row.domain || "")),
|
|
106
|
+
sandbox: Number(row.sandbox || 0) === 1,
|
|
107
|
+
createdAt: String(row.created_at || ""),
|
|
108
|
+
updatedAt: String(row.updated_at || ""),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* 同步列出全部 channel account。
|
|
113
|
+
*/
|
|
114
|
+
export function listStoredChannelAccountsSync(channelInput) {
|
|
115
|
+
return withChannelAccountDb((database) => {
|
|
116
|
+
const maybeChannel = optionalTrimmedText(channelInput);
|
|
117
|
+
const rows = maybeChannel
|
|
118
|
+
? database.prepare(`
|
|
119
|
+
SELECT
|
|
120
|
+
id, channel, name, identity, owner, creator,
|
|
121
|
+
bot_token_encrypted, app_id_encrypted, app_secret_encrypted,
|
|
122
|
+
domain, sandbox, created_at, updated_at
|
|
123
|
+
FROM channel_accounts
|
|
124
|
+
WHERE channel = ?
|
|
125
|
+
ORDER BY name ASC, id ASC;
|
|
126
|
+
`).all(maybeChannel)
|
|
127
|
+
: database.prepare(`
|
|
128
|
+
SELECT
|
|
129
|
+
id, channel, name, identity, owner, creator,
|
|
130
|
+
bot_token_encrypted, app_id_encrypted, app_secret_encrypted,
|
|
131
|
+
domain, sandbox, created_at, updated_at
|
|
132
|
+
FROM channel_accounts
|
|
133
|
+
ORDER BY channel ASC, name ASC, id ASC;
|
|
134
|
+
`).all();
|
|
135
|
+
const out = [];
|
|
136
|
+
for (const row of rows) {
|
|
137
|
+
const item = buildChannelAccountFromRow(row);
|
|
138
|
+
if (item)
|
|
139
|
+
out.push(item);
|
|
140
|
+
}
|
|
141
|
+
return out;
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* 同步按 ID 读取单个 channel account。
|
|
146
|
+
*/
|
|
147
|
+
export function getStoredChannelAccountSync(accountIdInput) {
|
|
148
|
+
const accountId = normalizeNonEmptyText(accountIdInput, "channel account id");
|
|
149
|
+
return withChannelAccountDb((database) => {
|
|
150
|
+
const row = database.prepare(`
|
|
151
|
+
SELECT
|
|
152
|
+
id, channel, name, identity, owner, creator,
|
|
153
|
+
bot_token_encrypted, app_id_encrypted, app_secret_encrypted,
|
|
154
|
+
domain, sandbox, created_at, updated_at
|
|
155
|
+
FROM channel_accounts
|
|
156
|
+
WHERE id = ?
|
|
157
|
+
LIMIT 1;
|
|
158
|
+
`).get(accountId);
|
|
159
|
+
return row ? buildChannelAccountFromRow(row) : null;
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* 新增或更新 channel account。
|
|
164
|
+
*
|
|
165
|
+
* 关键点(中文)
|
|
166
|
+
* - 这里保留和现有平台库一致的落盘结构,避免默认实现切换后出现数据断层。
|
|
167
|
+
* - 未显式传入的敏感字段会保留旧值,便于 CLI 局部更新。
|
|
168
|
+
*/
|
|
169
|
+
export async function upsertStoredChannelAccount(input) {
|
|
170
|
+
const id = normalizeNonEmptyText(input.id, "channel account id");
|
|
171
|
+
const channel = normalizeChannelAccountChannel(input.channel);
|
|
172
|
+
const name = normalizeNonEmptyText(input.name, "channel account name");
|
|
173
|
+
const existing = getStoredChannelAccountSync(id);
|
|
174
|
+
const createdAt = existing?.createdAt || nowIso();
|
|
175
|
+
const updatedAt = nowIso();
|
|
176
|
+
const nextBotToken = Object.prototype.hasOwnProperty.call(input, "botToken")
|
|
177
|
+
? optionalTrimmedText(input.botToken)
|
|
178
|
+
: existing?.botToken;
|
|
179
|
+
const nextAppId = Object.prototype.hasOwnProperty.call(input, "appId")
|
|
180
|
+
? optionalTrimmedText(input.appId)
|
|
181
|
+
: existing?.appId;
|
|
182
|
+
const nextAppSecret = Object.prototype.hasOwnProperty.call(input, "appSecret")
|
|
183
|
+
? optionalTrimmedText(input.appSecret)
|
|
184
|
+
: existing?.appSecret;
|
|
185
|
+
const botTokenEncrypted = nextBotToken ? encryptTextSync(nextBotToken) : null;
|
|
186
|
+
const appIdEncrypted = nextAppId ? encryptTextSync(nextAppId) : null;
|
|
187
|
+
const appSecretEncrypted = nextAppSecret ? encryptTextSync(nextAppSecret) : null;
|
|
188
|
+
withChannelAccountDb((database) => {
|
|
189
|
+
database.prepare(`
|
|
190
|
+
INSERT INTO channel_accounts (
|
|
191
|
+
id, channel, name, identity, owner, creator,
|
|
192
|
+
bot_token_encrypted, app_id_encrypted, app_secret_encrypted,
|
|
193
|
+
domain, sandbox, created_at, updated_at
|
|
194
|
+
)
|
|
195
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
196
|
+
ON CONFLICT(id) DO UPDATE SET
|
|
197
|
+
channel = excluded.channel,
|
|
198
|
+
name = excluded.name,
|
|
199
|
+
identity = excluded.identity,
|
|
200
|
+
owner = excluded.owner,
|
|
201
|
+
creator = excluded.creator,
|
|
202
|
+
bot_token_encrypted = excluded.bot_token_encrypted,
|
|
203
|
+
app_id_encrypted = excluded.app_id_encrypted,
|
|
204
|
+
app_secret_encrypted = excluded.app_secret_encrypted,
|
|
205
|
+
domain = excluded.domain,
|
|
206
|
+
sandbox = excluded.sandbox,
|
|
207
|
+
updated_at = excluded.updated_at;
|
|
208
|
+
`).run(id, channel, name, optionalTrimmedText(input.identity) || null, optionalTrimmedText(input.owner) || null, optionalTrimmedText(input.creator) || null, botTokenEncrypted, appIdEncrypted, appSecretEncrypted, optionalTrimmedText(input.domain) || null, input.sandbox === true ? 1 : 0, createdAt, updatedAt);
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* 删除单个 channel account。
|
|
213
|
+
*/
|
|
214
|
+
export async function removeStoredChannelAccount(accountIdInput) {
|
|
215
|
+
const accountId = normalizeNonEmptyText(accountIdInput, "channel account id");
|
|
216
|
+
withChannelAccountDb((database) => {
|
|
217
|
+
database.prepare("DELETE FROM channel_accounts WHERE id = ?;").run(accountId);
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=Store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../src/chat/accounts/Store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kDAAkD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAO/D,SAAS,MAAM;IACb,OAAO,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,qBAAqB,CAAC,KAAa,EAAE,SAAiB;IAC7D,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,GAAG,SAAS,kBAAkB,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,mBAAmB,CAAC,KAAyB;IACpD,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC9C,OAAO,UAA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