@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
|
@@ -6,457 +6,467 @@
|
|
|
6
6
|
* - 具体模型、依赖安装、命令模板等实现细节全部收敛到 plugin 内部 dependency helper。
|
|
7
7
|
* - 当前作为 chat 入站消息增强中间件接入语音转写。
|
|
8
8
|
*/
|
|
9
|
+
import { BasePlugin } from "../../../plugin/core/BasePlugin.js";
|
|
9
10
|
import { CHAT_PLUGIN_POINTS } from "../../../plugin/builtins/chat/runtime/PluginPoints.js";
|
|
10
11
|
import { isPluginEnabled } from "../../../plugin/core/Activation.js";
|
|
11
12
|
import { listVoiceModels, resolveVoicePluginModelId, } from "../../../plugin/builtins/asr/ModelCatalog.js";
|
|
12
13
|
import { getBooleanOpt, getStringOpt, readVoicePluginConfig, toJsonObject, writeVoicePluginConfig, } from "../../../plugin/builtins/asr/Config.js";
|
|
13
14
|
import { augmentAsrInboundMessage } from "../../../plugin/builtins/asr/InboundAugment.js";
|
|
14
15
|
import { checkVoiceTranscriber, installVoiceTranscriber, readVoiceTranscriberConfig, transcribeWithVoiceDependency, writeVoiceTranscriberConfig, } from "../../../plugin/builtins/asr/Dependency.js";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
provider: "local",
|
|
29
|
-
modelId: "SenseVoiceSmall",
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
setup: {
|
|
33
|
-
mode: "install-configure",
|
|
34
|
-
title: "安装语音识别",
|
|
35
|
-
description: "选择模型后即可完成依赖安装与当前配置写入。",
|
|
36
|
-
fields: [
|
|
37
|
-
{
|
|
38
|
-
key: "modelId",
|
|
39
|
-
label: "模型",
|
|
40
|
-
type: "select",
|
|
41
|
-
required: true,
|
|
42
|
-
sourceAction: "models",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
key: "installDeps",
|
|
46
|
-
label: "安装 Python 依赖",
|
|
47
|
-
type: "checkbox",
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
primaryAction: "install",
|
|
51
|
-
statusAction: "status",
|
|
52
|
-
},
|
|
53
|
-
usage: {
|
|
54
|
-
title: "配置语音识别",
|
|
55
|
-
description: "设置当前 agent 如何把语音内容转成文本并注入对话链路。",
|
|
56
|
-
fields: [
|
|
57
|
-
{
|
|
58
|
-
key: "injectPrompt",
|
|
59
|
-
label: "注入 Prompt 提示",
|
|
60
|
-
type: "boolean",
|
|
61
|
-
trueLabel: "开启",
|
|
62
|
-
falseLabel: "关闭",
|
|
63
|
-
description: "开启后会把 ASR 使用约束注入到 agent 的系统提示词。",
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
key: "augmentMessage",
|
|
67
|
-
label: "自动增强消息",
|
|
68
|
-
type: "boolean",
|
|
69
|
-
trueLabel: "开启",
|
|
70
|
-
falseLabel: "关闭",
|
|
71
|
-
description: "开启后,入站语音消息会先自动转写再交给 agent。",
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
key: "modelId",
|
|
75
|
-
label: "默认模型",
|
|
76
|
-
type: "select",
|
|
77
|
-
sourceAction: "models",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
key: "language",
|
|
81
|
-
label: "默认语言提示",
|
|
82
|
-
type: "string",
|
|
83
|
-
placeholder: "auto / zh / en",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
key: "timeoutMs",
|
|
87
|
-
label: "超时(毫秒)",
|
|
88
|
-
type: "number",
|
|
89
|
-
placeholder: "60000",
|
|
16
|
+
function createAsrPluginDefinition(plugin) {
|
|
17
|
+
return {
|
|
18
|
+
name: "asr",
|
|
19
|
+
title: "Automatic Speech Recognition",
|
|
20
|
+
description: "Detects voice and audio attachments in inbound chat messages, runs transcription through the configured ASR dependency, and appends readable text so the agent can work with spoken input like normal message content.",
|
|
21
|
+
config: {
|
|
22
|
+
plugin: "asr",
|
|
23
|
+
scope: "project",
|
|
24
|
+
defaultValue: {
|
|
25
|
+
injectPrompt: true,
|
|
26
|
+
augmentMessage: true,
|
|
27
|
+
provider: "local",
|
|
28
|
+
modelId: "SenseVoiceSmall",
|
|
90
29
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
};
|
|
109
|
-
},
|
|
110
|
-
hooks: {
|
|
111
|
-
pipeline: {
|
|
112
|
-
[CHAT_PLUGIN_POINTS.augmentInbound]: [
|
|
113
|
-
async ({ context, value }) => {
|
|
114
|
-
return await augmentAsrInboundMessage({ context, value });
|
|
30
|
+
},
|
|
31
|
+
setup: {
|
|
32
|
+
mode: "install-configure",
|
|
33
|
+
title: "安装语音识别",
|
|
34
|
+
description: "选择模型后即可完成依赖安装与当前配置写入。",
|
|
35
|
+
fields: [
|
|
36
|
+
{
|
|
37
|
+
key: "modelId",
|
|
38
|
+
label: "模型",
|
|
39
|
+
type: "select",
|
|
40
|
+
required: true,
|
|
41
|
+
sourceAction: "models",
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: "installDeps",
|
|
45
|
+
label: "安装 Python 依赖",
|
|
46
|
+
type: "checkbox",
|
|
115
47
|
},
|
|
116
48
|
],
|
|
49
|
+
primaryAction: "install",
|
|
50
|
+
statusAction: "status",
|
|
117
51
|
},
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
52
|
+
usage: {
|
|
53
|
+
title: "配置语音识别",
|
|
54
|
+
description: "设置当前 agent 如何把语音内容转成文本并注入对话链路。",
|
|
55
|
+
fields: [
|
|
56
|
+
{
|
|
57
|
+
key: "injectPrompt",
|
|
58
|
+
label: "注入 Prompt 提示",
|
|
59
|
+
type: "boolean",
|
|
60
|
+
trueLabel: "开启",
|
|
61
|
+
falseLabel: "关闭",
|
|
62
|
+
description: "开启后会把 ASR 使用约束注入到 agent 的系统提示词。",
|
|
126
63
|
},
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
data: {
|
|
135
|
-
plugin: toJsonObject(config) || {},
|
|
136
|
-
availability: {
|
|
137
|
-
enabled: availability.enabled,
|
|
138
|
-
available: availability.available,
|
|
139
|
-
reasons: availability.reasons,
|
|
140
|
-
},
|
|
141
|
-
transcriber: toJsonObject((transcriberConfig || null)),
|
|
142
|
-
},
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
install: {
|
|
147
|
-
allowWhenDisabled: true,
|
|
148
|
-
command: {
|
|
149
|
-
description: "安装 asr 转写依赖",
|
|
150
|
-
configure(command) {
|
|
151
|
-
command
|
|
152
|
-
.argument("[models...]")
|
|
153
|
-
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
154
|
-
.option("--models-dir <path>", "模型目录(可选)")
|
|
155
|
-
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
156
|
-
.option("--no-install-deps", "跳过依赖安装")
|
|
157
|
-
.option("--force", "强制覆盖已存在资源")
|
|
158
|
-
.option("--hf-token <token>", "HuggingFace token(可选)");
|
|
64
|
+
{
|
|
65
|
+
key: "augmentMessage",
|
|
66
|
+
label: "自动增强消息",
|
|
67
|
+
type: "boolean",
|
|
68
|
+
trueLabel: "开启",
|
|
69
|
+
falseLabel: "关闭",
|
|
70
|
+
description: "开启后,入站语音消息会先自动转写再交给 agent。",
|
|
159
71
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
: {}),
|
|
166
|
-
...(getStringOpt(opts, "modelsDir")
|
|
167
|
-
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
168
|
-
: {}),
|
|
169
|
-
...(getStringOpt(opts, "python")
|
|
170
|
-
? { pythonBin: getStringOpt(opts, "python") }
|
|
171
|
-
: {}),
|
|
172
|
-
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
173
|
-
force: getBooleanOpt(opts, "force", false),
|
|
174
|
-
...(getStringOpt(opts, "hfToken")
|
|
175
|
-
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
176
|
-
: {}),
|
|
177
|
-
};
|
|
72
|
+
{
|
|
73
|
+
key: "modelId",
|
|
74
|
+
label: "默认模型",
|
|
75
|
+
type: "select",
|
|
76
|
+
sourceAction: "models",
|
|
178
77
|
},
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
78
|
+
{
|
|
79
|
+
key: "language",
|
|
80
|
+
label: "默认语言提示",
|
|
81
|
+
type: "string",
|
|
82
|
+
placeholder: "auto / zh / en",
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "timeoutMs",
|
|
86
|
+
label: "超时(毫秒)",
|
|
87
|
+
type: "number",
|
|
88
|
+
placeholder: "60000",
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
saveAction: "configure",
|
|
92
|
+
statusAction: "status",
|
|
93
|
+
},
|
|
94
|
+
async availability(context) {
|
|
95
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
187
96
|
return {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
...(result.success ? {} : { error: result.message || "install failed" }),
|
|
97
|
+
enabled: false,
|
|
98
|
+
available: false,
|
|
99
|
+
reasons: ["asr plugin disabled in city config"],
|
|
192
100
|
};
|
|
193
|
-
}
|
|
101
|
+
}
|
|
102
|
+
const dependencyStatus = await checkVoiceTranscriber(context);
|
|
103
|
+
return {
|
|
104
|
+
enabled: true,
|
|
105
|
+
available: dependencyStatus.available,
|
|
106
|
+
reasons: dependencyStatus.reasons,
|
|
107
|
+
};
|
|
194
108
|
},
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
: {};
|
|
201
|
-
const { enabled: _ignoredEnabled, ...patch } = payloadObject;
|
|
202
|
-
const current = readVoicePluginConfig(context);
|
|
203
|
-
const next = {
|
|
204
|
-
...current,
|
|
205
|
-
...patch,
|
|
206
|
-
};
|
|
207
|
-
await writeVoicePluginConfig({
|
|
208
|
-
agentState: context,
|
|
209
|
-
value: next,
|
|
210
|
-
});
|
|
211
|
-
return {
|
|
212
|
-
success: true,
|
|
213
|
-
data: {
|
|
214
|
-
plugin: toJsonObject(next) || {},
|
|
109
|
+
hooks: {
|
|
110
|
+
pipeline: {
|
|
111
|
+
[CHAT_PLUGIN_POINTS.augmentInbound]: [
|
|
112
|
+
async ({ context, value }) => {
|
|
113
|
+
return await augmentAsrInboundMessage({ context, value });
|
|
215
114
|
},
|
|
216
|
-
|
|
115
|
+
],
|
|
217
116
|
},
|
|
218
117
|
},
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.option("--models-dir <path>", "模型目录(可选)")
|
|
228
|
-
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
229
|
-
.option("--no-install", "仅启用 plugin,不安装依赖")
|
|
230
|
-
.option("--no-install-deps", "跳过依赖安装")
|
|
231
|
-
.option("--force", "强制覆盖已存在资源")
|
|
232
|
-
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
233
|
-
.option("--no-inject-prompt", "关闭 prompt 注入")
|
|
234
|
-
.option("--no-augment-message", "关闭消息增强");
|
|
118
|
+
actions: {
|
|
119
|
+
status: {
|
|
120
|
+
allowWhenDisabled: true,
|
|
121
|
+
command: {
|
|
122
|
+
description: "查看 asr plugin 当前状态",
|
|
123
|
+
mapInput() {
|
|
124
|
+
return {};
|
|
125
|
+
},
|
|
235
126
|
},
|
|
236
|
-
|
|
127
|
+
execute: async ({ context }) => {
|
|
128
|
+
const config = readVoicePluginConfig(context);
|
|
129
|
+
const availability = await plugin.availability(context);
|
|
130
|
+
const transcriberConfig = readVoiceTranscriberConfig(context);
|
|
237
131
|
return {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
: {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
install: getBooleanOpt(opts, "install", true),
|
|
249
|
-
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
250
|
-
force: getBooleanOpt(opts, "force", false),
|
|
251
|
-
injectPrompt: getBooleanOpt(opts, "injectPrompt", true),
|
|
252
|
-
augmentMessage: getBooleanOpt(opts, "augmentMessage", true),
|
|
253
|
-
...(getStringOpt(opts, "hfToken")
|
|
254
|
-
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
255
|
-
: {}),
|
|
132
|
+
success: true,
|
|
133
|
+
data: {
|
|
134
|
+
plugin: toJsonObject(config) || {},
|
|
135
|
+
availability: {
|
|
136
|
+
enabled: availability.enabled,
|
|
137
|
+
available: availability.available,
|
|
138
|
+
reasons: availability.reasons,
|
|
139
|
+
},
|
|
140
|
+
transcriber: toJsonObject((transcriberConfig || null)),
|
|
141
|
+
},
|
|
256
142
|
};
|
|
257
143
|
},
|
|
258
144
|
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
145
|
+
install: {
|
|
146
|
+
allowWhenDisabled: true,
|
|
147
|
+
command: {
|
|
148
|
+
description: "安装 asr 转写依赖",
|
|
149
|
+
configure(command) {
|
|
150
|
+
command
|
|
151
|
+
.argument("[models...]")
|
|
152
|
+
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
153
|
+
.option("--models-dir <path>", "模型目录(可选)")
|
|
154
|
+
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
155
|
+
.option("--no-install-deps", "跳过依赖安装")
|
|
156
|
+
.option("--force", "强制覆盖已存在资源")
|
|
157
|
+
.option("--hf-token <token>", "HuggingFace token(可选)");
|
|
158
|
+
},
|
|
159
|
+
mapInput({ args, opts }) {
|
|
160
|
+
return {
|
|
161
|
+
modelIds: args,
|
|
162
|
+
...(getStringOpt(opts, "activeModel")
|
|
163
|
+
? { activeModel: getStringOpt(opts, "activeModel") }
|
|
164
|
+
: {}),
|
|
165
|
+
...(getStringOpt(opts, "modelsDir")
|
|
166
|
+
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
167
|
+
: {}),
|
|
168
|
+
...(getStringOpt(opts, "python")
|
|
169
|
+
? { pythonBin: getStringOpt(opts, "python") }
|
|
170
|
+
: {}),
|
|
171
|
+
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
172
|
+
force: getBooleanOpt(opts, "force", false),
|
|
173
|
+
...(getStringOpt(opts, "hfToken")
|
|
174
|
+
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
175
|
+
: {}),
|
|
176
|
+
};
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
execute: async ({ context, payload }) => {
|
|
180
|
+
const result = await installVoiceTranscriber({
|
|
276
181
|
context,
|
|
277
182
|
input: payload && typeof payload === "object" && !Array.isArray(payload)
|
|
278
183
|
? payload
|
|
279
184
|
: undefined,
|
|
280
185
|
});
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
289
|
-
return {
|
|
290
|
-
success: true,
|
|
291
|
-
data: {
|
|
292
|
-
plugin: toJsonObject(nextConfig) || {},
|
|
293
|
-
transcriber: toJsonObject(readVoiceTranscriberConfig(context)) || {},
|
|
294
|
-
},
|
|
295
|
-
};
|
|
186
|
+
return {
|
|
187
|
+
success: result.success,
|
|
188
|
+
...(result.message ? { message: result.message } : {}),
|
|
189
|
+
...(result.details !== undefined ? { data: result.details } : {}),
|
|
190
|
+
...(result.success ? {} : { error: result.message || "install failed" }),
|
|
191
|
+
};
|
|
192
|
+
},
|
|
296
193
|
},
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
194
|
+
configure: {
|
|
195
|
+
allowWhenDisabled: true,
|
|
196
|
+
execute: async ({ context, payload }) => {
|
|
197
|
+
const payloadObject = payload && typeof payload === "object" && !Array.isArray(payload)
|
|
198
|
+
? payload
|
|
199
|
+
: {};
|
|
200
|
+
const { enabled: _ignoredEnabled, ...patch } = payloadObject;
|
|
201
|
+
const current = readVoicePluginConfig(context);
|
|
202
|
+
const next = {
|
|
203
|
+
...current,
|
|
204
|
+
...patch,
|
|
205
|
+
};
|
|
206
|
+
await writeVoicePluginConfig({
|
|
207
|
+
agentState: context,
|
|
208
|
+
value: next,
|
|
209
|
+
});
|
|
210
|
+
return {
|
|
211
|
+
success: true,
|
|
212
|
+
data: {
|
|
213
|
+
plugin: toJsonObject(next) || {},
|
|
214
|
+
},
|
|
215
|
+
};
|
|
303
216
|
},
|
|
304
217
|
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
218
|
+
on: {
|
|
219
|
+
allowWhenDisabled: true,
|
|
220
|
+
command: {
|
|
221
|
+
description: "启用 asr plugin,并可选安装转写依赖",
|
|
222
|
+
configure(command) {
|
|
223
|
+
command
|
|
224
|
+
.argument("[models...]")
|
|
225
|
+
.option("--active-model <modelId>", "安装完成后设为当前模型")
|
|
226
|
+
.option("--models-dir <path>", "模型目录(可选)")
|
|
227
|
+
.option("--python <bin>", "Python 可执行文件(默认 python3)")
|
|
228
|
+
.option("--no-install", "仅启用 plugin,不安装依赖")
|
|
229
|
+
.option("--no-install-deps", "跳过依赖安装")
|
|
230
|
+
.option("--force", "强制覆盖已存在资源")
|
|
231
|
+
.option("--hf-token <token>", "HuggingFace token(可选)")
|
|
232
|
+
.option("--no-inject-prompt", "关闭 prompt 注入")
|
|
233
|
+
.option("--no-augment-message", "关闭消息增强");
|
|
234
|
+
},
|
|
235
|
+
mapInput({ args, opts }) {
|
|
236
|
+
return {
|
|
237
|
+
modelIds: args,
|
|
238
|
+
...(getStringOpt(opts, "activeModel")
|
|
239
|
+
? { activeModel: getStringOpt(opts, "activeModel") }
|
|
240
|
+
: {}),
|
|
241
|
+
...(getStringOpt(opts, "modelsDir")
|
|
242
|
+
? { modelsDir: getStringOpt(opts, "modelsDir") }
|
|
243
|
+
: {}),
|
|
244
|
+
...(getStringOpt(opts, "python")
|
|
245
|
+
? { pythonBin: getStringOpt(opts, "python") }
|
|
246
|
+
: {}),
|
|
247
|
+
install: getBooleanOpt(opts, "install", true),
|
|
248
|
+
installDeps: getBooleanOpt(opts, "installDeps", true),
|
|
249
|
+
force: getBooleanOpt(opts, "force", false),
|
|
250
|
+
injectPrompt: getBooleanOpt(opts, "injectPrompt", true),
|
|
251
|
+
augmentMessage: getBooleanOpt(opts, "augmentMessage", true),
|
|
252
|
+
...(getStringOpt(opts, "hfToken")
|
|
253
|
+
? { hfToken: getStringOpt(opts, "hfToken") }
|
|
254
|
+
: {}),
|
|
255
|
+
};
|
|
311
256
|
},
|
|
312
|
-
};
|
|
313
|
-
},
|
|
314
|
-
},
|
|
315
|
-
use: {
|
|
316
|
-
command: {
|
|
317
|
-
description: "切换 asr 当前转写模型",
|
|
318
|
-
configure(command) {
|
|
319
|
-
command.argument("<modelId>");
|
|
320
257
|
},
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
258
|
+
execute: async ({ context, payload }) => {
|
|
259
|
+
context.platform.setPluginEnabled?.("asr", true);
|
|
260
|
+
const nextConfig = {
|
|
261
|
+
...readVoicePluginConfig(context),
|
|
262
|
+
injectPrompt: typeof payload.injectPrompt === "boolean"
|
|
263
|
+
? payload.injectPrompt
|
|
264
|
+
: true,
|
|
265
|
+
augmentMessage: typeof payload.augmentMessage === "boolean"
|
|
266
|
+
? payload.augmentMessage
|
|
267
|
+
: true,
|
|
268
|
+
};
|
|
269
|
+
await writeVoicePluginConfig({
|
|
270
|
+
agentState: context,
|
|
271
|
+
value: nextConfig,
|
|
272
|
+
});
|
|
273
|
+
if (payload.install !== false) {
|
|
274
|
+
const installResult = await installVoiceTranscriber({
|
|
275
|
+
context,
|
|
276
|
+
input: payload && typeof payload === "object" && !Array.isArray(payload)
|
|
277
|
+
? payload
|
|
278
|
+
: undefined,
|
|
279
|
+
});
|
|
280
|
+
if (!installResult.success) {
|
|
281
|
+
return {
|
|
282
|
+
success: false,
|
|
283
|
+
error: installResult.message || "asr dependency install failed",
|
|
284
|
+
message: installResult.message || "asr dependency install failed",
|
|
285
|
+
};
|
|
286
|
+
}
|
|
325
287
|
}
|
|
326
288
|
return {
|
|
327
|
-
|
|
289
|
+
success: true,
|
|
290
|
+
data: {
|
|
291
|
+
plugin: toJsonObject(nextConfig) || {},
|
|
292
|
+
transcriber: toJsonObject(readVoiceTranscriberConfig(context)) || {},
|
|
293
|
+
},
|
|
328
294
|
};
|
|
329
295
|
},
|
|
330
296
|
},
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
297
|
+
off: {
|
|
298
|
+
command: {
|
|
299
|
+
description: "关闭 asr plugin",
|
|
300
|
+
mapInput() {
|
|
301
|
+
return {};
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
execute: async ({ context }) => {
|
|
305
|
+
context.platform.setPluginEnabled?.("asr", false);
|
|
335
306
|
return {
|
|
336
|
-
success:
|
|
337
|
-
|
|
338
|
-
|
|
307
|
+
success: true,
|
|
308
|
+
data: {
|
|
309
|
+
plugin: toJsonObject(readVoicePluginConfig(context)) || {},
|
|
310
|
+
},
|
|
339
311
|
};
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
use: {
|
|
315
|
+
command: {
|
|
316
|
+
description: "切换 asr 当前转写模型",
|
|
317
|
+
configure(command) {
|
|
318
|
+
command.argument("<modelId>");
|
|
346
319
|
},
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
320
|
+
mapInput({ args }) {
|
|
321
|
+
const modelId = String(args[0] || "").trim();
|
|
322
|
+
if (!modelId) {
|
|
323
|
+
throw new Error("modelId is required");
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
modelId,
|
|
327
|
+
};
|
|
352
328
|
},
|
|
353
|
-
};
|
|
354
|
-
},
|
|
355
|
-
},
|
|
356
|
-
transcribe: {
|
|
357
|
-
command: {
|
|
358
|
-
description: "转写本地音频文件",
|
|
359
|
-
configure(command) {
|
|
360
|
-
command
|
|
361
|
-
.argument("<audioPath>")
|
|
362
|
-
.option("--language <code>", "语言提示(可选,例如 zh / en)");
|
|
363
329
|
},
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
330
|
+
execute: async ({ context, payload }) => {
|
|
331
|
+
const modelId = String(payload.modelId || "").trim();
|
|
332
|
+
const resolvedModelId = resolveVoicePluginModelId(modelId);
|
|
333
|
+
if (!resolvedModelId) {
|
|
334
|
+
return {
|
|
335
|
+
success: false,
|
|
336
|
+
error: `Unsupported asr model: ${modelId}`,
|
|
337
|
+
message: `Unsupported asr model: ${modelId}`,
|
|
338
|
+
};
|
|
368
339
|
}
|
|
340
|
+
const transcriberConfig = await writeVoiceTranscriberConfig({
|
|
341
|
+
context,
|
|
342
|
+
value: {
|
|
343
|
+
...readVoiceTranscriberConfig(context),
|
|
344
|
+
modelId: resolvedModelId,
|
|
345
|
+
},
|
|
346
|
+
});
|
|
369
347
|
return {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
348
|
+
success: true,
|
|
349
|
+
data: {
|
|
350
|
+
transcriber: toJsonObject(transcriberConfig) || {},
|
|
351
|
+
},
|
|
374
352
|
};
|
|
375
353
|
},
|
|
376
354
|
},
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
355
|
+
transcribe: {
|
|
356
|
+
command: {
|
|
357
|
+
description: "转写本地音频文件",
|
|
358
|
+
configure(command) {
|
|
359
|
+
command
|
|
360
|
+
.argument("<audioPath>")
|
|
361
|
+
.option("--language <code>", "语言提示(可选,例如 zh / en)");
|
|
362
|
+
},
|
|
363
|
+
mapInput({ args, opts }) {
|
|
364
|
+
const audioPath = String(args[0] || "").trim();
|
|
365
|
+
if (!audioPath) {
|
|
366
|
+
throw new Error("audioPath is required");
|
|
367
|
+
}
|
|
368
|
+
return {
|
|
369
|
+
audioPath,
|
|
370
|
+
...(getStringOpt(opts, "language")
|
|
371
|
+
? { language: getStringOpt(opts, "language") }
|
|
372
|
+
: {}),
|
|
373
|
+
};
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
execute: async ({ context, payload }) => {
|
|
377
|
+
const pluginStatus = await plugin.availability(context);
|
|
378
|
+
if (!pluginStatus.enabled || !pluginStatus.available) {
|
|
379
|
+
return {
|
|
380
|
+
success: false,
|
|
381
|
+
error: pluginStatus.reasons.join("; "),
|
|
382
|
+
message: pluginStatus.reasons.join("; "),
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
const result = await transcribeWithVoiceDependency({
|
|
386
|
+
context,
|
|
387
|
+
audioPath: String(payload.audioPath || ""),
|
|
388
|
+
language: typeof payload.language === "string"
|
|
389
|
+
? String(payload.language || "")
|
|
390
|
+
: undefined,
|
|
391
|
+
});
|
|
380
392
|
return {
|
|
381
|
-
success:
|
|
382
|
-
|
|
383
|
-
|
|
393
|
+
success: result.success,
|
|
394
|
+
...(result !== undefined ? { data: result } : {}),
|
|
395
|
+
...(result.success ? {} : { error: result.error || "transcribe failed" }),
|
|
396
|
+
...(result.success ? {} : { message: result.error || "transcribe failed" }),
|
|
384
397
|
};
|
|
385
|
-
}
|
|
386
|
-
const result = await transcribeWithVoiceDependency({
|
|
387
|
-
context,
|
|
388
|
-
audioPath: String(payload.audioPath || ""),
|
|
389
|
-
language: typeof payload.language === "string"
|
|
390
|
-
? String(payload.language || "")
|
|
391
|
-
: undefined,
|
|
392
|
-
});
|
|
393
|
-
return {
|
|
394
|
-
success: result.success,
|
|
395
|
-
...(result !== undefined ? { data: result } : {}),
|
|
396
|
-
...(result.success ? {} : { error: result.error || "transcribe failed" }),
|
|
397
|
-
...(result.success ? {} : { message: result.error || "transcribe failed" }),
|
|
398
|
-
};
|
|
399
|
-
},
|
|
400
|
-
},
|
|
401
|
-
models: {
|
|
402
|
-
allowWhenDisabled: true,
|
|
403
|
-
command: {
|
|
404
|
-
description: "列出内置 asr 支持的模型目录",
|
|
405
|
-
mapInput() {
|
|
406
|
-
return {};
|
|
407
398
|
},
|
|
408
399
|
},
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
400
|
+
models: {
|
|
401
|
+
allowWhenDisabled: true,
|
|
402
|
+
command: {
|
|
403
|
+
description: "列出内置 asr 支持的模型目录",
|
|
404
|
+
mapInput() {
|
|
405
|
+
return {};
|
|
414
406
|
},
|
|
415
|
-
};
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
doctor: {
|
|
419
|
-
command: {
|
|
420
|
-
description: "检查 asr plugin 与转写依赖可用性",
|
|
421
|
-
mapInput() {
|
|
422
|
-
return {};
|
|
423
407
|
},
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
success: true,
|
|
430
|
-
data: {
|
|
431
|
-
availability: {
|
|
432
|
-
enabled: availability.enabled,
|
|
433
|
-
available: availability.available,
|
|
434
|
-
reasons: availability.reasons,
|
|
435
|
-
},
|
|
436
|
-
transcriberStatus: {
|
|
437
|
-
available: dependencyStatus.available,
|
|
438
|
-
reasons: dependencyStatus.reasons,
|
|
439
|
-
...(dependencyStatus.details !== undefined
|
|
440
|
-
? { details: dependencyStatus.details }
|
|
441
|
-
: {}),
|
|
408
|
+
execute: async () => {
|
|
409
|
+
return {
|
|
410
|
+
success: true,
|
|
411
|
+
data: {
|
|
412
|
+
models: listVoiceModels(),
|
|
442
413
|
},
|
|
414
|
+
};
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
doctor: {
|
|
418
|
+
command: {
|
|
419
|
+
description: "检查 asr plugin 与转写依赖可用性",
|
|
420
|
+
mapInput() {
|
|
421
|
+
return {};
|
|
443
422
|
},
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
423
|
+
},
|
|
424
|
+
execute: async ({ context }) => {
|
|
425
|
+
const availability = await plugin.availability(context);
|
|
426
|
+
const dependencyStatus = await checkVoiceTranscriber(context);
|
|
427
|
+
return {
|
|
428
|
+
success: true,
|
|
429
|
+
data: {
|
|
430
|
+
availability: {
|
|
431
|
+
enabled: availability.enabled,
|
|
432
|
+
available: availability.available,
|
|
433
|
+
reasons: availability.reasons,
|
|
434
|
+
},
|
|
435
|
+
transcriberStatus: {
|
|
436
|
+
available: dependencyStatus.available,
|
|
437
|
+
reasons: dependencyStatus.reasons,
|
|
438
|
+
...(dependencyStatus.details !== undefined
|
|
439
|
+
? { details: dependencyStatus.details }
|
|
440
|
+
: {}),
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
message: availability.available
|
|
444
|
+
? "asr plugin is available"
|
|
445
|
+
: availability.reasons.join("; ") || "asr plugin is not available",
|
|
446
|
+
};
|
|
447
|
+
},
|
|
448
448
|
},
|
|
449
449
|
},
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
}
|
|
461
|
-
}
|
|
450
|
+
system(context) {
|
|
451
|
+
const config = readVoicePluginConfig(context);
|
|
452
|
+
if (!isPluginEnabled({ plugin, context }) || config.injectPrompt !== true) {
|
|
453
|
+
return "";
|
|
454
|
+
}
|
|
455
|
+
return [
|
|
456
|
+
"# ASR Plugin",
|
|
457
|
+
"Audio attachments may be transcribed before agent execution.",
|
|
458
|
+
].join("\n");
|
|
459
|
+
},
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* AsrPlugin:语音识别插件。
|
|
464
|
+
*/
|
|
465
|
+
export class AsrPlugin extends BasePlugin {
|
|
466
|
+
name = "asr";
|
|
467
|
+
constructor(agent = null) {
|
|
468
|
+
super(agent);
|
|
469
|
+
Object.assign(this, createAsrPluginDefinition(this));
|
|
470
|
+
}
|
|
471
|
+
}
|
|
462
472
|
//# sourceMappingURL=Plugin.js.map
|