@downcity/plugins 1.0.254 → 1.0.280
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/builtin/BuiltinPluginReadmes.d.ts +14 -0
- package/bin/builtin/BuiltinPluginReadmes.d.ts.map +1 -0
- package/bin/builtin/BuiltinPluginReadmes.js +58 -0
- package/bin/builtin/BuiltinPluginReadmes.js.map +1 -0
- package/bin/builtin/BuiltinPluginTypes.d.ts +48 -0
- package/bin/builtin/BuiltinPluginTypes.d.ts.map +1 -0
- package/bin/builtin/BuiltinPluginTypes.js +161 -0
- package/bin/builtin/BuiltinPluginTypes.js.map +1 -0
- package/bin/builtin/PluginSettingsDefinitions.d.ts +9 -0
- package/bin/builtin/PluginSettingsDefinitions.d.ts.map +1 -0
- package/bin/builtin/PluginSettingsDefinitions.js +41 -0
- package/bin/builtin/PluginSettingsDefinitions.js.map +1 -0
- package/bin/builtin/main/PluginSettingsMain.d.ts +6 -0
- package/bin/builtin/main/PluginSettingsMain.d.ts.map +1 -0
- package/bin/builtin/main/PluginSettingsMain.js +65 -0
- package/bin/builtin/main/PluginSettingsMain.js.map +1 -0
- package/bin/builtin/renderer/PluginSettingsRenderer.d.ts +6 -0
- package/bin/builtin/renderer/PluginSettingsRenderer.d.ts.map +1 -0
- package/bin/builtin/renderer/PluginSettingsRenderer.js +76 -0
- package/bin/builtin/renderer/PluginSettingsRenderer.js.map +1 -0
- package/bin/builtin/types/PluginSettings.d.ts +35 -0
- package/bin/builtin/types/PluginSettings.d.ts.map +1 -0
- package/bin/builtin/types/PluginSettings.js +3 -0
- package/bin/builtin/types/PluginSettings.js.map +1 -0
- package/bin/chat/ChatPlugin.d.ts +12 -28
- package/bin/chat/ChatPlugin.d.ts.map +1 -1
- package/bin/chat/ChatPlugin.js +97 -49
- package/bin/chat/ChatPlugin.js.map +1 -1
- package/bin/chat/access/ChatAccessRuntime.js +1 -1
- package/bin/chat/access/ChatAccessRuntime.js.map +1 -1
- package/bin/chat/access/ChatAccessSchema.d.ts +2 -2
- package/bin/chat/access/ChatAccessSchema.d.ts.map +1 -1
- package/bin/chat/access/ChatAccessSchema.js +3 -3
- package/bin/chat/access/ChatAccessSchema.js.map +1 -1
- package/bin/chat/access/ChatAccessService.d.ts +2 -2
- package/bin/chat/access/ChatAccessService.d.ts.map +1 -1
- package/bin/chat/access/ChatAccessService.js +4 -4
- package/bin/chat/access/ChatAccessService.js.map +1 -1
- package/bin/chat/access/ChatAccessStore.d.ts +3 -3
- package/bin/chat/access/ChatAccessStore.d.ts.map +1 -1
- package/bin/chat/access/ChatAccessStore.js +17 -8
- package/bin/chat/access/ChatAccessStore.js.map +1 -1
- package/bin/chat/channels/BaseChatChannel.d.ts +1 -0
- package/bin/chat/channels/BaseChatChannel.d.ts.map +1 -1
- package/bin/chat/channels/BaseChatChannel.js +2 -0
- package/bin/chat/channels/BaseChatChannel.js.map +1 -1
- package/bin/chat/channels/RuntimeChannel.d.ts +4 -4
- package/bin/chat/channels/RuntimeChannel.d.ts.map +1 -1
- package/bin/chat/channels/RuntimeChannel.js +8 -8
- package/bin/chat/channels/RuntimeChannel.js.map +1 -1
- package/bin/chat/channels/feishu/Feishu.js +1 -1
- package/bin/chat/channels/feishu/Feishu.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts +1 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformClient.js +3 -0
- package/bin/chat/channels/feishu/FeishuPlatformClient.js.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts +2 -0
- package/bin/chat/channels/feishu/FeishuPlatformLookup.d.ts.map +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js +1 -1
- package/bin/chat/channels/feishu/FeishuPlatformLookup.js.map +1 -1
- package/bin/chat/channels/qq/QQ.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQ.js +3 -2
- package/bin/chat/channels/qq/QQ.js.map +1 -1
- package/bin/chat/channels/qq/QQEventCapture.d.ts +1 -1
- package/bin/chat/channels/qq/QQEventCapture.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQEventCapture.js +3 -3
- package/bin/chat/channels/qq/QQEventCapture.js.map +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.js +1 -1
- package/bin/chat/channels/qq/QQInboundDedupe.js.map +1 -1
- package/bin/chat/channels/qq/QQMessageHandler.d.ts +4 -0
- package/bin/chat/channels/qq/QQMessageHandler.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQMessageHandler.js +2 -0
- package/bin/chat/channels/qq/QQMessageHandler.js.map +1 -1
- package/bin/chat/channels/qq/QQSupport.d.ts +4 -0
- package/bin/chat/channels/qq/QQSupport.d.ts.map +1 -1
- package/bin/chat/channels/qq/QQSupport.js +1 -0
- package/bin/chat/channels/qq/QQSupport.js.map +1 -1
- package/bin/chat/channels/qq/VoiceInput.d.ts +3 -0
- package/bin/chat/channels/qq/VoiceInput.d.ts.map +1 -1
- package/bin/chat/channels/qq/VoiceInput.js +1 -1
- package/bin/chat/channels/qq/VoiceInput.js.map +1 -1
- package/bin/chat/channels/telegram/ApiClient.d.ts +3 -1
- package/bin/chat/channels/telegram/ApiClient.d.ts.map +1 -1
- package/bin/chat/channels/telegram/ApiClient.js +4 -2
- package/bin/chat/channels/telegram/ApiClient.js.map +1 -1
- package/bin/chat/channels/telegram/StateStore.d.ts +1 -1
- package/bin/chat/channels/telegram/StateStore.d.ts.map +1 -1
- package/bin/chat/channels/telegram/StateStore.js +2 -2
- package/bin/chat/channels/telegram/StateStore.js.map +1 -1
- package/bin/chat/channels/telegram/TelegramPlatformClient.d.ts.map +1 -1
- package/bin/chat/channels/telegram/TelegramPlatformClient.js +2 -1
- package/bin/chat/channels/telegram/TelegramPlatformClient.js.map +1 -1
- package/bin/chat/main/ChatPluginMain.d.ts +4 -0
- package/bin/chat/main/ChatPluginMain.d.ts.map +1 -0
- package/bin/chat/main/ChatPluginMain.js +137 -0
- package/bin/chat/main/ChatPluginMain.js.map +1 -0
- package/bin/chat/renderer/ChatPluginRenderer.d.ts +4 -0
- package/bin/chat/renderer/ChatPluginRenderer.d.ts.map +1 -0
- package/bin/chat/renderer/ChatPluginRenderer.js +105 -0
- package/bin/chat/renderer/ChatPluginRenderer.js.map +1 -0
- package/bin/chat/runtime/ChannelContextStore.d.ts +2 -2
- package/bin/chat/runtime/ChannelContextStore.js +20 -20
- package/bin/chat/runtime/ChannelContextStore.js.map +1 -1
- package/bin/chat/runtime/ChatActionExecution.js +6 -6
- package/bin/chat/runtime/ChatActionExecution.js.map +1 -1
- package/bin/chat/runtime/ChatChannelConfig.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelConfig.js +7 -12
- package/bin/chat/runtime/ChatChannelConfig.js.map +1 -1
- package/bin/chat/runtime/ChatChannelCore.d.ts +3 -3
- package/bin/chat/runtime/ChatChannelCore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatChannelCore.js +5 -5
- package/bin/chat/runtime/ChatChannelCore.js.map +1 -1
- package/bin/chat/runtime/ChatHistoryStore.d.ts +1 -1
- package/bin/chat/runtime/ChatHistoryStore.js +7 -7
- package/bin/chat/runtime/ChatHistoryStore.js.map +1 -1
- package/bin/chat/runtime/ChatMetaStore.d.ts +1 -1
- package/bin/chat/runtime/ChatMetaStore.js +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.d.ts +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.d.ts.map +1 -1
- package/bin/chat/runtime/ChatPluginActionRegistry.js +9 -9
- package/bin/chat/runtime/ChatPluginActionRegistry.js.map +1 -1
- package/bin/chat/runtime/ChatQueue.d.ts +3 -38
- package/bin/chat/runtime/ChatQueue.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueue.js +3 -51
- package/bin/chat/runtime/ChatQueue.js.map +1 -1
- package/bin/chat/runtime/ChatQueueStore.d.ts +5 -16
- package/bin/chat/runtime/ChatQueueStore.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueStore.js +8 -22
- package/bin/chat/runtime/ChatQueueStore.js.map +1 -1
- package/bin/chat/runtime/ChatQueueWorker.d.ts +1 -1
- package/bin/chat/runtime/ChatQueueWorker.d.ts.map +1 -1
- package/bin/chat/runtime/ChatQueueWorker.js +1 -2
- package/bin/chat/runtime/ChatQueueWorker.js.map +1 -1
- package/bin/chat/runtime/ChatSessionDelete.d.ts +3 -3
- package/bin/chat/runtime/ChatSessionDelete.js +4 -4
- package/bin/chat/runtime/ChatSessionDelete.js.map +1 -1
- package/bin/chat/runtime/ChatStorage.d.ts +7 -7
- package/bin/chat/runtime/ChatStorage.js +24 -24
- package/bin/chat/runtime/ChatStorage.js.map +1 -1
- package/bin/chat/types/ChatAccess.d.ts +2 -2
- package/bin/chat/types/ChatAccess.d.ts.map +1 -1
- package/bin/chat/types/ChatCommand.d.ts +1 -1
- package/bin/chat/types/ChatPluginChannelConfig.d.ts +57 -0
- package/bin/chat/types/ChatPluginChannelConfig.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginChannelConfig.js +3 -0
- package/bin/chat/types/ChatPluginChannelConfig.js.map +1 -0
- package/bin/chat/types/ChatPluginConfig.d.ts +19 -0
- package/bin/chat/types/ChatPluginConfig.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginConfig.js +3 -0
- package/bin/chat/types/ChatPluginConfig.js.map +1 -0
- package/bin/chat/types/ChatPluginOptions.d.ts +4 -4
- package/bin/chat/types/ChatPluginOptions.d.ts.map +1 -1
- package/bin/chat/types/ChatPluginOptions.js +1 -1
- package/bin/chat/types/ChatPluginProfile.d.ts +39 -0
- package/bin/chat/types/ChatPluginProfile.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginProfile.js +3 -0
- package/bin/chat/types/ChatPluginProfile.js.map +1 -0
- package/bin/chat/types/ChatPluginRenderer.d.ts +17 -0
- package/bin/chat/types/ChatPluginRenderer.d.ts.map +1 -0
- package/bin/chat/types/ChatPluginRenderer.js +3 -0
- package/bin/chat/types/ChatPluginRenderer.js.map +1 -0
- package/bin/chat/types/ChatRuntime.d.ts +11 -0
- package/bin/chat/types/ChatRuntime.d.ts.map +1 -1
- package/bin/chat/types/ChatRuntimeAccount.d.ts +3 -3
- package/bin/chat/types/ChatRuntimeAccount.d.ts.map +1 -1
- package/bin/chat/types/ChatRuntimeAccount.js +2 -2
- package/bin/chat/types/ChatStorage.d.ts +2 -2
- package/bin/chat/types/ChatStorage.d.ts.map +1 -1
- package/bin/chat.d.ts +3 -4
- package/bin/chat.d.ts.map +1 -1
- package/bin/chat.js +1 -2
- package/bin/chat.js.map +1 -1
- package/bin/contact/Action.js +5 -5
- package/bin/contact/Action.js.map +1 -1
- package/bin/contact/ContactPlugin.js +15 -15
- package/bin/contact/ContactPlugin.js.map +1 -1
- package/bin/contact/runtime/ChatRuntime.js +3 -3
- package/bin/contact/runtime/ChatRuntime.js.map +1 -1
- package/bin/contact/runtime/ContactStore.d.ts +8 -8
- package/bin/contact/runtime/ContactStore.d.ts.map +1 -1
- package/bin/contact/runtime/ContactStore.js +20 -20
- package/bin/contact/runtime/ContactStore.js.map +1 -1
- package/bin/contact/runtime/EndpointNotice.js +2 -2
- package/bin/contact/runtime/EndpointNotice.js.map +1 -1
- package/bin/contact/runtime/InboxStore.d.ts +6 -6
- package/bin/contact/runtime/InboxStore.d.ts.map +1 -1
- package/bin/contact/runtime/InboxStore.js +16 -16
- package/bin/contact/runtime/InboxStore.js.map +1 -1
- package/bin/contact/runtime/LinkApproval.js +14 -14
- package/bin/contact/runtime/LinkApproval.js.map +1 -1
- package/bin/contact/runtime/LinkStore.d.ts +2 -2
- package/bin/contact/runtime/LinkStore.d.ts.map +1 -1
- package/bin/contact/runtime/LinkStore.js +5 -5
- package/bin/contact/runtime/LinkStore.js.map +1 -1
- package/bin/contact/runtime/Paths.d.ts +15 -15
- package/bin/contact/runtime/Paths.d.ts.map +1 -1
- package/bin/contact/runtime/Paths.js +29 -29
- package/bin/contact/runtime/Paths.js.map +1 -1
- package/bin/contact/runtime/ShareBundle.d.ts +1 -1
- package/bin/contact/runtime/ShareBundle.d.ts.map +1 -1
- package/bin/contact/runtime/ShareBundle.js +4 -4
- package/bin/contact/runtime/ShareBundle.js.map +1 -1
- package/bin/contact/types/ContactApproval.d.ts +2 -2
- package/bin/contact/types/ContactApproval.d.ts.map +1 -1
- package/bin/image/ImagePlugin.d.ts +1 -4
- package/bin/image/ImagePlugin.d.ts.map +1 -1
- package/bin/image/ImagePlugin.js +26 -34
- package/bin/image/ImagePlugin.js.map +1 -1
- package/bin/image/runtime/ImageResultStorage.d.ts +2 -2
- package/bin/image/runtime/ImageResultStorage.d.ts.map +1 -1
- package/bin/image/runtime/ImageResultStorage.js +15 -38
- package/bin/image/runtime/ImageResultStorage.js.map +1 -1
- package/bin/image/types/ImagePlugin.d.ts +23 -16
- package/bin/image/types/ImagePlugin.d.ts.map +1 -1
- package/bin/image/types/ImagePlugin.js +1 -1
- package/bin/image.d.ts +1 -1
- package/bin/image.d.ts.map +1 -1
- package/bin/index.d.ts +2 -0
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +1 -0
- package/bin/index.js.map +1 -1
- package/bin/memory/MemoryPlugin.d.ts +1 -1
- package/bin/memory/MemoryPlugin.d.ts.map +1 -1
- package/bin/memory/MemoryPlugin.js +17 -7
- package/bin/memory/MemoryPlugin.js.map +1 -1
- package/bin/memory/types/Memory.d.ts +10 -4
- package/bin/memory/types/Memory.d.ts.map +1 -1
- package/bin/memory.d.ts +1 -1
- package/bin/memory.d.ts.map +1 -1
- package/bin/renderers.d.ts +5 -0
- package/bin/renderers.d.ts.map +1 -0
- package/bin/renderers.js +12 -0
- package/bin/renderers.js.map +1 -0
- package/bin/sound/Plugin.d.ts +2 -5
- package/bin/sound/Plugin.d.ts.map +1 -1
- package/bin/sound/Plugin.js +27 -31
- package/bin/sound/Plugin.js.map +1 -1
- package/bin/sound/types/SoundPlugin.d.ts +22 -15
- package/bin/sound/types/SoundPlugin.d.ts.map +1 -1
- package/bin/sound/types/SoundPlugin.js +2 -2
- package/bin/sound.d.ts +1 -1
- package/bin/sound.d.ts.map +1 -1
- package/bin/task/Action.d.ts +6 -6
- package/bin/task/Action.d.ts.map +1 -1
- package/bin/task/Action.js +21 -21
- package/bin/task/Action.js.map +1 -1
- package/bin/task/PROMPT.d.ts +1 -1
- package/bin/task/PROMPT.d.ts.map +1 -1
- package/bin/task/PROMPT.js +1 -1
- package/bin/task/PROMPT.js.map +1 -1
- package/bin/task/Scheduler.js +8 -8
- package/bin/task/Scheduler.js.map +1 -1
- package/bin/task/TaskPlugin.d.ts +7 -14
- package/bin/task/TaskPlugin.d.ts.map +1 -1
- package/bin/task/TaskPlugin.js +54 -43
- package/bin/task/TaskPlugin.js.map +1 -1
- package/bin/task/runtime/Model.d.ts +1 -5
- package/bin/task/runtime/Model.d.ts.map +1 -1
- package/bin/task/runtime/Model.js +2 -13
- package/bin/task/runtime/Model.js.map +1 -1
- package/bin/task/runtime/Paths.d.ts +7 -7
- package/bin/task/runtime/Paths.d.ts.map +1 -1
- package/bin/task/runtime/Paths.js +11 -11
- package/bin/task/runtime/Paths.js.map +1 -1
- package/bin/task/runtime/Runner.d.ts +1 -1
- package/bin/task/runtime/Runner.d.ts.map +1 -1
- package/bin/task/runtime/Runner.js +4 -5
- package/bin/task/runtime/Runner.js.map +1 -1
- package/bin/task/runtime/Store.d.ts +9 -9
- package/bin/task/runtime/Store.d.ts.map +1 -1
- package/bin/task/runtime/Store.js +17 -17
- package/bin/task/runtime/Store.js.map +1 -1
- package/bin/task/runtime/TaskActionExecution.js +6 -6
- package/bin/task/runtime/TaskActionExecution.js.map +1 -1
- package/bin/task/runtime/TaskPluginActionRegistry.js +1 -1
- package/bin/task/runtime/TaskPluginActionRegistry.js.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.d.ts +0 -1
- package/bin/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerRound.js +8 -3
- package/bin/task/runtime/TaskRunnerRound.js.map +1 -1
- package/bin/task/runtime/TaskRunnerScript.d.ts +0 -4
- package/bin/task/runtime/TaskRunnerScript.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerScript.js +0 -1
- package/bin/task/runtime/TaskRunnerScript.js.map +1 -1
- package/bin/task/runtime/TaskRunnerSession.d.ts +2 -3
- package/bin/task/runtime/TaskRunnerSession.d.ts.map +1 -1
- package/bin/task/runtime/TaskRunnerSession.js +2 -4
- package/bin/task/runtime/TaskRunnerSession.js.map +1 -1
- package/bin/task/types/TaskWorkspaceRuntime.d.ts +10 -0
- package/bin/task/types/TaskWorkspaceRuntime.d.ts.map +1 -0
- package/bin/task/types/TaskWorkspaceRuntime.js +3 -0
- package/bin/task/types/TaskWorkspaceRuntime.js.map +1 -0
- package/bin/web/Plugin.d.ts +2 -6
- package/bin/web/Plugin.d.ts.map +1 -1
- package/bin/web/Plugin.js +21 -17
- package/bin/web/Plugin.js.map +1 -1
- package/bin/web/providers/PlaywrightBrowserProvider.d.ts.map +1 -1
- package/bin/web/providers/PlaywrightBrowserProvider.js +59 -14
- package/bin/web/providers/PlaywrightBrowserProvider.js.map +1 -1
- package/bin/web/types/WebPlugin.d.ts +15 -9
- package/bin/web/types/WebPlugin.d.ts.map +1 -1
- package/bin/web.d.ts +1 -1
- package/bin/web.d.ts.map +1 -1
- package/bin/workboard/runtime/Collector.js +1 -1
- package/bin/workboard/runtime/Collector.js.map +1 -1
- package/package.json +29 -20
- package/scripts/chat-access.test.mjs +3 -2
- package/scripts/chat-channel-config.test.mjs +3 -3
- package/scripts/chat-storage.test.mjs +10 -14
- package/scripts/memory-plugin.test.mjs +9 -32
- package/scripts/playwright-browser-provider.test.mjs +260 -0
- package/scripts/plugin-main.test.mjs +101 -0
- package/scripts/plugin-subpaths.test.mjs +28 -0
- package/scripts/sound-plugin.test.mjs +21 -9
- package/scripts/unrestricted-sandbox-approval.test.mjs +1 -1
- package/scripts/web-plugin.test.mjs +43 -186
- package/src/builtin/BuiltinPluginReadmes.ts +58 -0
- package/src/builtin/BuiltinPluginTypes.ts +260 -0
- package/src/builtin/PluginSettingsDefinitions.ts +45 -0
- package/src/builtin/main/PluginSettingsMain.ts +75 -0
- package/src/builtin/renderer/PluginSettingsRenderer.tsx +110 -0
- package/src/builtin/types/PluginSettings.ts +46 -0
- package/src/chat/ChatPlugin.ts +99 -51
- package/src/chat/access/ChatAccessRuntime.ts +1 -1
- package/src/chat/access/ChatAccessSchema.ts +5 -5
- package/src/chat/access/ChatAccessService.ts +4 -4
- package/src/chat/access/ChatAccessStore.ts +17 -9
- package/src/chat/channels/BaseChatChannel.ts +2 -0
- package/src/chat/channels/RuntimeChannel.ts +9 -9
- package/src/chat/channels/feishu/Feishu.ts +1 -1
- package/src/chat/channels/feishu/FeishuPlatformClient.ts +3 -0
- package/src/chat/channels/feishu/FeishuPlatformLookup.ts +3 -1
- package/src/chat/channels/qq/QQ.ts +3 -2
- package/src/chat/channels/qq/QQEventCapture.ts +3 -3
- package/src/chat/channels/qq/QQInboundDedupe.ts +2 -3
- package/src/chat/channels/qq/QQMessageHandler.ts +6 -0
- package/src/chat/channels/qq/QQSupport.ts +5 -0
- package/src/chat/channels/qq/VoiceInput.ts +5 -1
- package/src/chat/channels/telegram/ApiClient.ts +10 -3
- package/src/chat/channels/telegram/StateStore.ts +2 -2
- package/src/chat/channels/telegram/TelegramPlatformClient.ts +2 -1
- package/src/chat/main/ChatPluginMain.ts +163 -0
- package/src/chat/renderer/ChatPluginRenderer.tsx +149 -0
- package/src/chat/runtime/ChannelContextStore.ts +20 -20
- package/src/chat/runtime/ChatActionExecution.ts +6 -6
- package/src/chat/runtime/ChatChannelConfig.ts +7 -14
- package/src/chat/runtime/ChatChannelCore.ts +9 -9
- package/src/chat/runtime/ChatHistoryStore.ts +7 -7
- package/src/chat/runtime/ChatMetaStore.ts +1 -1
- package/src/chat/runtime/ChatPluginActionRegistry.ts +10 -10
- package/src/chat/runtime/ChatQueue.ts +2 -69
- package/src/chat/runtime/ChatQueueStore.ts +10 -26
- package/src/chat/runtime/ChatQueueWorker.ts +2 -5
- package/src/chat/runtime/ChatSessionDelete.ts +4 -4
- package/src/chat/runtime/ChatStorage.ts +24 -24
- package/src/chat/types/ChatAccess.ts +2 -2
- package/src/chat/types/ChatCommand.ts +1 -1
- package/src/chat/types/ChatPluginChannelConfig.ts +63 -0
- package/src/chat/types/ChatPluginConfig.ts +21 -0
- package/src/chat/types/ChatPluginOptions.ts +4 -4
- package/src/chat/types/ChatPluginProfile.ts +52 -0
- package/src/chat/types/ChatPluginRenderer.ts +25 -0
- package/src/chat/types/ChatRuntime.ts +14 -0
- package/src/chat/types/ChatRuntimeAccount.ts +3 -3
- package/src/chat/types/ChatStorage.ts +2 -2
- package/src/chat.ts +6 -14
- package/src/contact/Action.ts +5 -5
- package/src/contact/ContactPlugin.ts +15 -15
- package/src/contact/runtime/ChatRuntime.ts +3 -3
- package/src/contact/runtime/ContactStore.ts +20 -20
- package/src/contact/runtime/EndpointNotice.ts +2 -2
- package/src/contact/runtime/InboxStore.ts +16 -16
- package/src/contact/runtime/LinkApproval.ts +16 -16
- package/src/contact/runtime/LinkStore.ts +5 -5
- package/src/contact/runtime/Paths.ts +29 -29
- package/src/contact/runtime/ShareBundle.ts +5 -5
- package/src/contact/types/ContactApproval.ts +2 -2
- package/src/image/ImagePlugin.ts +30 -33
- package/src/image/runtime/ImageResultStorage.ts +36 -62
- package/src/image/types/ImagePlugin.ts +25 -19
- package/src/image.ts +2 -0
- package/src/index.ts +8 -0
- package/src/memory/MemoryPlugin.ts +17 -5
- package/src/memory/types/Memory.ts +11 -4
- package/src/memory.ts +1 -0
- package/src/renderers.ts +18 -0
- package/src/sound/Plugin.ts +34 -33
- package/src/sound/types/SoundPlugin.ts +24 -19
- package/src/sound.ts +2 -0
- package/src/task/Action.ts +27 -27
- package/src/task/PROMPT.ts +1 -1
- package/src/task/PROMPT.ts.txt +5 -6
- package/src/task/Scheduler.ts +8 -8
- package/src/task/TaskPlugin.ts +55 -46
- package/src/task/runtime/Model.ts +3 -13
- package/src/task/runtime/Paths.ts +11 -11
- package/src/task/runtime/Runner.ts +5 -6
- package/src/task/runtime/Store.ts +22 -22
- package/src/task/runtime/TaskActionExecution.ts +6 -6
- package/src/task/runtime/TaskPluginActionRegistry.ts +1 -1
- package/src/task/runtime/TaskRunnerRound.ts +13 -4
- package/src/task/runtime/TaskRunnerScript.ts +0 -5
- package/src/task/runtime/TaskRunnerSession.ts +10 -8
- package/src/task/types/TaskWorkspaceRuntime.ts +12 -0
- package/src/web/Plugin.ts +23 -22
- package/src/web/providers/PlaywrightBrowserProvider.ts +93 -17
- package/src/web/types/WebPlugin.ts +16 -13
- package/src/web.ts +1 -0
- package/src/workboard/runtime/Collector.ts +1 -1
- package/tsconfig.json +4 -1
- package/LICENSE +0 -183
- package/bin/chat/Index.d.ts +0 -15
- package/bin/chat/Index.d.ts.map +0 -1
- package/bin/chat/Index.js +0 -11
- package/bin/chat/Index.js.map +0 -1
- package/bin/chat/config/ChatPluginConfig.d.ts +0 -67
- package/bin/chat/config/ChatPluginConfig.d.ts.map +0 -1
- package/bin/chat/config/ChatPluginConfig.js +0 -237
- package/bin/chat/config/ChatPluginConfig.js.map +0 -1
- package/bin/chat/types/ChatPluginResource.d.ts +0 -68
- package/bin/chat/types/ChatPluginResource.d.ts.map +0 -1
- package/bin/chat/types/ChatPluginResource.js +0 -10
- package/bin/chat/types/ChatPluginResource.js.map +0 -1
- package/bin/contact/Index.d.ts +0 -8
- package/bin/contact/Index.d.ts.map +0 -1
- package/bin/contact/Index.js +0 -8
- package/bin/contact/Index.js.map +0 -1
- package/bin/memory/Index.d.ts +0 -11
- package/bin/memory/Index.d.ts.map +0 -1
- package/bin/memory/Index.js +0 -11
- package/bin/memory/Index.js.map +0 -1
- package/bin/skill/Command.d.ts +0 -29
- package/bin/skill/Command.d.ts.map +0 -1
- package/bin/skill/Command.js +0 -35
- package/bin/skill/Command.js.map +0 -1
- package/bin/task/Index.d.ts +0 -9
- package/bin/task/Index.d.ts.map +0 -1
- package/bin/task/Index.js +0 -9
- package/bin/task/Index.js.map +0 -1
- package/src/chat/Index.ts +0 -36
- package/src/chat/config/ChatPluginConfig.ts +0 -266
- package/src/chat/types/ChatPluginResource.ts +0 -95
- package/src/contact/Index.ts +0 -8
- package/src/memory/Index.ts +0 -14
- package/src/skill/Command.ts +0 -58
- package/src/task/Index.ts +0 -8
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat Plugin 的结构化配置协议。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - Zod Schema 是内建 Chat 行为配置与 Resource 配置的唯一源码。
|
|
6
|
-
* - Plugin config 只描述 queue 行为,完整渠道配置由独立 Resource Item 承载。
|
|
7
|
-
* - `readOnly` 字段由 Resource Resolver 写入,`writeOnly` 字段由 CLI 安全采集和脱敏。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { JsonObject } from "@downcity/agent";
|
|
11
|
-
import { z } from "zod";
|
|
12
|
-
import { resolveChatChannelBotInfo } from "@/chat/channels/BotInfoProvider.js";
|
|
13
|
-
import type { ChatPluginResource } from "@/chat/types/ChatPluginResource.js";
|
|
14
|
-
|
|
15
|
-
const resource_id_schema = z.string()
|
|
16
|
-
.trim()
|
|
17
|
-
.min(1)
|
|
18
|
-
.max(80)
|
|
19
|
-
.regex(/^[a-z0-9][a-z0-9_-]*$/u)
|
|
20
|
-
.meta({
|
|
21
|
-
title: "Resource ID",
|
|
22
|
-
description: "Stable Resource ID generated by City.",
|
|
23
|
-
readOnly: true,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const resource_name_schema = z.string()
|
|
27
|
-
.trim()
|
|
28
|
-
.min(1)
|
|
29
|
-
.meta({
|
|
30
|
-
title: "Name",
|
|
31
|
-
description: "Display name written by the Resource Resolver.",
|
|
32
|
-
readOnly: true,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
const secret_schema = z.string()
|
|
36
|
-
.trim()
|
|
37
|
-
.min(1)
|
|
38
|
-
.meta({ writeOnly: true });
|
|
39
|
-
|
|
40
|
-
/** Telegram Resource 完整配置 Schema。 */
|
|
41
|
-
const telegram_resource_schema = z.object({
|
|
42
|
-
id: resource_id_schema,
|
|
43
|
-
type: z.literal("telegram").meta({ title: "Type" }),
|
|
44
|
-
name: resource_name_schema,
|
|
45
|
-
bot_token: secret_schema.meta({
|
|
46
|
-
title: "Bot Token",
|
|
47
|
-
description: "Telegram Bot API Token.",
|
|
48
|
-
writeOnly: true,
|
|
49
|
-
}),
|
|
50
|
-
username: z.string().trim().min(1).optional().meta({
|
|
51
|
-
title: "Username",
|
|
52
|
-
description: "Telegram username written by the Resource Resolver.",
|
|
53
|
-
readOnly: true,
|
|
54
|
-
}),
|
|
55
|
-
bot_user_id: z.string().trim().min(1).optional().meta({
|
|
56
|
-
title: "Bot User ID",
|
|
57
|
-
description: "Telegram Bot user ID written by the Resource Resolver.",
|
|
58
|
-
readOnly: true,
|
|
59
|
-
}),
|
|
60
|
-
}).strict().meta({
|
|
61
|
-
title: "Telegram",
|
|
62
|
-
description: "Telegram Bot Resource.",
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
/** Feishu / Lark Resource 完整配置 Schema。 */
|
|
66
|
-
const feishu_resource_schema = z.object({
|
|
67
|
-
id: resource_id_schema,
|
|
68
|
-
type: z.literal("feishu").meta({ title: "Type" }),
|
|
69
|
-
name: resource_name_schema,
|
|
70
|
-
app_id: z.string().trim().min(1).meta({
|
|
71
|
-
title: "App ID",
|
|
72
|
-
description: "Feishu or Lark App ID.",
|
|
73
|
-
}),
|
|
74
|
-
app_secret: secret_schema.meta({
|
|
75
|
-
title: "App Secret",
|
|
76
|
-
description: "Feishu or Lark App Secret.",
|
|
77
|
-
writeOnly: true,
|
|
78
|
-
}),
|
|
79
|
-
domain: z.url().optional().meta({
|
|
80
|
-
title: "Open API Domain",
|
|
81
|
-
description: "Optional Feishu or Lark Open API domain.",
|
|
82
|
-
}),
|
|
83
|
-
identity: z.string().trim().min(1).optional().meta({
|
|
84
|
-
title: "Identity",
|
|
85
|
-
readOnly: true,
|
|
86
|
-
}),
|
|
87
|
-
owner: z.string().trim().min(1).optional().meta({
|
|
88
|
-
title: "Owner",
|
|
89
|
-
readOnly: true,
|
|
90
|
-
}),
|
|
91
|
-
creator: z.string().trim().min(1).optional().meta({
|
|
92
|
-
title: "Creator",
|
|
93
|
-
readOnly: true,
|
|
94
|
-
}),
|
|
95
|
-
bot_user_id: z.string().trim().min(1).optional().meta({
|
|
96
|
-
title: "Bot User ID",
|
|
97
|
-
readOnly: true,
|
|
98
|
-
}),
|
|
99
|
-
}).strict().meta({
|
|
100
|
-
title: "Feishu / Lark",
|
|
101
|
-
description: "Feishu or Lark Bot Resource.",
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
/** QQ Resource 完整配置 Schema。 */
|
|
105
|
-
const qq_resource_schema = z.object({
|
|
106
|
-
id: resource_id_schema,
|
|
107
|
-
type: z.literal("qq").meta({ title: "Type" }),
|
|
108
|
-
name: resource_name_schema,
|
|
109
|
-
app_id: z.string().trim().min(1).meta({
|
|
110
|
-
title: "App ID",
|
|
111
|
-
description: "QQ Bot App ID.",
|
|
112
|
-
}),
|
|
113
|
-
app_secret: secret_schema.meta({
|
|
114
|
-
title: "App Secret",
|
|
115
|
-
description: "QQ Bot App Secret.",
|
|
116
|
-
writeOnly: true,
|
|
117
|
-
}),
|
|
118
|
-
sandbox: z.boolean().optional().meta({
|
|
119
|
-
title: "Sandbox",
|
|
120
|
-
description: "Whether to use the QQ sandbox environment.",
|
|
121
|
-
default: false,
|
|
122
|
-
}),
|
|
123
|
-
identity: z.string().trim().min(1).optional().meta({
|
|
124
|
-
title: "Identity",
|
|
125
|
-
readOnly: true,
|
|
126
|
-
}),
|
|
127
|
-
bot_user_id: z.string().trim().min(1).optional().meta({
|
|
128
|
-
title: "Bot User ID",
|
|
129
|
-
readOnly: true,
|
|
130
|
-
}),
|
|
131
|
-
}).strict().meta({
|
|
132
|
-
title: "QQ",
|
|
133
|
-
description: "QQ Bot Resource.",
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
/** Chat Plugin 单个完整 Resource Item Schema。 */
|
|
137
|
-
export const chat_plugin_resource_schema = z.discriminatedUnion("type", [
|
|
138
|
-
telegram_resource_schema,
|
|
139
|
-
feishu_resource_schema,
|
|
140
|
-
qq_resource_schema,
|
|
141
|
-
]);
|
|
142
|
-
|
|
143
|
-
/** Chat Plugin 完整配置 Schema。 */
|
|
144
|
-
export const chat_plugin_config_schema = z.object({
|
|
145
|
-
queue: z.object({
|
|
146
|
-
max_concurrency: z.number()
|
|
147
|
-
.int()
|
|
148
|
-
.min(1)
|
|
149
|
-
.max(32)
|
|
150
|
-
.optional()
|
|
151
|
-
.meta({
|
|
152
|
-
title: "Maximum concurrency",
|
|
153
|
-
description: "Maximum number of chat lanes executed concurrently.",
|
|
154
|
-
}),
|
|
155
|
-
merge_debounce_ms: z.number()
|
|
156
|
-
.int()
|
|
157
|
-
.min(0)
|
|
158
|
-
.max(60_000)
|
|
159
|
-
.optional()
|
|
160
|
-
.meta({
|
|
161
|
-
title: "Merge debounce",
|
|
162
|
-
description: "Debounce window used to merge consecutive inbound messages.",
|
|
163
|
-
}),
|
|
164
|
-
merge_max_wait_ms: z.number()
|
|
165
|
-
.int()
|
|
166
|
-
.min(0)
|
|
167
|
-
.max(120_000)
|
|
168
|
-
.optional()
|
|
169
|
-
.meta({
|
|
170
|
-
title: "Maximum merge wait",
|
|
171
|
-
description: "Maximum time to wait before executing a merged inbound burst.",
|
|
172
|
-
}),
|
|
173
|
-
}).strict().optional().meta({
|
|
174
|
-
title: "Queue",
|
|
175
|
-
description: "Chat queue scheduling and inbound message merge behavior.",
|
|
176
|
-
}),
|
|
177
|
-
}).strict().meta({
|
|
178
|
-
title: "Chat Plugin",
|
|
179
|
-
description: "Chat queue behavior. Messaging channels are Plugin Resources.",
|
|
180
|
-
});
|
|
181
|
-
|
|
182
|
-
/** Chat Plugin 完整结构化配置。 */
|
|
183
|
-
export type ChatPluginConfig = z.infer<typeof chat_plugin_config_schema>;
|
|
184
|
-
|
|
185
|
-
/** 供 City Plugin Catalog 使用的标准 JSON Schema。 */
|
|
186
|
-
export const CHAT_PLUGIN_CONFIG_JSON_SCHEMA = z.toJSONSchema(
|
|
187
|
-
chat_plugin_config_schema,
|
|
188
|
-
{ target: "draft-2020-12" },
|
|
189
|
-
) as JsonObject;
|
|
190
|
-
|
|
191
|
-
/** 供 City Plugin Catalog 使用的完整 Resource Item JSON Schema。 */
|
|
192
|
-
export const CHAT_PLUGIN_RESOURCE_JSON_SCHEMA = z.toJSONSchema(
|
|
193
|
-
chat_plugin_resource_schema,
|
|
194
|
-
{ target: "draft-2020-12" },
|
|
195
|
-
) as JsonObject;
|
|
196
|
-
|
|
197
|
-
/** 在运行时装配边界解析并收窄 Chat Plugin 配置。 */
|
|
198
|
-
export function parse_chat_plugin_config(input: unknown): ChatPluginConfig {
|
|
199
|
-
return chat_plugin_config_schema.parse(input);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
/** 解析一个完整 Chat Plugin Resource Item。 */
|
|
203
|
-
export function parse_chat_plugin_resource(input: unknown): ChatPluginResource {
|
|
204
|
-
return chat_plugin_resource_schema.parse(input);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
/** 读取一个 Chat Resource 类型分支的标准 JSON Schema。 */
|
|
208
|
-
export function get_chat_plugin_resource_json_schema(
|
|
209
|
-
resource_type: ChatPluginResource["type"],
|
|
210
|
-
): JsonObject {
|
|
211
|
-
const variants = Array.isArray(CHAT_PLUGIN_RESOURCE_JSON_SCHEMA.oneOf)
|
|
212
|
-
? CHAT_PLUGIN_RESOURCE_JSON_SCHEMA.oneOf
|
|
213
|
-
: [];
|
|
214
|
-
for (const value of variants) {
|
|
215
|
-
if (!value || typeof value !== "object" || Array.isArray(value)) continue;
|
|
216
|
-
const variant = value as JsonObject;
|
|
217
|
-
const properties = variant.properties;
|
|
218
|
-
if (!properties || typeof properties !== "object" || Array.isArray(properties)) continue;
|
|
219
|
-
const type_schema = (properties as JsonObject).type;
|
|
220
|
-
if (
|
|
221
|
-
type_schema
|
|
222
|
-
&& typeof type_schema === "object"
|
|
223
|
-
&& !Array.isArray(type_schema)
|
|
224
|
-
&& (type_schema as JsonObject).const === resource_type
|
|
225
|
-
) {
|
|
226
|
-
return JSON.parse(JSON.stringify(variant)) as JsonObject;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
throw new Error(`Missing Chat Resource schema: ${resource_type}`);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* 根据用户字段解析并返回 Resolver 可写的动态字段。
|
|
234
|
-
*
|
|
235
|
-
* 关键点(中文):返回值不包含 `id`、`type` 和凭据,字段所有权由 City 按 Schema 校验。
|
|
236
|
-
*/
|
|
237
|
-
export async function resolve_chat_plugin_resource(
|
|
238
|
-
input: JsonObject,
|
|
239
|
-
): Promise<JsonObject> {
|
|
240
|
-
const type = String(input.type || "").trim();
|
|
241
|
-
if (type !== "telegram" && type !== "feishu" && type !== "qq") {
|
|
242
|
-
throw new Error(`Unsupported Chat Resource type: ${type}`);
|
|
243
|
-
}
|
|
244
|
-
const result = await resolveChatChannelBotInfo({
|
|
245
|
-
channel: type,
|
|
246
|
-
credentials: {
|
|
247
|
-
botToken: typeof input.bot_token === "string" ? input.bot_token : undefined,
|
|
248
|
-
appId: typeof input.app_id === "string" ? input.app_id : undefined,
|
|
249
|
-
appSecret: typeof input.app_secret === "string" ? input.app_secret : undefined,
|
|
250
|
-
domain: typeof input.domain === "string" ? input.domain : undefined,
|
|
251
|
-
sandbox: input.sandbox === true,
|
|
252
|
-
},
|
|
253
|
-
});
|
|
254
|
-
const identity = String(result.identity || "").trim();
|
|
255
|
-
const bot_user_id = String(result.botUserId || "").trim();
|
|
256
|
-
const owner = String(result.owner || "").trim();
|
|
257
|
-
const creator = String(result.creator || "").trim();
|
|
258
|
-
return {
|
|
259
|
-
name: result.name,
|
|
260
|
-
...(type === "telegram" && identity ? { username: identity } : {}),
|
|
261
|
-
...(type !== "telegram" && identity ? { identity } : {}),
|
|
262
|
-
...(bot_user_id ? { bot_user_id } : {}),
|
|
263
|
-
...(type === "feishu" && owner ? { owner } : {}),
|
|
264
|
-
...(type === "feishu" && creator ? { creator } : {}),
|
|
265
|
-
};
|
|
266
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Chat Plugin Resource 类型。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - Resource 是 City 解析后传给 Chat Plugin Factory 的完整配置对象。
|
|
6
|
-
* - `id` 是稳定本地身份,`type` 是渠道判别字段,`name` 等只读字段由 Resolver 写入。
|
|
7
|
-
* - 凭据仍属于完整 Resource Item,但 CLI 展示时必须根据 Schema 的 `writeOnly` 注解脱敏。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
/** Telegram Bot Resource。 */
|
|
11
|
-
export interface TelegramPluginResource {
|
|
12
|
-
/** CLI 生成的稳定 Resource ID。 */
|
|
13
|
-
id: string;
|
|
14
|
-
|
|
15
|
-
/** Telegram Resource 判别字段。 */
|
|
16
|
-
type: "telegram";
|
|
17
|
-
|
|
18
|
-
/** Resolver 获取的 Bot 真实名称。 */
|
|
19
|
-
name: string;
|
|
20
|
-
|
|
21
|
-
/** Telegram Bot API Token。 */
|
|
22
|
-
bot_token: string;
|
|
23
|
-
|
|
24
|
-
/** Resolver 获取的 Telegram username。 */
|
|
25
|
-
username?: string;
|
|
26
|
-
|
|
27
|
-
/** Resolver 获取的 Telegram Bot 用户 ID。 */
|
|
28
|
-
bot_user_id?: string;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** Feishu / Lark Bot Resource。 */
|
|
32
|
-
export interface FeishuPluginResource {
|
|
33
|
-
/** CLI 生成的稳定 Resource ID。 */
|
|
34
|
-
id: string;
|
|
35
|
-
|
|
36
|
-
/** Feishu Resource 判别字段。 */
|
|
37
|
-
type: "feishu";
|
|
38
|
-
|
|
39
|
-
/** Resolver 获取的 Bot 真实名称。 */
|
|
40
|
-
name: string;
|
|
41
|
-
|
|
42
|
-
/** Feishu / Lark App ID。 */
|
|
43
|
-
app_id: string;
|
|
44
|
-
|
|
45
|
-
/** Feishu / Lark App Secret。 */
|
|
46
|
-
app_secret: string;
|
|
47
|
-
|
|
48
|
-
/** 可选 Open API Domain。 */
|
|
49
|
-
domain?: string;
|
|
50
|
-
|
|
51
|
-
/** Resolver 获取的 Bot 身份。 */
|
|
52
|
-
identity?: string;
|
|
53
|
-
|
|
54
|
-
/** Resolver 获取的所有者名称。 */
|
|
55
|
-
owner?: string;
|
|
56
|
-
|
|
57
|
-
/** Resolver 获取的创建者名称。 */
|
|
58
|
-
creator?: string;
|
|
59
|
-
|
|
60
|
-
/** Resolver 获取的 Bot 用户 ID。 */
|
|
61
|
-
bot_user_id?: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** QQ Bot Resource。 */
|
|
65
|
-
export interface QqPluginResource {
|
|
66
|
-
/** CLI 生成的稳定 Resource ID。 */
|
|
67
|
-
id: string;
|
|
68
|
-
|
|
69
|
-
/** QQ Resource 判别字段。 */
|
|
70
|
-
type: "qq";
|
|
71
|
-
|
|
72
|
-
/** Resolver 获取的 Bot 真实名称。 */
|
|
73
|
-
name: string;
|
|
74
|
-
|
|
75
|
-
/** QQ Bot App ID。 */
|
|
76
|
-
app_id: string;
|
|
77
|
-
|
|
78
|
-
/** QQ Bot App Secret。 */
|
|
79
|
-
app_secret: string;
|
|
80
|
-
|
|
81
|
-
/** 是否使用 QQ 沙箱环境。 */
|
|
82
|
-
sandbox?: boolean;
|
|
83
|
-
|
|
84
|
-
/** Resolver 获取的 Bot 身份。 */
|
|
85
|
-
identity?: string;
|
|
86
|
-
|
|
87
|
-
/** Resolver 获取的 Bot 用户 ID。 */
|
|
88
|
-
bot_user_id?: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** Chat Plugin 支持的完整 Resource Item。 */
|
|
92
|
-
export type ChatPluginResource =
|
|
93
|
-
| TelegramPluginResource
|
|
94
|
-
| FeishuPluginResource
|
|
95
|
-
| QqPluginResource;
|
package/src/contact/Index.ts
DELETED
package/src/memory/Index.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Memory Plugin 导出入口。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - Index 只负责导出 Memory Plugin 与默认实现。
|
|
6
|
-
* - 真正运行时的 per-agent 实例由宿主显式创建并传给 Agent。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { MemoryPlugin } from "./MemoryPlugin.js";
|
|
10
|
-
export { BuiltinMemoryProvider } from "./providers/BuiltinMemoryProvider.js";
|
|
11
|
-
export {
|
|
12
|
-
FileMemoryStorageAdapter,
|
|
13
|
-
get_default_file_memory_root_path,
|
|
14
|
-
} from "./adapters/FileMemoryStorageAdapter.js";
|
package/src/skill/Command.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Skill 安装命令 helper。
|
|
3
|
-
*
|
|
4
|
-
* 设计目标(中文)
|
|
5
|
-
* - 不自建 registry,直接复用社区的 `npx skills` 安装生态。
|
|
6
|
-
* - 当前 helper 由需要准备 skill 依赖的其他 plugin 复用,不作为 SkillPlugin action 暴露。
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { execa } from "execa";
|
|
10
|
-
|
|
11
|
-
async function runNpxSkills(args: string[], opts?: { yes?: boolean }): Promise<number> {
|
|
12
|
-
const yes = opts?.yes !== false;
|
|
13
|
-
const result = await execa("npx", [yes ? "-y" : "", "skills", ...args].filter(Boolean), {
|
|
14
|
-
stdio: "inherit",
|
|
15
|
-
});
|
|
16
|
-
return result.exitCode ?? 0;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* skill 安装选项。
|
|
21
|
-
*/
|
|
22
|
-
export interface SkillInstallOptions {
|
|
23
|
-
/**
|
|
24
|
-
* 是否执行全局安装。
|
|
25
|
-
*/
|
|
26
|
-
global?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 是否跳过交互确认。
|
|
29
|
-
*/
|
|
30
|
-
yes?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* 安装目标 agent 名称。
|
|
33
|
-
*/
|
|
34
|
-
agent?: string;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* 安装指定 skill。
|
|
39
|
-
*/
|
|
40
|
-
export async function skillInstallCommand(
|
|
41
|
-
spec: string,
|
|
42
|
-
options: SkillInstallOptions = {},
|
|
43
|
-
): Promise<void> {
|
|
44
|
-
const s = String(spec || "").trim();
|
|
45
|
-
if (!s) throw new Error("Missing spec");
|
|
46
|
-
|
|
47
|
-
const args: string[] = ["add", s];
|
|
48
|
-
const agent = String(options.agent || "").trim();
|
|
49
|
-
if (agent) args.push("--agent", agent);
|
|
50
|
-
|
|
51
|
-
const yes = options.yes !== false;
|
|
52
|
-
if (yes) args.push("-y");
|
|
53
|
-
|
|
54
|
-
const globalInstall = options.global !== false;
|
|
55
|
-
if (globalInstall) args.push("-g");
|
|
56
|
-
|
|
57
|
-
await runNpxSkills(args, { yes });
|
|
58
|
-
}
|