@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,6 +6,8 @@
|
|
|
6
6
|
* - Console 只通过 setup / action 与插件交互,保持极简统一。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
10
|
+
import { BasePlugin } from "@/plugin/core/BasePlugin.js";
|
|
9
11
|
import type { Plugin } from "@/plugin/types/Plugin.js";
|
|
10
12
|
import type {
|
|
11
13
|
TtsInstallInput,
|
|
@@ -29,11 +31,9 @@ import {
|
|
|
29
31
|
toJsonObject,
|
|
30
32
|
} from "@/plugin/builtins/tts/PluginSupport.js";
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
export const ttsPlugin: Plugin = {
|
|
36
|
-
name: "tts",
|
|
34
|
+
function createTtsPluginDefinition(plugin: Plugin): Plugin {
|
|
35
|
+
return {
|
|
36
|
+
name: "tts",
|
|
37
37
|
title: "Text To Speech",
|
|
38
38
|
description:
|
|
39
39
|
"Generates local speech audio files from plain text through an installed TTS model, then returns a reusable audio file tag for downstream sending.",
|
|
@@ -118,7 +118,7 @@ export const ttsPlugin: Plugin = {
|
|
|
118
118
|
statusAction: "status",
|
|
119
119
|
},
|
|
120
120
|
async availability(context) {
|
|
121
|
-
if (!isPluginEnabled({ plugin
|
|
121
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
122
122
|
return {
|
|
123
123
|
enabled: false,
|
|
124
124
|
available: false,
|
|
@@ -143,7 +143,7 @@ export const ttsPlugin: Plugin = {
|
|
|
143
143
|
},
|
|
144
144
|
execute: async ({ context }) => {
|
|
145
145
|
const config = readTtsPluginConfig(context);
|
|
146
|
-
const availability = await
|
|
146
|
+
const availability = await plugin.availability!(context);
|
|
147
147
|
const synthesizer = await checkTtsSynthesizer(context);
|
|
148
148
|
return {
|
|
149
149
|
success: true,
|
|
@@ -446,7 +446,7 @@ export const ttsPlugin: Plugin = {
|
|
|
446
446
|
},
|
|
447
447
|
},
|
|
448
448
|
execute: async ({ context, payload }) => {
|
|
449
|
-
const pluginStatus = await
|
|
449
|
+
const pluginStatus = await plugin.availability!(context);
|
|
450
450
|
if (!pluginStatus.enabled || !pluginStatus.available) {
|
|
451
451
|
return {
|
|
452
452
|
success: false,
|
|
@@ -477,7 +477,7 @@ export const ttsPlugin: Plugin = {
|
|
|
477
477
|
},
|
|
478
478
|
},
|
|
479
479
|
system(context) {
|
|
480
|
-
if (!isPluginEnabled({ plugin
|
|
480
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
481
481
|
return "";
|
|
482
482
|
}
|
|
483
483
|
return [
|
|
@@ -493,4 +493,17 @@ export const ttsPlugin: Plugin = {
|
|
|
493
493
|
"Example: `city tts synthesize \"你好,欢迎来到 Downcity\" --format wav`",
|
|
494
494
|
].join("\n");
|
|
495
495
|
},
|
|
496
|
-
};
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
/**
|
|
500
|
+
* TtsPlugin:文本转语音插件。
|
|
501
|
+
*/
|
|
502
|
+
export class TtsPlugin extends BasePlugin {
|
|
503
|
+
readonly name = "tts";
|
|
504
|
+
|
|
505
|
+
constructor(agent: AgentRuntime | null = null) {
|
|
506
|
+
super(agent);
|
|
507
|
+
Object.assign(this, createTtsPluginDefinition(this));
|
|
508
|
+
}
|
|
509
|
+
}
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* - `web` plugin 不再自实现联网与浏览器能力,只负责 provider 选择、状态检查与提示词注入。
|
|
6
6
|
* - 真正的联网逻辑直接交给外部实现:`web-access` 或 `agent-browser`。
|
|
7
7
|
*/
|
|
8
|
+
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
9
|
+
import { BasePlugin } from "@/plugin/core/BasePlugin.js";
|
|
8
10
|
import type { Plugin } from "@/plugin/types/Plugin.js";
|
|
9
11
|
import type { JsonObject, JsonValue } from "@/types/common/Json.js";
|
|
10
12
|
import type { WebPluginConfig, WebPluginInstallInput } from "@/plugin/builtins/web/types/WebPlugin.js";
|
|
@@ -82,11 +84,9 @@ function getInstallScopeOpt(
|
|
|
82
84
|
return undefined;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
export const webPlugin: Plugin = {
|
|
89
|
-
name: "web",
|
|
87
|
+
function createWebPluginDefinition(plugin: Plugin): Plugin {
|
|
88
|
+
return {
|
|
89
|
+
name: "web",
|
|
90
90
|
title: "Web Access",
|
|
91
91
|
description:
|
|
92
92
|
"Connects the agent to either web-access or agent-browser, checks provider readiness, and injects the matching guidance into the runtime prompt.",
|
|
@@ -164,7 +164,7 @@ export const webPlugin: Plugin = {
|
|
|
164
164
|
statusAction: "status",
|
|
165
165
|
},
|
|
166
166
|
async availability(context) {
|
|
167
|
-
if (!isPluginEnabled({ plugin
|
|
167
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
168
168
|
return {
|
|
169
169
|
enabled: false,
|
|
170
170
|
available: false,
|
|
@@ -189,7 +189,7 @@ export const webPlugin: Plugin = {
|
|
|
189
189
|
},
|
|
190
190
|
execute: async ({ context }) => {
|
|
191
191
|
const config = readWebPluginConfig(context);
|
|
192
|
-
const availability = await
|
|
192
|
+
const availability = await plugin.availability!(context);
|
|
193
193
|
const source = await inspectWebPluginDependency(context);
|
|
194
194
|
return {
|
|
195
195
|
success: true,
|
|
@@ -461,7 +461,7 @@ export const webPlugin: Plugin = {
|
|
|
461
461
|
},
|
|
462
462
|
},
|
|
463
463
|
execute: async ({ context }) => {
|
|
464
|
-
const availability = await
|
|
464
|
+
const availability = await plugin.availability!(context);
|
|
465
465
|
const dependency = await doctorWebPluginDependency(context);
|
|
466
466
|
return {
|
|
467
467
|
success: true,
|
|
@@ -482,7 +482,7 @@ export const webPlugin: Plugin = {
|
|
|
482
482
|
},
|
|
483
483
|
system(context) {
|
|
484
484
|
const config = readWebPluginConfig(context);
|
|
485
|
-
if (!isPluginEnabled({ plugin
|
|
485
|
+
if (!isPluginEnabled({ plugin, context }) || !config.injectPrompt) {
|
|
486
486
|
return "";
|
|
487
487
|
}
|
|
488
488
|
const providerPrompt =
|
|
@@ -498,4 +498,17 @@ export const webPlugin: Plugin = {
|
|
|
498
498
|
providerPrompt,
|
|
499
499
|
].join("\n");
|
|
500
500
|
},
|
|
501
|
-
};
|
|
501
|
+
};
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
/**
|
|
505
|
+
* WebPlugin:provider 选择器与提示词适配层。
|
|
506
|
+
*/
|
|
507
|
+
export class WebPlugin extends BasePlugin {
|
|
508
|
+
readonly name = "web";
|
|
509
|
+
|
|
510
|
+
constructor(agent: AgentRuntime | null = null) {
|
|
511
|
+
super(agent);
|
|
512
|
+
Object.assign(this, createWebPluginDefinition(this));
|
|
513
|
+
}
|
|
514
|
+
}
|
|
@@ -6,76 +6,89 @@
|
|
|
6
6
|
* - 当前通过 plugin HTTP 注入暴露 `/api/workboard/snapshot`,供 console 代理与 UI 消费。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
10
|
+
import { BasePlugin } from "@/plugin/core/BasePlugin.js";
|
|
9
11
|
import type { Plugin } from "@/plugin/types/Plugin.js";
|
|
10
12
|
import { isPluginEnabled } from "@/plugin/core/Activation.js";
|
|
11
13
|
import { getWorkboardSnapshotStore } from "@/plugin/builtins/workboard/runtime/Store.js";
|
|
12
14
|
import type { WorkboardSnapshotResponse } from "@/plugin/builtins/workboard/types/Workboard.js";
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
function createWorkboardPluginDefinition(plugin: Plugin): Plugin {
|
|
17
|
+
return {
|
|
18
|
+
name: "workboard",
|
|
19
|
+
title: "Workboard Snapshot",
|
|
20
|
+
description:
|
|
21
|
+
"Collects structured runtime activity snapshots so console surfaces can show what the current agent is doing now and what it recently worked on.",
|
|
22
|
+
availability(context) {
|
|
23
|
+
if (!isPluginEnabled({ plugin, context })) {
|
|
24
|
+
return {
|
|
25
|
+
enabled: false,
|
|
26
|
+
available: false,
|
|
27
|
+
reasons: ["workboard plugin disabled in city config"],
|
|
28
|
+
};
|
|
29
|
+
}
|
|
24
30
|
return {
|
|
25
|
-
enabled:
|
|
26
|
-
available:
|
|
27
|
-
reasons: [
|
|
31
|
+
enabled: true,
|
|
32
|
+
available: true,
|
|
33
|
+
reasons: [],
|
|
28
34
|
};
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
},
|
|
36
|
+
http: {
|
|
37
|
+
server: {
|
|
38
|
+
authPolicies: [
|
|
39
|
+
{
|
|
40
|
+
path: "/api/workboard/*",
|
|
41
|
+
method: "GET",
|
|
42
|
+
requireAuth: true,
|
|
43
|
+
anyPermissions: ["agent.read"],
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
register({ app, getContext }) {
|
|
47
|
+
app.get("/api/workboard/snapshot", async (c) => {
|
|
48
|
+
try {
|
|
49
|
+
const availability = await plugin.availability?.(getContext());
|
|
50
|
+
if (availability && availability.available !== true) {
|
|
51
|
+
return c.json(
|
|
52
|
+
{
|
|
53
|
+
success: false,
|
|
54
|
+
error: availability.reasons.join("; ") || "workboard unavailable",
|
|
55
|
+
},
|
|
56
|
+
503,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const snapshot = await getWorkboardSnapshotStore({
|
|
61
|
+
contextResolver: getContext,
|
|
62
|
+
}).readSnapshot();
|
|
63
|
+
const payload: WorkboardSnapshotResponse = {
|
|
64
|
+
success: true,
|
|
65
|
+
snapshot,
|
|
66
|
+
};
|
|
67
|
+
return c.json(payload);
|
|
68
|
+
} catch (error) {
|
|
51
69
|
return c.json(
|
|
52
70
|
{
|
|
53
71
|
success: false,
|
|
54
|
-
error:
|
|
72
|
+
error: error instanceof Error ? error.message : String(error),
|
|
55
73
|
},
|
|
56
|
-
|
|
74
|
+
500,
|
|
57
75
|
);
|
|
58
76
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
contextResolver: getContext,
|
|
62
|
-
}).readSnapshot();
|
|
63
|
-
const payload: WorkboardSnapshotResponse = {
|
|
64
|
-
success: true,
|
|
65
|
-
snapshot,
|
|
66
|
-
};
|
|
67
|
-
return c.json(payload);
|
|
68
|
-
} catch (error) {
|
|
69
|
-
return c.json(
|
|
70
|
-
{
|
|
71
|
-
success: false,
|
|
72
|
-
error: error instanceof Error ? error.message : String(error),
|
|
73
|
-
},
|
|
74
|
-
500,
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
});
|
|
77
|
+
});
|
|
78
|
+
},
|
|
78
79
|
},
|
|
79
80
|
},
|
|
80
|
-
}
|
|
81
|
-
}
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* WorkboardPlugin:运行态观测面板插件。
|
|
86
|
+
*/
|
|
87
|
+
export class WorkboardPlugin extends BasePlugin {
|
|
88
|
+
readonly name = "workboard";
|
|
89
|
+
|
|
90
|
+
constructor(agent: AgentRuntime | null = null) {
|
|
91
|
+
super(agent);
|
|
92
|
+
Object.assign(this, createWorkboardPluginDefinition(this));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这里只做确定性采集,不引入 LLM 推理。
|
|
6
|
-
* - 内部仍聚合 session、task、runtime
|
|
6
|
+
* - 内部仍聚合 session、task、plugin runtime 三类运行事实,但最终只输出对外安全的模糊状态。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { listTaskDefinitions } from "@/plugin/builtins/task/Action.js";
|
|
@@ -72,7 +72,7 @@ export async function collectWorkboardSnapshot(
|
|
|
72
72
|
signals: toWorkboardSignals({
|
|
73
73
|
currentCount: current.length,
|
|
74
74
|
recentCount: recent.length,
|
|
75
|
-
|
|
75
|
+
plugins: runtimePlugins,
|
|
76
76
|
taskResult,
|
|
77
77
|
}),
|
|
78
78
|
};
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { ControlSessionSummary } from "@/runtime/server/http/control/types/ControlViewData.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { PluginStateSnapshot } from "@/plugin/types/PluginState.js";
|
|
11
11
|
import type { TaskListResponse } from "@/plugin/builtins/task/types/TaskCommand.js";
|
|
12
12
|
import type {
|
|
13
13
|
WorkboardActivityItem,
|
|
@@ -181,10 +181,10 @@ export function toWorkboardSummary(params: {
|
|
|
181
181
|
export function toWorkboardSignals(params: {
|
|
182
182
|
currentCount: number;
|
|
183
183
|
recentCount: number;
|
|
184
|
-
|
|
184
|
+
plugins: PluginStateSnapshot[];
|
|
185
185
|
taskResult: TaskListResponse;
|
|
186
186
|
}): WorkboardSignalItem[] {
|
|
187
|
-
const degradedCount = params.
|
|
187
|
+
const degradedCount = params.plugins.filter((item) => item.state !== "running").length;
|
|
188
188
|
const taskCount = Array.isArray(params.taskResult.tasks) ? params.taskResult.tasks.length : 0;
|
|
189
189
|
|
|
190
190
|
return [
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 主动运行型能力与被动扩展型能力统一收敛到 plugin 概念。
|
|
6
6
|
* - plugin 的长期状态归属于实例本身,而不是模块级单例。
|
|
7
|
-
* -
|
|
7
|
+
* - 旧生命周期模型暂时通过 `lifecycle` 兼容,后续可逐步收敛到 `start/stop/command`。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
@@ -98,7 +98,7 @@ export abstract class BasePlugin implements Plugin {
|
|
|
98
98
|
readonly http?: PluginHttpDefinition;
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
101
|
+
* 生命周期兼容层。
|
|
102
102
|
*/
|
|
103
103
|
lifecycle?: PluginLifecycle;
|
|
104
104
|
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* 内建 plugin class 清单。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 所有内建 plugin 统一收敛到一套 `BasePlugin` class 注册表。
|
|
6
|
+
* - 不再保留“plugin runtime / static plugin”两套定义源。
|
|
7
|
+
* - 运行方式差异只通过 plugin 自身能力体现,例如是否声明 `lifecycle`。
|
|
3
8
|
*/
|
|
4
9
|
|
|
5
10
|
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
6
11
|
import type { BasePlugin } from "@/plugin/core/BasePlugin.js";
|
|
12
|
+
import { AuthPlugin } from "@/plugin/builtins/auth/Plugin.js";
|
|
13
|
+
import { SkillPlugin } from "@/plugin/builtins/skill/Plugin.js";
|
|
14
|
+
import { WebPlugin } from "@/plugin/builtins/web/Plugin.js";
|
|
15
|
+
import { AsrPlugin } from "@/plugin/builtins/asr/Plugin.js";
|
|
16
|
+
import { TtsPlugin } from "@/plugin/builtins/tts/Plugin.js";
|
|
17
|
+
import { WorkboardPlugin } from "@/plugin/builtins/workboard/Plugin.js";
|
|
7
18
|
import { ChatPlugin } from "@/plugin/builtins/chat/ChatPlugin.js";
|
|
8
19
|
import { ContactPlugin } from "@/plugin/builtins/contact/ContactPlugin.js";
|
|
9
20
|
import { SchedulePlugin } from "@/plugin/builtins/schedule/SchedulePlugin.js";
|
|
@@ -12,16 +23,22 @@ import { MemoryPlugin } from "@/plugin/builtins/memory/MemoryPlugin.js";
|
|
|
12
23
|
import { ShellPlugin } from "@/plugin/builtins/shell/ShellPlugin.js";
|
|
13
24
|
|
|
14
25
|
/**
|
|
15
|
-
*
|
|
26
|
+
* 单个内建 plugin class 构造器。
|
|
16
27
|
*/
|
|
17
28
|
export type BuiltinPluginClass<T extends BasePlugin = BasePlugin> = new (
|
|
18
29
|
agent: AgentRuntime | null,
|
|
19
30
|
) => T;
|
|
20
31
|
|
|
21
32
|
/**
|
|
22
|
-
*
|
|
33
|
+
* 全部内建 plugin classes。
|
|
23
34
|
*/
|
|
24
35
|
export const BUILTIN_PLUGIN_CLASSES: BuiltinPluginClass[] = [
|
|
36
|
+
AuthPlugin,
|
|
37
|
+
SkillPlugin,
|
|
38
|
+
WebPlugin,
|
|
39
|
+
AsrPlugin,
|
|
40
|
+
TtsPlugin,
|
|
41
|
+
WorkboardPlugin,
|
|
25
42
|
ChatPlugin,
|
|
26
43
|
ContactPlugin,
|
|
27
44
|
SchedulePlugin,
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这里承载 console 侧的静态 plugin 元数据视图。
|
|
6
|
-
* -
|
|
6
|
+
* - 全部视图统一来源于 `BasePlugin` class 注册表,不再维护独立静态定义。
|
|
7
7
|
* - 当前先服务 Console 与 `city plugin` CLI 的静态回退场景。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { listRegisteredPlugins } from "@/plugin/core/PluginClassRegistry.js";
|
|
11
|
+
import type { BasePlugin } from "@/plugin/core/BasePlugin.js";
|
|
11
12
|
import { isPluginEnabled } from "@/plugin/core/Activation.js";
|
|
12
13
|
import type {
|
|
13
14
|
Plugin,
|
|
@@ -44,8 +45,8 @@ export function toStaticPluginView(plugin: Plugin): PluginView {
|
|
|
44
45
|
/**
|
|
45
46
|
* 列出全部内建 plugin 定义。
|
|
46
47
|
*/
|
|
47
|
-
export function listBuiltinPlugins():
|
|
48
|
-
return
|
|
48
|
+
export function listBuiltinPlugins(): BasePlugin[] {
|
|
49
|
+
return listRegisteredPlugins();
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
/**
|
|
@@ -60,7 +61,7 @@ export function listStaticPluginViews(): PluginView[] {
|
|
|
60
61
|
/**
|
|
61
62
|
* 按名称查找内建 plugin 定义。
|
|
62
63
|
*/
|
|
63
|
-
export function findBuiltinPlugin(pluginName: string):
|
|
64
|
+
export function findBuiltinPlugin(pluginName: string): BasePlugin | null {
|
|
64
65
|
const key = String(pluginName || "").trim();
|
|
65
66
|
if (!key) return null;
|
|
66
67
|
return listBuiltinPlugins().find((plugin) => plugin.name === key) || null;
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Plugin HTTP 路由装配。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 这里统一装配内建 plugin 的
|
|
5
|
+
* - 这里统一装配内建 plugin 的 HTTP 路由与鉴权策略。
|
|
6
6
|
* - plugin 自己声明路由;server 与 console 只负责消费这份声明。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { Hono } from "hono";
|
|
10
|
-
import {
|
|
10
|
+
import { listRegisteredPlugins } from "@/plugin/core/PluginClassRegistry.js";
|
|
11
11
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
12
12
|
import type { AuthRoutePolicy } from "@/types/runtime/auth/AuthRoute.js";
|
|
13
13
|
|
|
@@ -27,9 +27,9 @@ function dedupeAuthPolicies(policies: AuthRoutePolicy[]): AuthRoutePolicy[] {
|
|
|
27
27
|
/**
|
|
28
28
|
* 列出全部内建 plugin runtime 鉴权策略。
|
|
29
29
|
*/
|
|
30
|
-
export function
|
|
30
|
+
export function listBuiltinPluginAuthPolicies(): AuthRoutePolicy[] {
|
|
31
31
|
return dedupeAuthPolicies(
|
|
32
|
-
|
|
32
|
+
listRegisteredPlugins().flatMap((plugin) => plugin.http?.server?.authPolicies || []),
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -40,8 +40,8 @@ export function registerBuiltinPluginHttpRoutes(params: {
|
|
|
40
40
|
app: Hono;
|
|
41
41
|
getContext: () => AgentContext;
|
|
42
42
|
}): void {
|
|
43
|
-
for (const plugin of
|
|
44
|
-
plugin.http?.
|
|
43
|
+
for (const plugin of listRegisteredPlugins()) {
|
|
44
|
+
plugin.http?.server?.register({
|
|
45
45
|
app: params.app,
|
|
46
46
|
getContext: params.getContext,
|
|
47
47
|
pluginName: plugin.name,
|
|
@@ -12,6 +12,7 @@ import { logger as defaultLogger } from "@/utils/logger/Logger.js";
|
|
|
12
12
|
import { loadAgentEnvSnapshot, loadDowncityConfig, loadGlobalEnvFromStore } from "@/config/Config.js";
|
|
13
13
|
import { isPluginEnabled } from "@/plugin/core/Activation.js";
|
|
14
14
|
import { findBuiltinPlugin, listStaticPluginViews } from "@/plugin/core/Catalog.js";
|
|
15
|
+
import { isManagedPlugin } from "@/plugin/core/PluginClassRegistry.js";
|
|
15
16
|
import {
|
|
16
17
|
createAgentPathRuntime,
|
|
17
18
|
createAgentPluginConfigRuntime,
|
|
@@ -99,6 +100,13 @@ export async function getLocalPluginAvailability(
|
|
|
99
100
|
reasons: [`Unknown plugin: ${pluginName}`],
|
|
100
101
|
};
|
|
101
102
|
}
|
|
103
|
+
if (isManagedPlugin(plugin)) {
|
|
104
|
+
return {
|
|
105
|
+
enabled: false,
|
|
106
|
+
available: false,
|
|
107
|
+
reasons: [`Plugin "${plugin.name}" must run through an active agent.`],
|
|
108
|
+
};
|
|
109
|
+
}
|
|
102
110
|
|
|
103
111
|
const context = createLocalPluginCommandContext(projectRoot);
|
|
104
112
|
if (plugin.availability) {
|
|
@@ -138,6 +146,13 @@ export async function runLocalPluginAction(params: {
|
|
|
138
146
|
message: `Unknown plugin: ${params.pluginName}`,
|
|
139
147
|
};
|
|
140
148
|
}
|
|
149
|
+
if (isManagedPlugin(plugin)) {
|
|
150
|
+
return {
|
|
151
|
+
success: false,
|
|
152
|
+
error: `Plugin "${plugin.name}" must run through an active agent`,
|
|
153
|
+
message: `Plugin "${plugin.name}" must run through an active agent`,
|
|
154
|
+
};
|
|
155
|
+
}
|
|
141
156
|
|
|
142
157
|
const actionName = String(params.actionName || "").trim();
|
|
143
158
|
if (!actionName) {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PluginClassRegistry
|
|
2
|
+
* PluginClassRegistry:统一内建 plugin 类注册表。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 所有内建 plugin 都通过这里暴露实例与名称。
|
|
6
|
+
* - “是否由运行中的 agent 承载”不再由独立类型区分,而是从 plugin 能力推导。
|
|
3
7
|
*/
|
|
4
8
|
|
|
5
9
|
import type { AgentRuntime } from "@/core/AgentCoreTypes.js";
|
|
@@ -16,19 +20,44 @@ function createPluginInstance(
|
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
/**
|
|
19
|
-
*
|
|
23
|
+
* 判断 plugin 是否需要运行中的 agent 来承载生命周期/命令。
|
|
24
|
+
*/
|
|
25
|
+
export function isManagedPlugin(plugin: BasePlugin): boolean {
|
|
26
|
+
return Boolean(plugin.lifecycle);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 返回全部已注册内建 plugin 名称。
|
|
20
31
|
*/
|
|
21
32
|
export function listRegisteredPluginNames(): string[] {
|
|
22
33
|
return BUILTIN_PLUGIN_CLASSES.map((PluginClass) => new PluginClass(null).name);
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
/**
|
|
26
|
-
*
|
|
37
|
+
* 返回全部已注册内建 plugin 实例视图。
|
|
27
38
|
*/
|
|
28
39
|
export function listRegisteredPlugins(): BasePlugin[] {
|
|
29
40
|
return BUILTIN_PLUGIN_CLASSES.map((PluginClass) => new PluginClass(null));
|
|
30
41
|
}
|
|
31
42
|
|
|
43
|
+
/**
|
|
44
|
+
* 返回全部本地 plugin 实例视图。
|
|
45
|
+
*
|
|
46
|
+
* 关键点(中文)
|
|
47
|
+
* - 本地 plugin 指“不依赖运行中 agent lifecycle”的那一类。
|
|
48
|
+
* - 这类 plugin 可直接由 CLI / 控制面在本进程执行。
|
|
49
|
+
*/
|
|
50
|
+
export function listLocalPlugins(): BasePlugin[] {
|
|
51
|
+
return listRegisteredPlugins().filter((plugin) => !isManagedPlugin(plugin));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 返回全部受 agent 托管的 plugin 实例视图。
|
|
56
|
+
*/
|
|
57
|
+
export function listManagedPlugins(): BasePlugin[] {
|
|
58
|
+
return listRegisteredPlugins().filter((plugin) => isManagedPlugin(plugin));
|
|
59
|
+
}
|
|
60
|
+
|
|
32
61
|
/**
|
|
33
62
|
* 返回无宿主静态 plugin 实例集合。
|
|
34
63
|
*/
|
|
@@ -39,7 +68,7 @@ export function getRegisteredStaticPluginInstances(): Map<string, BasePlugin> {
|
|
|
39
68
|
}
|
|
40
69
|
|
|
41
70
|
/**
|
|
42
|
-
* 为当前 agent
|
|
71
|
+
* 为当前 agent 创建一组内建 plugin instances。
|
|
43
72
|
*/
|
|
44
73
|
export function createRegisteredPluginInstances(
|
|
45
74
|
agent: AgentRuntime | null,
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
* Plugin Action CLI 注册器。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* -
|
|
6
|
-
* -
|
|
5
|
+
* - 负责把“本地可执行”的 plugin actions 挂到 commander(`city <plugin> <action>`)。
|
|
6
|
+
* - 需要运行中 agent 的 plugin 不在这里注册,避免和受托管命令桥接冲突。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import type { Command } from "commander";
|
|
11
11
|
import type { JsonObject, JsonValue } from "@/types/common/Json.js";
|
|
12
|
-
import {
|
|
12
|
+
import { listLocalPlugins } from "@/plugin/core/PluginClassRegistry.js";
|
|
13
13
|
import type { Plugin, PluginAction } from "@/plugin/types/Plugin.js";
|
|
14
14
|
import { runLocalPluginAction } from "@/plugin/core/LocalExecution.js";
|
|
15
15
|
import { printResult } from "@/utils/cli/CliOutput.js";
|
|
@@ -206,7 +206,7 @@ function registerPluginActionCommand(params: {
|
|
|
206
206
|
* 注册全部 plugin actions 的 CLI 命令。
|
|
207
207
|
*/
|
|
208
208
|
export function registerAllPluginsForCli(program: Command): void {
|
|
209
|
-
for (const plugin of
|
|
209
|
+
for (const plugin of listLocalPlugins()) {
|
|
210
210
|
for (const [actionName, action] of Object.entries(plugin.actions || {})) {
|
|
211
211
|
registerPluginActionCommand({
|
|
212
212
|
program,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* PluginCommandRequest:统一 runtime
|
|
2
|
+
* PluginCommandRequest:统一 plugin runtime command 请求解析模块。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 统一收口 HTTP / RPC 两种入口的请求体解析。
|
|
6
|
-
* - runtime
|
|
6
|
+
* - plugin runtime 远程调用统一走 runtime command 协议,不再让 action 自带 HTTP route。
|
|
7
7
|
* - 通用调度参数(`schedule` / `delay` / `time`)也在这里一次性归一化。
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
type JsonRecord = Record<string, unknown>;
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* 统一 runtime
|
|
20
|
+
* 统一 plugin runtime command 请求体。
|
|
21
21
|
*/
|
|
22
22
|
export type PluginCommandRequestBody = {
|
|
23
23
|
/**
|
|
@@ -77,7 +77,7 @@ function readScheduleInput(
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
* 解析统一 runtime
|
|
80
|
+
* 解析统一 plugin runtime command 请求体。
|
|
81
81
|
*/
|
|
82
82
|
export function parsePluginCommandRequestBody(
|
|
83
83
|
rawBody: JsonValue | undefined,
|
|
@@ -35,11 +35,11 @@ export function listPluginInstances(input?: {
|
|
|
35
35
|
context?: AgentContext;
|
|
36
36
|
runtime?: AgentRuntime;
|
|
37
37
|
}): BasePlugin[] {
|
|
38
|
-
const contextPlugins = input?.context?.agent?.
|
|
38
|
+
const contextPlugins = input?.context?.agent?.pluginInstances;
|
|
39
39
|
if (contextPlugins instanceof Map && contextPlugins.size > 0) {
|
|
40
40
|
return [...contextPlugins.values()];
|
|
41
41
|
}
|
|
42
|
-
const runtimePlugins = input?.runtime?.
|
|
42
|
+
const runtimePlugins = input?.runtime?.pluginInstances;
|
|
43
43
|
if (runtimePlugins instanceof Map && runtimePlugins.size > 0) {
|
|
44
44
|
return [...runtimePlugins.values()];
|
|
45
45
|
}
|