@downcity/agent 1.1.32 → 1.1.35
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/README.md +26 -84
- package/bin/config/Defaults.js +1 -1
- package/bin/config/Defaults.js.map +1 -1
- package/bin/config/DowncitySchema.d.ts.map +1 -1
- package/bin/config/DowncitySchema.js +2 -8
- package/bin/config/DowncitySchema.js.map +1 -1
- package/bin/config/Paths.d.ts +2 -2
- package/bin/config/Paths.js +2 -2
- package/bin/config/project/AgentInitializer.d.ts.map +1 -1
- package/bin/config/project/AgentInitializer.js +2 -2
- package/bin/config/project/AgentInitializer.js.map +1 -1
- package/bin/core/AgentContextTypes.d.ts +10 -10
- package/bin/core/AgentContextTypes.d.ts.map +1 -1
- package/bin/core/AgentContextTypes.js +1 -1
- package/bin/core/AgentCore.d.ts +14 -13
- package/bin/core/AgentCore.d.ts.map +1 -1
- package/bin/core/AgentCore.js +63 -90
- package/bin/core/AgentCore.js.map +1 -1
- package/bin/core/AgentCoreTypes.d.ts +4 -4
- package/bin/core/AgentCoreTypes.d.ts.map +1 -1
- package/bin/core/AgentCoreTypes.js +1 -1
- package/bin/{session → executor}/Executor.d.ts +4 -4
- package/bin/executor/Executor.d.ts.map +1 -0
- package/bin/executor/Executor.js.map +1 -0
- package/bin/{session → executor}/SessionRunScope.d.ts +5 -5
- package/bin/executor/SessionRunScope.d.ts.map +1 -0
- package/bin/{session → executor}/SessionRunScope.js +1 -1
- package/bin/executor/SessionRunScope.js.map +1 -0
- package/bin/{session → executor}/composer/compaction/SessionCompactionComposer.d.ts +1 -1
- package/bin/executor/composer/compaction/SessionCompactionComposer.d.ts.map +1 -0
- package/bin/executor/composer/compaction/SessionCompactionComposer.js.map +1 -0
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts.map +1 -0
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionComposer.js.map +1 -0
- package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts +2 -2
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +1 -0
- package/bin/executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +1 -0
- package/bin/{session → executor}/composer/context/LocalSessionContextComposer.d.ts +2 -2
- package/bin/executor/composer/context/LocalSessionContextComposer.d.ts.map +1 -0
- package/bin/executor/composer/context/LocalSessionContextComposer.js.map +1 -0
- package/bin/{session → executor}/composer/context/SessionContextComposer.d.ts +2 -2
- package/bin/executor/composer/context/SessionContextComposer.d.ts.map +1 -0
- package/bin/executor/composer/context/SessionContextComposer.js.map +1 -0
- package/bin/{session → executor}/composer/history/SessionHistoryComposer.d.ts +2 -2
- package/bin/executor/composer/history/SessionHistoryComposer.d.ts.map +1 -0
- package/bin/executor/composer/history/SessionHistoryComposer.js.map +1 -0
- package/bin/{session → executor}/composer/history/SessionHistoryWriter.d.ts +2 -2
- package/bin/executor/composer/history/SessionHistoryWriter.d.ts.map +1 -0
- package/bin/executor/composer/history/SessionHistoryWriter.js.map +1 -0
- package/bin/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts +2 -2
- package/bin/executor/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts.map +1 -0
- package/bin/executor/composer/history/jsonl/JsonlSessionHistoryComposer.js.map +1 -0
- package/bin/executor/composer/system/SessionSystemComposer.d.ts.map +1 -0
- package/bin/executor/composer/system/SessionSystemComposer.js.map +1 -0
- package/bin/{session → executor}/composer/system/default/DefaultSessionSystemComposer.d.ts +1 -1
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -0
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.js.map +1 -0
- package/bin/executor/composer/system/default/InitPromptAssets.d.ts.map +1 -0
- package/bin/executor/composer/system/default/InitPromptAssets.js.map +1 -0
- package/bin/executor/composer/system/default/InitPrompts.d.ts.map +1 -0
- package/bin/executor/composer/system/default/InitPrompts.js.map +1 -0
- package/bin/executor/composer/system/default/PromptRenderer.d.ts.map +1 -0
- package/bin/executor/composer/system/default/PromptRenderer.js.map +1 -0
- package/bin/executor/composer/system/default/StaticPromptCatalog.d.ts.map +1 -0
- package/bin/executor/composer/system/default/StaticPromptCatalog.js.map +1 -0
- package/bin/{session → executor}/composer/system/default/SystemDomain.d.ts +9 -9
- package/bin/executor/composer/system/default/SystemDomain.d.ts.map +1 -0
- package/bin/{session → executor}/composer/system/default/SystemDomain.js +17 -17
- package/bin/executor/composer/system/default/SystemDomain.js.map +1 -0
- package/bin/executor/composer/system/default/SystemPromptAssets.d.ts.map +1 -0
- package/bin/executor/composer/system/default/SystemPromptAssets.js.map +1 -0
- package/bin/executor/composer/system/default/assets/core.prompt.d.ts.map +1 -0
- package/bin/{session → executor}/composer/system/default/assets/core.prompt.js +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.js.map +1 -0
- package/bin/executor/composer/system/default/assets/init/PROFILE.md.d.ts.map +1 -0
- package/bin/{session → executor}/composer/system/default/assets/init/PROFILE.md.js +1 -1
- package/bin/executor/composer/system/default/assets/init/PROFILE.md.js.map +1 -0
- package/bin/executor/composer/system/default/assets/init/SOUL.md.d.ts.map +1 -0
- package/bin/{session → executor}/composer/system/default/assets/init/SOUL.md.js +1 -1
- package/bin/executor/composer/system/default/assets/init/SOUL.md.js.map +1 -0
- package/bin/{session → executor}/composer/system/default/assets/plugin.prompt.d.ts +1 -1
- package/bin/executor/composer/system/default/assets/plugin.prompt.d.ts.map +1 -0
- package/bin/executor/composer/system/default/assets/plugin.prompt.js +8 -0
- package/bin/executor/composer/system/default/assets/plugin.prompt.js.map +1 -0
- package/bin/executor/composer/system/default/assets/task.prompt.d.ts.map +1 -0
- package/bin/{session → executor}/composer/system/default/assets/task.prompt.js +1 -1
- package/bin/executor/composer/system/default/assets/task.prompt.js.map +1 -0
- package/bin/executor/composer/system/default/variables/GeoContext.d.ts.map +1 -0
- package/bin/executor/composer/system/default/variables/GeoContext.js.map +1 -0
- package/bin/executor/composer/system/default/variables/PromptTypes.d.ts.map +1 -0
- package/bin/executor/composer/system/default/variables/PromptTypes.js.map +1 -0
- package/bin/executor/composer/system/default/variables/VariableReplacer.d.ts.map +1 -0
- package/bin/executor/composer/system/default/variables/VariableReplacer.js.map +1 -0
- package/bin/executor/core-engine/CoreEngineError.d.ts.map +1 -0
- package/bin/executor/core-engine/CoreEngineError.js.map +1 -0
- package/bin/{session → executor}/core-engine/CoreEngineLoopDecision.d.ts +1 -1
- package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts.map +1 -0
- package/bin/executor/core-engine/CoreEngineLoopDecision.js.map +1 -0
- package/bin/{session → executor}/core-engine/CoreEngineMessageState.d.ts +1 -1
- package/bin/executor/core-engine/CoreEngineMessageState.d.ts.map +1 -0
- package/bin/executor/core-engine/CoreEngineMessageState.js.map +1 -0
- package/bin/{session → executor}/core-engine/CoreEngineSignals.d.ts +1 -1
- package/bin/executor/core-engine/CoreEngineSignals.d.ts.map +1 -0
- package/bin/executor/core-engine/CoreEngineSignals.js.map +1 -0
- package/bin/{session → executor}/core-engine/CoreEngineUiStreamCollector.d.ts +1 -1
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts.map +1 -0
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.js.map +1 -0
- package/bin/executor/ids/resolveSessionId.d.ts.map +1 -0
- package/bin/executor/ids/resolveSessionId.js.map +1 -0
- package/bin/{session → executor}/messages/AssistantResultPersistence.d.ts +1 -1
- package/bin/executor/messages/AssistantResultPersistence.d.ts.map +1 -0
- package/bin/executor/messages/AssistantResultPersistence.js.map +1 -0
- package/bin/{session → executor}/messages/SessionAttachmentMapper.d.ts +1 -1
- package/bin/executor/messages/SessionAttachmentMapper.d.ts.map +1 -0
- package/bin/executor/messages/SessionAttachmentMapper.js.map +1 -0
- package/bin/{session → executor}/messages/SessionMessageCodec.d.ts +1 -1
- package/bin/executor/messages/SessionMessageCodec.d.ts.map +1 -0
- package/bin/executor/messages/SessionMessageCodec.js.map +1 -0
- package/bin/{session → executor}/messages/SessionMessageLog.d.ts +1 -1
- package/bin/executor/messages/SessionMessageLog.d.ts.map +1 -0
- package/bin/executor/messages/SessionMessageLog.js.map +1 -0
- package/bin/{session → executor}/messages/SessionStepEventMapper.d.ts +1 -1
- package/bin/executor/messages/SessionStepEventMapper.d.ts.map +1 -0
- package/bin/executor/messages/SessionStepEventMapper.js.map +1 -0
- package/bin/{session → executor}/store/history/SessionHistoryStore.d.ts +2 -2
- package/bin/executor/store/history/SessionHistoryStore.d.ts.map +1 -0
- package/bin/executor/store/history/SessionHistoryStore.js.map +1 -0
- package/bin/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.d.ts +3 -3
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +1 -0
- package/bin/executor/store/history/jsonl/JsonlSessionHistoryStore.js.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolBridge.d.ts +5 -5
- package/bin/executor/tools/shell/ShellToolBridge.d.ts.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolBridge.js +3 -3
- package/bin/executor/tools/shell/ShellToolBridge.js.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolDefinition.d.ts +2 -2
- package/bin/executor/tools/shell/ShellToolDefinition.d.ts.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolDefinition.js +2 -2
- package/bin/executor/tools/shell/ShellToolDefinition.js.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolFormatting.d.ts +2 -2
- package/bin/executor/tools/shell/ShellToolFormatting.d.ts.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolFormatting.js +2 -2
- package/bin/executor/tools/shell/ShellToolFormatting.js.map +1 -0
- package/bin/executor/tools/shell/ShellToolSchemas.d.ts.map +1 -0
- package/bin/{session → executor}/tools/shell/ShellToolSchemas.js +1 -1
- package/bin/executor/tools/shell/ShellToolSchemas.js.map +1 -0
- package/bin/{session → executor}/types/SessionExecutor.d.ts +1 -1
- package/bin/executor/types/SessionExecutor.d.ts.map +1 -0
- package/bin/executor/types/SessionExecutor.js.map +1 -0
- package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -0
- package/bin/executor/types/SessionHistoryMeta.js.map +1 -0
- package/bin/executor/types/SessionHistoryPaths.d.ts.map +1 -0
- package/bin/executor/types/SessionHistoryPaths.js.map +1 -0
- package/bin/executor/types/SessionLoop.d.ts.map +1 -0
- package/bin/executor/types/SessionLoop.js.map +1 -0
- package/bin/executor/types/SessionMessages.d.ts.map +1 -0
- package/bin/executor/types/SessionMessages.js.map +1 -0
- package/bin/executor/types/SessionPrompts.d.ts.map +1 -0
- package/bin/executor/types/SessionPrompts.js.map +1 -0
- package/bin/{session → executor}/types/SessionRun.d.ts +2 -2
- package/bin/executor/types/SessionRun.d.ts.map +1 -0
- package/bin/executor/types/SessionRun.js.map +1 -0
- package/bin/index.d.ts +26 -26
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +19 -19
- package/bin/index.js.map +1 -1
- package/bin/plugin/builtins/asr/Plugin.d.ts +7 -3
- package/bin/plugin/builtins/asr/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/asr/Plugin.js +404 -394
- package/bin/plugin/builtins/asr/Plugin.js.map +1 -1
- package/bin/plugin/builtins/auth/Plugin.d.ts +7 -3
- package/bin/plugin/builtins/auth/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/auth/Plugin.js +133 -123
- package/bin/plugin/builtins/auth/Plugin.js.map +1 -1
- package/bin/plugin/builtins/chat/Action.d.ts +4 -4
- package/bin/plugin/builtins/chat/Action.js +5 -5
- package/bin/plugin/builtins/chat/Action.js.map +1 -1
- package/bin/plugin/builtins/chat/ChatPlugin.js +3 -3
- package/bin/plugin/builtins/chat/ChatPlugin.js.map +1 -1
- package/bin/plugin/builtins/chat/ChatPluginTypes.d.ts +1 -1
- package/bin/plugin/builtins/chat/PROMPT.direct.d.ts +1 -1
- package/bin/plugin/builtins/chat/PROMPT.direct.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/PROMPT.direct.js +1 -1
- package/bin/plugin/builtins/chat/PROMPT.direct.js.map +1 -1
- package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.d.ts → ChannelAccountManager.d.ts} +4 -4
- package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.d.ts.map → ChannelAccountManager.d.ts.map} +1 -1
- package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.js → ChannelAccountManager.js} +4 -4
- package/bin/plugin/builtins/chat/accounts/{ChannelAccountService.js.map → ChannelAccountManager.js.map} +1 -1
- package/bin/plugin/builtins/chat/channels/feishu/types/FeishuChannel.d.ts +1 -1
- package/bin/plugin/builtins/chat/channels/feishu/types/FeishuChannel.js +1 -1
- package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.d.ts +1 -1
- package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.js +1 -1
- package/bin/plugin/builtins/chat/channels/qq/PROMPT.direct.js.map +1 -1
- package/bin/plugin/builtins/chat/channels/qq/types/QqChannel.d.ts +1 -1
- package/bin/plugin/builtins/chat/channels/qq/types/QqChannel.js +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatActionExecution.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatActionExecution.js +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatActionExecution.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatActionInput.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatActionInput.js +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelConfig.js +8 -8
- package/bin/plugin/builtins/chat/runtime/ChatChannelConfig.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelCore.js +11 -11
- package/bin/plugin/builtins/chat/runtime/ChatChannelCore.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelFacade.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelFacade.js +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelLifecycle.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatChannelLifecycle.js +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatMetaStore.d.ts +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatMetaStore.js +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatPluginActionRegistry.d.ts +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatPluginActionRegistry.js +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatPluginSystem.js +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatPluginSystem.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.d.ts +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.js +4 -4
- package/bin/plugin/builtins/chat/runtime/ChatPromptAssets.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatQueueStore.d.ts +4 -4
- package/bin/plugin/builtins/chat/runtime/ChatQueueStore.js +4 -4
- package/bin/plugin/builtins/chat/runtime/ChatQueueStore.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatQueueWorker.d.ts +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatQueueWorker.js +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatSession.d.ts +6 -6
- package/bin/plugin/builtins/chat/runtime/ChatSession.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatSession.js +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatSession.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.d.ts +3 -3
- package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.js +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatSessionContextComposer.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatSessionTypes.d.ts +2 -2
- package/bin/plugin/builtins/chat/runtime/ChatSessionTypes.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatkeySend.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/ChatkeySend.js +1 -1
- package/bin/plugin/builtins/chat/runtime/InboundAugment.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/InboundAugment.js +1 -1
- package/bin/plugin/builtins/chat/runtime/PluginDispatch.d.ts +2 -2
- package/bin/plugin/builtins/chat/runtime/PluginDispatch.js +2 -2
- package/bin/plugin/builtins/chat/runtime/PluginPoints.d.ts +10 -10
- package/bin/plugin/builtins/chat/runtime/PluginPoints.js +10 -10
- package/bin/plugin/builtins/chat/runtime/SystemPrompt.js +1 -1
- package/bin/plugin/builtins/chat/runtime/SystemPrompt.js.map +1 -1
- package/bin/plugin/builtins/chat/runtime/UIMessageTransformer.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/UIMessageTransformer.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/runtime/UserVisibleText.d.ts +1 -1
- package/bin/plugin/builtins/chat/runtime/UserVisibleText.d.ts.map +1 -1
- package/bin/plugin/builtins/chat/types/ChannelContext.d.ts +1 -1
- package/bin/plugin/builtins/chat/types/ChannelContext.js +1 -1
- package/bin/plugin/builtins/chat/types/ChannelStatus.d.ts +1 -1
- package/bin/plugin/builtins/chat/types/ChatMessageMarkup.d.ts +1 -1
- package/bin/plugin/builtins/chat/types/ChatMessageMarkup.js +1 -1
- package/bin/plugin/builtins/chat/types/ChatMeta.d.ts +2 -2
- package/bin/plugin/builtins/chat/types/ChatMeta.js +2 -2
- package/bin/plugin/builtins/chat/types/ChatPlugin.d.ts +6 -6
- package/bin/plugin/builtins/chat/types/ChatPlugin.js +3 -3
- package/bin/plugin/builtins/chat/types/ChatPluginActionPayload.d.ts +2 -2
- package/bin/plugin/builtins/chat/types/ChatPluginActionPayload.js +2 -2
- package/bin/plugin/builtins/chat/types/ChatPromptContext.d.ts +2 -2
- package/bin/plugin/builtins/chat/types/ChatRuntime.d.ts +3 -3
- package/bin/plugin/builtins/chat/types/ChatRuntime.js +2 -2
- package/bin/plugin/builtins/contact/Action.d.ts +3 -3
- package/bin/plugin/builtins/contact/Action.js +2 -2
- package/bin/plugin/builtins/contact/ContactPlugin.js +2 -2
- package/bin/plugin/builtins/contact/ContactPlugin.js.map +1 -1
- package/bin/plugin/builtins/contact/runtime/ContactPromptAssets.d.ts +2 -2
- package/bin/plugin/builtins/contact/runtime/ContactPromptAssets.js +2 -2
- package/bin/plugin/builtins/contact/runtime/Paths.d.ts +1 -1
- package/bin/plugin/builtins/contact/runtime/Paths.js +1 -1
- package/bin/plugin/builtins/contact/runtime/RemoteClient.d.ts +1 -1
- package/bin/plugin/builtins/contact/runtime/RemoteClient.js +2 -2
- package/bin/plugin/builtins/contact/runtime/RemoteClient.js.map +1 -1
- package/bin/plugin/builtins/contact/types/ContactCheck.d.ts +2 -2
- package/bin/plugin/builtins/contact/types/ContactCheck.d.ts.map +1 -1
- package/bin/plugin/builtins/contact/types/ContactCommand.d.ts +1 -1
- package/bin/plugin/builtins/contact/types/ContactCommand.js +1 -1
- package/bin/plugin/builtins/memory/MemoryPlugin.d.ts +1 -1
- package/bin/plugin/builtins/memory/MemoryPlugin.js +1 -1
- package/bin/plugin/builtins/memory/runtime/Search.js +1 -1
- package/bin/plugin/builtins/memory/runtime/Search.js.map +1 -1
- package/bin/plugin/builtins/memory/runtime/Store.d.ts +3 -3
- package/bin/plugin/builtins/memory/runtime/Store.js +3 -3
- package/bin/plugin/builtins/shell/ShellRuntimeTypes.d.ts +4 -4
- package/bin/plugin/builtins/shell/ShellRuntimeTypes.js +3 -3
- package/bin/plugin/builtins/shell/runtime/ShellActionRuntime.d.ts +2 -2
- package/bin/plugin/builtins/shell/runtime/ShellActionRuntime.js +2 -2
- package/bin/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.d.ts +2 -2
- package/bin/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.js +2 -2
- package/bin/plugin/builtins/shell/runtime/ShellProcessEvents.d.ts +1 -1
- package/bin/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.js +1 -1
- package/bin/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.js.map +1 -1
- package/bin/plugin/builtins/shell/types/ShellPlugin.d.ts +4 -4
- package/bin/plugin/builtins/shell/types/ShellPlugin.js +2 -2
- package/bin/plugin/builtins/skill/Plugin.d.ts +8 -4
- package/bin/plugin/builtins/skill/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/skill/Plugin.js +215 -205
- package/bin/plugin/builtins/skill/Plugin.js.map +1 -1
- package/bin/plugin/builtins/skill/runtime/SystemProvider.js +1 -1
- package/bin/plugin/builtins/skill/runtime/SystemProvider.js.map +1 -1
- package/bin/plugin/builtins/task/PROMPT.d.ts +1 -1
- package/bin/plugin/builtins/task/PROMPT.d.ts.map +1 -1
- package/bin/plugin/builtins/task/PROMPT.js +1 -1
- package/bin/plugin/builtins/task/PROMPT.js.map +1 -1
- package/bin/plugin/builtins/task/Scheduler.d.ts +4 -4
- package/bin/plugin/builtins/task/Scheduler.d.ts.map +1 -1
- package/bin/plugin/builtins/task/Scheduler.js +2 -2
- package/bin/plugin/builtins/task/runtime/CronTrigger.d.ts +4 -4
- package/bin/plugin/builtins/task/runtime/CronTrigger.d.ts.map +1 -1
- package/bin/plugin/builtins/task/runtime/CronTrigger.js +2 -2
- package/bin/plugin/builtins/task/runtime/CronTrigger.js.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskActionExecution.d.ts +1 -1
- package/bin/plugin/builtins/task/runtime/TaskActionExecution.js +1 -1
- package/bin/plugin/builtins/task/runtime/TaskActionInput.d.ts +1 -1
- package/bin/plugin/builtins/task/runtime/TaskActionInput.js +2 -2
- package/bin/plugin/builtins/task/runtime/TaskActionInput.js.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskPluginActionRegistry.d.ts +3 -3
- package/bin/plugin/builtins/task/runtime/TaskPluginActionRegistry.js +3 -3
- package/bin/plugin/builtins/task/runtime/TaskPromptAssets.d.ts.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskPromptAssets.js +2 -2
- package/bin/plugin/builtins/task/runtime/TaskPromptAssets.js.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunChatDispatch.d.ts +2 -2
- package/bin/plugin/builtins/task/runtime/TaskRunChatDispatch.js +2 -2
- package/bin/plugin/builtins/task/runtime/TaskRunnerRound.d.ts +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerRound.d.ts.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerRound.js +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerRound.js.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerSession.d.ts +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerSession.d.ts.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerSession.js +8 -8
- package/bin/plugin/builtins/task/runtime/TaskRunnerSession.js.map +1 -1
- package/bin/plugin/builtins/task/runtime/TaskRunnerTypes.d.ts +2 -2
- package/bin/plugin/builtins/task/runtime/TaskRunnerTypes.d.ts.map +1 -1
- package/bin/plugin/builtins/task/types/Cron.d.ts +3 -3
- package/bin/plugin/builtins/task/types/Cron.d.ts.map +1 -1
- package/bin/plugin/builtins/task/types/TaskPluginTypes.d.ts +3 -3
- package/bin/plugin/builtins/task/types/TaskPluginTypes.js +3 -3
- package/bin/plugin/builtins/tts/Plugin.d.ts +7 -3
- package/bin/plugin/builtins/tts/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/tts/Plugin.js +419 -409
- package/bin/plugin/builtins/tts/Plugin.js.map +1 -1
- package/bin/plugin/builtins/web/Plugin.d.ts +7 -3
- package/bin/plugin/builtins/web/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/web/Plugin.js +380 -370
- package/bin/plugin/builtins/web/Plugin.js.map +1 -1
- package/bin/plugin/builtins/workboard/Plugin.d.ts +7 -3
- package/bin/plugin/builtins/workboard/Plugin.d.ts.map +1 -1
- package/bin/plugin/builtins/workboard/Plugin.js +64 -54
- package/bin/plugin/builtins/workboard/Plugin.js.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.d.ts +1 -1
- package/bin/plugin/builtins/workboard/runtime/Collector.js +2 -2
- package/bin/plugin/builtins/workboard/runtime/Collector.js.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts +2 -2
- package/bin/plugin/builtins/workboard/runtime/Normalizer.d.ts.map +1 -1
- package/bin/plugin/builtins/workboard/runtime/Normalizer.js +1 -1
- package/bin/plugin/builtins/workboard/runtime/Normalizer.js.map +1 -1
- package/bin/plugin/core/BasePlugin.d.ts +2 -2
- package/bin/plugin/core/BasePlugin.js +2 -2
- package/bin/plugin/core/BuiltinPluginClasses.d.ts +8 -3
- package/bin/plugin/core/BuiltinPluginClasses.d.ts.map +1 -1
- package/bin/plugin/core/BuiltinPluginClasses.js +19 -2
- package/bin/plugin/core/BuiltinPluginClasses.js.map +1 -1
- package/bin/plugin/core/Catalog.d.ts +4 -3
- package/bin/plugin/core/Catalog.d.ts.map +1 -1
- package/bin/plugin/core/Catalog.js +3 -3
- package/bin/plugin/core/Catalog.js.map +1 -1
- package/bin/plugin/core/HttpRoutes.d.ts +2 -2
- package/bin/plugin/core/HttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/HttpRoutes.js +6 -6
- package/bin/plugin/core/HttpRoutes.js.map +1 -1
- package/bin/plugin/core/LocalExecution.d.ts.map +1 -1
- package/bin/plugin/core/LocalExecution.js +15 -0
- package/bin/plugin/core/LocalExecution.js.map +1 -1
- package/bin/plugin/core/PluginActionRunner.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionRunner.js +0 -1
- package/bin/plugin/core/PluginActionRunner.js.map +1 -1
- package/bin/plugin/core/PluginClassRegistry.d.ts +24 -4
- package/bin/plugin/core/PluginClassRegistry.d.ts.map +1 -1
- package/bin/plugin/core/PluginClassRegistry.js +30 -4
- package/bin/plugin/core/PluginClassRegistry.js.map +1 -1
- package/bin/plugin/core/PluginCommand.d.ts +2 -2
- package/bin/plugin/core/PluginCommand.js +4 -4
- package/bin/plugin/core/PluginCommand.js.map +1 -1
- package/bin/plugin/core/PluginCommandRequest.d.ts +4 -4
- package/bin/plugin/core/PluginCommandRequest.js +3 -3
- package/bin/plugin/core/PluginStateController.js +2 -2
- package/bin/plugin/core/PluginStateController.js.map +1 -1
- package/bin/plugin/core/schedule/Store.d.ts +2 -2
- package/bin/plugin/core/schedule/Store.js +2 -2
- package/bin/plugin/core/schedule/Time.d.ts +1 -1
- package/bin/plugin/core/schedule/Time.js +1 -1
- package/bin/plugin/types/Plugin.d.ts +17 -21
- package/bin/plugin/types/Plugin.d.ts.map +1 -1
- package/bin/plugin/types/PluginApi.d.ts +3 -3
- package/bin/plugin/types/PluginApi.d.ts.map +1 -1
- package/bin/plugin/types/PluginApi.js +1 -1
- package/bin/plugin/types/PluginState.d.ts +1 -1
- package/bin/plugin/types/PluginState.d.ts.map +1 -1
- package/bin/plugin/types/Plugins.d.ts +2 -2
- package/bin/plugin/types/Plugins.d.ts.map +1 -1
- package/bin/runtime/host/AgentHostRuntime.js +1 -1
- package/bin/runtime/host/daemon/Api.d.ts +2 -2
- package/bin/runtime/host/daemon/Api.js +1 -1
- package/bin/runtime/sandbox/types/SandboxRuntime.d.ts +1 -1
- package/bin/runtime/sandbox/types/SandboxRuntime.js +1 -1
- package/bin/runtime/server/http/Server.d.ts +8 -8
- package/bin/runtime/server/http/Server.d.ts.map +1 -1
- package/bin/runtime/server/http/Server.js +8 -30
- package/bin/runtime/server/http/Server.js.map +1 -1
- package/bin/runtime/server/http/control/ExecuteBySession.d.ts +1 -1
- package/bin/runtime/server/http/control/MessageTimeline.d.ts +1 -1
- package/bin/runtime/server/http/control/MessageTimeline.d.ts.map +1 -1
- package/bin/runtime/server/http/control/OverviewRoutes.d.ts +1 -1
- package/bin/runtime/server/http/control/OverviewRoutes.d.ts.map +1 -1
- package/bin/runtime/server/http/control/OverviewRoutes.js +2 -6
- package/bin/runtime/server/http/control/OverviewRoutes.js.map +1 -1
- package/bin/runtime/server/http/control/SessionRoutes.js +1 -1
- package/bin/runtime/server/http/control/SessionRoutes.js.map +1 -1
- package/bin/runtime/server/http/control/TaskRoutes.d.ts +1 -1
- package/bin/runtime/server/http/control/TaskRoutes.js +1 -1
- package/bin/runtime/server/http/plugins/plugins.d.ts +3 -3
- package/bin/runtime/server/http/plugins/plugins.d.ts.map +1 -1
- package/bin/runtime/server/http/plugins/plugins.js +61 -4
- package/bin/runtime/server/http/plugins/plugins.js.map +1 -1
- package/bin/runtime/server/http/sdk/Router.d.ts +2 -2
- package/bin/runtime/server/http/sdk/Router.d.ts.map +1 -1
- package/bin/runtime/server/http/sdk/Router.js +2 -2
- package/bin/runtime/server/http/sdk/Router.js.map +1 -1
- package/bin/runtime/server/http/sdk/SessionRoutes.d.ts +2 -2
- package/bin/runtime/server/http/sdk/SessionRoutes.d.ts.map +1 -1
- package/bin/runtime/server/http/sdk/SessionRoutes.js +72 -13
- package/bin/runtime/server/http/sdk/SessionRoutes.js.map +1 -1
- package/bin/runtime/server/rpc/Server.d.ts +2 -4
- package/bin/runtime/server/rpc/Server.d.ts.map +1 -1
- package/bin/runtime/server/rpc/Server.js +7 -12
- package/bin/runtime/server/rpc/Server.js.map +1 -1
- package/bin/sdk/Agent.d.ts +21 -20
- package/bin/sdk/Agent.d.ts.map +1 -1
- package/bin/sdk/Agent.js +46 -33
- package/bin/sdk/Agent.js.map +1 -1
- package/bin/sdk/AgentSdkTypes.d.ts +310 -38
- package/bin/sdk/AgentSdkTypes.d.ts.map +1 -1
- package/bin/sdk/AgentSdkTypes.js +1 -1
- package/bin/sdk/RemoteAgent.d.ts +9 -57
- package/bin/sdk/RemoteAgent.d.ts.map +1 -1
- package/bin/sdk/RemoteAgent.js +62 -14
- package/bin/sdk/RemoteAgent.js.map +1 -1
- package/bin/sdk/Session.d.ts +15 -16
- package/bin/sdk/Session.d.ts.map +1 -1
- package/bin/sdk/Session.js +47 -35
- package/bin/sdk/Session.js.map +1 -1
- package/bin/sdk/SessionSystemBuilder.d.ts +8 -8
- package/bin/sdk/SessionSystemBuilder.d.ts.map +1 -1
- package/bin/sdk/SessionSystemBuilder.js +6 -6
- package/bin/sdk/SessionSystemBuilder.js.map +1 -1
- package/bin/sdk/session/Browse.d.ts +76 -0
- package/bin/sdk/session/Browse.d.ts.map +1 -0
- package/bin/sdk/session/Browse.js +418 -0
- package/bin/sdk/session/Browse.js.map +1 -0
- package/bin/sdk/session/Metadata.d.ts +1 -1
- package/bin/sdk/session/Metadata.d.ts.map +1 -1
- package/bin/sdk/session/Persistence.d.ts +1 -1
- package/bin/sdk/session/Persistence.d.ts.map +1 -1
- package/bin/sdk/session/Persistence.js +1 -1
- package/bin/sdk/session/Persistence.js.map +1 -1
- package/bin/sdk/session/RuntimeSessionPort.d.ts +4 -4
- package/bin/sdk/session/RuntimeSessionPort.d.ts.map +1 -1
- package/bin/sdk/session/RuntimeSessionPort.js +3 -3
- package/bin/sdk/session/index.d.ts +2 -1
- package/bin/sdk/session/index.d.ts.map +1 -1
- package/bin/sdk/session/index.js +2 -1
- package/bin/sdk/session/index.js.map +1 -1
- package/bin/sdk/session/runtime/SessionPromptRuntime.d.ts +2 -2
- package/bin/sdk/session/runtime/SessionPromptRuntime.d.ts.map +1 -1
- package/bin/types/config/DowncityConfig.d.ts +132 -96
- package/bin/types/config/DowncityConfig.d.ts.map +1 -1
- package/bin/types/runtime/host/AgentHost.d.ts +1 -1
- package/bin/types/runtime/host/AgentHost.js +1 -1
- package/bin/types/runtime/http/InlineInstant.d.ts +2 -2
- package/bin/types/runtime/http/InlineInstant.d.ts.map +1 -1
- package/bin/types/runtime/platform/PlatformGateway.d.ts +10 -10
- package/bin/types/runtime/platform/PlatformGateway.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionEvent.d.ts +1 -1
- package/bin/types/sdk/AgentSessionEvent.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionTurn.d.ts +1 -1
- package/bin/types/sdk/AgentSessionTurn.d.ts.map +1 -1
- package/package.json +2 -2
- package/scripts/session-prompt-runtime.test.mjs +30 -10
- package/src/config/Defaults.ts +1 -1
- package/src/config/DowncitySchema.ts +2 -8
- package/src/config/Paths.ts +2 -2
- package/src/config/project/AgentInitializer.ts +4 -5
- package/src/core/AgentContextTypes.ts +10 -10
- package/src/core/AgentCore.ts +86 -93
- package/src/core/AgentCoreTypes.ts +4 -4
- package/src/{session → executor}/Executor.ts +21 -21
- package/src/{session → executor}/README.md +5 -5
- package/src/{session → executor}/SessionRunScope.ts +5 -5
- package/src/{session → executor}/composer/compaction/SessionCompactionComposer.ts +1 -1
- package/src/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.ts +1 -1
- package/src/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.ts +2 -2
- package/src/{session → executor}/composer/context/LocalSessionContextComposer.ts +4 -4
- package/src/{session → executor}/composer/context/SessionContextComposer.ts +2 -2
- package/src/{session → executor}/composer/history/SessionHistoryComposer.ts +2 -2
- package/src/{session → executor}/composer/history/SessionHistoryWriter.ts +2 -2
- package/src/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.ts +3 -3
- package/src/{session → executor}/composer/system/default/DefaultSessionSystemComposer.ts +4 -4
- package/src/{session → executor}/composer/system/default/InitPromptAssets.ts +2 -2
- package/src/{session → executor}/composer/system/default/InitPrompts.ts +1 -1
- package/src/{session → executor}/composer/system/default/PromptRenderer.ts +1 -1
- package/src/{session → executor}/composer/system/default/StaticPromptCatalog.ts +1 -1
- package/src/{session → executor}/composer/system/default/SystemDomain.ts +26 -26
- package/src/{session → executor}/composer/system/default/SystemPromptAssets.ts +3 -3
- package/src/{session → executor}/composer/system/default/assets/core.prompt.ts +1 -1
- package/src/{session → executor}/composer/system/default/assets/init/PROFILE.md.ts +1 -1
- package/src/{session → executor}/composer/system/default/assets/init/SOUL.md.ts +1 -1
- package/src/{session → executor}/composer/system/default/assets/plugin.prompt.ts +2 -2
- package/src/{session → executor}/composer/system/default/assets/plugin.prompt.ts.txt +2 -2
- package/src/{session → executor}/composer/system/default/assets/task.prompt.ts +1 -1
- package/src/{session → executor}/composer/system/default/variables/GeoContext.ts +1 -1
- package/src/{session → executor}/composer/system/default/variables/VariableReplacer.ts +2 -2
- package/src/{session → executor}/core-engine/CoreEngineLoopDecision.ts +1 -1
- package/src/{session → executor}/core-engine/CoreEngineMessageState.ts +2 -2
- package/src/{session → executor}/core-engine/CoreEngineSignals.ts +1 -1
- package/src/{session → executor}/core-engine/CoreEngineUiStreamCollector.ts +3 -3
- package/src/{session → executor}/messages/AssistantResultPersistence.ts +1 -1
- package/src/{session → executor}/messages/SessionAttachmentMapper.ts +1 -1
- package/src/{session → executor}/messages/SessionMessageCodec.ts +2 -2
- package/src/{session → executor}/messages/SessionMessageLog.ts +1 -1
- package/src/{session → executor}/messages/SessionStepEventMapper.ts +1 -1
- package/src/{session → executor}/store/history/SessionHistoryStore.ts +2 -2
- package/src/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.ts +6 -6
- package/src/{session → executor}/tools/shell/ShellToolBridge.ts +6 -6
- package/src/{session → executor}/tools/shell/ShellToolDefinition.ts +2 -2
- package/src/{session → executor}/tools/shell/ShellToolFormatting.ts +3 -3
- package/src/{session → executor}/tools/shell/ShellToolSchemas.ts +1 -1
- package/src/{session → executor}/types/SessionExecutor.ts +1 -1
- package/src/{session → executor}/types/SessionRun.ts +2 -2
- package/src/index.ts +43 -28
- package/src/plugin/builtins/asr/Plugin.ts +24 -11
- package/src/plugin/builtins/auth/Plugin.ts +19 -6
- package/src/plugin/builtins/chat/Action.ts +5 -5
- package/src/plugin/builtins/chat/ChatPlugin.ts +3 -3
- package/src/plugin/builtins/chat/ChatPluginTypes.ts +1 -1
- package/src/plugin/builtins/chat/PROMPT.direct.ts +1 -1
- package/src/plugin/builtins/chat/PROMPT.direct.ts.txt +1 -1
- package/src/plugin/builtins/chat/accounts/{ChannelAccountService.ts → ChannelAccountManager.ts} +3 -3
- package/src/plugin/builtins/chat/channels/feishu/types/FeishuChannel.ts +1 -1
- package/src/plugin/builtins/chat/channels/qq/PROMPT.direct.ts +1 -1
- package/src/plugin/builtins/chat/channels/qq/PROMPT.direct.ts.txt +1 -1
- package/src/plugin/builtins/chat/channels/qq/types/QqChannel.ts +1 -1
- package/src/plugin/builtins/chat/runtime/ChatActionExecution.ts +2 -2
- package/src/plugin/builtins/chat/runtime/ChatActionInput.ts +1 -1
- package/src/plugin/builtins/chat/runtime/ChatChannelConfig.ts +8 -8
- package/src/plugin/builtins/chat/runtime/ChatChannelCore.ts +14 -14
- package/src/plugin/builtins/chat/runtime/ChatChannelFacade.ts +1 -1
- package/src/plugin/builtins/chat/runtime/ChatChannelLifecycle.ts +1 -1
- package/src/plugin/builtins/chat/runtime/ChatMetaStore.ts +2 -2
- package/src/plugin/builtins/chat/runtime/ChatPluginActionRegistry.ts +3 -3
- package/src/plugin/builtins/chat/runtime/ChatPluginSystem.ts +2 -2
- package/src/plugin/builtins/chat/runtime/ChatPromptAssets.ts +4 -4
- package/src/plugin/builtins/chat/runtime/ChatQueueStore.ts +5 -5
- package/src/plugin/builtins/chat/runtime/ChatQueueWorker.ts +3 -3
- package/src/plugin/builtins/chat/runtime/ChatSession.ts +7 -7
- package/src/plugin/builtins/chat/runtime/ChatSessionContextComposer.ts +4 -4
- package/src/plugin/builtins/chat/runtime/ChatSessionTypes.ts +2 -2
- package/src/plugin/builtins/chat/runtime/ChatkeySend.ts +1 -1
- package/src/plugin/builtins/chat/runtime/InboundAugment.ts +1 -1
- package/src/plugin/builtins/chat/runtime/PluginDispatch.ts +2 -2
- package/src/plugin/builtins/chat/runtime/PluginPoints.ts +10 -10
- package/src/plugin/builtins/chat/runtime/SystemPrompt.ts +1 -1
- package/src/plugin/builtins/chat/runtime/UIMessageTransformer.ts +1 -1
- package/src/plugin/builtins/chat/runtime/UserVisibleText.ts +1 -1
- package/src/plugin/builtins/chat/types/ChannelContext.ts +1 -1
- package/src/plugin/builtins/chat/types/ChannelStatus.ts +1 -1
- package/src/plugin/builtins/chat/types/ChatMessageMarkup.ts +1 -1
- package/src/plugin/builtins/chat/types/ChatMeta.ts +2 -2
- package/src/plugin/builtins/chat/types/ChatPlugin.ts +6 -6
- package/src/plugin/builtins/chat/types/ChatPluginActionPayload.ts +2 -2
- package/src/plugin/builtins/chat/types/ChatPromptContext.ts +2 -2
- package/src/plugin/builtins/chat/types/ChatRuntime.ts +3 -3
- package/src/plugin/builtins/contact/Action.ts +3 -3
- package/src/plugin/builtins/contact/ContactPlugin.ts +2 -2
- package/src/plugin/builtins/contact/runtime/ChatRuntime.ts +1 -1
- package/src/plugin/builtins/contact/runtime/ContactPromptAssets.ts +2 -2
- package/src/plugin/builtins/contact/runtime/Paths.ts +1 -1
- package/src/plugin/builtins/contact/runtime/RemoteClient.ts +2 -2
- package/src/plugin/builtins/contact/types/ContactCheck.ts +2 -2
- package/src/plugin/builtins/contact/types/ContactCommand.ts +1 -1
- package/src/plugin/builtins/memory/MemoryPlugin.ts +1 -1
- package/src/plugin/builtins/memory/runtime/Search.ts +1 -1
- package/src/plugin/builtins/memory/runtime/Store.ts +3 -3
- package/src/plugin/builtins/shell/ShellRuntimeTypes.ts +4 -4
- package/src/plugin/builtins/shell/runtime/ShellActionRuntime.ts +2 -2
- package/src/plugin/builtins/shell/runtime/ShellActionRuntimeSupport.ts +2 -2
- package/src/plugin/builtins/shell/runtime/ShellProcessEvents.ts +1 -1
- package/src/plugin/builtins/shell/runtime/ShellRuntimeEnvironment.ts +1 -1
- package/src/plugin/builtins/shell/types/ShellPlugin.ts +4 -4
- package/src/plugin/builtins/skill/Plugin.ts +21 -8
- package/src/plugin/builtins/skill/runtime/SystemProvider.ts +1 -1
- package/src/plugin/builtins/task/PROMPT.ts +1 -1
- package/src/plugin/builtins/task/PROMPT.ts.txt +5 -5
- package/src/plugin/builtins/task/Scheduler.ts +4 -4
- package/src/plugin/builtins/task/runtime/CronTrigger.ts +9 -9
- package/src/plugin/builtins/task/runtime/TaskActionExecution.ts +1 -1
- package/src/plugin/builtins/task/runtime/TaskActionInput.ts +2 -2
- package/src/plugin/builtins/task/runtime/TaskPluginActionRegistry.ts +3 -3
- package/src/plugin/builtins/task/runtime/TaskPromptAssets.ts +2 -2
- package/src/plugin/builtins/task/runtime/TaskRunChatDispatch.ts +2 -2
- package/src/plugin/builtins/task/runtime/TaskRunnerRound.ts +2 -2
- package/src/plugin/builtins/task/runtime/TaskRunnerSession.ts +10 -10
- package/src/plugin/builtins/task/runtime/TaskRunnerTypes.ts +2 -2
- package/src/plugin/builtins/task/types/Cron.ts +3 -3
- package/src/plugin/builtins/task/types/TaskPluginTypes.ts +3 -3
- package/src/plugin/builtins/tts/Plugin.ts +23 -10
- package/src/plugin/builtins/web/Plugin.ts +23 -10
- package/src/plugin/builtins/workboard/Plugin.ts +71 -58
- package/src/plugin/builtins/workboard/runtime/Collector.ts +2 -2
- package/src/plugin/builtins/workboard/runtime/Normalizer.ts +3 -3
- package/src/plugin/core/BasePlugin.ts +2 -2
- package/src/plugin/core/BuiltinPluginClasses.ts +20 -3
- package/src/plugin/core/Catalog.ts +6 -5
- package/src/plugin/core/HttpRoutes.ts +6 -6
- package/src/plugin/core/LocalExecution.ts +15 -0
- package/src/plugin/core/PluginActionRunner.ts +0 -1
- package/src/plugin/core/PluginClassRegistry.ts +33 -4
- package/src/plugin/core/PluginCommand.ts +4 -4
- package/src/plugin/core/PluginCommandRequest.ts +4 -4
- package/src/plugin/core/PluginStateController.ts +2 -2
- package/src/plugin/core/schedule/Store.ts +2 -2
- package/src/plugin/core/schedule/Time.ts +1 -1
- package/src/plugin/types/Plugin.ts +18 -22
- package/src/plugin/types/PluginApi.ts +3 -3
- package/src/plugin/types/PluginState.ts +0 -5
- package/src/plugin/types/Plugins.ts +2 -2
- package/src/runtime/host/AgentHostRuntime.ts +1 -1
- package/src/runtime/host/daemon/Api.ts +2 -2
- package/src/runtime/sandbox/types/SandboxRuntime.ts +1 -1
- package/src/runtime/server/http/Server.ts +19 -51
- package/src/runtime/server/http/control/MessageTimeline.ts +1 -1
- package/src/runtime/server/http/control/OverviewRoutes.ts +2 -6
- package/src/runtime/server/http/control/SessionRoutes.ts +1 -1
- package/src/runtime/server/http/control/TaskRoutes.ts +1 -1
- package/src/runtime/server/http/plugins/plugins.ts +71 -4
- package/src/runtime/server/http/sdk/Router.ts +3 -3
- package/src/runtime/server/http/sdk/SessionRoutes.ts +82 -14
- package/src/runtime/server/rpc/Server.ts +13 -20
- package/src/sdk/Agent.ts +57 -39
- package/src/sdk/AgentSdkTypes.ts +358 -40
- package/src/sdk/RemoteAgent.ts +93 -21
- package/src/sdk/Session.ts +61 -43
- package/src/sdk/SessionSystemBuilder.ts +12 -12
- package/src/sdk/session/Browse.ts +519 -0
- package/src/sdk/session/Metadata.ts +1 -1
- package/src/sdk/session/Persistence.ts +3 -3
- package/src/sdk/session/RuntimeSessionPort.ts +4 -4
- package/src/sdk/session/index.ts +10 -1
- package/src/sdk/session/runtime/SessionPromptRuntime.ts +2 -2
- package/src/types/config/DowncityConfig.ts +143 -96
- package/src/types/runtime/host/AgentHost.ts +1 -1
- package/src/types/runtime/http/InlineInstant.ts +2 -2
- package/src/types/runtime/platform/PlatformGateway.ts +10 -10
- package/src/types/sdk/AgentSessionEvent.ts +1 -1
- package/src/types/sdk/AgentSessionTurn.ts +1 -1
- package/tsconfig.json +1 -2
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/plugin/core/Plugins.d.ts +0 -20
- package/bin/plugin/core/Plugins.d.ts.map +0 -1
- package/bin/plugin/core/Plugins.js +0 -33
- package/bin/plugin/core/Plugins.js.map +0 -1
- package/bin/runtime/host/PluginRuntime.d.ts +0 -24
- package/bin/runtime/host/PluginRuntime.d.ts.map +0 -1
- package/bin/runtime/host/PluginRuntime.js +0 -31
- package/bin/runtime/host/PluginRuntime.js.map +0 -1
- package/bin/runtime/server/http/services/services.d.ts +0 -25
- package/bin/runtime/server/http/services/services.d.ts.map +0 -1
- package/bin/runtime/server/http/services/services.js +0 -82
- package/bin/runtime/server/http/services/services.js.map +0 -1
- package/bin/session/Executor.d.ts.map +0 -1
- package/bin/session/Executor.js.map +0 -1
- package/bin/session/SessionRunScope.d.ts.map +0 -1
- package/bin/session/SessionRunScope.js.map +0 -1
- package/bin/session/composer/compaction/SessionCompactionComposer.d.ts.map +0 -1
- package/bin/session/composer/compaction/SessionCompactionComposer.js.map +0 -1
- package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts.map +0 -1
- package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionComposer.js.map +0 -1
- package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionExecutor.d.ts.map +0 -1
- package/bin/session/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js.map +0 -1
- package/bin/session/composer/context/LocalSessionContextComposer.d.ts.map +0 -1
- package/bin/session/composer/context/LocalSessionContextComposer.js.map +0 -1
- package/bin/session/composer/context/SessionContextComposer.d.ts.map +0 -1
- package/bin/session/composer/context/SessionContextComposer.js.map +0 -1
- package/bin/session/composer/history/SessionHistoryComposer.d.ts.map +0 -1
- package/bin/session/composer/history/SessionHistoryComposer.js.map +0 -1
- package/bin/session/composer/history/SessionHistoryWriter.d.ts.map +0 -1
- package/bin/session/composer/history/SessionHistoryWriter.js.map +0 -1
- package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.d.ts.map +0 -1
- package/bin/session/composer/history/jsonl/JsonlSessionHistoryComposer.js.map +0 -1
- package/bin/session/composer/system/SessionSystemComposer.d.ts.map +0 -1
- package/bin/session/composer/system/SessionSystemComposer.js.map +0 -1
- package/bin/session/composer/system/default/DefaultSessionSystemComposer.d.ts.map +0 -1
- package/bin/session/composer/system/default/DefaultSessionSystemComposer.js.map +0 -1
- package/bin/session/composer/system/default/InitPromptAssets.d.ts.map +0 -1
- package/bin/session/composer/system/default/InitPromptAssets.js.map +0 -1
- package/bin/session/composer/system/default/InitPrompts.d.ts.map +0 -1
- package/bin/session/composer/system/default/InitPrompts.js.map +0 -1
- package/bin/session/composer/system/default/PromptRenderer.d.ts.map +0 -1
- package/bin/session/composer/system/default/PromptRenderer.js.map +0 -1
- package/bin/session/composer/system/default/StaticPromptCatalog.d.ts.map +0 -1
- package/bin/session/composer/system/default/StaticPromptCatalog.js.map +0 -1
- package/bin/session/composer/system/default/SystemDomain.d.ts.map +0 -1
- package/bin/session/composer/system/default/SystemDomain.js.map +0 -1
- package/bin/session/composer/system/default/SystemPromptAssets.d.ts.map +0 -1
- package/bin/session/composer/system/default/SystemPromptAssets.js.map +0 -1
- package/bin/session/composer/system/default/assets/core.prompt.d.ts.map +0 -1
- package/bin/session/composer/system/default/assets/core.prompt.js.map +0 -1
- package/bin/session/composer/system/default/assets/init/PROFILE.md.d.ts.map +0 -1
- package/bin/session/composer/system/default/assets/init/PROFILE.md.js.map +0 -1
- package/bin/session/composer/system/default/assets/init/SOUL.md.d.ts.map +0 -1
- package/bin/session/composer/system/default/assets/init/SOUL.md.js.map +0 -1
- package/bin/session/composer/system/default/assets/plugin.prompt.d.ts.map +0 -1
- package/bin/session/composer/system/default/assets/plugin.prompt.js +0 -8
- package/bin/session/composer/system/default/assets/plugin.prompt.js.map +0 -1
- package/bin/session/composer/system/default/assets/task.prompt.d.ts.map +0 -1
- package/bin/session/composer/system/default/assets/task.prompt.js.map +0 -1
- package/bin/session/composer/system/default/variables/GeoContext.d.ts.map +0 -1
- package/bin/session/composer/system/default/variables/GeoContext.js.map +0 -1
- package/bin/session/composer/system/default/variables/PromptTypes.d.ts.map +0 -1
- package/bin/session/composer/system/default/variables/PromptTypes.js.map +0 -1
- package/bin/session/composer/system/default/variables/VariableReplacer.d.ts.map +0 -1
- package/bin/session/composer/system/default/variables/VariableReplacer.js.map +0 -1
- package/bin/session/core-engine/CoreEngineError.d.ts.map +0 -1
- package/bin/session/core-engine/CoreEngineError.js.map +0 -1
- package/bin/session/core-engine/CoreEngineLoopDecision.d.ts.map +0 -1
- package/bin/session/core-engine/CoreEngineLoopDecision.js.map +0 -1
- package/bin/session/core-engine/CoreEngineMessageState.d.ts.map +0 -1
- package/bin/session/core-engine/CoreEngineMessageState.js.map +0 -1
- package/bin/session/core-engine/CoreEngineSignals.d.ts.map +0 -1
- package/bin/session/core-engine/CoreEngineSignals.js.map +0 -1
- package/bin/session/core-engine/CoreEngineUiStreamCollector.d.ts.map +0 -1
- package/bin/session/core-engine/CoreEngineUiStreamCollector.js.map +0 -1
- package/bin/session/ids/resolveSessionId.d.ts.map +0 -1
- package/bin/session/ids/resolveSessionId.js.map +0 -1
- package/bin/session/messages/AssistantResultPersistence.d.ts.map +0 -1
- package/bin/session/messages/AssistantResultPersistence.js.map +0 -1
- package/bin/session/messages/SessionAttachmentMapper.d.ts.map +0 -1
- package/bin/session/messages/SessionAttachmentMapper.js.map +0 -1
- package/bin/session/messages/SessionMessageCodec.d.ts.map +0 -1
- package/bin/session/messages/SessionMessageCodec.js.map +0 -1
- package/bin/session/messages/SessionMessageLog.d.ts.map +0 -1
- package/bin/session/messages/SessionMessageLog.js.map +0 -1
- package/bin/session/messages/SessionStepEventMapper.d.ts.map +0 -1
- package/bin/session/messages/SessionStepEventMapper.js.map +0 -1
- package/bin/session/store/history/SessionHistoryStore.d.ts.map +0 -1
- package/bin/session/store/history/SessionHistoryStore.js.map +0 -1
- package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.d.ts.map +0 -1
- package/bin/session/store/history/jsonl/JsonlSessionHistoryStore.js.map +0 -1
- package/bin/session/tools/shell/ShellToolBridge.d.ts.map +0 -1
- package/bin/session/tools/shell/ShellToolBridge.js.map +0 -1
- package/bin/session/tools/shell/ShellToolDefinition.d.ts.map +0 -1
- package/bin/session/tools/shell/ShellToolDefinition.js.map +0 -1
- package/bin/session/tools/shell/ShellToolFormatting.d.ts.map +0 -1
- package/bin/session/tools/shell/ShellToolFormatting.js.map +0 -1
- package/bin/session/tools/shell/ShellToolSchemas.d.ts.map +0 -1
- package/bin/session/tools/shell/ShellToolSchemas.js.map +0 -1
- package/bin/session/types/SessionExecutor.d.ts.map +0 -1
- package/bin/session/types/SessionExecutor.js.map +0 -1
- package/bin/session/types/SessionHistoryMeta.d.ts.map +0 -1
- package/bin/session/types/SessionHistoryMeta.js.map +0 -1
- package/bin/session/types/SessionHistoryPaths.d.ts.map +0 -1
- package/bin/session/types/SessionHistoryPaths.js.map +0 -1
- package/bin/session/types/SessionLoop.d.ts.map +0 -1
- package/bin/session/types/SessionLoop.js.map +0 -1
- package/bin/session/types/SessionMessages.d.ts.map +0 -1
- package/bin/session/types/SessionMessages.js.map +0 -1
- package/bin/session/types/SessionPrompts.d.ts.map +0 -1
- package/bin/session/types/SessionPrompts.js.map +0 -1
- package/bin/session/types/SessionRun.d.ts.map +0 -1
- package/bin/session/types/SessionRun.js.map +0 -1
- package/src/plugin/core/Plugins.ts +0 -39
- package/src/runtime/host/PluginRuntime.ts +0 -42
- package/src/runtime/server/http/services/services.ts +0 -114
- /package/bin/{session → executor}/Executor.js +0 -0
- /package/bin/{session → executor}/composer/compaction/SessionCompactionComposer.js +0 -0
- /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.d.ts +0 -0
- /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionComposer.js +0 -0
- /package/bin/{session → executor}/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js +0 -0
- /package/bin/{session → executor}/composer/context/LocalSessionContextComposer.js +0 -0
- /package/bin/{session → executor}/composer/context/SessionContextComposer.js +0 -0
- /package/bin/{session → executor}/composer/history/SessionHistoryComposer.js +0 -0
- /package/bin/{session → executor}/composer/history/SessionHistoryWriter.js +0 -0
- /package/bin/{session → executor}/composer/history/jsonl/JsonlSessionHistoryComposer.js +0 -0
- /package/bin/{session → executor}/composer/system/SessionSystemComposer.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/SessionSystemComposer.js +0 -0
- /package/bin/{session → executor}/composer/system/default/DefaultSessionSystemComposer.js +0 -0
- /package/bin/{session → executor}/composer/system/default/InitPromptAssets.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/InitPromptAssets.js +0 -0
- /package/bin/{session → executor}/composer/system/default/InitPrompts.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/InitPrompts.js +0 -0
- /package/bin/{session → executor}/composer/system/default/PromptRenderer.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/PromptRenderer.js +0 -0
- /package/bin/{session → executor}/composer/system/default/StaticPromptCatalog.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/StaticPromptCatalog.js +0 -0
- /package/bin/{session → executor}/composer/system/default/SystemPromptAssets.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/SystemPromptAssets.js +0 -0
- /package/bin/{session → executor}/composer/system/default/assets/core.prompt.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/assets/init/PROFILE.md.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/assets/init/SOUL.md.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/assets/task.prompt.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/GeoContext.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/GeoContext.js +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/PromptTypes.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/PromptTypes.js +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/VariableReplacer.d.ts +0 -0
- /package/bin/{session → executor}/composer/system/default/variables/VariableReplacer.js +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineError.d.ts +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineError.js +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineLoopDecision.js +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineMessageState.js +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineSignals.js +0 -0
- /package/bin/{session → executor}/core-engine/CoreEngineUiStreamCollector.js +0 -0
- /package/bin/{session → executor}/ids/resolveSessionId.d.ts +0 -0
- /package/bin/{session → executor}/ids/resolveSessionId.js +0 -0
- /package/bin/{session → executor}/messages/AssistantResultPersistence.js +0 -0
- /package/bin/{session → executor}/messages/SessionAttachmentMapper.js +0 -0
- /package/bin/{session → executor}/messages/SessionMessageCodec.js +0 -0
- /package/bin/{session → executor}/messages/SessionMessageLog.js +0 -0
- /package/bin/{session → executor}/messages/SessionStepEventMapper.js +0 -0
- /package/bin/{session → executor}/store/history/SessionHistoryStore.js +0 -0
- /package/bin/{session → executor}/store/history/jsonl/JsonlSessionHistoryStore.js +0 -0
- /package/bin/{session → executor}/tools/shell/ShellToolSchemas.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionExecutor.js +0 -0
- /package/bin/{session → executor}/types/SessionHistoryMeta.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionHistoryMeta.js +0 -0
- /package/bin/{session → executor}/types/SessionHistoryPaths.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionHistoryPaths.js +0 -0
- /package/bin/{session → executor}/types/SessionLoop.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionLoop.js +0 -0
- /package/bin/{session → executor}/types/SessionMessages.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionMessages.js +0 -0
- /package/bin/{session → executor}/types/SessionPrompts.d.ts +0 -0
- /package/bin/{session → executor}/types/SessionPrompts.js +0 -0
- /package/bin/{session → executor}/types/SessionRun.js +0 -0
- /package/src/{session → executor}/composer/system/SessionSystemComposer.ts +0 -0
- /package/src/{session → executor}/composer/system/default/assets/core.prompt.ts.txt +0 -0
- /package/src/{session → executor}/composer/system/default/assets/init/PROFILE.md.ts.txt +0 -0
- /package/src/{session → executor}/composer/system/default/assets/init/SOUL.md.ts.txt +0 -0
- /package/src/{session → executor}/composer/system/default/assets/task.prompt.ts.txt +0 -0
- /package/src/{session → executor}/composer/system/default/variables/PromptTypes.ts +0 -0
- /package/src/{session → executor}/core-engine/CoreEngineError.ts +0 -0
- /package/src/{session → executor}/ids/resolveSessionId.ts +0 -0
- /package/src/{session → executor}/types/SessionHistoryMeta.ts +0 -0
- /package/src/{session → executor}/types/SessionHistoryPaths.ts +0 -0
- /package/src/{session → executor}/types/SessionLoop.ts +0 -0
- /package/src/{session → executor}/types/SessionMessages.ts +0 -0
- /package/src/{session → executor}/types/SessionPrompts.ts +0 -0
|
@@ -5,468 +5,478 @@
|
|
|
5
5
|
* - TTS Plugin 现在自己内聚本地模型与 Python 依赖,不再依赖 console 模型池。
|
|
6
6
|
* - Console 只通过 setup / action 与插件交互,保持极简统一。
|
|
7
7
|
*/
|
|
8
|
+
import { BasePlugin } from "../../../plugin/core/BasePlugin.js";
|
|
8
9
|
import { isPluginEnabled } from "../../../plugin/core/Activation.js";
|
|
9
10
|
import { checkTtsSynthesizer, installTtsSynthesizer, listTtsModelOptions, readTtsPluginConfig, writeTtsPluginConfig, } from "../../../plugin/builtins/tts/Dependency.js";
|
|
10
11
|
import { resolveTtsModelId } from "../../../plugin/builtins/tts/runtime/Catalog.js";
|
|
11
12
|
import { synthesizeSpeechFile } from "../../../plugin/builtins/tts/runtime/Synthesizer.js";
|
|
12
13
|
import { getBooleanOpt, getNumberOpt, getStringOpt, toJsonObject, } from "../../../plugin/builtins/tts/PluginSupport.js";
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
format: "wav",
|
|
27
|
-
speed: 1,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
setup: {
|
|
31
|
-
mode: "install-configure",
|
|
32
|
-
title: "安装语音合成",
|
|
33
|
-
description: "选择模型后直接完成模型下载、独立运行环境准备与配置写入。",
|
|
34
|
-
fields: [
|
|
35
|
-
{
|
|
36
|
-
key: "modelId",
|
|
37
|
-
label: "模型",
|
|
38
|
-
type: "select",
|
|
39
|
-
required: true,
|
|
40
|
-
sourceAction: "models",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
key: "format",
|
|
44
|
-
label: "输出格式",
|
|
45
|
-
type: "select",
|
|
46
|
-
required: true,
|
|
47
|
-
options: [
|
|
48
|
-
{ label: "WAV", value: "wav" },
|
|
49
|
-
{ label: "FLAC", value: "flac" },
|
|
50
|
-
],
|
|
51
|
-
},
|
|
52
|
-
],
|
|
53
|
-
primaryAction: "install",
|
|
54
|
-
statusAction: "status",
|
|
55
|
-
},
|
|
56
|
-
usage: {
|
|
57
|
-
title: "配置语音合成",
|
|
58
|
-
description: "设置当前 agent 默认使用的语音模型与输出参数。",
|
|
59
|
-
fields: [
|
|
60
|
-
{
|
|
61
|
-
key: "modelId",
|
|
62
|
-
label: "默认模型",
|
|
63
|
-
type: "select",
|
|
64
|
-
required: true,
|
|
65
|
-
sourceAction: "models",
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
key: "format",
|
|
69
|
-
label: "输出格式",
|
|
70
|
-
type: "select",
|
|
71
|
-
required: true,
|
|
72
|
-
options: [
|
|
73
|
-
{ label: "WAV", value: "wav", description: "兼容性最好,适合绝大多数渠道。" },
|
|
74
|
-
{ label: "FLAC", value: "flac", description: "体积更小,适合存档或传输。" },
|
|
75
|
-
],
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
key: "speed",
|
|
79
|
-
label: "默认语速",
|
|
80
|
-
type: "number",
|
|
81
|
-
placeholder: "1",
|
|
82
|
-
description: "1 为正常语速,可按需要设置为 0.8、1.2 等。",
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
key: "language",
|
|
86
|
-
label: "默认语言提示",
|
|
87
|
-
type: "string",
|
|
88
|
-
placeholder: "auto / zh / en",
|
|
14
|
+
function createTtsPluginDefinition(plugin) {
|
|
15
|
+
return {
|
|
16
|
+
name: "tts",
|
|
17
|
+
title: "Text To Speech",
|
|
18
|
+
description: "Generates local speech audio files from plain text through an installed TTS model, then returns a reusable audio file tag for downstream sending.",
|
|
19
|
+
config: {
|
|
20
|
+
plugin: "tts",
|
|
21
|
+
scope: "project",
|
|
22
|
+
defaultValue: {
|
|
23
|
+
provider: "local",
|
|
24
|
+
modelId: "qwen3-tts-0.6b",
|
|
25
|
+
format: "wav",
|
|
26
|
+
speed: 1,
|
|
89
27
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return {
|
|
103
|
-
enabled: false,
|
|
104
|
-
available: false,
|
|
105
|
-
reasons: ["tts plugin disabled in city config"],
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
const dependencyStatus = await checkTtsSynthesizer(context);
|
|
109
|
-
return {
|
|
110
|
-
enabled: true,
|
|
111
|
-
available: dependencyStatus.available,
|
|
112
|
-
reasons: dependencyStatus.reasons,
|
|
113
|
-
};
|
|
114
|
-
},
|
|
115
|
-
actions: {
|
|
116
|
-
status: {
|
|
117
|
-
allowWhenDisabled: true,
|
|
118
|
-
command: {
|
|
119
|
-
description: "查看 tts plugin 当前状态",
|
|
120
|
-
mapInput() {
|
|
121
|
-
return {};
|
|
28
|
+
},
|
|
29
|
+
setup: {
|
|
30
|
+
mode: "install-configure",
|
|
31
|
+
title: "安装语音合成",
|
|
32
|
+
description: "选择模型后直接完成模型下载、独立运行环境准备与配置写入。",
|
|
33
|
+
fields: [
|
|
34
|
+
{
|
|
35
|
+
key: "modelId",
|
|
36
|
+
label: "模型",
|
|
37
|
+
type: "select",
|
|
38
|
+
required: true,
|
|
39
|
+
sourceAction: "models",
|
|
122
40
|
},
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
synthesizer: {
|
|
138
|
-
available: synthesizer.available,
|
|
139
|
-
reasons: synthesizer.reasons,
|
|
140
|
-
details: synthesizer.details || null,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
},
|
|
41
|
+
{
|
|
42
|
+
key: "format",
|
|
43
|
+
label: "输出格式",
|
|
44
|
+
type: "select",
|
|
45
|
+
required: true,
|
|
46
|
+
options: [
|
|
47
|
+
{ label: "WAV", value: "wav" },
|
|
48
|
+
{ label: "FLAC", value: "flac" },
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
primaryAction: "install",
|
|
53
|
+
statusAction: "status",
|
|
145
54
|
},
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
55
|
+
usage: {
|
|
56
|
+
title: "配置语音合成",
|
|
57
|
+
description: "设置当前 agent 默认使用的语音模型与输出参数。",
|
|
58
|
+
fields: [
|
|
59
|
+
{
|
|
60
|
+
key: "modelId",
|
|
61
|
+
label: "默认模型",
|
|
62
|
+
type: "select",
|
|
63
|
+
required: true,
|
|
64
|
+
sourceAction: "models",
|
|
152
65
|
},
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
66
|
+
{
|
|
67
|
+
key: "format",
|
|
68
|
+
label: "输出格式",
|
|
69
|
+
type: "select",
|
|
70
|
+
required: true,
|
|
71
|
+
options: [
|
|
72
|
+
{ label: "WAV", value: "wav", description: "兼容性最好,适合绝大多数渠道。" },
|
|
73
|
+
{ label: "FLAC", value: "flac", description: "体积更小,适合存档或传输。" },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: "speed",
|
|
78
|
+
label: "默认语速",
|
|
79
|
+
type: "number",
|
|
80
|
+
placeholder: "1",
|
|
81
|
+
description: "1 为正常语速,可按需要设置为 0.8、1.2 等。",
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
key: "language",
|
|
85
|
+
label: "默认语言提示",
|
|
86
|
+
type: "string",
|
|
87
|
+
placeholder: "auto / zh / en",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "voice",
|
|
91
|
+
label: "默认音色",
|
|
92
|
+
type: "string",
|
|
93
|
+
placeholder: "可选音色 ID",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
saveAction: "configure",
|
|
97
|
+
statusAction: "status",
|
|
98
|
+
},
|
|
99
|
+
async availability(context) {
|
|
100
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
156
101
|
return {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
reasons: result.reasons,
|
|
161
|
-
details: result.details || null,
|
|
162
|
-
},
|
|
102
|
+
enabled: false,
|
|
103
|
+
available: false,
|
|
104
|
+
reasons: ["tts plugin disabled in city config"],
|
|
163
105
|
};
|
|
164
|
-
}
|
|
106
|
+
}
|
|
107
|
+
const dependencyStatus = await checkTtsSynthesizer(context);
|
|
108
|
+
return {
|
|
109
|
+
enabled: true,
|
|
110
|
+
available: dependencyStatus.available,
|
|
111
|
+
reasons: dependencyStatus.reasons,
|
|
112
|
+
};
|
|
165
113
|
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
114
|
+
actions: {
|
|
115
|
+
status: {
|
|
116
|
+
allowWhenDisabled: true,
|
|
117
|
+
command: {
|
|
118
|
+
description: "查看 tts plugin 当前状态",
|
|
119
|
+
mapInput() {
|
|
120
|
+
return {};
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
execute: async ({ context }) => {
|
|
124
|
+
const config = readTtsPluginConfig(context);
|
|
125
|
+
const availability = await plugin.availability(context);
|
|
126
|
+
const synthesizer = await checkTtsSynthesizer(context);
|
|
127
|
+
return {
|
|
128
|
+
success: true,
|
|
129
|
+
data: {
|
|
130
|
+
plugin: toJsonObject(config) || {},
|
|
131
|
+
availability: {
|
|
132
|
+
enabled: availability.enabled,
|
|
133
|
+
available: availability.available,
|
|
134
|
+
reasons: availability.reasons,
|
|
135
|
+
},
|
|
136
|
+
synthesizer: {
|
|
137
|
+
available: synthesizer.available,
|
|
138
|
+
reasons: synthesizer.reasons,
|
|
139
|
+
details: synthesizer.details || null,
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
};
|
|
172
143
|
},
|
|
173
144
|
},
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
145
|
+
doctor: {
|
|
146
|
+
allowWhenDisabled: true,
|
|
147
|
+
command: {
|
|
148
|
+
description: "检查 tts plugin 依赖状态",
|
|
149
|
+
mapInput() {
|
|
150
|
+
return {};
|
|
179
151
|
},
|
|
180
|
-
};
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
install: {
|
|
184
|
-
allowWhenDisabled: true,
|
|
185
|
-
command: {
|
|
186
|
-
description: "安装 tts 语音合成依赖",
|
|
187
|
-
configure(command) {
|
|
188
|
-
command
|
|
189
|
-
.argument("[models...]")
|
|
190
|
-
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
191
|
-
.option("--models-dir <path>", "模型目录(可选)")
|
|
192
|
-
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
193
|
-
.option("--no-install-deps", "跳过依赖安装")
|
|
194
|
-
.option("--force", "强制覆盖已存在资源")
|
|
195
|
-
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
196
|
-
.option("--format <format>", "默认输出格式(wav/flac)");
|
|
197
152
|
},
|
|
198
|
-
|
|
153
|
+
execute: async ({ context }) => {
|
|
154
|
+
const result = await checkTtsSynthesizer(context);
|
|
199
155
|
return {
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
: {}),
|
|
207
|
-
...(getStringOpt(opts, "python")
|
|
208
|
-
? { pythonBin: getStringOpt(opts, "python") }
|
|
209
|
-
: {}),
|
|
210
|
-
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
211
|
-
force: getBooleanOpt(opts, "force", false),
|
|
212
|
-
...(getStringOpt(opts, "hfToken")
|
|
213
|
-
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
214
|
-
: {}),
|
|
215
|
-
...(getStringOpt(opts, "format")
|
|
216
|
-
? { format: getStringOpt(opts, "format") }
|
|
217
|
-
: {}),
|
|
156
|
+
success: true,
|
|
157
|
+
data: {
|
|
158
|
+
available: result.available,
|
|
159
|
+
reasons: result.reasons,
|
|
160
|
+
details: result.details || null,
|
|
161
|
+
},
|
|
218
162
|
};
|
|
219
163
|
},
|
|
220
164
|
},
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
});
|
|
228
|
-
return {
|
|
229
|
-
success: result.success,
|
|
230
|
-
...(result.message ? { message: result.message } : {}),
|
|
231
|
-
...(result.details !== undefined ? { data: result.details } : {}),
|
|
232
|
-
...(result.success ? {} : { error: result.message || "install failed" }),
|
|
233
|
-
};
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
configure: {
|
|
237
|
-
allowWhenDisabled: true,
|
|
238
|
-
execute: async ({ context, payload }) => {
|
|
239
|
-
const payloadObject = payload && typeof payload === "object" && !Array.isArray(payload)
|
|
240
|
-
? payload
|
|
241
|
-
: {};
|
|
242
|
-
const { enabled: _ignoredEnabled, ...patch } = payloadObject;
|
|
243
|
-
const current = readTtsPluginConfig(context);
|
|
244
|
-
const next = {
|
|
245
|
-
...current,
|
|
246
|
-
...patch,
|
|
247
|
-
};
|
|
248
|
-
await writeTtsPluginConfig({
|
|
249
|
-
context,
|
|
250
|
-
value: next,
|
|
251
|
-
});
|
|
252
|
-
return {
|
|
253
|
-
success: true,
|
|
254
|
-
data: {
|
|
255
|
-
plugin: toJsonObject(next) || {},
|
|
165
|
+
models: {
|
|
166
|
+
allowWhenDisabled: true,
|
|
167
|
+
command: {
|
|
168
|
+
description: "列出可用于 tts 的本地模型",
|
|
169
|
+
mapInput() {
|
|
170
|
+
return {};
|
|
256
171
|
},
|
|
257
|
-
};
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
on: {
|
|
261
|
-
allowWhenDisabled: true,
|
|
262
|
-
command: {
|
|
263
|
-
description: "启用 tts plugin,并可选安装本地依赖",
|
|
264
|
-
configure(command) {
|
|
265
|
-
command
|
|
266
|
-
.argument("[models...]")
|
|
267
|
-
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
268
|
-
.option("--models-dir <path>", "模型目录(可选)")
|
|
269
|
-
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
270
|
-
.option("--no-install", "仅启用 plugin,不安装依赖")
|
|
271
|
-
.option("--no-install-deps", "跳过依赖安装")
|
|
272
|
-
.option("--force", "强制覆盖已存在资源")
|
|
273
|
-
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
274
|
-
.option("--format <format>", "默认输出格式(wav/flac)");
|
|
275
172
|
},
|
|
276
|
-
|
|
173
|
+
execute: async () => {
|
|
277
174
|
return {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
...(getStringOpt(opts, "modelsDir")
|
|
283
|
-
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
284
|
-
: {}),
|
|
285
|
-
...(getStringOpt(opts, "python")
|
|
286
|
-
? { pythonBin: getStringOpt(opts, "python") }
|
|
287
|
-
: {}),
|
|
288
|
-
install: getBooleanOpt(opts, "install", true),
|
|
289
|
-
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
290
|
-
force: getBooleanOpt(opts, "force", false),
|
|
291
|
-
...(getStringOpt(opts, "hfToken")
|
|
292
|
-
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
293
|
-
: {}),
|
|
294
|
-
...(getStringOpt(opts, "format")
|
|
295
|
-
? { format: getStringOpt(opts, "format") }
|
|
296
|
-
: {}),
|
|
175
|
+
success: true,
|
|
176
|
+
data: {
|
|
177
|
+
options: listTtsModelOptions(),
|
|
178
|
+
},
|
|
297
179
|
};
|
|
298
180
|
},
|
|
299
181
|
},
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
182
|
+
install: {
|
|
183
|
+
allowWhenDisabled: true,
|
|
184
|
+
command: {
|
|
185
|
+
description: "安装 tts 语音合成依赖",
|
|
186
|
+
configure(command) {
|
|
187
|
+
command
|
|
188
|
+
.argument("[models...]")
|
|
189
|
+
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
190
|
+
.option("--models-dir <path>", "模型目录(可选)")
|
|
191
|
+
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
192
|
+
.option("--no-install-deps", "跳过依赖安装")
|
|
193
|
+
.option("--force", "强制覆盖已存在资源")
|
|
194
|
+
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
195
|
+
.option("--format <format>", "默认输出格式(wav/flac)");
|
|
196
|
+
},
|
|
197
|
+
mapInput({ args, opts }) {
|
|
198
|
+
return {
|
|
199
|
+
modelIds: args,
|
|
200
|
+
...(getStringOpt(opts, "activeModel")
|
|
201
|
+
? { activeModel: getStringOpt(opts, "activeModel") }
|
|
202
|
+
: {}),
|
|
203
|
+
...(getStringOpt(opts, "modelsDir")
|
|
204
|
+
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
205
|
+
: {}),
|
|
206
|
+
...(getStringOpt(opts, "python")
|
|
207
|
+
? { pythonBin: getStringOpt(opts, "python") }
|
|
208
|
+
: {}),
|
|
209
|
+
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
210
|
+
force: getBooleanOpt(opts, "force", false),
|
|
211
|
+
...(getStringOpt(opts, "hfToken")
|
|
212
|
+
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
213
|
+
: {}),
|
|
214
|
+
...(getStringOpt(opts, "format")
|
|
215
|
+
? { format: getStringOpt(opts, "format") }
|
|
216
|
+
: {}),
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
},
|
|
220
|
+
execute: async ({ context, payload }) => {
|
|
221
|
+
const result = await installTtsSynthesizer({
|
|
304
222
|
context,
|
|
305
223
|
input: payload && typeof payload === "object" && !Array.isArray(payload)
|
|
306
224
|
? payload
|
|
307
225
|
: undefined,
|
|
308
226
|
});
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
}
|
|
317
|
-
return {
|
|
318
|
-
success: true,
|
|
319
|
-
data: {
|
|
320
|
-
plugin: toJsonObject(readTtsPluginConfig(context)) || {},
|
|
321
|
-
},
|
|
322
|
-
};
|
|
227
|
+
return {
|
|
228
|
+
success: result.success,
|
|
229
|
+
...(result.message ? { message: result.message } : {}),
|
|
230
|
+
...(result.details !== undefined ? { data: result.details } : {}),
|
|
231
|
+
...(result.success ? {} : { error: result.message || "install failed" }),
|
|
232
|
+
};
|
|
233
|
+
},
|
|
323
234
|
},
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
235
|
+
configure: {
|
|
236
|
+
allowWhenDisabled: true,
|
|
237
|
+
execute: async ({ context, payload }) => {
|
|
238
|
+
const payloadObject = payload && typeof payload === "object" && !Array.isArray(payload)
|
|
239
|
+
? payload
|
|
240
|
+
: {};
|
|
241
|
+
const { enabled: _ignoredEnabled, ...patch } = payloadObject;
|
|
242
|
+
const current = readTtsPluginConfig(context);
|
|
243
|
+
const next = {
|
|
244
|
+
...current,
|
|
245
|
+
...patch,
|
|
246
|
+
};
|
|
247
|
+
await writeTtsPluginConfig({
|
|
248
|
+
context,
|
|
249
|
+
value: next,
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
success: true,
|
|
253
|
+
data: {
|
|
254
|
+
plugin: toJsonObject(next) || {},
|
|
255
|
+
},
|
|
256
|
+
};
|
|
330
257
|
},
|
|
331
258
|
},
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
259
|
+
on: {
|
|
260
|
+
allowWhenDisabled: true,
|
|
261
|
+
command: {
|
|
262
|
+
description: "启用 tts plugin,并可选安装本地依赖",
|
|
263
|
+
configure(command) {
|
|
264
|
+
command
|
|
265
|
+
.argument("[models...]")
|
|
266
|
+
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
267
|
+
.option("--models-dir <path>", "模型目录(可选)")
|
|
268
|
+
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
269
|
+
.option("--no-install", "仅启用 plugin,不安装依赖")
|
|
270
|
+
.option("--no-install-deps", "跳过依赖安装")
|
|
271
|
+
.option("--force", "强制覆盖已存在资源")
|
|
272
|
+
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
273
|
+
.option("--format <format>", "默认输出格式(wav/flac)");
|
|
274
|
+
},
|
|
275
|
+
mapInput({ args, opts }) {
|
|
276
|
+
return {
|
|
277
|
+
modelIds: args,
|
|
278
|
+
...(getStringOpt(opts, "activeModel")
|
|
279
|
+
? { activeModel: getStringOpt(opts, "activeModel") }
|
|
280
|
+
: {}),
|
|
281
|
+
...(getStringOpt(opts, "modelsDir")
|
|
282
|
+
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
283
|
+
: {}),
|
|
284
|
+
...(getStringOpt(opts, "python")
|
|
285
|
+
? { pythonBin: getStringOpt(opts, "python") }
|
|
286
|
+
: {}),
|
|
287
|
+
install: getBooleanOpt(opts, "install", true),
|
|
288
|
+
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
289
|
+
force: getBooleanOpt(opts, "force", false),
|
|
290
|
+
...(getStringOpt(opts, "hfToken")
|
|
291
|
+
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
292
|
+
: {}),
|
|
293
|
+
...(getStringOpt(opts, "format")
|
|
294
|
+
? { format: getStringOpt(opts, "format") }
|
|
295
|
+
: {}),
|
|
296
|
+
};
|
|
338
297
|
},
|
|
339
|
-
};
|
|
340
|
-
},
|
|
341
|
-
},
|
|
342
|
-
use: {
|
|
343
|
-
allowWhenDisabled: true,
|
|
344
|
-
command: {
|
|
345
|
-
description: "切换 tts 当前模型",
|
|
346
|
-
configure(command) {
|
|
347
|
-
command.argument("<modelId>");
|
|
348
298
|
},
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
if (
|
|
352
|
-
|
|
299
|
+
execute: async ({ context, payload }) => {
|
|
300
|
+
context.platform.setPluginEnabled?.("tts", true);
|
|
301
|
+
if (payload.install !== false) {
|
|
302
|
+
const installResult = await installTtsSynthesizer({
|
|
303
|
+
context,
|
|
304
|
+
input: payload && typeof payload === "object" && !Array.isArray(payload)
|
|
305
|
+
? payload
|
|
306
|
+
: undefined,
|
|
307
|
+
});
|
|
308
|
+
if (!installResult.success) {
|
|
309
|
+
return {
|
|
310
|
+
success: false,
|
|
311
|
+
error: installResult.message || "tts dependency install failed",
|
|
312
|
+
message: installResult.message || "tts dependency install failed",
|
|
313
|
+
};
|
|
314
|
+
}
|
|
353
315
|
}
|
|
354
316
|
return {
|
|
355
|
-
|
|
317
|
+
success: true,
|
|
318
|
+
data: {
|
|
319
|
+
plugin: toJsonObject(readTtsPluginConfig(context)) || {},
|
|
320
|
+
},
|
|
356
321
|
};
|
|
357
322
|
},
|
|
358
323
|
},
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
324
|
+
off: {
|
|
325
|
+
command: {
|
|
326
|
+
description: "关闭 tts plugin",
|
|
327
|
+
mapInput() {
|
|
328
|
+
return {};
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
execute: async ({ context }) => {
|
|
332
|
+
context.platform.setPluginEnabled?.("tts", false);
|
|
363
333
|
return {
|
|
364
|
-
success:
|
|
365
|
-
|
|
366
|
-
|
|
334
|
+
success: true,
|
|
335
|
+
data: {
|
|
336
|
+
plugin: toJsonObject(readTtsPluginConfig(context)) || {},
|
|
337
|
+
},
|
|
367
338
|
};
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
339
|
+
},
|
|
340
|
+
},
|
|
341
|
+
use: {
|
|
342
|
+
allowWhenDisabled: true,
|
|
343
|
+
command: {
|
|
344
|
+
description: "切换 tts 当前模型",
|
|
345
|
+
configure(command) {
|
|
346
|
+
command.argument("<modelId>");
|
|
374
347
|
},
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
348
|
+
mapInput({ args }) {
|
|
349
|
+
const modelId = String(args[0] || "").trim();
|
|
350
|
+
if (!modelId) {
|
|
351
|
+
throw new Error("modelId is required");
|
|
352
|
+
}
|
|
353
|
+
return {
|
|
354
|
+
modelId,
|
|
355
|
+
};
|
|
380
356
|
},
|
|
381
|
-
};
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
synthesize: {
|
|
385
|
-
command: {
|
|
386
|
-
description: "将文本生成语音文件",
|
|
387
|
-
configure(command) {
|
|
388
|
-
command
|
|
389
|
-
.argument("<text>")
|
|
390
|
-
.option("--model <modelId>", "语音模型 ID")
|
|
391
|
-
.option("--language <language>", "语言提示(可选,例如 zh / en)")
|
|
392
|
-
.option("--voice <voice>", "音色 ID(可选)")
|
|
393
|
-
.option("--format <format>", "输出格式(wav/flac)")
|
|
394
|
-
.option("--speed <speed>", "语速倍率", Number)
|
|
395
|
-
.option("--output <path>", "输出文件路径或目录(可选)");
|
|
396
357
|
},
|
|
397
|
-
|
|
398
|
-
const
|
|
399
|
-
|
|
400
|
-
|
|
358
|
+
execute: async ({ context, payload }) => {
|
|
359
|
+
const modelId = String(payload.modelId || "").trim();
|
|
360
|
+
const resolvedModelId = resolveTtsModelId(modelId);
|
|
361
|
+
if (!resolvedModelId) {
|
|
362
|
+
return {
|
|
363
|
+
success: false,
|
|
364
|
+
error: `Unsupported tts model: ${modelId}`,
|
|
365
|
+
message: `Unsupported tts model: ${modelId}`,
|
|
366
|
+
};
|
|
401
367
|
}
|
|
368
|
+
const nextConfig = await writeTtsPluginConfig({
|
|
369
|
+
context,
|
|
370
|
+
value: {
|
|
371
|
+
...readTtsPluginConfig(context),
|
|
372
|
+
modelId: resolvedModelId,
|
|
373
|
+
},
|
|
374
|
+
});
|
|
402
375
|
return {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
...(getStringOpt(opts, "language")
|
|
408
|
-
? { language: getStringOpt(opts, "language") }
|
|
409
|
-
: {}),
|
|
410
|
-
...(getStringOpt(opts, "voice")
|
|
411
|
-
? { voice: getStringOpt(opts, "voice") }
|
|
412
|
-
: {}),
|
|
413
|
-
...(getStringOpt(opts, "format")
|
|
414
|
-
? { format: getStringOpt(opts, "format") }
|
|
415
|
-
: {}),
|
|
416
|
-
...(typeof getNumberOpt(opts, "speed") === "number"
|
|
417
|
-
? { speed: getNumberOpt(opts, "speed") }
|
|
418
|
-
: {}),
|
|
419
|
-
...(getStringOpt(opts, "output")
|
|
420
|
-
? { output: getStringOpt(opts, "output") }
|
|
421
|
-
: {}),
|
|
376
|
+
success: true,
|
|
377
|
+
data: {
|
|
378
|
+
plugin: toJsonObject(nextConfig) || {},
|
|
379
|
+
},
|
|
422
380
|
};
|
|
423
381
|
},
|
|
424
382
|
},
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
383
|
+
synthesize: {
|
|
384
|
+
command: {
|
|
385
|
+
description: "将文本生成语音文件",
|
|
386
|
+
configure(command) {
|
|
387
|
+
command
|
|
388
|
+
.argument("<text>")
|
|
389
|
+
.option("--model <modelId>", "语音模型 ID")
|
|
390
|
+
.option("--language <language>", "语言提示(可选,例如 zh / en)")
|
|
391
|
+
.option("--voice <voice>", "音色 ID(可选)")
|
|
392
|
+
.option("--format <format>", "输出格式(wav/flac)")
|
|
393
|
+
.option("--speed <speed>", "语速倍率", Number)
|
|
394
|
+
.option("--output <path>", "输出文件路径或目录(可选)");
|
|
395
|
+
},
|
|
396
|
+
mapInput({ args, opts }) {
|
|
397
|
+
const text = String(args[0] || "").trim();
|
|
398
|
+
if (!text) {
|
|
399
|
+
throw new Error("text is required");
|
|
400
|
+
}
|
|
401
|
+
return {
|
|
402
|
+
text,
|
|
403
|
+
...(getStringOpt(opts, "model")
|
|
404
|
+
? { modelId: getStringOpt(opts, "model") }
|
|
405
|
+
: {}),
|
|
406
|
+
...(getStringOpt(opts, "language")
|
|
407
|
+
? { language: getStringOpt(opts, "language") }
|
|
408
|
+
: {}),
|
|
409
|
+
...(getStringOpt(opts, "voice")
|
|
410
|
+
? { voice: getStringOpt(opts, "voice") }
|
|
411
|
+
: {}),
|
|
412
|
+
...(getStringOpt(opts, "format")
|
|
413
|
+
? { format: getStringOpt(opts, "format") }
|
|
414
|
+
: {}),
|
|
415
|
+
...(typeof getNumberOpt(opts, "speed") === "number"
|
|
416
|
+
? { speed: getNumberOpt(opts, "speed") }
|
|
417
|
+
: {}),
|
|
418
|
+
...(getStringOpt(opts, "output")
|
|
419
|
+
? { output: getStringOpt(opts, "output") }
|
|
420
|
+
: {}),
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
execute: async ({ context, payload }) => {
|
|
425
|
+
const pluginStatus = await plugin.availability(context);
|
|
426
|
+
if (!pluginStatus.enabled || !pluginStatus.available) {
|
|
427
|
+
return {
|
|
428
|
+
success: false,
|
|
429
|
+
error: pluginStatus.reasons[0] || "tts plugin unavailable",
|
|
430
|
+
message: pluginStatus.reasons[0] || "tts plugin unavailable",
|
|
431
|
+
};
|
|
432
|
+
}
|
|
433
|
+
const input = payload && typeof payload === "object" && !Array.isArray(payload)
|
|
434
|
+
? payload
|
|
435
|
+
: {};
|
|
436
|
+
const result = await synthesizeSpeechFile({
|
|
437
|
+
context,
|
|
438
|
+
config: readTtsPluginConfig(context),
|
|
439
|
+
input,
|
|
440
|
+
});
|
|
428
441
|
return {
|
|
429
|
-
success:
|
|
430
|
-
|
|
431
|
-
|
|
442
|
+
success: true,
|
|
443
|
+
data: {
|
|
444
|
+
outputPath: result.outputPath,
|
|
445
|
+
fileTag: result.fileTag,
|
|
446
|
+
bytes: result.bytes,
|
|
447
|
+
...(result.stderrSummary ? { stderr: result.stderrSummary } : {}),
|
|
448
|
+
},
|
|
432
449
|
};
|
|
433
|
-
}
|
|
434
|
-
const input = payload && typeof payload === "object" && !Array.isArray(payload)
|
|
435
|
-
? payload
|
|
436
|
-
: {};
|
|
437
|
-
const result = await synthesizeSpeechFile({
|
|
438
|
-
context,
|
|
439
|
-
config: readTtsPluginConfig(context),
|
|
440
|
-
input,
|
|
441
|
-
});
|
|
442
|
-
return {
|
|
443
|
-
success: true,
|
|
444
|
-
data: {
|
|
445
|
-
outputPath: result.outputPath,
|
|
446
|
-
fileTag: result.fileTag,
|
|
447
|
-
bytes: result.bytes,
|
|
448
|
-
...(result.stderrSummary ? { stderr: result.stderrSummary } : {}),
|
|
449
|
-
},
|
|
450
|
-
};
|
|
450
|
+
},
|
|
451
451
|
},
|
|
452
452
|
},
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
"
|
|
469
|
-
|
|
470
|
-
}
|
|
471
|
-
}
|
|
453
|
+
system(context) {
|
|
454
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
455
|
+
return "";
|
|
456
|
+
}
|
|
457
|
+
return [
|
|
458
|
+
"# TTS Plugin",
|
|
459
|
+
"The agent can call the tts plugin to synthesize speech audio from plain text.",
|
|
460
|
+
"Typical usage flow:",
|
|
461
|
+
"1. Check availability with `city tts status` when you need to confirm whether the plugin and model are ready.",
|
|
462
|
+
"2. Generate audio with `city tts synthesize <text>`.",
|
|
463
|
+
"3. Optionally override synthesis parameters with `--voice`, `--language`, `--format`, `--speed`, and `--output`.",
|
|
464
|
+
"Use the `tts.synthesize` action when the user asks to generate spoken audio or a reusable audio file tag.",
|
|
465
|
+
"A successful synthesis returns a local output path and a reusable `<file type=\"audio\">...</file>` tag for downstream sending.",
|
|
466
|
+
"If the Python runner prints non-fatal stderr, the command still succeeds and returns that stderr summary as extra context.",
|
|
467
|
+
"Example: `city tts synthesize \"你好,欢迎来到 Downcity\" --format wav`",
|
|
468
|
+
].join("\n");
|
|
469
|
+
},
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* TtsPlugin:文本转语音插件。
|
|
474
|
+
*/
|
|
475
|
+
export class TtsPlugin extends BasePlugin {
|
|
476
|
+
name = "tts";
|
|
477
|
+
constructor(agent = null) {
|
|
478
|
+
super(agent);
|
|
479
|
+
Object.assign(this, createTtsPluginDefinition(this));
|
|
480
|
+
}
|
|
481
|
+
}
|
|
472
482
|
//# sourceMappingURL=Plugin.js.map
|