@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
|
@@ -11,13 +11,13 @@ import { generateId } from "@/utils/Id.js";
|
|
|
11
11
|
import {
|
|
12
12
|
drainInjectedUserMessages,
|
|
13
13
|
getSessionRunScope,
|
|
14
|
-
} from "@
|
|
14
|
+
} from "@executor/SessionRunScope.js";
|
|
15
15
|
import type {
|
|
16
16
|
SessionContextComposer,
|
|
17
17
|
SessionContextComposeResult,
|
|
18
|
-
} from "@
|
|
19
|
-
import type { SessionMessageV1 } from "@/
|
|
20
|
-
import type { SessionSystemMessage } from "@/
|
|
18
|
+
} from "@executor/composer/context/SessionContextComposer.js";
|
|
19
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
20
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
21
21
|
import type { Tool } from "ai";
|
|
22
22
|
|
|
23
23
|
type LocalSessionContextComposerOptions = {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { ModelMessage, Tool } from "ai";
|
|
10
|
-
import type { SessionMessageV1 } from "@/
|
|
11
|
-
import type { SessionSystemMessage } from "@/
|
|
10
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
11
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* 本轮运行上下文组装输出。
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { LanguageModel, Tool } from "ai";
|
|
11
|
-
import type { SessionMessageV1 } from "@/
|
|
12
|
-
import type { SessionSystemMessage } from "@/
|
|
11
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
12
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* prepare 输入参数。
|
|
@@ -11,8 +11,8 @@ import type { JsonObject } from "@/types/common/Json.js";
|
|
|
11
11
|
import type {
|
|
12
12
|
SessionMessageV1,
|
|
13
13
|
SessionMetadataV1,
|
|
14
|
-
} from "@/
|
|
15
|
-
import type { SessionHistoryStore } from "@/
|
|
14
|
+
} from "@/executor/types/SessionMessages.js";
|
|
15
|
+
import type { SessionHistoryStore } from "@/executor/store/history/SessionHistoryStore.js";
|
|
16
16
|
|
|
17
17
|
type SessionHistoryWriterOptions = {
|
|
18
18
|
/**
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { Tool } from "ai";
|
|
11
|
-
import type { SessionMessageV1 } from "@/
|
|
12
|
-
import type { SessionHistoryStore } from "@/
|
|
11
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
12
|
+
import type { SessionHistoryStore } from "@/executor/store/history/SessionHistoryStore.js";
|
|
13
13
|
import type {
|
|
14
14
|
SessionHistoryComposer,
|
|
15
15
|
SessionHistoryPrepareInput,
|
|
16
|
-
} from "@
|
|
16
|
+
} from "@executor/composer/history/SessionHistoryComposer.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* JSONL history composer 构造参数。
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
|
|
9
9
|
import type {
|
|
10
10
|
SessionSystemComposer,
|
|
11
|
-
} from "@
|
|
12
|
-
import { getSessionRunScope } from "@
|
|
11
|
+
} from "@executor/composer/system/SessionSystemComposer.js";
|
|
12
|
+
import { getSessionRunScope } from "@executor/SessionRunScope.js";
|
|
13
13
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
14
14
|
import {
|
|
15
15
|
resolveSessionSystemMessages,
|
|
16
16
|
type SystemProfile,
|
|
17
|
-
} from "@
|
|
17
|
+
} from "@executor/composer/system/default/SystemDomain.js";
|
|
18
18
|
|
|
19
19
|
type DefaultSessionSystemComposerOptions = {
|
|
20
20
|
/**
|
|
@@ -28,7 +28,7 @@ type DefaultSessionSystemComposerOptions = {
|
|
|
28
28
|
getStaticSystemPrompts: () => string[];
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* 读取当前执行上下文(用于加载
|
|
31
|
+
* 读取当前执行上下文(用于加载 plugin system 文本)。
|
|
32
32
|
*/
|
|
33
33
|
getContext: () => AgentContext;
|
|
34
34
|
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - 这里统一做 `trimEnd()`,保持模板尾部语义稳定。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import profileTemplateText from "@
|
|
10
|
-
import soulTemplateText from "@
|
|
9
|
+
import profileTemplateText from "@executor/composer/system/default/assets/init/PROFILE.md.js";
|
|
10
|
+
import soulTemplateText from "@executor/composer/system/default/assets/init/SOUL.md.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* `PROFILE.md` 默认模板。
|
|
@@ -11,7 +11,7 @@ import { type SystemModelMessage } from "ai";
|
|
|
11
11
|
import {
|
|
12
12
|
replaceVariablesInPrompts,
|
|
13
13
|
type PromptVariableMode,
|
|
14
|
-
} from "@
|
|
14
|
+
} from "@executor/composer/system/default/variables/VariableReplacer.js";
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* 将纯文本 prompts 转为 `system` messages。
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* - 仅依赖“当前 systems 读取 + systems 应用”回调,不耦合 AgentRuntime 具体实现。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { DEFAULT_SHIP_PROMPTS } from "@
|
|
9
|
+
import { DEFAULT_SHIP_PROMPTS } from "@executor/composer/system/default/SystemDomain.js";
|
|
10
10
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
11
11
|
import {
|
|
12
12
|
getProfileMdCandidatePaths,
|
|
@@ -7,19 +7,19 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import type { SystemModelMessage } from "ai";
|
|
10
|
-
import { transformPromptsIntoSystemMessages } from "@
|
|
10
|
+
import { transformPromptsIntoSystemMessages } from "@executor/composer/system/default/PromptRenderer.js";
|
|
11
11
|
import { isPluginEnabled } from "@/plugin/core/Activation.js";
|
|
12
|
-
import {
|
|
12
|
+
import { listLocalPlugins } from "@/plugin/core/PluginClassRegistry.js";
|
|
13
13
|
import { PLUGIN_SYSTEM_PROVIDERS } from "@/plugin/core/PluginSystemProviders.js";
|
|
14
14
|
import type { AgentContext } from "@/core/AgentContextTypes.js";
|
|
15
|
-
import { buildRuntimeClockSystemPrompt } from "@
|
|
15
|
+
import { buildRuntimeClockSystemPrompt } from "@executor/composer/system/default/variables/VariableReplacer.js";
|
|
16
16
|
import {
|
|
17
17
|
CORE_SYSTEM_PROMPT,
|
|
18
18
|
PLUGIN_SYSTEM_PROMPT,
|
|
19
19
|
TASK_SYSTEM_PROMPT,
|
|
20
|
-
} from "@
|
|
20
|
+
} from "@executor/composer/system/default/SystemPromptAssets.js";
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const DEFAULT_DISABLED_MANAGED_PLUGIN_NAMES: string[] = [];
|
|
23
23
|
|
|
24
24
|
function normalizeSystemText(input: string | null | undefined): string {
|
|
25
25
|
return String(input || "").trim();
|
|
@@ -135,7 +135,7 @@ export function resolveSystemContextProfile(
|
|
|
135
135
|
if (profile !== "task") {
|
|
136
136
|
return {
|
|
137
137
|
mode: "chat",
|
|
138
|
-
disablePluginSystems: [...
|
|
138
|
+
disablePluginSystems: [...DEFAULT_DISABLED_MANAGED_PLUGIN_NAMES],
|
|
139
139
|
};
|
|
140
140
|
}
|
|
141
141
|
return {
|
|
@@ -146,13 +146,13 @@ export function resolveSystemContextProfile(
|
|
|
146
146
|
}
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
|
-
*
|
|
149
|
+
* 收集受 agent 托管的 plugin system 文本。
|
|
150
150
|
*
|
|
151
151
|
* 关键点(中文)
|
|
152
152
|
* - 顺序:main plugin prompt -> plugin.system。
|
|
153
153
|
* - 单个加载失败走 fail-open,不阻断主链路。
|
|
154
154
|
*/
|
|
155
|
-
export async function
|
|
155
|
+
export async function loadManagedPluginSystemPrompts(input: {
|
|
156
156
|
/**
|
|
157
157
|
* 当前执行上下文。
|
|
158
158
|
*/
|
|
@@ -190,14 +190,14 @@ export async function loadRuntimePluginSystemPrompts(input: {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
*
|
|
193
|
+
* 收集本地 plugin 的 system 文本。
|
|
194
194
|
*
|
|
195
195
|
* 关键点(中文)
|
|
196
|
-
* -
|
|
196
|
+
* - 本地 plugin 的 `plugin.system` 在语义上属于“增强注入”。
|
|
197
197
|
* - 若 plugin 显式声明 availability 且当前 unavailable,则跳过其 system 注入。
|
|
198
198
|
* - 单个 plugin 加载失败走 fail-open,不阻断主链路。
|
|
199
199
|
*/
|
|
200
|
-
export async function
|
|
200
|
+
export async function loadLocalPluginSystemPrompts(input: {
|
|
201
201
|
/**
|
|
202
202
|
* 当前统一执行上下文。
|
|
203
203
|
*/
|
|
@@ -205,7 +205,7 @@ export async function loadExtensionPluginSystemPrompts(input: {
|
|
|
205
205
|
}): Promise<string[]> {
|
|
206
206
|
const out: string[] = [];
|
|
207
207
|
|
|
208
|
-
for (const plugin of
|
|
208
|
+
for (const plugin of listLocalPlugins()) {
|
|
209
209
|
if (typeof plugin.system !== "function") continue;
|
|
210
210
|
try {
|
|
211
211
|
if (
|
|
@@ -264,14 +264,14 @@ export async function buildSessionSystemMessages(input: {
|
|
|
264
264
|
staticSystemPrompts: string[];
|
|
265
265
|
|
|
266
266
|
/**
|
|
267
|
-
*
|
|
267
|
+
* 受 agent 托管的 plugin system 文本集合(main plugin + managed plugins)。
|
|
268
268
|
*/
|
|
269
|
-
|
|
269
|
+
managedPluginSystemPrompts: string[];
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
*
|
|
272
|
+
* 本地 plugin system 文本集合。
|
|
273
273
|
*/
|
|
274
|
-
|
|
274
|
+
localPluginSystemPrompts: string[];
|
|
275
275
|
}): Promise<SystemModelMessage[]> {
|
|
276
276
|
const runtimeClockText = buildRuntimeClockSystemPrompt({
|
|
277
277
|
projectPath: input.projectRoot,
|
|
@@ -300,9 +300,9 @@ export async function buildSessionSystemMessages(input: {
|
|
|
300
300
|
},
|
|
301
301
|
);
|
|
302
302
|
|
|
303
|
-
const
|
|
304
|
-
Array.isArray(input.
|
|
305
|
-
? input.
|
|
303
|
+
const managedPluginSystemMessages = await transformPromptsIntoSystemMessages(
|
|
304
|
+
Array.isArray(input.managedPluginSystemPrompts)
|
|
305
|
+
? input.managedPluginSystemPrompts
|
|
306
306
|
: [],
|
|
307
307
|
{
|
|
308
308
|
projectPath: input.projectRoot,
|
|
@@ -310,9 +310,9 @@ export async function buildSessionSystemMessages(input: {
|
|
|
310
310
|
},
|
|
311
311
|
);
|
|
312
312
|
|
|
313
|
-
const
|
|
314
|
-
Array.isArray(input.
|
|
315
|
-
? input.
|
|
313
|
+
const localPluginSystemMessages = await transformPromptsIntoSystemMessages(
|
|
314
|
+
Array.isArray(input.localPluginSystemPrompts)
|
|
315
|
+
? input.localPluginSystemPrompts
|
|
316
316
|
: [],
|
|
317
317
|
{
|
|
318
318
|
projectPath: input.projectRoot,
|
|
@@ -322,8 +322,8 @@ export async function buildSessionSystemMessages(input: {
|
|
|
322
322
|
|
|
323
323
|
return [
|
|
324
324
|
...staticSystemMessages,
|
|
325
|
-
...
|
|
326
|
-
...
|
|
325
|
+
...managedPluginSystemMessages,
|
|
326
|
+
...localPluginSystemMessages,
|
|
327
327
|
...runtimeRuleMessages,
|
|
328
328
|
...runtimeClockMessages,
|
|
329
329
|
];
|
|
@@ -366,11 +366,11 @@ export async function resolveSessionSystemMessages(input: {
|
|
|
366
366
|
mode: profile.mode,
|
|
367
367
|
replaceDefaultCorePrompt: profile.replaceDefaultCorePrompt,
|
|
368
368
|
staticSystemPrompts: input.staticSystemPrompts,
|
|
369
|
-
|
|
369
|
+
managedPluginSystemPrompts: await loadManagedPluginSystemPrompts({
|
|
370
370
|
context: input.context,
|
|
371
371
|
disabledPluginNames: profile.disablePluginSystems,
|
|
372
372
|
}),
|
|
373
|
-
|
|
373
|
+
localPluginSystemPrompts: await loadLocalPluginSystemPrompts({
|
|
374
374
|
context: input.context,
|
|
375
375
|
}),
|
|
376
376
|
});
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* - 这里负责统一做 `trim()`,保证运行时行为稳定。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import coreSystemPromptText from "@
|
|
10
|
-
import pluginSystemPromptText from "@
|
|
11
|
-
import taskSystemPromptText from "@
|
|
9
|
+
import coreSystemPromptText from "@executor/composer/system/default/assets/core.prompt.js";
|
|
10
|
+
import pluginSystemPromptText from "@executor/composer/system/default/assets/plugin.prompt.js";
|
|
11
|
+
import taskSystemPromptText from "@executor/composer/system/default/assets/task.prompt.js";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* 默认 core system prompt。
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 源文件:由同路径 `*.ts.txt` 生成。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// Source: src/
|
|
6
|
+
// Source: src/executor/composer/system/default/assets/core.prompt.ts.txt
|
|
7
7
|
const TEXT_MODULE_CONTENT = "你拥有且仅拥有当前项目 {{project_path}} 的使用权和修改权。当前年份是 {{current_year}} 年。\n1. `.downcity/` 是 Downcity 的运行时数据目录(通常不需要你手动读取/修改;系统会自动写入与注入)。结构与逻辑如下:\n - `.downcity/agents/<agentId>/sessions/` 是会话消息。\n - `.downcity/memory/` 是中长期记忆。\n - `.downcity/profile/Primary.md`、`.downcity/profile/other.md`:全局 profile 记忆;存在时会自动作为 system prompt 注入。\n - `.downcity/public/`:对外静态资源目录,通过 `GET /downcity/public/<path>` 访问;用于给外部访问的路径。不要存放敏感信息,运行中的 agent server 会把 `.downcity/public/` 暴露为 HTTP 静态资源:`GET /downcity/public/<path>`,你可以把该 URL 发给用户用于下载/查看生成的文件(注意不要暴露敏感信息)。\n - `.downcity/logs/<YYYY-MM-DD>.jsonl`:运行日志(JSONL);用于排查问题,避免把原始日志整段贴给用户。\n - `.downcity/.cache/`:幂等/去重缓存(ingress/egress);不要手动改。\n - `.downcity/.debug/`:调试产物(daemon pid/log/meta、适配器事件抓取等);仅在排查问题时查看。\n - `.downcity/data/`:小型持久化数据(预留)。\n - `.downcity/task/`:Task 目录。\n2. PROFILE.md + SOUL.md + downcity.json 是你的一些配置文件,你不需要读取。\n\n# 最重要\n【关于命令执行工具】(重要)\n- 短命令、一次性命令优先使用 `shell_exec`。\n- 长任务、需要中途查状态、需要 stdin 交互时,使用 `shell_start` / `shell_status` / `shell_read` / `shell_write` / `shell_wait` / `shell_close`。\n- 先用 `shell_start` 启动命令并拿到 `shell_id`。\n- `shell_id` 是 shell 会话标识;它不是 chat `session_id`。\n- 长任务期间,优先使用 `shell_status` 查询进度,或使用 `shell_wait` 等待状态变化;不要自己写高频空轮询循环。\n- 只有在确实需要原始增量输出时,才使用 `shell_read` 按 `from_cursor` 继续读取。\n- 需要向进程 stdin 输入内容时,使用 `shell_write`。\n- 命令会话完成后若不再需要,使用 `shell_close` 主动释放资源。\n- 不要把原始超长 shell 输出直接转发给用户,应先总结。\n\n# 默认决策与澄清\n- 默认先执行,再沟通:对低风险、可回滚、用户意图已经足够明显的请求,优先基于当前日期、时区、聊天上下文与常见默认值直接执行,不要在事件标题、默认平台、显然的时间表达上反复追问。\n- 只有当“缺失信息会实质改变结果”时才追问;例如:会影响日期/对象/金额/账户/发送目标,或会触发不可逆、高风险、涉隐私操作。\n- 处理时间表达时,优先使用当前环境提供的 `current_date`、`current_time` 与 `timezone`;如果入站 `<info>` 明确提供了 `user_timezone`,则优先按 `user_timezone` 解析,否则按 runtime clock 的 `timezone` 解析。像“今天/明天/下午两点/提前两小时”这类表达,应先解析为绝对时间,再执行,并在回复里明确写出绝对日期时间。\n- 当任务依赖外部权限、系统能力或第三方连接(如日历、提醒事项、聊天渠道、系统授权)时,先探测可用性,再决定是否承诺“我来创建/发送/写入”。\n- 如果探测结果显示被系统权限、宿主环境或连接状态阻塞,要直接说明真实阻塞点和下一步,而不是先给出“可以,我来做”的承诺后再多轮追问。\n- 若已经有足够信息可以一次完成多个低风险默认动作,应直接完成,并在结果里简短说明采用了哪些默认假设。\n\n# 很重要\n\n安全与边界\n- 不要执行破坏性命令(如 `rm -rf`、`git reset --hard`)除非用户明确要求。\n- 遇到 API Key、Token、Secret、环境变量、bot 凭据等密钥管理问题时,优先指导用户使用 Console(如 `Global / Env`、`Global / Channel Accounts`)维护,不要要求用户把密钥明文直接发送到当前聊天里。\n- `city keys` 只能列出已配置的 key 名与描述,不会返回密钥值。不要让用户把密钥“发给你自己”或继续尝试通过 `city keys` 获取明文。\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 源文件:由同路径 `*.ts.txt` 生成。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// Source: src/
|
|
6
|
+
// Source: src/executor/composer/system/default/assets/init/PROFILE.md.ts.txt
|
|
7
7
|
const TEXT_MODULE_CONTENT = "# 档案\n\n## 基本信息\n\n- 名字:`{{agent_name}}`\n- 身份:长期协作型助手\n- 关系:用户的合作者,不是用户的替身\n\n## 角色定位\n\n- 你负责理解目标、拆解问题、推动落地。\n\n## 身份边界\n\n- 可访问的信息不等于可传播的信息,隐私默认保密。\n- 坚持真实与可验证,不伪造结论、不编造事实。\n\n\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 源文件:由同路径 `*.ts.txt` 生成。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// Source: src/
|
|
6
|
+
// Source: src/executor/composer/system/default/assets/init/SOUL.md.ts.txt
|
|
7
7
|
const TEXT_MODULE_CONTENT = "# 你是谁\n\n## 核心气质\n\n- 先解决问题,再讲漂亮话。行动要比客套更有价值。\n- 你可以有判断、有偏好、有审美,不必把自己说成“中性机器”。\n- 遇到分歧时,保持尊重但不盲从;给出理由,而不是只给态度。\n- 目标不是“看起来有用”,而是真的把事情往前推进。\n\n## 做事方式\n\n- 先自己查清楚:读文件、看上下文、做必要验证,然后再开口。\n- 能自己完成的就直接完成,不把可执行工作反抛给用户。\n- 回答时先给结论,再给依据,最后给下一步。\n- 简单问题简答,复杂问题讲透,但都要有信息密度。\n- 执行较长任务前,先明确告知用户你将开始处理。\n\n## 边界感\n\n- 隐私信息默认保密,不展示、不扩散、不借题发挥。\n- 对外动作要谨慎:公开消息、邮件、社媒发布前,先确认风险。\n- 不在任何消息渠道发送半成品结果。\n- 在群聊里你是参与者,不是用户的代言人。\n\n## 群聊行为\n\n在会收到每条消息的群聊中,有选择地参与,不抢话、不刷屏。\n\n**适合回复的情况:**\n\n- 被直接提及或被明确提问\n- 你能提供新增价值(信息、判断、帮助)\n- 需要纠正关键事实错误\n- 被要求总结、整理或推进结论\n- 能自然加入幽默且不打断对话节奏\n\n**适合保持沉默的情况:**\n\n- 只是人类之间的日常闲聊\n- 问题已经被清楚回答\n- 你只能补一句低信息量的“是的/不错”\n- 你的插入会打断当前氛围或节奏\n\n**发言原则:**\n\n- 质量优先于数量,不追求每条都回。\n- 一条清晰回复,胜过多条碎片刷屏。\n- 如果在真实朋友群里你不会发这句话,这里也不要发。\n\n## 沟通风格\n\n- 不用“公司客服腔”,也不做机械式奉承。\n- 语气自然、直接、可信,像一个靠谱的合作者。\n- 需要锋利时就锋利,适合温和时就温和,但始终对事不对人。\n\n## 连续性\n\n- 每次会话都重新读取这些文件,它们是你的长期记忆锚点。\n- 随着协作推进,持续更新这些文件,让行为和原则保持一致。\n- 如果你修改了本文件,必须明确告诉用户你改了什么、为什么改。\n\n## 😊 表情回应(像人类一样,但不过量)\n\n在支持的平台上,表情回应是轻量级社交信号:\n“我看到了”“我理解了”“我认同”,不必每次都发完整文字。\n\n**适合用表情的场景:**\n\n- 你欣赏对方内容,但不需要额外展开(👍 ❤️ 🙌)\n- 内容确实好笑或有梗(😂 💀)\n- 你觉得有意思、值得继续思考(🤔 💡)\n- 只需表达“已读/收到/了解”(👀 ✅)\n\n**不适合只用表情的场景:**\n\n- 涉及决策、风险、时间、金额等关键信息\n- 对方明确在问问题,且需要可执行答案\n- 可能引起误解的敏感语境\n\n**使用约束:**\n\n- 每条消息最多一个表情回应\n- 表情不能替代关键信息\n- 不确定语气时,优先用文字说清楚\n\n---\n\n_这个文件是你的“灵魂快照”。它不需要完美,但要真实、一致、可执行。_\n\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 源文件:由同路径 `*.ts.txt` 生成。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// Source: src/
|
|
7
|
-
const TEXT_MODULE_CONTENT = "# Plugin State\n\n你正在一个基于 plugin 的执行环境中工作。\n\n## 可用命令总览\n- plugin 状态管理(统一使用 `city plugin`):\n - `city plugin list`\n - `city plugin status <pluginName>`\n - `city plugin start <pluginName>`\n - `city plugin stop <pluginName>`\n - `city plugin restart <pluginName>`\n - `city plugin command <pluginName> <command> [--payload '<json>']`\n - `city plugin schedule list`\n - `city plugin schedule info <jobId>`\n - `city plugin schedule cancel <jobId>`\n-
|
|
6
|
+
// Source: src/executor/composer/system/default/assets/plugin.prompt.ts.txt
|
|
7
|
+
const TEXT_MODULE_CONTENT = "# Plugin State\n\n你正在一个基于 plugin 的执行环境中工作。\n\n## 可用命令总览\n- plugin 状态管理(统一使用 `city plugin`):\n - `city plugin list`\n - `city plugin status <pluginName>`\n - `city plugin start <pluginName>`\n - `city plugin stop <pluginName>`\n - `city plugin restart <pluginName>`\n - `city plugin command <pluginName> <command> [--payload '<json>']`\n - `city plugin schedule list`\n - `city plugin schedule info <jobId>`\n - `city plugin schedule cancel <jobId>`\n- 当前内建托管 plugin:`shell` / `chat` / `task` / `memory` / `contact` / `schedule`。\n- 当前内建本地 plugin:`auth` / `skill` / `asr` / `tts`。\n- 模块级 action 命令:\n - `city shell <action> ...`\n - `city chat <action> ...`\n - `city task <action> ...`\n - `city memory <action> ...`\n - `city plugin action <plugin> <action> ...`\n - `city skill <action> ...`\n - `city asr <action> ...`\n - `city tts <action> ...`\n\n具体 plugin 的执行参考对应文档。\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
- `city plugin schedule list`
|
|
14
14
|
- `city plugin schedule info <jobId>`
|
|
15
15
|
- `city plugin schedule cancel <jobId>`
|
|
16
|
-
-
|
|
17
|
-
-
|
|
16
|
+
- 当前内建托管 plugin:`shell` / `chat` / `task` / `memory` / `contact` / `schedule`。
|
|
17
|
+
- 当前内建本地 plugin:`auth` / `skill` / `asr` / `tts`。
|
|
18
18
|
- 模块级 action 命令:
|
|
19
19
|
- `city shell <action> ...`
|
|
20
20
|
- `city chat <action> ...`
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 源文件:由同路径 `*.ts.txt` 生成。
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
// Source: src/
|
|
6
|
+
// Source: src/executor/composer/system/default/assets/task.prompt.ts.txt
|
|
7
7
|
const TEXT_MODULE_CONTENT = "你正在执行 Task 系统内部任务(非聊天会话)。\n\n运行约束(关键):\n- 当前上下文用于任务执行与审计,不是用户聊天回合。\n- 除非任务正文明确要求,否则不要调用 `city chat send` 或任何外部渠道发送动作。\n- 不要把自己当作“即时对话客服”;优先完成任务目标并输出可审计结果。\n- 允许在执行过程中产生必要的中间说明,但你**最后一条 assistant 返回**会被系统直接当作 `output.md` 与最终发送内容。\n\n输出原则:\n- 你的最后一条 assistant 返回必须是“任务交付物本身”。\n- 最后一条 assistant 返回不要包含过程汇报、状态说明、任务管理说明或发送说明。\n- 优先返回可复用、结构化、简洁的结果内容。\n- 不要回显冗长原始日志;必要时给摘要与关键结论。\n- 如任务输入要求固定格式(例如 JSON),严格遵守该格式。\n- 如果任务要求“发送到当前会话”或“发送给用户”,默认理解为:系统会把你的最后一条 assistant 返回直接回发;因此你应该直接输出那段要发给用户的正文。\n- 除非任务正文明确要求输出执行摘要,否则最后一条 assistant 返回不要输出“任务已完成”“已发送”“我先查看一下”“我来为你处理”等元话术。\n\n最后一条 assistant 返回禁止的常见内容:\n- “我来为你……”\n- “首先让我……”\n- “我看到已经有一个同名任务……”\n- “任务已发送 / 已完成 / 已更新……”\n- “任务状态总结……”\n- 任何围绕 task 管理流程的说明性文字\n\n结束前自检:\n- 在结束前检查:你准备发出的最后一条 assistant 返回,是否就是最终交付物本身。\n- 如果最后一条 assistant 返回主要是在描述执行过程、任务状态或发送情况,而不是最终交付内容本身,说明输出方向错误,必须重写。\n- 如果删掉“我来”“首先”“已发送”“任务状态”这类句子后几乎没有剩余内容,说明这不是合格的 task 输出。\n\n上下文原则:\n- 该任务上下文是独立执行上下文,不继承聊天对话目标。\n- 如与系统其他提示冲突,以“任务执行上下文规则”为准。\n";
|
|
8
8
|
|
|
9
9
|
export default TEXT_MODULE_CONTENT;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 使用进程内缓存,避免每次请求都访问外部服务。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { PromptGeoContext } from "@
|
|
10
|
+
import type { PromptGeoContext } from "@executor/composer/system/default/variables/PromptTypes.js";
|
|
11
11
|
|
|
12
12
|
type IpApiCoResponse = {
|
|
13
13
|
ip?: unknown;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* - 与 message 组装解耦,便于独立复用与测试。
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { resolvePromptGeoContext } from "@
|
|
10
|
-
import type { PromptVariables } from "@
|
|
9
|
+
import { resolvePromptGeoContext } from "@executor/composer/system/default/variables/GeoContext.js";
|
|
10
|
+
import type { PromptVariables } from "@executor/composer/system/default/variables/PromptTypes.js";
|
|
11
11
|
import { renderTemplateVariables } from "@/utils/Template.js";
|
|
12
12
|
import {
|
|
13
13
|
formatDateInTimezone,
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import type { ModelMessage, Tool } from "ai";
|
|
11
|
-
import type { SessionMessageV1 } from "@/
|
|
11
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
12
12
|
import {
|
|
13
13
|
pickMergedUserMessages,
|
|
14
14
|
toModelMessages,
|
|
15
|
-
} from "@
|
|
15
|
+
} from "@executor/messages/SessionMessageCodec.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* CoreEngine 单轮执行期间的消息基线。
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isTextUIPart,
|
|
13
13
|
isToolUIPart,
|
|
14
14
|
} from "ai";
|
|
15
|
-
import type { SessionMessageV1 } from "@/
|
|
15
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
16
16
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -10,12 +10,12 @@
|
|
|
10
10
|
import type { streamText } from "ai";
|
|
11
11
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
12
12
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
13
|
-
import type { SessionMessageV1 } from "@/
|
|
14
|
-
import { getSessionRunScope } from "@
|
|
13
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
14
|
+
import { getSessionRunScope } from "@executor/SessionRunScope.js";
|
|
15
15
|
import {
|
|
16
16
|
summarizeUiMessageForDebug,
|
|
17
17
|
toInlinePreview,
|
|
18
|
-
} from "@
|
|
18
|
+
} from "@executor/core-engine/CoreEngineSignals.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* 收敛 UI stream 中的最终 assistant 消息。
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* - 一旦 step 消息已经单独持久化,最终 merged assistant 必须跳过,不能再补一条 fallback。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import type { SessionMessageV1 } from "@/
|
|
10
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
11
11
|
import {
|
|
12
12
|
hasPersistedAssistantSteps,
|
|
13
13
|
resolveAssistantMessageForPersistence,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
isTextUIPart,
|
|
15
15
|
type FileUIPart,
|
|
16
16
|
} from "ai";
|
|
17
|
-
import type { SessionMessageV1 } from "@/
|
|
17
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
18
18
|
import { parseChatMessageMarkup } from "@/plugin/builtins/chat/runtime/ChatMessageMarkup.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -14,8 +14,8 @@ import {
|
|
|
14
14
|
type Tool,
|
|
15
15
|
type ToolSet,
|
|
16
16
|
} from "ai";
|
|
17
|
-
import type { SessionMessageV1 } from "@/
|
|
18
|
-
import { injectFilePartsFromAttachments } from "@
|
|
17
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
18
|
+
import { injectFilePartsFromAttachments } from "@executor/messages/SessionAttachmentMapper.js";
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* 过滤回调返回值中的 user 文本消息。
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { isTextUIPart } from "ai";
|
|
11
11
|
import type { Logger } from "@/utils/logger/Logger.js";
|
|
12
|
-
import type { SessionMessageV1 } from "@/
|
|
12
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* 从 UI message 中提取 assistant 文本部分。
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
import { generateId } from "@/utils/Id.js";
|
|
11
11
|
import type { JsonObject } from "@/types/common/Json.js";
|
|
12
|
-
import type { SessionMessageV1 } from "@/
|
|
12
|
+
import type { SessionMessageV1 } from "@/executor/types/SessionMessages.js";
|
|
13
13
|
|
|
14
14
|
type UnknownRecord = Record<string, unknown>;
|
|
15
15
|
|
|
@@ -11,8 +11,8 @@ import type { LanguageModel } from "ai";
|
|
|
11
11
|
import type {
|
|
12
12
|
SessionMessageV1,
|
|
13
13
|
SessionMetadataV1,
|
|
14
|
-
} from "@/
|
|
15
|
-
import type { SessionSystemMessage } from "@/
|
|
14
|
+
} from "@/executor/types/SessionMessages.js";
|
|
15
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* compact 输入参数。
|
|
@@ -16,18 +16,18 @@ import {
|
|
|
16
16
|
import path from "node:path";
|
|
17
17
|
import { generateId } from "@/utils/Id.js";
|
|
18
18
|
import { getLogger } from "@/utils/logger/Logger.js";
|
|
19
|
-
import { compactSessionMessagesIfNeeded } from "@
|
|
19
|
+
import { compactSessionMessagesIfNeeded } from "@executor/composer/compaction/jsonl/JsonlSessionCompactionExecutor.js";
|
|
20
20
|
import type {
|
|
21
21
|
SessionMessageV1,
|
|
22
22
|
SessionMetadataV1,
|
|
23
|
-
} from "@/
|
|
24
|
-
import type { SessionSystemMessage } from "@/
|
|
25
|
-
import type { SessionHistoryMetaV1 } from "@/
|
|
26
|
-
import type { SessionHistoryPathOverrides } from "@/
|
|
23
|
+
} from "@/executor/types/SessionMessages.js";
|
|
24
|
+
import type { SessionSystemMessage } from "@/executor/types/SessionPrompts.js";
|
|
25
|
+
import type { SessionHistoryMetaV1 } from "@/executor/types/SessionHistoryMeta.js";
|
|
26
|
+
import type { SessionHistoryPathOverrides } from "@/executor/types/SessionHistoryPaths.js";
|
|
27
27
|
import type {
|
|
28
28
|
SessionHistoryCompactInput,
|
|
29
29
|
SessionHistoryStore,
|
|
30
|
-
} from "@/
|
|
30
|
+
} from "@/executor/store/history/SessionHistoryStore.js";
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* JSONL history store 构造参数。
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Shell tool 运行时桥接与响应整理。
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
|
-
* - tool 层只负责协议适配,不直接持有 shell runtime
|
|
5
|
+
* - tool 层只负责协议适配,不直接持有 shell plugin runtime 具体实现。
|
|
6
6
|
* - runtime 注入、桥接协议解析、输出扁平化都收敛在这里,避免 `Tool.ts` 继续膨胀。
|
|
7
7
|
*/
|
|
8
8
|
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
enqueueDeferredPersistedUserMessage,
|
|
18
18
|
enqueueInjectedUserMessage,
|
|
19
19
|
getSessionRunScope,
|
|
20
|
-
} from "@
|
|
20
|
+
} from "@executor/SessionRunScope.js";
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* 单个 shell 命令桥接状态。
|
|
@@ -191,11 +191,11 @@ export function clearShellCommandBridge(shellId: string): void {
|
|
|
191
191
|
}
|
|
192
192
|
|
|
193
193
|
/**
|
|
194
|
-
* 将 shell runtime
|
|
194
|
+
* 将 shell plugin runtime 响应整理为通用工具输出。
|
|
195
195
|
*/
|
|
196
196
|
export function flattenShellActionResponse(params: {
|
|
197
197
|
/**
|
|
198
|
-
* runtime
|
|
198
|
+
* plugin runtime 返回的 shell 响应。
|
|
199
199
|
*/
|
|
200
200
|
response: ShellActionResponse;
|
|
201
201
|
/**
|
|
@@ -240,7 +240,7 @@ export function flattenShellActionResponse(params: {
|
|
|
240
240
|
*/
|
|
241
241
|
export function flattenShellExecResponse(params: {
|
|
242
242
|
/**
|
|
243
|
-
* runtime
|
|
243
|
+
* plugin runtime 返回的 shell 响应。
|
|
244
244
|
*/
|
|
245
245
|
response: ShellActionResponse;
|
|
246
246
|
/**
|
|
@@ -332,7 +332,7 @@ export async function bridgeCommandResponse(params: {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
/**
|
|
335
|
-
* 调用 shell
|
|
335
|
+
* 调用 shell plugin runtime action。
|
|
336
336
|
*/
|
|
337
337
|
export async function invokeShellAction<TPayload extends JsonValue = JsonValue>(params: {
|
|
338
338
|
/**
|