@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
|
@@ -14,7 +14,7 @@ import type { ChatChannelState } from "@/plugin/builtins/chat/types/ChatRuntime.
|
|
|
14
14
|
|
|
15
15
|
const CHAT_CHANNEL_NAMES: ChatChannelName[] = ["telegram", "feishu", "qq"];
|
|
16
16
|
|
|
17
|
-
type
|
|
17
|
+
type ChatRuntimeBindings = {
|
|
18
18
|
getChannelAccountId?(context: AgentContext, channel: ChatChannelName): string;
|
|
19
19
|
resolveChannelAccount?(
|
|
20
20
|
context: AgentContext,
|
|
@@ -23,11 +23,11 @@ type ChatServiceRuntimeBindings = {
|
|
|
23
23
|
isChannelEnabled?(context: AgentContext, channel: ChatChannelName): boolean;
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
-
function
|
|
26
|
+
function resolveChatPluginBindings(
|
|
27
27
|
context: AgentContext,
|
|
28
|
-
):
|
|
29
|
-
const candidate = context.agent?.
|
|
30
|
-
|
|
|
28
|
+
): ChatRuntimeBindings | null {
|
|
29
|
+
const candidate = context.agent?.pluginInstances?.get?.("chat") as
|
|
30
|
+
| ChatRuntimeBindings
|
|
31
31
|
| undefined;
|
|
32
32
|
return candidate || null;
|
|
33
33
|
}
|
|
@@ -74,10 +74,10 @@ export function resolveChannelAccountId(
|
|
|
74
74
|
context: AgentContext,
|
|
75
75
|
channel: ChatChannelName,
|
|
76
76
|
): string {
|
|
77
|
-
const
|
|
78
|
-
const explicit = String(
|
|
77
|
+
const plugin = resolveChatPluginBindings(context);
|
|
78
|
+
const explicit = String(plugin?.getChannelAccountId?.(context, channel) || "").trim();
|
|
79
79
|
if (explicit) return explicit;
|
|
80
|
-
const config = context.config.
|
|
80
|
+
const config = context.config.plugins?.chat?.channels?.[channel] as
|
|
81
81
|
| { channelAccountId?: unknown }
|
|
82
82
|
| undefined;
|
|
83
83
|
return String(config?.channelAccountId || "").trim();
|
|
@@ -90,8 +90,8 @@ export function resolveChannelAccount(
|
|
|
90
90
|
context: AgentContext,
|
|
91
91
|
channel: ChatChannelName,
|
|
92
92
|
): StoredChannelAccount | null {
|
|
93
|
-
const
|
|
94
|
-
const explicit =
|
|
93
|
+
const plugin = resolveChatPluginBindings(context);
|
|
94
|
+
const explicit = plugin?.resolveChannelAccount?.(context, channel);
|
|
95
95
|
if (explicit) return explicit;
|
|
96
96
|
const channelAccountId = resolveChannelAccountId(context, channel);
|
|
97
97
|
const account = context.platform.resolveChannelAccount?.({
|
|
@@ -125,11 +125,11 @@ export function isChatChannelEnabled(
|
|
|
125
125
|
context: AgentContext,
|
|
126
126
|
channel: ChatChannelName,
|
|
127
127
|
): boolean {
|
|
128
|
-
const
|
|
129
|
-
if (typeof
|
|
130
|
-
return
|
|
128
|
+
const plugin = resolveChatPluginBindings(context);
|
|
129
|
+
if (typeof plugin?.isChannelEnabled === "function") {
|
|
130
|
+
return plugin.isChannelEnabled(context, channel);
|
|
131
131
|
}
|
|
132
|
-
return context.config.
|
|
132
|
+
return context.config.plugins?.chat?.channels?.[channel]?.enabled === true;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
/**
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* ChatMetaStore:按 sessionId 维护 chat 路由元信息。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 入站消息到达时由
|
|
6
|
-
* - 出站按 sessionId/chatKey 发送时由
|
|
5
|
+
* - 入站消息到达时由 chat plugin runtime 写入
|
|
6
|
+
* - 出站按 sessionId/chatKey 发送时由 chat plugin runtime 读取
|
|
7
7
|
* - 底层数据落在 `.downcity/channel/meta.json`,由 ChannelContextStore 统一维护
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatPluginActions:chat
|
|
2
|
+
* ChatPluginActions:chat plugin runtime 的 action 注册表模块。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这里专门负责把 chat 的 CLI/execute 定义装配成 `PluginActions`。
|
|
6
|
-
* -
|
|
6
|
+
* - `ChatPlugin` 本体只保留实例状态与 lifecycle,不再承载大段 action 声明。
|
|
7
7
|
* - action 执行仍然复用各 runtime 模块,确保行为与现有实现保持一致。
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -95,7 +95,7 @@ function attachCommandHelpText(command: Command, text: string): void {
|
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
|
-
* 创建 chat
|
|
98
|
+
* 创建 chat plugin runtime 的 action 定义表。
|
|
99
99
|
*/
|
|
100
100
|
export function createChatPluginActions(params: {
|
|
101
101
|
channelState: ChatChannelState;
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
resolveCurrentChatEnvironmentPromptInput,
|
|
13
13
|
} from "@/plugin/builtins/chat/runtime/SystemPrompt.js";
|
|
14
14
|
import {
|
|
15
|
-
|
|
15
|
+
CHAT_PLUGIN_PROMPT,
|
|
16
16
|
FEISHU_CHAT_CHANNEL_PROMPT,
|
|
17
17
|
QQ_CHAT_CHANNEL_PROMPT,
|
|
18
18
|
TELEGRAM_CHAT_CHANNEL_PROMPT,
|
|
@@ -61,7 +61,7 @@ export async function buildChatPluginSystem(
|
|
|
61
61
|
context: AgentContext,
|
|
62
62
|
): Promise<string> {
|
|
63
63
|
return [
|
|
64
|
-
|
|
64
|
+
CHAT_PLUGIN_PROMPT,
|
|
65
65
|
await buildCurrentChatEnvironmentPrompt(context),
|
|
66
66
|
...(await buildCurrentChannelPrompts(context)),
|
|
67
67
|
]
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatPromptAssets:chat
|
|
2
|
+
* ChatPromptAssets:chat plugin runtime 静态提示词资产。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - prompt 文本真实来源是 `*.ts.txt` 文本文件。
|
|
6
6
|
* - 这里统一做 `trim()`,避免多渠道 prompt 行为不一致。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import chatPluginPromptText from "@/plugin/builtins/chat/PROMPT.direct.js";
|
|
10
10
|
import feishuChatPromptText from "@/plugin/builtins/chat/channels/feishu/PROMPT.direct.js";
|
|
11
11
|
import qqChatPromptText from "@/plugin/builtins/chat/channels/qq/PROMPT.direct.js";
|
|
12
12
|
import telegramChatPromptText from "@/plugin/builtins/chat/channels/telegram/PROMPT.direct.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* chat
|
|
15
|
+
* chat plugin runtime 基础 prompt。
|
|
16
16
|
*/
|
|
17
|
-
export const
|
|
17
|
+
export const CHAT_PLUGIN_PROMPT = chatPluginPromptText.trim();
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* 飞书 channel prompt。
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatQueueStore:chat
|
|
2
|
+
* ChatQueueStore:chat plugin runtime 队列存储。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这是 chat queue 的实例级状态容器。
|
|
6
|
-
* - 允许 `
|
|
6
|
+
* - 允许 `ChatPlugin` 持有自己的 queue store,而不是完全依赖模块级全局状态。
|
|
7
7
|
* - 旧的 `ChatQueue.ts` 会保留共享门面,逐步迁移到显式实例注入。
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -20,7 +20,7 @@ import type {
|
|
|
20
20
|
export type ChatQueueEnqueueListener = (laneKey: string) => void;
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* ChatPlugin queue store 的最小能力接口。
|
|
24
24
|
*/
|
|
25
25
|
export interface ChatQueueStorePort {
|
|
26
26
|
/**
|
|
@@ -171,11 +171,11 @@ export function getSharedChatQueueStore(): ChatQueueStore {
|
|
|
171
171
|
* 从运行时解析 chat queue store。
|
|
172
172
|
*
|
|
173
173
|
* 关键点(中文)
|
|
174
|
-
* - 新路径优先读取 `runtime.agent.
|
|
174
|
+
* - 新路径优先读取 `runtime.agent.pluginInstances.chat.queueStore`。
|
|
175
175
|
* - 迁移阶段若拿不到,则回退到共享 queue store,保证旧入口可继续工作。
|
|
176
176
|
*/
|
|
177
177
|
export function resolveChatQueueStore(runtime?: AgentContext): ChatQueueStorePort {
|
|
178
|
-
const chatService = runtime?.agent?.
|
|
178
|
+
const chatService = runtime?.agent?.pluginInstances?.get?.("chat") as
|
|
179
179
|
| { queueStore?: ChatQueueStorePort }
|
|
180
180
|
| undefined;
|
|
181
181
|
if (chatService?.queueStore) {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatQueueWorker:chat
|
|
2
|
+
* ChatQueueWorker:chat plugin runtime 侧队列执行器。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 消费
|
|
5
|
+
* - 消费 chat plugin runtime 持有的队列模块
|
|
6
6
|
* - 只负责把 lane 中的新输入持续提交给 `session.prompt()`
|
|
7
7
|
* - turn 并入策略、history 落盘、assistant 收敛统一交给 Session
|
|
8
8
|
*/
|
|
@@ -198,7 +198,7 @@ export class ChatQueueWorker {
|
|
|
198
198
|
* 在单次执行期间维持“正在输入”心跳。
|
|
199
199
|
*
|
|
200
200
|
* 关键点(中文)
|
|
201
|
-
* - 通过
|
|
201
|
+
* - 通过 chat plugin runtime 的 dispatcher 发送动作(不经过 main bindings)
|
|
202
202
|
* - 先发送一次,再按固定间隔续发
|
|
203
203
|
* - 发送失败不影响主执行流程(best-effort)
|
|
204
204
|
*/
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { LanguageModel, Tool } from "ai";
|
|
11
|
-
import { Executor } from "@
|
|
12
|
-
import type { SessionHistoryComposer } from "@
|
|
13
|
-
import type { SessionHistoryStore } from "@/
|
|
14
|
-
import type { SessionCompactionComposer } from "@
|
|
15
|
-
import type { SessionSystemComposer } from "@
|
|
11
|
+
import { Executor } from "@executor/Executor.js";
|
|
12
|
+
import type { SessionHistoryComposer } from "@executor/composer/history/SessionHistoryComposer.js";
|
|
13
|
+
import type { SessionHistoryStore } from "@/executor/store/history/SessionHistoryStore.js";
|
|
14
|
+
import type { SessionCompactionComposer } from "@executor/composer/compaction/SessionCompactionComposer.js";
|
|
15
|
+
import type { SessionSystemComposer } from "@executor/composer/system/SessionSystemComposer.js";
|
|
16
16
|
import type { ChatSessionContextComposer } from "@/plugin/builtins/chat/runtime/ChatSessionContextComposer.js";
|
|
17
17
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
18
|
-
import type { SessionAssistantStepCallback } from "@/
|
|
19
|
-
import type { SessionRunResult } from "@/
|
|
18
|
+
import type { SessionAssistantStepCallback } from "@/executor/types/SessionRun.js";
|
|
19
|
+
import type { SessionRunResult } from "@/executor/types/SessionRun.js";
|
|
20
20
|
import type { ChatSessionTurnState } from "@/plugin/builtins/chat/runtime/ChatSessionTypes.js";
|
|
21
21
|
|
|
22
22
|
type ChatSessionOptions = {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { ModelMessage, Tool } from "ai";
|
|
11
|
-
import { drainInjectedUserMessages } from "@
|
|
12
|
-
import { LocalSessionContextComposer } from "@
|
|
13
|
-
import type { SessionMessageV1 } from "@/
|
|
14
|
-
import type { SessionSystemMessage } from "@/
|
|
11
|
+
import { drainInjectedUserMessages } from "@executor/SessionRunScope.js";
|
|
12
|
+
import { LocalSessionContextComposer } from "@executor/composer/context/LocalSessionContextComposer.js";
|
|
13
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
14
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
15
15
|
import type { ChatSessionTurnState } from "@/plugin/builtins/chat/runtime/ChatSessionTypes.js";
|
|
16
16
|
|
|
17
17
|
type ChatSessionContextComposerOptions = {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - 普通 Session 仍可复用基础 `run / append*` 能力,不强耦合 chat 语义。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { SessionUserMessageV1 } from "@/
|
|
10
|
-
import type { SessionAssistantStepCallback } from "@/
|
|
9
|
+
import type { SessionUserMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
10
|
+
import type { SessionAssistantStepCallback } from "@/executor/types/SessionRun.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* ChatSession 单次 turn 绑定的运行态。
|
|
@@ -21,7 +21,7 @@ import { readChatMetaBySessionId } from "./ChatMetaStore.js";
|
|
|
21
21
|
* 解析实际分发目标。
|
|
22
22
|
*
|
|
23
23
|
* 规则(中文)
|
|
24
|
-
* - 仅使用
|
|
24
|
+
* - 仅使用 chat plugin runtime 维护的 session 路由映射。
|
|
25
25
|
* - 不再支持 legacy chatKey 字符串解析回退。
|
|
26
26
|
*/
|
|
27
27
|
export async function resolveDispatchTargetByChatKey(params: {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* PluginDispatch:chat 领域的 plugin 调用辅助。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - chat
|
|
5
|
+
* - chat plugin runtime 只依赖这里,不直接依赖某个具体 plugin 模块路径。
|
|
6
6
|
* - 这里封装 chat 领域的 plugin 点调用语义,保持 service 边界稳定。
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -48,7 +48,7 @@ export async function observeIncomingChatPrincipal(params: {
|
|
|
48
48
|
*
|
|
49
49
|
* 关键点(中文)
|
|
50
50
|
* - 这是 guard 语义:允许则静默返回,拒绝则直接抛错。
|
|
51
|
-
* - 这样 chat
|
|
51
|
+
* - 这样 chat plugin runtime 可以像处理中间件一样串联 guard 点。
|
|
52
52
|
*/
|
|
53
53
|
export async function guardIncomingChat(params: {
|
|
54
54
|
context: AgentContext;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Chat
|
|
2
|
+
* Chat plugin 点定义。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - plugin 点由 chat
|
|
6
|
-
* -
|
|
5
|
+
* - plugin 点由 chat plugin runtime 定义,不由具体 plugin 定义。
|
|
6
|
+
* - chat plugin runtime 只依赖这些稳定点名,具体 plugin 负责实现其中某些点。
|
|
7
7
|
* - 后续新增 chat 生命周期 plugin 点,也应统一收敛到这里。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Chat
|
|
11
|
+
* Chat runtime 对外暴露的 plugin 点目录。
|
|
12
12
|
*/
|
|
13
13
|
export const CHAT_PLUGIN_POINTS = {
|
|
14
14
|
/**
|
|
15
15
|
* 增强入站消息正文。
|
|
16
16
|
*
|
|
17
17
|
* 说明(中文)
|
|
18
|
-
* -
|
|
18
|
+
* - chat plugin runtime 先构造基础 attachment/body 文本。
|
|
19
19
|
* - plugin 通过 pipeline 往 `pluginSections` 中追加中间块。
|
|
20
20
|
*/
|
|
21
21
|
augmentInbound: "chat.augmentInbound",
|
|
@@ -23,7 +23,7 @@ export const CHAT_PLUGIN_POINTS = {
|
|
|
23
23
|
* 回复前文本增强。
|
|
24
24
|
*
|
|
25
25
|
* 说明(中文)
|
|
26
|
-
* -
|
|
26
|
+
* - chat plugin runtime 在真正回发到 channel 前调用。
|
|
27
27
|
* - plugin 可在这里做收尾改写、格式整理、签名注入等。
|
|
28
28
|
*/
|
|
29
29
|
beforeReply: "chat.beforeReply",
|
|
@@ -31,7 +31,7 @@ export const CHAT_PLUGIN_POINTS = {
|
|
|
31
31
|
* 回复后事件通知。
|
|
32
32
|
*
|
|
33
33
|
* 说明(中文)
|
|
34
|
-
* -
|
|
34
|
+
* - chat plugin runtime 在一次回复发送完成后触发。
|
|
35
35
|
* - plugin 可在这里做审计、统计、回执同步等副作用。
|
|
36
36
|
*/
|
|
37
37
|
afterReply: "chat.afterReply",
|
|
@@ -39,7 +39,7 @@ export const CHAT_PLUGIN_POINTS = {
|
|
|
39
39
|
* 入队前数据增强。
|
|
40
40
|
*
|
|
41
41
|
* 说明(中文)
|
|
42
|
-
* -
|
|
42
|
+
* - chat plugin runtime 在 append ingress / enqueue 之前调用。
|
|
43
43
|
* - plugin 可在这里改写入队文本或补充 extra metadata。
|
|
44
44
|
*/
|
|
45
45
|
beforeEnqueue: "chat.beforeEnqueue",
|
|
@@ -47,7 +47,7 @@ export const CHAT_PLUGIN_POINTS = {
|
|
|
47
47
|
* 入队后事件通知。
|
|
48
48
|
*
|
|
49
49
|
* 说明(中文)
|
|
50
|
-
* -
|
|
50
|
+
* - chat plugin runtime 在消息真正入队完成后调用。
|
|
51
51
|
* - plugin 可在这里做统计、观测、调试落点。
|
|
52
52
|
*/
|
|
53
53
|
afterEnqueue: "chat.afterEnqueue",
|
|
@@ -63,7 +63,7 @@ export const CHAT_PLUGIN_POINTS = {
|
|
|
63
63
|
* 判定当前入站消息是否允许执行。
|
|
64
64
|
*
|
|
65
65
|
* 说明(中文)
|
|
66
|
-
* - 由
|
|
66
|
+
* - 由 chat plugin runtime 在 ingress 阶段显式调用。
|
|
67
67
|
* - 典型实现方是 auth plugin。
|
|
68
68
|
*/
|
|
69
69
|
authorizeIncoming: "chat.authorizeIncoming",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 统一从 request context + ChatMetaStore 读取当前 chat 元信息。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { getSessionRunScope } from "@
|
|
10
|
+
import { getSessionRunScope } from "@executor/SessionRunScope.js";
|
|
11
11
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
12
12
|
import type { ChatEnvironmentPromptInput } from "@/plugin/builtins/chat/types/ChatPromptContext.js";
|
|
13
13
|
import { readChatMetaBySessionId } from "@/plugin/builtins/chat/runtime/ChatMetaStore.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
type UIMessagePart,
|
|
15
15
|
type UITools,
|
|
16
16
|
} from "ai";
|
|
17
|
-
import type { SessionMessageV1 } from "@/
|
|
17
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
18
18
|
import type { JsonObject, JsonValue } from "@/types/common/Json.js";
|
|
19
19
|
|
|
20
20
|
type AnyUiMessagePart = UIMessagePart<UIDataTypes, UITools>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 因此需要一个稳定的、与 Agent 解耦的提取逻辑(属于 chat/egress 语义)
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { SessionMessageV1 } from "@/
|
|
10
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
11
11
|
import {
|
|
12
12
|
extractTextFromUiMessage,
|
|
13
13
|
extractToolCallsFromUiMessage,
|
|
@@ -42,7 +42,7 @@ export type ChatChannelStateSnapshot = {
|
|
|
42
42
|
*/
|
|
43
43
|
channel: ChatChannelName;
|
|
44
44
|
/**
|
|
45
|
-
* 是否在配置中启用(`downcity.json` 的 `
|
|
45
|
+
* 是否在配置中启用(`downcity.json` 的 `plugins.chat.channels.<channel>.enabled`)。
|
|
46
46
|
*/
|
|
47
47
|
enabled: boolean;
|
|
48
48
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ChatMeta:chat
|
|
2
|
+
* ChatMeta:chat plugin runtime 维护的 session 路由元信息。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 只描述“如何把 sessionId 路由回平台 chat”
|
|
6
|
-
* - 由
|
|
6
|
+
* - 由 chat plugin runtime 在接收入站消息时更新
|
|
7
7
|
* - 不属于 core context message schema
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Chat
|
|
2
|
+
* Chat plugin 交互类型定义。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 统一描述 chat
|
|
6
|
-
* -
|
|
5
|
+
* - 统一描述 chat plugin runtime 与 plugin 之间的扩展 payload。
|
|
6
|
+
* - chat plugin runtime 负责定义结构,plugin 只消费这些稳定字段。
|
|
7
7
|
* - 字段全部保持 Json 兼容,避免把函数或运行时私有对象塞进 plugin 点。
|
|
8
8
|
*/
|
|
9
9
|
|
|
@@ -36,7 +36,7 @@ export interface ChatPluginAttachment {
|
|
|
36
36
|
* 附件本地绝对路径。
|
|
37
37
|
*
|
|
38
38
|
* 说明(中文)
|
|
39
|
-
* - 若
|
|
39
|
+
* - 若 chat plugin runtime 尚未把附件落地,则该字段可为空。
|
|
40
40
|
* - 依赖本地文件的 plugin 应在缺失时跳过处理。
|
|
41
41
|
*/
|
|
42
42
|
path?: string;
|
|
@@ -87,14 +87,14 @@ export interface ChatInboundAugmentInput {
|
|
|
87
87
|
*/
|
|
88
88
|
rootPath: string;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* chat plugin runtime 已生成的附件文本块。
|
|
91
91
|
*
|
|
92
92
|
* 说明(中文)
|
|
93
93
|
* - 一般是 `<file ...>` 标签拼接后的结果。
|
|
94
94
|
*/
|
|
95
95
|
attachmentText?: string;
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
97
|
+
* chat plugin runtime 已抽取的正文文本。
|
|
98
98
|
*/
|
|
99
99
|
bodyText?: string;
|
|
100
100
|
/**
|
|
@@ -19,7 +19,7 @@ export interface ChatEnvironmentPromptInput {
|
|
|
19
19
|
*
|
|
20
20
|
* 说明(中文)
|
|
21
21
|
* - 对外统一使用 `sessionId` 语义。
|
|
22
|
-
* - chat
|
|
22
|
+
* - chat plugin runtime 内部统一按 session 语义路由与持久化。
|
|
23
23
|
*/
|
|
24
24
|
sessionId: string;
|
|
25
25
|
|
|
@@ -27,7 +27,7 @@ export interface ChatEnvironmentPromptInput {
|
|
|
27
27
|
* 当前 chatKey。
|
|
28
28
|
*
|
|
29
29
|
* 说明(中文)
|
|
30
|
-
* - chat
|
|
30
|
+
* - chat plugin runtime 里通常与 `sessionId` 一致。
|
|
31
31
|
* - 保留独立字段,避免未来路由键语义调整时影响调用方。
|
|
32
32
|
*/
|
|
33
33
|
chatKey: string;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* ChatRuntime 类型定义。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - 这些类型描述 chat
|
|
6
|
-
* - channel bots 的状态所有权归属于
|
|
5
|
+
* - 这些类型描述 chat plugin runtime 的实例级运行态。
|
|
6
|
+
* - channel bots 的状态所有权归属于 `ChatPlugin` 实例,而不是模块级单例。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { FeishuBot } from "@/plugin/builtins/chat/channels/feishu/Feishu.js";
|
|
@@ -11,7 +11,7 @@ import type { QQBot } from "@/plugin/builtins/chat/channels/qq/QQ.js";
|
|
|
11
11
|
import type { TelegramBot } from "@/plugin/builtins/chat/channels/telegram/Bot.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* `ChatPlugin` 实例持有的渠道状态。
|
|
15
15
|
*
|
|
16
16
|
* 关键点(中文)
|
|
17
17
|
* - 这里显式把 3 个内建渠道拆成独立槽位,避免继续使用弱类型 map。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这里只负责 CLI action 与内部远端 command action 映射,不承载 contact 业务实现。
|
|
6
|
-
* - 业务动作通过 handlers 注入,保持 `
|
|
6
|
+
* - 业务动作通过 handlers 注入,保持 `ContactPlugin` 类本身更薄。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
} from "./runtime/ContactPayload.js";
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* ContactPlugin 注入给 action 注册表的业务动作。
|
|
40
40
|
*/
|
|
41
41
|
export type ContactActionHandlers = {
|
|
42
42
|
/**
|
|
@@ -90,7 +90,7 @@ export type ContactActionHandlers = {
|
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
|
-
* 创建 contact
|
|
93
|
+
* 创建 contact plugin action 表。
|
|
94
94
|
*/
|
|
95
95
|
export function createContactActions(handlers: ContactActionHandlers): PluginActions {
|
|
96
96
|
return {
|
|
@@ -434,14 +434,14 @@ export class ContactPlugin extends BasePlugin {
|
|
|
434
434
|
return {
|
|
435
435
|
success: true,
|
|
436
436
|
agentName: getAgentName(context),
|
|
437
|
-
|
|
437
|
+
plugin: "contact",
|
|
438
438
|
};
|
|
439
439
|
}
|
|
440
440
|
const contact = await findContactByInboundToken(context.rootPath, token);
|
|
441
441
|
return {
|
|
442
442
|
success: true,
|
|
443
443
|
agentName: getAgentName(context),
|
|
444
|
-
|
|
444
|
+
plugin: "contact",
|
|
445
445
|
authenticated: Boolean(contact && contact.status === "trusted"),
|
|
446
446
|
};
|
|
447
447
|
}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
10
10
|
import type { ContactChatResponse } from "@/plugin/builtins/contact/types/ContactChat.js";
|
|
11
|
-
import type { SessionMessageV1 } from "@/
|
|
11
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
12
12
|
import {
|
|
13
13
|
appendContactMessage,
|
|
14
14
|
findContactByInboundToken,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* ContactPromptAssets:contact
|
|
2
|
+
* ContactPromptAssets:contact plugin runtime 静态提示词资产。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - contact prompt 文本真实来源是 `PROMPT.ts.txt`。
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
import contactPromptText from "@/plugin/builtins/contact/PROMPT.js";
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* contact
|
|
12
|
+
* contact plugin runtime system prompt。
|
|
13
13
|
*/
|
|
14
14
|
export const CONTACT_SERVICE_PROMPT = contactPromptText.trim();
|