@downcity/agent 1.1.287 → 1.1.310
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 +23 -16
- package/bin/agent/Agent.d.ts +35 -45
- package/bin/agent/Agent.d.ts.map +1 -1
- package/bin/agent/Agent.js +131 -107
- package/bin/agent/Agent.js.map +1 -1
- package/bin/agent/AgentInstructions.d.ts +2 -2
- package/bin/agent/AgentInstructions.d.ts.map +1 -1
- package/bin/agent/AgentInstructions.js +2 -2
- package/bin/agent/AgentInstructions.js.map +1 -1
- package/bin/agent/AgentModel.d.ts +2 -2
- package/bin/agent/AgentModel.d.ts.map +1 -1
- package/bin/agent/AgentModel.js +2 -2
- package/bin/agent/AgentModel.js.map +1 -1
- package/bin/agent/AgentSessions.d.ts +11 -7
- package/bin/agent/AgentSessions.d.ts.map +1 -1
- package/bin/agent/AgentSessions.js +39 -97
- package/bin/agent/AgentSessions.js.map +1 -1
- package/bin/agent/AgentState.d.ts +2 -21
- package/bin/agent/AgentState.d.ts.map +1 -1
- package/bin/agent/AgentState.js +6 -50
- package/bin/agent/AgentState.js.map +1 -1
- package/bin/executor/Executor.d.ts +25 -55
- package/bin/executor/Executor.d.ts.map +1 -1
- package/bin/executor/Executor.js +93 -178
- package/bin/executor/Executor.js.map +1 -1
- package/bin/executor/composer/system/SessionSystemComposer.d.ts +2 -2
- package/bin/executor/composer/system/SessionSystemComposer.d.ts.map +1 -1
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.d.ts +9 -9
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.d.ts.map +1 -1
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.js +19 -19
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.js.map +1 -1
- package/bin/executor/composer/system/default/PromptRenderer.d.ts +2 -2
- package/bin/executor/composer/system/default/PromptRenderer.d.ts.map +1 -1
- package/bin/executor/composer/system/default/PromptRenderer.js +3 -3
- package/bin/executor/composer/system/default/PromptRenderer.js.map +1 -1
- package/bin/executor/composer/system/default/SystemDomain.d.ts +27 -27
- package/bin/executor/composer/system/default/SystemDomain.d.ts.map +1 -1
- package/bin/executor/composer/system/default/SystemDomain.js +44 -44
- package/bin/executor/composer/system/default/SystemDomain.js.map +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.d.ts +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.d.ts.map +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.js +1 -1
- package/bin/executor/composer/system/default/assets/core.prompt.js.map +1 -1
- package/bin/executor/composer/system/default/variables/GeoContext.d.ts +1 -1
- package/bin/executor/composer/system/default/variables/GeoContext.d.ts.map +1 -1
- package/bin/executor/composer/system/default/variables/GeoContext.js +3 -3
- package/bin/executor/composer/system/default/variables/GeoContext.js.map +1 -1
- package/bin/executor/composer/system/default/variables/PromptTypes.d.ts +2 -2
- package/bin/executor/composer/system/default/variables/PromptTypes.d.ts.map +1 -1
- package/bin/executor/composer/system/default/variables/VariableReplacer.d.ts +4 -4
- package/bin/executor/composer/system/default/variables/VariableReplacer.d.ts.map +1 -1
- package/bin/executor/composer/system/default/variables/VariableReplacer.js +24 -24
- package/bin/executor/composer/system/default/variables/VariableReplacer.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineError.d.ts +2 -2
- package/bin/executor/core-engine/CoreEngineError.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineError.js +2 -2
- package/bin/executor/core-engine/CoreEngineError.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts +2 -2
- package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineLoopDecision.js +2 -2
- package/bin/executor/core-engine/CoreEngineLoopDecision.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineMessageState.d.ts +2 -2
- package/bin/executor/core-engine/CoreEngineMessageState.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineMessageState.js +9 -9
- package/bin/executor/core-engine/CoreEngineMessageState.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineRunner.d.ts +8 -8
- package/bin/executor/core-engine/CoreEngineRunner.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineRunner.js +94 -108
- package/bin/executor/core-engine/CoreEngineRunner.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineSignals.d.ts +10 -10
- package/bin/executor/core-engine/CoreEngineSignals.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineSignals.js +19 -19
- package/bin/executor/core-engine/CoreEngineSignals.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts +6 -6
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.js +12 -12
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.js.map +1 -1
- package/bin/executor/ids/resolveSessionId.d.ts +4 -4
- package/bin/executor/ids/resolveSessionId.d.ts.map +1 -1
- package/bin/executor/ids/resolveSessionId.js +4 -4
- package/bin/executor/ids/resolveSessionId.js.map +1 -1
- package/bin/executor/messages/ChatMessageMarkup.d.ts +10 -10
- package/bin/executor/messages/ChatMessageMarkup.d.ts.map +1 -1
- package/bin/executor/messages/ChatMessageMarkup.js +22 -22
- package/bin/executor/messages/ChatMessageMarkup.js.map +1 -1
- package/bin/executor/messages/ChatMessageMarkupTypes.d.ts +10 -10
- package/bin/executor/messages/ChatMessageMarkupTypes.d.ts.map +1 -1
- package/bin/executor/messages/SessionAttachmentMapper.d.ts +4 -4
- package/bin/executor/messages/SessionAttachmentMapper.d.ts.map +1 -1
- package/bin/executor/messages/SessionAttachmentMapper.js +12 -12
- package/bin/executor/messages/SessionAttachmentMapper.js.map +1 -1
- package/bin/executor/messages/SessionMessageCodec.d.ts +5 -5
- package/bin/executor/messages/SessionMessageCodec.d.ts.map +1 -1
- package/bin/executor/messages/SessionMessageCodec.js +12 -22
- package/bin/executor/messages/SessionMessageCodec.js.map +1 -1
- package/bin/executor/messages/SessionMessageLog.d.ts +2 -2
- package/bin/executor/messages/SessionMessageLog.d.ts.map +1 -1
- package/bin/executor/messages/SessionMessageLog.js +3 -3
- package/bin/executor/messages/SessionMessageLog.js.map +1 -1
- package/bin/executor/messages/SessionStepEventMapper.d.ts +4 -4
- package/bin/executor/messages/SessionStepEventMapper.d.ts.map +1 -1
- package/bin/executor/messages/SessionStepEventMapper.js +7 -7
- package/bin/executor/messages/SessionStepEventMapper.js.map +1 -1
- package/bin/executor/messages/UIMessageTransformer.d.ts +3 -3
- package/bin/executor/messages/UIMessageTransformer.d.ts.map +1 -1
- package/bin/executor/messages/UIMessageTransformer.js +6 -6
- package/bin/executor/messages/UIMessageTransformer.js.map +1 -1
- package/bin/executor/messages/UserVisibleText.d.ts +2 -2
- package/bin/executor/messages/UserVisibleText.d.ts.map +1 -1
- package/bin/executor/messages/UserVisibleText.js +5 -5
- package/bin/executor/messages/UserVisibleText.js.map +1 -1
- package/bin/executor/services/ExecutorRecoveryPolicy.d.ts +15 -15
- package/bin/executor/services/ExecutorRecoveryPolicy.d.ts.map +1 -1
- package/bin/executor/services/ExecutorRecoveryPolicy.js +13 -12
- package/bin/executor/services/ExecutorRecoveryPolicy.js.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.d.ts +10 -10
- package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.js +1 -1
- package/bin/executor/types/SessionRecords.d.ts +9 -9
- package/bin/executor/types/SessionRecords.d.ts.map +1 -1
- package/bin/executor/types/SessionRecords.js +4 -4
- package/bin/executor/types/SessionRecords.js.map +1 -1
- package/bin/index.d.ts +41 -55
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +24 -31
- package/bin/index.js.map +1 -1
- package/bin/plugin/core/ActionScheduleExecutor.d.ts +4 -4
- package/bin/plugin/core/ActionScheduleExecutor.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleExecutor.js +18 -20
- package/bin/plugin/core/ActionScheduleExecutor.js.map +1 -1
- package/bin/plugin/core/ActionScheduleRuntime.d.ts +2 -2
- package/bin/plugin/core/ActionScheduleRuntime.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleRuntime.js +6 -6
- package/bin/plugin/core/ActionScheduleRuntime.js.map +1 -1
- package/bin/plugin/core/ActionScheduleStore.d.ts +23 -22
- package/bin/plugin/core/ActionScheduleStore.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleStore.js +120 -117
- package/bin/plugin/core/ActionScheduleStore.js.map +1 -1
- package/bin/plugin/core/ActionScheduleTime.d.ts +5 -5
- package/bin/plugin/core/ActionScheduleTime.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleTime.js +6 -6
- package/bin/plugin/core/ActionScheduleTime.js.map +1 -1
- package/bin/plugin/core/BasePlugin.d.ts +6 -20
- package/bin/plugin/core/BasePlugin.d.ts.map +1 -1
- package/bin/plugin/core/BasePlugin.js +0 -12
- package/bin/plugin/core/BasePlugin.js.map +1 -1
- package/bin/plugin/core/HookRegistry.d.ts +11 -11
- package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
- package/bin/plugin/core/HookRegistry.js +45 -45
- package/bin/plugin/core/HookRegistry.js.map +1 -1
- package/bin/plugin/core/PluginActionFactory.d.ts +18 -26
- package/bin/plugin/core/PluginActionFactory.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionFactory.js +5 -8
- package/bin/plugin/core/PluginActionFactory.js.map +1 -1
- package/bin/plugin/core/PluginActionRunner.d.ts +15 -33
- package/bin/plugin/core/PluginActionRunner.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionRunner.js +11 -147
- package/bin/plugin/core/PluginActionRunner.js.map +1 -1
- package/bin/plugin/core/PluginCatalog.d.ts +12 -12
- package/bin/plugin/core/PluginCatalog.d.ts.map +1 -1
- package/bin/plugin/core/PluginCatalog.js +18 -18
- package/bin/plugin/core/PluginCatalog.js.map +1 -1
- package/bin/plugin/core/PluginContext.d.ts +32 -0
- package/bin/plugin/core/PluginContext.d.ts.map +1 -0
- package/bin/plugin/core/PluginContext.js +26 -0
- package/bin/plugin/core/PluginContext.js.map +1 -0
- package/bin/plugin/core/PluginHttpRoutes.d.ts +5 -5
- package/bin/plugin/core/PluginHttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/PluginHttpRoutes.js +5 -5
- package/bin/plugin/core/PluginHttpRoutes.js.map +1 -1
- package/bin/plugin/core/PluginRegistry.d.ts +35 -24
- package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
- package/bin/plugin/core/PluginRegistry.js +99 -71
- package/bin/plugin/core/PluginRegistry.js.map +1 -1
- package/bin/plugin/core/PluginStateController.d.ts +5 -13
- package/bin/plugin/core/PluginStateController.d.ts.map +1 -1
- package/bin/plugin/core/PluginStateController.js +2 -32
- package/bin/plugin/core/PluginStateController.js.map +1 -1
- package/bin/plugin/tool/PluginToolRuntime.d.ts +15 -0
- package/bin/plugin/tool/PluginToolRuntime.d.ts.map +1 -0
- package/bin/plugin/tool/PluginToolRuntime.js +105 -0
- package/bin/plugin/tool/PluginToolRuntime.js.map +1 -0
- package/bin/{executor/tools/plugin → plugin/tool}/PluginToolSchemas.d.ts +1 -1
- package/bin/plugin/tool/PluginToolSchemas.d.ts.map +1 -0
- package/bin/{executor/tools/plugin → plugin/tool}/PluginToolSchemas.js +1 -1
- package/bin/plugin/tool/PluginToolSchemas.js.map +1 -0
- package/bin/plugin/tool/PluginTools.d.ts +25 -0
- package/bin/plugin/tool/PluginTools.d.ts.map +1 -0
- package/bin/{executor/tools/plugin/PluginToolDefinition.js → plugin/tool/PluginTools.js} +19 -19
- package/bin/plugin/tool/PluginTools.js.map +1 -0
- package/bin/plugin/types/ActionSchedule.d.ts +10 -10
- package/bin/plugin/types/ActionSchedule.d.ts.map +1 -1
- package/bin/plugin/types/ActionSchedule.js +1 -1
- package/bin/plugin/types/PluginApi.d.ts +3 -3
- package/bin/plugin/types/PluginApi.d.ts.map +1 -1
- package/bin/remote/RemoteAgent.d.ts +1 -1
- package/bin/remote/RemoteAgent.d.ts.map +1 -1
- package/bin/remote/RemoteAgent.js +3 -3
- package/bin/remote/RemoteAgent.js.map +1 -1
- package/bin/remote/RemoteSession.d.ts +18 -12
- package/bin/remote/RemoteSession.d.ts.map +1 -1
- package/bin/remote/RemoteSession.js +87 -21
- package/bin/remote/RemoteSession.js.map +1 -1
- package/bin/remote/RemoteTransport.d.ts +13 -11
- package/bin/remote/RemoteTransport.d.ts.map +1 -1
- package/bin/remote/transports/HttpRemoteAgentTransport.d.ts +9 -7
- package/bin/remote/transports/HttpRemoteAgentTransport.d.ts.map +1 -1
- package/bin/remote/transports/HttpRemoteAgentTransport.js +36 -39
- package/bin/remote/transports/HttpRemoteAgentTransport.js.map +1 -1
- package/bin/remote/transports/RpcClient.d.ts +14 -31
- package/bin/remote/transports/RpcClient.d.ts.map +1 -1
- package/bin/remote/transports/RpcClient.js +40 -66
- package/bin/remote/transports/RpcClient.js.map +1 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.d.ts +9 -7
- package/bin/remote/transports/RpcRemoteAgentTransport.d.ts.map +1 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.js +10 -10
- package/bin/remote/transports/RpcRemoteAgentTransport.js.map +1 -1
- package/bin/session/DefaultSessionComposer.d.ts.map +1 -1
- package/bin/session/DefaultSessionComposer.js +2 -4
- package/bin/session/DefaultSessionComposer.js.map +1 -1
- package/bin/session/Session.d.ts +49 -31
- package/bin/session/Session.d.ts.map +1 -1
- package/bin/session/Session.js +303 -243
- package/bin/session/Session.js.map +1 -1
- package/bin/session/SessionCommand.d.ts +24 -0
- package/bin/session/SessionCommand.d.ts.map +1 -0
- package/bin/session/SessionCommand.js +35 -0
- package/bin/session/SessionCommand.js.map +1 -0
- package/bin/session/SessionLoop.d.ts +96 -0
- package/bin/session/SessionLoop.d.ts.map +1 -0
- package/bin/session/SessionLoop.js +554 -0
- package/bin/session/SessionLoop.js.map +1 -0
- package/bin/session/SessionMessages.d.ts +20 -16
- package/bin/session/SessionMessages.d.ts.map +1 -1
- package/bin/session/SessionMessages.js +102 -81
- package/bin/session/SessionMessages.js.map +1 -1
- package/bin/session/SessionQueue.d.ts +15 -25
- package/bin/session/SessionQueue.d.ts.map +1 -1
- package/bin/session/SessionQueue.js +31 -45
- package/bin/session/SessionQueue.js.map +1 -1
- package/bin/session/SessionState.d.ts +6 -6
- package/bin/session/SessionState.d.ts.map +1 -1
- package/bin/session/SessionState.js +45 -93
- package/bin/session/SessionState.js.map +1 -1
- package/bin/session/SessionSystem.js +7 -7
- package/bin/session/SessionSystem.js.map +1 -1
- package/bin/session/SessionTitle.d.ts +7 -12
- package/bin/session/SessionTitle.d.ts.map +1 -1
- package/bin/session/SessionTitle.js +15 -20
- package/bin/session/SessionTitle.js.map +1 -1
- package/bin/session/browse/Browse.d.ts +17 -26
- package/bin/session/browse/Browse.d.ts.map +1 -1
- package/bin/session/browse/Browse.js +106 -303
- package/bin/session/browse/Browse.js.map +1 -1
- package/bin/session/browse/SessionMessageTimeline.d.ts +13 -0
- package/bin/session/browse/SessionMessageTimeline.d.ts.map +1 -0
- package/bin/session/browse/SessionMessageTimeline.js +110 -0
- package/bin/session/browse/SessionMessageTimeline.js.map +1 -0
- package/bin/session/control/SessionInteractions.d.ts +39 -0
- package/bin/session/control/SessionInteractions.d.ts.map +1 -0
- package/bin/session/control/SessionInteractions.js +219 -0
- package/bin/session/control/SessionInteractions.js.map +1 -0
- package/bin/session/execution/SessionAssistantOutputAdapter.d.ts +49 -0
- package/bin/session/execution/SessionAssistantOutputAdapter.d.ts.map +1 -0
- package/bin/session/execution/SessionAssistantOutputAdapter.js +117 -0
- package/bin/session/execution/SessionAssistantOutputAdapter.js.map +1 -0
- package/bin/session/execution/tools/SessionShellApprovalAdapter.d.ts +28 -0
- package/bin/session/execution/tools/SessionShellApprovalAdapter.d.ts.map +1 -0
- package/bin/session/execution/tools/SessionShellApprovalAdapter.js +75 -0
- package/bin/session/execution/tools/SessionShellApprovalAdapter.js.map +1 -0
- package/bin/session/messages/SessionAssistantMessageWriter.d.ts +6 -4
- package/bin/session/messages/SessionAssistantMessageWriter.d.ts.map +1 -1
- package/bin/session/messages/SessionAssistantMessageWriter.js +34 -18
- package/bin/session/messages/SessionAssistantMessageWriter.js.map +1 -1
- package/bin/session/messages/SessionJsonValue.d.ts +2 -2
- package/bin/session/messages/SessionJsonValue.d.ts.map +1 -1
- package/bin/session/messages/SessionJsonValue.js.map +1 -1
- package/bin/session/messages/SessionMessageCodec.d.ts.map +1 -1
- package/bin/session/messages/SessionMessageCodec.js +30 -84
- package/bin/session/messages/SessionMessageCodec.js.map +1 -1
- package/bin/session/messages/SessionMessageCompaction.js +2 -2
- package/bin/session/messages/SessionMessageCompaction.js.map +1 -1
- package/bin/session/messages/SessionMessageInteractionWriter.d.ts +51 -0
- package/bin/session/messages/SessionMessageInteractionWriter.d.ts.map +1 -0
- package/bin/session/messages/SessionMessageInteractionWriter.js +177 -0
- package/bin/session/messages/SessionMessageInteractionWriter.js.map +1 -0
- package/bin/session/preview/SessionMessagePreview.js +2 -2
- package/bin/session/preview/SessionMessagePreview.js.map +1 -1
- package/bin/session/runtime/SessionCompactOperation.d.ts +29 -0
- package/bin/session/runtime/SessionCompactOperation.d.ts.map +1 -0
- package/bin/session/runtime/SessionCompactOperation.js +66 -0
- package/bin/session/runtime/SessionCompactOperation.js.map +1 -0
- package/bin/session/runtime/SessionHistoryCompaction.d.ts +22 -0
- package/bin/session/runtime/SessionHistoryCompaction.d.ts.map +1 -0
- package/bin/session/runtime/SessionHistoryCompaction.js +31 -0
- package/bin/session/runtime/SessionHistoryCompaction.js.map +1 -0
- package/bin/session/runtime/SessionTurnContext.d.ts +26 -0
- package/bin/session/runtime/SessionTurnContext.d.ts.map +1 -0
- package/bin/session/runtime/SessionTurnContext.js +181 -0
- package/bin/session/runtime/SessionTurnContext.js.map +1 -0
- package/bin/session/storage/Metadata.d.ts +13 -70
- package/bin/session/storage/Metadata.d.ts.map +1 -1
- package/bin/session/storage/Metadata.js +31 -116
- package/bin/session/storage/Metadata.js.map +1 -1
- package/bin/session/storage/RuntimeSessionPort.d.ts +7 -7
- package/bin/session/storage/RuntimeSessionPort.d.ts.map +1 -1
- package/bin/session/storage/RuntimeSessionPort.js +7 -7
- package/bin/session/storage/RuntimeSessionPort.js.map +1 -1
- package/bin/tools/ask/AskQuestionsTool.d.ts +39 -0
- package/bin/tools/ask/AskQuestionsTool.d.ts.map +1 -0
- package/bin/tools/ask/AskQuestionsTool.js +67 -0
- package/bin/tools/ask/AskQuestionsTool.js.map +1 -0
- package/bin/tools/ask/AskQuestionsToolSchemas.d.ts +29 -0
- package/bin/tools/ask/AskQuestionsToolSchemas.d.ts.map +1 -0
- package/bin/tools/ask/AskQuestionsToolSchemas.js +51 -0
- package/bin/tools/ask/AskQuestionsToolSchemas.js.map +1 -0
- package/bin/tools/index.d.ts +9 -0
- package/bin/tools/index.d.ts.map +1 -0
- package/bin/tools/index.js +8 -0
- package/bin/tools/index.js.map +1 -0
- package/bin/types/action/ActionResult.d.ts +26 -0
- package/bin/types/action/ActionResult.d.ts.map +1 -0
- package/bin/types/action/ActionResult.js +17 -0
- package/bin/types/action/ActionResult.js.map +1 -0
- package/bin/types/agent/AgentOptions.d.ts +13 -23
- package/bin/types/agent/AgentOptions.d.ts.map +1 -1
- package/bin/types/agent/AgentState.d.ts +4 -13
- package/bin/types/agent/AgentState.d.ts.map +1 -1
- package/bin/types/agent/AgentState.js +2 -2
- package/bin/types/agent/RemoteAgentPluginAction.d.ts +2 -2
- package/bin/types/agent/RemoteAgentPluginAction.d.ts.map +1 -1
- package/bin/types/agent/SessionActor.d.ts +16 -15
- package/bin/types/agent/SessionActor.d.ts.map +1 -1
- package/bin/types/agent/SessionTypes.d.ts +69 -91
- package/bin/types/agent/SessionTypes.d.ts.map +1 -1
- package/bin/types/executor/SessionAssistantOutput.d.ts +34 -0
- package/bin/types/executor/SessionAssistantOutput.d.ts.map +1 -0
- package/bin/types/executor/SessionAssistantOutput.js +8 -0
- package/bin/types/executor/SessionAssistantOutput.js.map +1 -0
- package/bin/types/executor/SessionToolExecutionContext.d.ts +5 -5
- package/bin/types/executor/SessionToolExecutionContext.d.ts.map +1 -1
- package/bin/types/executor/SessionToolExecutionContext.js +2 -2
- package/bin/types/executor/SessionTurnContext.d.ts +125 -0
- package/bin/types/executor/SessionTurnContext.d.ts.map +1 -0
- package/bin/types/executor/SessionTurnContext.js +10 -0
- package/bin/types/executor/SessionTurnContext.js.map +1 -0
- package/bin/types/plugin/PluginAction.d.ts +13 -10
- package/bin/types/plugin/PluginAction.d.ts.map +1 -1
- package/bin/types/plugin/PluginCommand.d.ts +8 -65
- package/bin/types/plugin/PluginCommand.d.ts.map +1 -1
- package/bin/types/plugin/PluginCommand.js +2 -4
- package/bin/types/plugin/PluginCommand.js.map +1 -1
- package/bin/types/plugin/PluginContext.d.ts +34 -0
- package/bin/types/plugin/PluginContext.d.ts.map +1 -0
- package/bin/types/plugin/PluginContext.js +9 -0
- package/bin/types/plugin/PluginContext.js.map +1 -0
- package/bin/types/plugin/PluginDefinition.d.ts +8 -28
- package/bin/types/plugin/PluginDefinition.d.ts.map +1 -1
- package/bin/types/plugin/PluginDefinition.js +1 -1
- package/bin/types/plugin/PluginExecutionContext.d.ts +29 -0
- package/bin/types/plugin/PluginExecutionContext.d.ts.map +1 -0
- package/bin/types/plugin/{PluginRunContext.js → PluginExecutionContext.js} +2 -2
- package/bin/types/plugin/PluginExecutionContext.js.map +1 -0
- package/bin/types/plugin/PluginHttp.d.ts +5 -5
- package/bin/types/plugin/PluginHttp.d.ts.map +1 -1
- package/bin/types/plugin/PluginRegistry.d.ts +21 -0
- package/bin/types/plugin/PluginRegistry.d.ts.map +1 -0
- package/bin/types/plugin/PluginRegistry.js +9 -0
- package/bin/types/plugin/PluginRegistry.js.map +1 -0
- package/bin/types/plugin/PluginRuntime.d.ts +28 -40
- package/bin/types/plugin/PluginRuntime.d.ts.map +1 -1
- package/bin/types/plugin/PluginState.d.ts +0 -15
- package/bin/types/plugin/PluginState.d.ts.map +1 -1
- package/bin/types/plugin/PluginTool.d.ts +90 -0
- package/bin/types/plugin/PluginTool.d.ts.map +1 -0
- package/bin/types/plugin/PluginTool.js.map +1 -0
- package/bin/types/rpc/RpcProtocol.d.ts +50 -72
- package/bin/types/rpc/RpcProtocol.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionCompact.d.ts +31 -0
- package/bin/types/sdk/AgentSessionCompact.d.ts.map +1 -0
- package/bin/types/sdk/AgentSessionCompact.js +8 -0
- package/bin/types/sdk/AgentSessionCompact.js.map +1 -0
- package/bin/types/sdk/AgentSessionPrompt.d.ts +1 -1
- package/bin/types/sdk/AgentSessionPrompt.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionPrompt.js +1 -1
- package/bin/types/sdk/AgentSessionPrompt.js.map +1 -1
- package/bin/types/sdk/AgentSessionStop.d.ts +2 -2
- package/bin/types/sdk/AgentSessionStop.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionTurn.d.ts +3 -13
- package/bin/types/sdk/AgentSessionTurn.d.ts.map +1 -1
- package/bin/types/session/SessionCommand.d.ts +26 -0
- package/bin/types/session/SessionCommand.d.ts.map +1 -0
- package/bin/types/session/SessionCommand.js +7 -0
- package/bin/types/session/SessionCommand.js.map +1 -0
- package/bin/types/session/SessionComposer.d.ts +8 -4
- package/bin/types/session/SessionComposer.d.ts.map +1 -1
- package/bin/{executor/types/SessionRun.d.ts → types/session/SessionExecution.d.ts} +37 -33
- package/bin/types/session/SessionExecution.d.ts.map +1 -0
- package/bin/types/session/SessionExecution.js +10 -0
- package/bin/types/session/SessionExecution.js.map +1 -0
- package/bin/types/session/SessionInteraction.d.ts +165 -0
- package/bin/types/session/SessionInteraction.d.ts.map +1 -0
- package/bin/types/session/SessionInteraction.js +8 -0
- package/bin/types/session/SessionInteraction.js.map +1 -0
- package/bin/types/session/SessionInteractions.d.ts +17 -0
- package/bin/types/session/SessionInteractions.d.ts.map +1 -0
- package/bin/types/session/SessionInteractions.js +8 -0
- package/bin/types/session/SessionInteractions.js.map +1 -0
- package/bin/types/session/SessionLocalState.d.ts +1 -1
- package/bin/types/session/SessionLoop.d.ts +63 -0
- package/bin/types/session/SessionLoop.d.ts.map +1 -0
- package/bin/types/session/{SessionTurn.js → SessionLoop.js} +2 -2
- package/bin/types/session/SessionLoop.js.map +1 -0
- package/bin/types/session/SessionMessage.d.ts +37 -28
- package/bin/types/session/SessionMessage.d.ts.map +1 -1
- package/bin/types/session/SessionMessages.d.ts +2 -4
- package/bin/types/session/SessionMessages.d.ts.map +1 -1
- package/bin/types/session/SessionMutation.d.ts +19 -1
- package/bin/types/session/SessionMutation.d.ts.map +1 -1
- package/bin/types/session/SessionMutation.js +1 -0
- package/bin/types/session/SessionMutation.js.map +1 -1
- package/bin/types/session/SessionOptions.d.ts +34 -20
- package/bin/types/session/SessionOptions.d.ts.map +1 -1
- package/bin/types/session/SessionPort.d.ts +6 -19
- package/bin/types/session/SessionPort.d.ts.map +1 -1
- package/bin/types/session/SessionState.d.ts +3 -13
- package/bin/types/session/SessionState.d.ts.map +1 -1
- package/bin/types/store/AgentStore.d.ts +31 -0
- package/bin/types/store/AgentStore.d.ts.map +1 -0
- package/bin/types/store/AgentStore.js +9 -0
- package/bin/types/store/AgentStore.js.map +1 -0
- package/bin/types/store/LocalStore.d.ts +36 -0
- package/bin/types/store/LocalStore.d.ts.map +1 -0
- package/bin/types/store/LocalStore.js +9 -0
- package/bin/types/store/LocalStore.js.map +1 -0
- package/bin/types/store/SessionStore.d.ts +82 -0
- package/bin/types/store/SessionStore.d.ts.map +1 -0
- package/bin/types/store/SessionStore.js +9 -0
- package/bin/types/store/SessionStore.js.map +1 -0
- package/bin/types/tools/ask/AskQuestionsTool.d.ts +22 -0
- package/bin/types/tools/ask/AskQuestionsTool.d.ts.map +1 -0
- package/bin/types/tools/ask/AskQuestionsTool.js +8 -0
- package/bin/types/tools/ask/AskQuestionsTool.js.map +1 -0
- package/bin/types/workspace/FileSystem.d.ts +55 -0
- package/bin/types/workspace/FileSystem.d.ts.map +1 -0
- package/bin/types/workspace/FileSystem.js +9 -0
- package/bin/types/workspace/FileSystem.js.map +1 -0
- package/bin/types/workspace/FileTool.d.ts +181 -0
- package/bin/types/workspace/FileTool.d.ts.map +1 -0
- package/bin/types/workspace/FileTool.js +10 -0
- package/bin/types/workspace/FileTool.js.map +1 -0
- package/bin/types/workspace/SearchTool.d.ts +131 -0
- package/bin/types/workspace/SearchTool.d.ts.map +1 -0
- package/bin/types/workspace/SearchTool.js +10 -0
- package/bin/types/workspace/SearchTool.js.map +1 -0
- package/bin/types/workspace/Workspace.d.ts +24 -0
- package/bin/types/workspace/Workspace.d.ts.map +1 -0
- package/bin/types/workspace/Workspace.js +9 -0
- package/bin/types/workspace/Workspace.js.map +1 -0
- package/bin/types/workspace/WorkspaceEnv.d.ts +16 -0
- package/bin/types/workspace/WorkspaceEnv.d.ts.map +1 -0
- package/bin/types/workspace/WorkspaceEnv.js +9 -0
- package/bin/types/workspace/WorkspaceEnv.js.map +1 -0
- package/bin/types/workspace/WorkspaceTools.d.ts +20 -0
- package/bin/types/workspace/WorkspaceTools.d.ts.map +1 -0
- package/bin/types/workspace/WorkspaceTools.js +9 -0
- package/bin/types/workspace/WorkspaceTools.js.map +1 -0
- package/bin/utils/Id.d.ts +1 -1
- package/bin/utils/Id.d.ts.map +1 -1
- package/bin/utils/Id.js +1 -1
- package/bin/utils/Id.js.map +1 -1
- package/bin/utils/Template.d.ts +1 -1
- package/bin/utils/Template.d.ts.map +1 -1
- package/bin/utils/Template.js +1 -1
- package/bin/utils/Template.js.map +1 -1
- package/bin/utils/Time.d.ts +5 -5
- package/bin/utils/Time.d.ts.map +1 -1
- package/bin/utils/Time.js +5 -5
- package/bin/utils/Time.js.map +1 -1
- package/bin/utils/cli/CliOutput.d.ts +1 -1
- package/bin/utils/cli/CliOutput.d.ts.map +1 -1
- package/bin/utils/cli/CliOutput.js +6 -6
- package/bin/utils/cli/CliOutput.js.map +1 -1
- package/bin/utils/cli/PrettyStatus.d.ts +3 -3
- package/bin/utils/cli/PrettyStatus.d.ts.map +1 -1
- package/bin/utils/cli/PrettyStatus.js +4 -4
- package/bin/utils/cli/PrettyStatus.js.map +1 -1
- package/bin/utils/logger/FormatRequest.d.ts +2 -2
- package/bin/utils/logger/FormatRequest.d.ts.map +1 -1
- package/bin/utils/logger/FormatRequest.js +49 -49
- package/bin/utils/logger/FormatRequest.js.map +1 -1
- package/bin/utils/logger/FormatResponse.d.ts +1 -1
- package/bin/utils/logger/FormatResponse.d.ts.map +1 -1
- package/bin/utils/logger/FormatResponse.js +36 -36
- package/bin/utils/logger/FormatResponse.js.map +1 -1
- package/bin/utils/logger/FormatShared.d.ts +16 -16
- package/bin/utils/logger/FormatShared.d.ts.map +1 -1
- package/bin/utils/logger/FormatShared.js +28 -28
- package/bin/utils/logger/FormatShared.js.map +1 -1
- package/bin/utils/logger/Logger.d.ts +15 -12
- package/bin/utils/logger/Logger.d.ts.map +1 -1
- package/bin/utils/logger/Logger.js +28 -26
- package/bin/utils/logger/Logger.js.map +1 -1
- package/bin/utils/object/DeepMerge.d.ts +1 -1
- package/bin/utils/object/DeepMerge.d.ts.map +1 -1
- package/bin/utils/object/DeepMerge.js +5 -5
- package/bin/utils/object/DeepMerge.js.map +1 -1
- package/bin/utils/object/ObjectGuards.d.ts +1 -1
- package/bin/utils/object/ObjectGuards.d.ts.map +1 -1
- package/bin/utils/object/ObjectGuards.js +1 -1
- package/bin/utils/object/ObjectGuards.js.map +1 -1
- package/bin/utils/path/AncestorFiles.d.ts +1 -1
- package/bin/utils/path/AncestorFiles.d.ts.map +1 -1
- package/bin/utils/path/AncestorFiles.js +2 -2
- package/bin/utils/path/AncestorFiles.js.map +1 -1
- package/bin/utils/storage/index.d.ts +2 -2
- package/bin/utils/storage/index.d.ts.map +1 -1
- package/bin/utils/storage/index.js +2 -2
- package/bin/utils/storage/index.js.map +1 -1
- package/bin/utils/string/EscapeRegExp.d.ts +1 -1
- package/bin/utils/string/EscapeRegExp.d.ts.map +1 -1
- package/bin/utils/string/EscapeRegExp.js +1 -1
- package/bin/utils/string/EscapeRegExp.js.map +1 -1
- package/bin/workspace/LocalFileSystem.d.ts +44 -0
- package/bin/workspace/LocalFileSystem.d.ts.map +1 -0
- package/bin/workspace/LocalFileSystem.js +153 -0
- package/bin/workspace/LocalFileSystem.js.map +1 -0
- package/bin/workspace/Workspace.d.ts +52 -0
- package/bin/workspace/Workspace.d.ts.map +1 -0
- package/bin/workspace/Workspace.js +153 -0
- package/bin/workspace/Workspace.js.map +1 -0
- package/bin/workspace/WorkspaceEnv.d.ts +19 -0
- package/bin/workspace/WorkspaceEnv.d.ts.map +1 -0
- package/bin/workspace/WorkspaceEnv.js +50 -0
- package/bin/workspace/WorkspaceEnv.js.map +1 -0
- package/bin/workspace/WorkspacePaths.d.ts +67 -0
- package/bin/workspace/WorkspacePaths.d.ts.map +1 -0
- package/bin/workspace/WorkspacePaths.js +102 -0
- package/bin/workspace/WorkspacePaths.js.map +1 -0
- package/bin/workspace/file/FileActionRuntime.d.ts +14 -0
- package/bin/workspace/file/FileActionRuntime.d.ts.map +1 -0
- package/bin/workspace/file/FileActionRuntime.js +386 -0
- package/bin/workspace/file/FileActionRuntime.js.map +1 -0
- package/bin/workspace/file/FileAtomicWriter.d.ts +20 -0
- package/bin/workspace/file/FileAtomicWriter.d.ts.map +1 -0
- package/bin/workspace/file/FileAtomicWriter.js +50 -0
- package/bin/workspace/file/FileAtomicWriter.js.map +1 -0
- package/bin/workspace/file/FileEncoding.d.ts +34 -0
- package/bin/workspace/file/FileEncoding.d.ts.map +1 -0
- package/bin/workspace/file/FileEncoding.js +152 -0
- package/bin/workspace/file/FileEncoding.js.map +1 -0
- package/bin/workspace/file/FilePathPolicy.d.ts +26 -0
- package/bin/workspace/file/FilePathPolicy.d.ts.map +1 -0
- package/bin/workspace/file/FilePathPolicy.js +134 -0
- package/bin/workspace/file/FilePathPolicy.js.map +1 -0
- package/bin/workspace/file/FileToolError.d.ts +30 -0
- package/bin/workspace/file/FileToolError.d.ts.map +1 -0
- package/bin/workspace/file/FileToolError.js +78 -0
- package/bin/workspace/file/FileToolError.js.map +1 -0
- package/bin/workspace/search/SearchActionRuntime.d.ts +14 -0
- package/bin/workspace/search/SearchActionRuntime.d.ts.map +1 -0
- package/bin/workspace/search/SearchActionRuntime.js +359 -0
- package/bin/workspace/search/SearchActionRuntime.js.map +1 -0
- package/bin/workspace/search/SearchToolError.d.ts +26 -0
- package/bin/workspace/search/SearchToolError.d.ts.map +1 -0
- package/bin/workspace/search/SearchToolError.js +76 -0
- package/bin/workspace/search/SearchToolError.js.map +1 -0
- package/bin/{session/messages → workspace/store}/JsonlSessionMessageStore.d.ts +4 -31
- package/bin/workspace/store/JsonlSessionMessageStore.d.ts.map +1 -0
- package/bin/{session/messages → workspace/store}/JsonlSessionMessageStore.js +28 -63
- package/bin/workspace/store/JsonlSessionMessageStore.js.map +1 -0
- package/bin/workspace/store/LocalAgentStore.d.ts +43 -0
- package/bin/workspace/store/LocalAgentStore.d.ts.map +1 -0
- package/bin/workspace/store/LocalAgentStore.js +135 -0
- package/bin/workspace/store/LocalAgentStore.js.map +1 -0
- package/bin/workspace/store/LocalSessionStore.d.ts +38 -0
- package/bin/workspace/store/LocalSessionStore.d.ts.map +1 -0
- package/bin/workspace/store/LocalSessionStore.js +70 -0
- package/bin/workspace/store/LocalSessionStore.js.map +1 -0
- package/bin/workspace/store/LocalStorePaths.d.ts +81 -0
- package/bin/workspace/store/LocalStorePaths.d.ts.map +1 -0
- package/bin/workspace/store/LocalStorePaths.js +112 -0
- package/bin/workspace/store/LocalStorePaths.js.map +1 -0
- package/bin/workspace/store/SessionMessageStoreFactory.d.ts +12 -0
- package/bin/workspace/store/SessionMessageStoreFactory.d.ts.map +1 -0
- package/bin/workspace/store/SessionMessageStoreFactory.js +13 -0
- package/bin/workspace/store/SessionMessageStoreFactory.js.map +1 -0
- package/bin/workspace/tool/FileToolSchemas.d.ts +35 -0
- package/bin/workspace/tool/FileToolSchemas.d.ts.map +1 -0
- package/bin/workspace/tool/FileToolSchemas.js +73 -0
- package/bin/workspace/tool/FileToolSchemas.js.map +1 -0
- package/bin/workspace/tool/FileTools.d.ts +11 -0
- package/bin/workspace/tool/FileTools.d.ts.map +1 -0
- package/bin/workspace/tool/FileTools.js +61 -0
- package/bin/workspace/tool/FileTools.js.map +1 -0
- package/bin/workspace/tool/SearchToolSchemas.d.ts +24 -0
- package/bin/workspace/tool/SearchToolSchemas.d.ts.map +1 -0
- package/bin/workspace/tool/SearchToolSchemas.js +60 -0
- package/bin/workspace/tool/SearchToolSchemas.js.map +1 -0
- package/bin/workspace/tool/SearchTools.d.ts +11 -0
- package/bin/workspace/tool/SearchTools.d.ts.map +1 -0
- package/bin/workspace/tool/SearchTools.js +38 -0
- package/bin/workspace/tool/SearchTools.js.map +1 -0
- package/bin/workspace/tool/WorkspaceTools.d.ts +11 -0
- package/bin/workspace/tool/WorkspaceTools.d.ts.map +1 -0
- package/bin/workspace/tool/WorkspaceTools.js +22 -0
- package/bin/workspace/tool/WorkspaceTools.js.map +1 -0
- package/package.json +11 -6
- package/scripts/action-schedule-store.test.mjs +101 -0
- package/scripts/agent-env-shell-sandbox.test.mjs +9 -19
- package/scripts/agent-env.test.mjs +10 -39
- package/scripts/agent-ready.test.mjs +16 -11
- package/scripts/agent-session-maintenance.test.mjs +9 -7
- package/scripts/agent-store.test.mjs +83 -0
- package/scripts/city-model-tool-loop.test.mjs +48 -22
- package/scripts/core-engine-context-compaction.test.mjs +29 -26
- package/scripts/core-engine-ui-stream-collector.test.mjs +4 -4
- package/scripts/executor-failure-result.test.mjs +36 -33
- package/scripts/file-tools.test.mjs +282 -0
- package/scripts/image-plugin-job.test.mjs +43 -34
- package/scripts/logger-isolation.test.mjs +6 -6
- package/scripts/multi-agent-plugin-isolation.test.mjs +8 -8
- package/scripts/{plugin-tool-bridge.test.mjs → plugin-tools.test.mjs} +106 -102
- package/scripts/public-api-naming.test.mjs +108 -0
- package/scripts/remote-session-reconnect.test.mjs +78 -9
- package/scripts/search-tools.test.mjs +188 -0
- package/scripts/session-ask-question.test.mjs +216 -0
- package/scripts/session-compact-handle.test.mjs +117 -0
- package/scripts/session-composer.test.mjs +7 -5
- package/scripts/session-config-turn-boundary.test.mjs +177 -43
- package/scripts/session-list-title.test.mjs +23 -23
- package/scripts/session-message-timeline.test.mjs +65 -0
- package/scripts/session-messages-error.test.mjs +0 -1
- package/scripts/session-messages.test.mjs +305 -68
- package/scripts/session-queue.test.mjs +75 -40
- package/scripts/session-shell-approval.test.mjs +25 -22
- package/scripts/session-system-blocks.test.mjs +3 -3
- package/scripts/session-title-event.test.mjs +7 -7
- package/scripts/session-turn-context.test.mjs +99 -0
- package/scripts/session-turn-failure.test.mjs +158 -38
- package/scripts/workspace.test.mjs +146 -0
- package/src/agent/Agent.ts +159 -109
- package/src/agent/AgentInstructions.ts +2 -2
- package/src/agent/AgentModel.ts +2 -2
- package/src/agent/AgentSessions.ts +50 -148
- package/src/agent/AgentState.ts +8 -63
- package/src/executor/Executor.ts +120 -226
- package/src/executor/README.md +13 -11
- package/src/executor/composer/system/SessionSystemComposer.ts +2 -2
- package/src/executor/composer/system/default/DefaultSessionSystemComposer.ts +24 -24
- package/src/executor/composer/system/default/PromptRenderer.ts +4 -4
- package/src/executor/composer/system/default/SystemDomain.ts +68 -68
- package/src/executor/composer/system/default/assets/core.prompt.ts +1 -1
- package/src/executor/composer/system/default/assets/core.prompt.ts.txt +1 -1
- package/src/executor/composer/system/default/variables/GeoContext.ts +4 -4
- package/src/executor/composer/system/default/variables/PromptTypes.ts +2 -2
- package/src/executor/composer/system/default/variables/VariableReplacer.ts +30 -30
- package/src/executor/core-engine/CoreEngineError.ts +2 -2
- package/src/executor/core-engine/CoreEngineLoopDecision.ts +2 -2
- package/src/executor/core-engine/CoreEngineMessageState.ts +16 -16
- package/src/executor/core-engine/CoreEngineRunner.ts +124 -134
- package/src/executor/core-engine/CoreEngineSignals.ts +24 -24
- package/src/executor/core-engine/CoreEngineUiStreamCollector.ts +18 -18
- package/src/executor/ids/resolveSessionId.ts +5 -5
- package/src/executor/messages/ChatMessageMarkup.ts +23 -23
- package/src/executor/messages/ChatMessageMarkupTypes.ts +10 -10
- package/src/executor/messages/SessionAttachmentMapper.ts +14 -14
- package/src/executor/messages/SessionMessageCodec.ts +17 -27
- package/src/executor/messages/SessionMessageLog.ts +3 -3
- package/src/executor/messages/SessionStepEventMapper.ts +9 -9
- package/src/executor/messages/UIMessageTransformer.ts +6 -6
- package/src/executor/messages/UserVisibleText.ts +6 -6
- package/src/executor/services/ExecutorRecoveryPolicy.ts +33 -32
- package/src/executor/types/SessionHistoryMeta.ts +10 -10
- package/src/executor/types/SessionRecords.ts +13 -13
- package/src/index.ts +108 -184
- package/src/plugin/core/ActionScheduleExecutor.ts +21 -23
- package/src/plugin/core/ActionScheduleRuntime.ts +8 -8
- package/src/plugin/core/ActionScheduleStore.ts +140 -128
- package/src/plugin/core/ActionScheduleTime.ts +6 -6
- package/src/plugin/core/BasePlugin.ts +6 -27
- package/src/plugin/core/HookRegistry.ts +56 -56
- package/src/plugin/core/PluginActionFactory.ts +20 -38
- package/src/plugin/core/PluginActionRunner.ts +21 -181
- package/src/plugin/core/PluginCatalog.ts +23 -23
- package/src/plugin/core/PluginContext.ts +52 -0
- package/src/plugin/core/PluginHttpRoutes.ts +8 -8
- package/src/plugin/core/PluginRegistry.ts +125 -88
- package/src/plugin/core/PluginStateController.ts +5 -47
- package/src/plugin/tool/PluginToolRuntime.ts +121 -0
- package/src/{executor/tools/plugin → plugin/tool}/PluginToolSchemas.ts +1 -1
- package/src/{executor/tools/plugin/PluginToolDefinition.ts → plugin/tool/PluginTools.ts} +25 -27
- package/src/plugin/types/ActionSchedule.ts +10 -10
- package/src/plugin/types/PluginApi.ts +3 -3
- package/src/remote/RemoteAgent.ts +3 -3
- package/src/remote/RemoteSession.ts +110 -28
- package/src/remote/RemoteTransport.ts +17 -20
- package/src/remote/transports/HttpRemoteAgentTransport.ts +59 -59
- package/src/remote/transports/RpcClient.ts +65 -106
- package/src/remote/transports/RpcRemoteAgentTransport.ts +21 -21
- package/src/session/DefaultSessionComposer.ts +2 -3
- package/src/session/Session.ts +352 -298
- package/src/session/SessionCommand.ts +42 -0
- package/src/session/SessionLoop.ts +661 -0
- package/src/session/SessionMessages.ts +141 -94
- package/src/session/SessionQueue.ts +31 -64
- package/src/session/SessionState.ts +48 -116
- package/src/session/SessionSystem.ts +7 -7
- package/src/session/SessionTitle.ts +24 -39
- package/src/session/browse/Browse.ts +160 -384
- package/src/session/browse/SessionMessageTimeline.ts +135 -0
- package/src/session/control/SessionInteractions.ts +290 -0
- package/src/session/execution/SessionAssistantOutputAdapter.ts +144 -0
- package/src/session/execution/tools/SessionShellApprovalAdapter.ts +94 -0
- package/src/session/messages/SessionAssistantMessageWriter.ts +33 -21
- package/src/session/messages/SessionJsonValue.ts +3 -3
- package/src/session/messages/SessionMessageCodec.ts +29 -84
- package/src/session/messages/SessionMessageCompaction.ts +2 -2
- package/src/session/messages/SessionMessageInteractionWriter.ts +277 -0
- package/src/session/preview/SessionMessagePreview.ts +2 -2
- package/src/session/runtime/SessionCompactOperation.ts +93 -0
- package/src/session/runtime/SessionHistoryCompaction.ts +45 -0
- package/src/session/runtime/SessionTurnContext.ts +222 -0
- package/src/session/storage/Metadata.ts +46 -195
- package/src/session/storage/RuntimeSessionPort.ts +13 -13
- package/src/tools/ask/AskQuestionsTool.ts +85 -0
- package/src/tools/ask/AskQuestionsToolSchemas.ts +55 -0
- package/src/tools/index.ts +12 -0
- package/src/types/action/ActionResult.ts +36 -0
- package/src/types/agent/AgentOptions.ts +13 -25
- package/src/types/agent/AgentState.ts +4 -15
- package/src/types/agent/RemoteAgentPluginAction.ts +2 -2
- package/src/types/agent/SessionActor.ts +21 -20
- package/src/types/agent/SessionTypes.ts +74 -94
- package/src/types/executor/SessionAssistantOutput.ts +35 -0
- package/src/types/executor/SessionToolExecutionContext.ts +5 -5
- package/src/types/executor/SessionTurnContext.ts +171 -0
- package/src/types/plugin/PluginAction.ts +13 -10
- package/src/types/plugin/PluginCommand.ts +8 -70
- package/src/types/plugin/PluginContext.ts +43 -0
- package/src/types/plugin/PluginDefinition.ts +8 -35
- package/src/types/plugin/PluginExecutionContext.ts +34 -0
- package/src/types/plugin/PluginHttp.ts +5 -5
- package/src/types/plugin/PluginRegistry.ts +25 -0
- package/src/types/plugin/PluginRuntime.ts +30 -43
- package/src/types/plugin/PluginState.ts +0 -17
- package/src/{executor/tools/plugin/types → types/plugin}/PluginTool.ts +42 -20
- package/src/types/rpc/RpcProtocol.ts +49 -74
- package/src/types/sdk/AgentSessionCompact.ts +36 -0
- package/src/types/sdk/AgentSessionPrompt.ts +1 -1
- package/src/types/sdk/AgentSessionStop.ts +2 -2
- package/src/types/sdk/AgentSessionTurn.ts +3 -15
- package/src/types/session/SessionCommand.ts +27 -0
- package/src/types/session/SessionComposer.ts +8 -4
- package/src/{executor/types/SessionRun.ts → types/session/SessionExecution.ts} +41 -34
- package/src/types/session/SessionInteraction.ts +209 -0
- package/src/types/session/SessionInteractions.ts +21 -0
- package/src/types/session/SessionLocalState.ts +1 -1
- package/src/types/session/SessionLoop.ts +72 -0
- package/src/types/session/SessionMessage.ts +43 -28
- package/src/types/session/SessionMessages.ts +2 -4
- package/src/types/session/SessionMutation.ts +21 -0
- package/src/types/session/SessionOptions.ts +38 -23
- package/src/types/session/SessionPort.ts +6 -24
- package/src/types/session/SessionState.ts +3 -16
- package/src/types/store/AgentStore.ts +52 -0
- package/src/types/store/LocalStore.ts +39 -0
- package/src/types/store/SessionStore.ts +105 -0
- package/src/types/tools/ask/AskQuestionsTool.ts +27 -0
- package/src/types/workspace/FileSystem.ts +76 -0
- package/src/types/workspace/FileTool.ts +225 -0
- package/src/types/workspace/SearchTool.ts +156 -0
- package/src/types/workspace/Workspace.ts +27 -0
- package/src/types/workspace/WorkspaceEnv.ts +19 -0
- package/src/types/workspace/WorkspaceTools.ts +23 -0
- package/src/utils/Id.ts +1 -1
- package/src/utils/Template.ts +1 -1
- package/src/utils/Time.ts +8 -8
- package/src/utils/cli/CliOutput.ts +7 -7
- package/src/utils/cli/PrettyStatus.ts +4 -4
- package/src/utils/logger/FormatRequest.ts +64 -64
- package/src/utils/logger/FormatResponse.ts +44 -44
- package/src/utils/logger/FormatShared.ts +28 -28
- package/src/utils/logger/Logger.ts +30 -26
- package/src/utils/object/DeepMerge.ts +5 -5
- package/src/utils/object/ObjectGuards.ts +1 -1
- package/src/utils/path/AncestorFiles.ts +3 -3
- package/src/utils/storage/index.ts +2 -2
- package/src/utils/string/EscapeRegExp.ts +1 -1
- package/src/workspace/LocalFileSystem.ts +209 -0
- package/src/workspace/Workspace.ts +180 -0
- package/src/workspace/WorkspaceEnv.ts +54 -0
- package/src/workspace/WorkspacePaths.ts +112 -0
- package/src/workspace/file/FileActionRuntime.ts +433 -0
- package/src/workspace/file/FileAtomicWriter.ts +61 -0
- package/src/workspace/file/FileEncoding.ts +175 -0
- package/src/workspace/file/FilePathPolicy.ts +162 -0
- package/src/workspace/file/FileToolError.ts +99 -0
- package/src/workspace/search/SearchActionRuntime.ts +438 -0
- package/src/workspace/search/SearchToolError.ts +94 -0
- package/src/{session/messages → workspace/store}/JsonlSessionMessageStore.ts +40 -91
- package/src/workspace/store/LocalAgentStore.ts +191 -0
- package/src/workspace/store/LocalSessionStore.ts +114 -0
- package/src/workspace/store/LocalStorePaths.ts +209 -0
- package/src/workspace/store/SessionMessageStoreFactory.ts +18 -0
- package/src/workspace/tool/FileToolSchemas.ts +77 -0
- package/src/workspace/tool/FileTools.ts +91 -0
- package/src/workspace/tool/SearchToolSchemas.ts +62 -0
- package/src/workspace/tool/SearchTools.ts +61 -0
- package/src/workspace/tool/WorkspaceTools.ts +31 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/bin/agent/AgentContext.d.ts +0 -69
- package/bin/agent/AgentContext.d.ts.map +0 -1
- package/bin/agent/AgentContext.js +0 -56
- package/bin/agent/AgentContext.js.map +0 -1
- package/bin/config/AgentEnv.d.ts +0 -9
- package/bin/config/AgentEnv.d.ts.map +0 -1
- package/bin/config/AgentEnv.js +0 -48
- package/bin/config/AgentEnv.js.map +0 -1
- package/bin/config/AgentInitializer.d.ts +0 -31
- package/bin/config/AgentInitializer.d.ts.map +0 -1
- package/bin/config/AgentInitializer.js +0 -131
- package/bin/config/AgentInitializer.js.map +0 -1
- package/bin/config/EnvFile.d.ts +0 -31
- package/bin/config/EnvFile.d.ts.map +0 -1
- package/bin/config/EnvFile.js +0 -89
- package/bin/config/EnvFile.js.map +0 -1
- package/bin/config/ExecutionBinding.d.ts +0 -31
- package/bin/config/ExecutionBinding.d.ts.map +0 -1
- package/bin/config/ExecutionBinding.js +0 -46
- package/bin/config/ExecutionBinding.js.map +0 -1
- package/bin/config/Gitignore.d.ts +0 -21
- package/bin/config/Gitignore.d.ts.map +0 -1
- package/bin/config/Gitignore.js +0 -46
- package/bin/config/Gitignore.js.map +0 -1
- package/bin/config/Paths.d.ts +0 -122
- package/bin/config/Paths.d.ts.map +0 -1
- package/bin/config/Paths.js +0 -183
- package/bin/config/Paths.js.map +0 -1
- package/bin/config/PlatformPaths.d.ts +0 -31
- package/bin/config/PlatformPaths.d.ts.map +0 -1
- package/bin/config/PlatformPaths.js +0 -53
- package/bin/config/PlatformPaths.js.map +0 -1
- package/bin/config/ProjectSetup.d.ts +0 -11
- package/bin/config/ProjectSetup.d.ts.map +0 -1
- package/bin/config/ProjectSetup.js +0 -32
- package/bin/config/ProjectSetup.js.map +0 -1
- package/bin/executor/messages/AssistantFileResource.d.ts +0 -63
- package/bin/executor/messages/AssistantFileResource.d.ts.map +0 -1
- package/bin/executor/messages/AssistantFileResource.js +0 -352
- package/bin/executor/messages/AssistantFileResource.js.map +0 -1
- package/bin/executor/tools/file/ReadImageToolBridge.d.ts +0 -21
- package/bin/executor/tools/file/ReadImageToolBridge.d.ts.map +0 -1
- package/bin/executor/tools/file/ReadImageToolBridge.js +0 -69
- package/bin/executor/tools/file/ReadImageToolBridge.js.map +0 -1
- package/bin/executor/tools/plugin/PluginToolBridge.d.ts +0 -19
- package/bin/executor/tools/plugin/PluginToolBridge.d.ts.map +0 -1
- package/bin/executor/tools/plugin/PluginToolBridge.js +0 -181
- package/bin/executor/tools/plugin/PluginToolBridge.js.map +0 -1
- package/bin/executor/tools/plugin/PluginToolDefinition.d.ts +0 -25
- package/bin/executor/tools/plugin/PluginToolDefinition.d.ts.map +0 -1
- package/bin/executor/tools/plugin/PluginToolDefinition.js.map +0 -1
- package/bin/executor/tools/plugin/PluginToolSchemas.d.ts.map +0 -1
- package/bin/executor/tools/plugin/PluginToolSchemas.js.map +0 -1
- package/bin/executor/tools/plugin/types/PluginTool.d.ts +0 -76
- package/bin/executor/tools/plugin/types/PluginTool.d.ts.map +0 -1
- package/bin/executor/tools/plugin/types/PluginTool.js.map +0 -1
- package/bin/executor/types/SessionExecutor.d.ts +0 -26
- package/bin/executor/types/SessionExecutor.d.ts.map +0 -1
- package/bin/executor/types/SessionExecutor.js +0 -9
- package/bin/executor/types/SessionExecutor.js.map +0 -1
- package/bin/executor/types/SessionRun.d.ts.map +0 -1
- package/bin/executor/types/SessionRun.js +0 -10
- package/bin/executor/types/SessionRun.js.map +0 -1
- package/bin/plugin/core/PluginCommand.d.ts +0 -17
- package/bin/plugin/core/PluginCommand.d.ts.map +0 -1
- package/bin/plugin/core/PluginCommand.js +0 -189
- package/bin/plugin/core/PluginCommand.js.map +0 -1
- package/bin/plugin/core/PluginCommandRequest.d.ts +0 -36
- package/bin/plugin/core/PluginCommandRequest.d.ts.map +0 -1
- package/bin/plugin/core/PluginCommandRequest.js +0 -53
- package/bin/plugin/core/PluginCommandRequest.js.map +0 -1
- package/bin/plugin/core/PluginLocalExecution.d.ts +0 -45
- package/bin/plugin/core/PluginLocalExecution.d.ts.map +0 -1
- package/bin/plugin/core/PluginLocalExecution.js +0 -115
- package/bin/plugin/core/PluginLocalExecution.js.map +0 -1
- package/bin/session/SessionTurn.d.ts +0 -84
- package/bin/session/SessionTurn.d.ts.map +0 -1
- package/bin/session/SessionTurn.js +0 -579
- package/bin/session/SessionTurn.js.map +0 -1
- package/bin/session/approval/SessionApprovalBroker.d.ts +0 -48
- package/bin/session/approval/SessionApprovalBroker.d.ts.map +0 -1
- package/bin/session/approval/SessionApprovalBroker.js +0 -126
- package/bin/session/approval/SessionApprovalBroker.js.map +0 -1
- package/bin/session/messages/JsonlSessionMessageStore.d.ts.map +0 -1
- package/bin/session/messages/JsonlSessionMessageStore.js.map +0 -1
- package/bin/session/storage/Instruction.d.ts +0 -16
- package/bin/session/storage/Instruction.d.ts.map +0 -1
- package/bin/session/storage/Instruction.js +0 -48
- package/bin/session/storage/Instruction.js.map +0 -1
- package/bin/session/storage/Paths.d.ts +0 -81
- package/bin/session/storage/Paths.d.ts.map +0 -1
- package/bin/session/storage/Paths.js +0 -112
- package/bin/session/storage/Paths.js.map +0 -1
- package/bin/types/common/EnvFile.d.ts +0 -30
- package/bin/types/common/EnvFile.d.ts.map +0 -1
- package/bin/types/common/EnvFile.js +0 -10
- package/bin/types/common/EnvFile.js.map +0 -1
- package/bin/types/config/AgentProject.d.ts +0 -73
- package/bin/types/config/AgentProject.d.ts.map +0 -1
- package/bin/types/config/AgentProject.js +0 -9
- package/bin/types/config/AgentProject.js.map +0 -1
- package/bin/types/config/DowncityConfig.d.ts +0 -145
- package/bin/types/config/DowncityConfig.d.ts.map +0 -1
- package/bin/types/config/DowncityConfig.js +0 -2
- package/bin/types/config/DowncityConfig.js.map +0 -1
- package/bin/types/config/ExecutionBinding.d.ts +0 -26
- package/bin/types/config/ExecutionBinding.d.ts.map +0 -1
- package/bin/types/config/ExecutionBinding.js +0 -10
- package/bin/types/config/ExecutionBinding.js.map +0 -1
- package/bin/types/config/LlmConfig.d.ts +0 -100
- package/bin/types/config/LlmConfig.d.ts.map +0 -1
- package/bin/types/config/LlmConfig.js +0 -10
- package/bin/types/config/LlmConfig.js.map +0 -1
- package/bin/types/executor/SessionRunContext.d.ts +0 -155
- package/bin/types/executor/SessionRunContext.d.ts.map +0 -1
- package/bin/types/executor/SessionRunContext.js +0 -10
- package/bin/types/executor/SessionRunContext.js.map +0 -1
- package/bin/types/platform/Store.d.ts +0 -191
- package/bin/types/platform/Store.d.ts.map +0 -1
- package/bin/types/platform/Store.js +0 -9
- package/bin/types/platform/Store.js.map +0 -1
- package/bin/types/plugin/PluginConfig.d.ts +0 -12
- package/bin/types/plugin/PluginConfig.d.ts.map +0 -1
- package/bin/types/plugin/PluginConfig.js +0 -5
- package/bin/types/plugin/PluginConfig.js.map +0 -1
- package/bin/types/plugin/PluginControl.d.ts +0 -74
- package/bin/types/plugin/PluginControl.d.ts.map +0 -1
- package/bin/types/plugin/PluginControl.js +0 -9
- package/bin/types/plugin/PluginControl.js.map +0 -1
- package/bin/types/plugin/PluginRunContext.d.ts +0 -26
- package/bin/types/plugin/PluginRunContext.d.ts.map +0 -1
- package/bin/types/plugin/PluginRunContext.js.map +0 -1
- package/bin/types/plugin/PluginSetup.d.ts +0 -133
- package/bin/types/plugin/PluginSetup.d.ts.map +0 -1
- package/bin/types/plugin/PluginSetup.js +0 -9
- package/bin/types/plugin/PluginSetup.js.map +0 -1
- package/bin/types/plugin/PluginToolRuntime.d.ts +0 -86
- package/bin/types/plugin/PluginToolRuntime.d.ts.map +0 -1
- package/bin/types/plugin/PluginToolRuntime.js +0 -9
- package/bin/types/plugin/PluginToolRuntime.js.map +0 -1
- package/bin/types/runtime/auth/AuthPermission.d.ts +0 -49
- package/bin/types/runtime/auth/AuthPermission.d.ts.map +0 -1
- package/bin/types/runtime/auth/AuthPermission.js +0 -87
- package/bin/types/runtime/auth/AuthPermission.js.map +0 -1
- package/bin/types/runtime/auth/AuthRoute.d.ts +0 -29
- package/bin/types/runtime/auth/AuthRoute.d.ts.map +0 -1
- package/bin/types/runtime/auth/AuthRoute.js +0 -8
- package/bin/types/runtime/auth/AuthRoute.js.map +0 -1
- package/bin/types/runtime/auth/AuthToken.d.ts +0 -46
- package/bin/types/runtime/auth/AuthToken.d.ts.map +0 -1
- package/bin/types/runtime/auth/AuthToken.js +0 -9
- package/bin/types/runtime/auth/AuthToken.js.map +0 -1
- package/bin/types/runtime/auth/AuthTypes.d.ts +0 -227
- package/bin/types/runtime/auth/AuthTypes.d.ts.map +0 -1
- package/bin/types/runtime/auth/AuthTypes.js +0 -9
- package/bin/types/runtime/auth/AuthTypes.js.map +0 -1
- package/bin/types/runtime/http/InlineInstant.d.ts +0 -82
- package/bin/types/runtime/http/InlineInstant.d.ts.map +0 -1
- package/bin/types/runtime/http/InlineInstant.js +0 -10
- package/bin/types/runtime/http/InlineInstant.js.map +0 -1
- package/bin/types/runtime/platform/Platform.d.ts +0 -362
- package/bin/types/runtime/platform/Platform.d.ts.map +0 -1
- package/bin/types/runtime/platform/Platform.js +0 -10
- package/bin/types/runtime/platform/Platform.js.map +0 -1
- package/bin/types/runtime/platform/PlatformGateway.d.ts +0 -41
- package/bin/types/runtime/platform/PlatformGateway.d.ts.map +0 -1
- package/bin/types/runtime/platform/PlatformGateway.js +0 -2
- package/bin/types/runtime/platform/PlatformGateway.js.map +0 -1
- package/bin/types/session/SessionApproval.d.ts +0 -63
- package/bin/types/session/SessionApproval.d.ts.map +0 -1
- package/bin/types/session/SessionApproval.js +0 -7
- package/bin/types/session/SessionApproval.js.map +0 -1
- package/bin/types/session/SessionApprovalBroker.d.ts +0 -17
- package/bin/types/session/SessionApprovalBroker.d.ts.map +0 -1
- package/bin/types/session/SessionApprovalBroker.js +0 -7
- package/bin/types/session/SessionApprovalBroker.js.map +0 -1
- package/bin/types/session/SessionInstruction.d.ts +0 -22
- package/bin/types/session/SessionInstruction.d.ts.map +0 -1
- package/bin/types/session/SessionInstruction.js +0 -9
- package/bin/types/session/SessionInstruction.js.map +0 -1
- package/bin/types/session/SessionQueue.d.ts +0 -88
- package/bin/types/session/SessionQueue.d.ts.map +0 -1
- package/bin/types/session/SessionQueue.js +0 -7
- package/bin/types/session/SessionQueue.js.map +0 -1
- package/bin/types/session/SessionTurn.d.ts +0 -52
- package/bin/types/session/SessionTurn.d.ts.map +0 -1
- package/bin/types/session/SessionTurn.js.map +0 -1
- package/scripts/assistant-file-resource.test.mjs +0 -344
- package/scripts/read-image-tool-bridge.test.mjs +0 -71
- package/src/agent/AgentContext.ts +0 -98
- package/src/config/AgentEnv.ts +0 -49
- package/src/config/AgentInitializer.ts +0 -167
- package/src/config/EnvFile.ts +0 -99
- package/src/config/ExecutionBinding.ts +0 -50
- package/src/config/Gitignore.ts +0 -52
- package/src/config/Paths.ts +0 -241
- package/src/config/PlatformPaths.ts +0 -57
- package/src/config/ProjectSetup.ts +0 -44
- package/src/executor/messages/AssistantFileResource.ts +0 -446
- package/src/executor/tools/file/ReadImageToolBridge.ts +0 -79
- package/src/executor/tools/plugin/PluginToolBridge.ts +0 -212
- package/src/executor/types/SessionExecutor.ts +0 -34
- package/src/plugin/core/PluginCommand.ts +0 -230
- package/src/plugin/core/PluginCommandRequest.ts +0 -93
- package/src/plugin/core/PluginLocalExecution.ts +0 -154
- package/src/session/SessionTurn.ts +0 -669
- package/src/session/approval/SessionApprovalBroker.ts +0 -164
- package/src/session/storage/Instruction.ts +0 -72
- package/src/session/storage/Paths.ts +0 -209
- package/src/types/common/EnvFile.ts +0 -31
- package/src/types/config/AgentProject.ts +0 -85
- package/src/types/config/DowncityConfig.ts +0 -153
- package/src/types/config/ExecutionBinding.ts +0 -27
- package/src/types/config/LlmConfig.ts +0 -115
- package/src/types/executor/SessionRunContext.ts +0 -191
- package/src/types/platform/Store.ts +0 -197
- package/src/types/plugin/PluginConfig.ts +0 -13
- package/src/types/plugin/PluginControl.ts +0 -80
- package/src/types/plugin/PluginRunContext.ts +0 -31
- package/src/types/plugin/PluginSetup.ts +0 -138
- package/src/types/plugin/PluginToolRuntime.ts +0 -98
- package/src/types/runtime/auth/AuthPermission.ts +0 -120
- package/src/types/runtime/auth/AuthRoute.ts +0 -31
- package/src/types/runtime/auth/AuthToken.ts +0 -47
- package/src/types/runtime/auth/AuthTypes.ts +0 -235
- package/src/types/runtime/http/InlineInstant.ts +0 -96
- package/src/types/runtime/platform/Platform.ts +0 -432
- package/src/types/runtime/platform/PlatformGateway.ts +0 -46
- package/src/types/session/SessionApproval.ts +0 -69
- package/src/types/session/SessionApprovalBroker.ts +0 -18
- package/src/types/session/SessionInstruction.ts +0 -24
- package/src/types/session/SessionQueue.ts +0 -102
- package/src/types/session/SessionTurn.ts +0 -56
- /package/bin/{executor/tools/plugin/types → types/plugin}/PluginTool.js +0 -0
|
@@ -91,7 +91,7 @@ export interface ParsedChatMessageMarkup {
|
|
|
91
91
|
* 说明(中文)
|
|
92
92
|
* - 会把多段文本按消息原始顺序合并,中间使用空行分隔。
|
|
93
93
|
*/
|
|
94
|
-
|
|
94
|
+
body_text: string;
|
|
95
95
|
/**
|
|
96
96
|
* 按出现顺序提取出的附件标签列表。
|
|
97
97
|
*/
|
|
@@ -106,39 +106,39 @@ export interface ParsedChatMessageMarkup {
|
|
|
106
106
|
*/
|
|
107
107
|
export interface ChatMessageSendOptions {
|
|
108
108
|
/**
|
|
109
|
-
* 目标
|
|
109
|
+
* 目标 chat_key。
|
|
110
110
|
*
|
|
111
111
|
* 说明(中文)
|
|
112
112
|
* - 未提供时由调用方回退到当前上下文或显式参数。
|
|
113
113
|
*/
|
|
114
|
-
|
|
114
|
+
chat_key?: string;
|
|
115
115
|
/**
|
|
116
116
|
* 延迟发送毫秒数。
|
|
117
117
|
*
|
|
118
118
|
* 说明(中文)
|
|
119
|
-
* - 由 `delay/
|
|
119
|
+
* - 由 `delay/delay_ms/delay-ms` 解析得到。
|
|
120
120
|
*/
|
|
121
|
-
|
|
121
|
+
delay_ms?: number;
|
|
122
122
|
/**
|
|
123
123
|
* 定时发送的绝对毫秒时间戳。
|
|
124
124
|
*
|
|
125
125
|
* 说明(中文)
|
|
126
|
-
* - 由 `time/sendAt/
|
|
126
|
+
* - 由 `time/sendAt/send_at_ms` 等字段解析得到。
|
|
127
127
|
*/
|
|
128
|
-
|
|
128
|
+
send_at_ms?: number;
|
|
129
129
|
/**
|
|
130
130
|
* 是否使用 reply 语义发送。
|
|
131
131
|
*
|
|
132
132
|
* 说明(中文)
|
|
133
|
-
* - 允许仅设置布尔值,也允许结合 `
|
|
133
|
+
* - 允许仅设置布尔值,也允许结合 `message_id` 一起使用。
|
|
134
134
|
*/
|
|
135
|
-
|
|
135
|
+
reply_to_message?: boolean;
|
|
136
136
|
/**
|
|
137
137
|
* 可选目标消息 ID。
|
|
138
138
|
*
|
|
139
139
|
* 说明(中文)
|
|
140
140
|
* - 当前主要用于 Telegram/Feishu reply 场景。
|
|
141
141
|
*/
|
|
142
|
-
|
|
142
|
+
message_id?: string;
|
|
143
143
|
}
|
|
144
144
|
//# sourceMappingURL=ChatMessageMarkupTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatMessageMarkupTypes.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/ChatMessageMarkupTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC;;;;;OAKG;IACH,
|
|
1
|
+
{"version":3,"file":"ChatMessageMarkupTypes.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/ChatMessageMarkupTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,OAAO,GACP,OAAO,GACP,OAAO,GACP,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,IAAI,EAAE,mBAAmB,CAAC;IAE1B;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAC1B,sBAAsB,GACtB,sBAAsB,CAAC;AAE3B;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAElC;;;;;OAKG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,KAAK,EAAE,kBAAkB,EAAE,CAAC;IAE5B;;OAEG;IACH,QAAQ,EAAE,kBAAkB,EAAE,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -17,17 +17,17 @@ import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords
|
|
|
17
17
|
* - 已经是 data URL 或远程 URL 的附件保持原样。
|
|
18
18
|
* - 本地文件读取失败时直接报错,避免模型请求拿到不可访问的本地路径。
|
|
19
19
|
*/
|
|
20
|
-
export declare function
|
|
20
|
+
export declare function hydrate_user_prompt_file_parts(parts: SessionUserMessagePart[], project_root?: string): Promise<SessionUserMessagePart[]>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* 将历史中的本地 file part 临时转换为模型可消费的 data URL。
|
|
23
23
|
*
|
|
24
24
|
* 关键点(中文)
|
|
25
25
|
* - 该函数只修改本轮内存消息,不回写历史。
|
|
26
26
|
* - 新历史保留 Agent 根目录相对路径,旧历史的 `file://` 仍继续兼容。
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function hydrate_file_url_parts_for_model(messages: SessionMessageRecordV1[], project_root?: string): Promise<SessionMessageRecordV1[]>;
|
|
29
29
|
/**
|
|
30
30
|
* 在 user 消息上注入 FileUIPart,以便多模态模型直接消费本地附件。
|
|
31
31
|
*/
|
|
32
|
-
export declare function
|
|
32
|
+
export declare function inject_file_parts_from_attachments(messages: SessionMessageRecordV1[], project_root?: string): Promise<SessionMessageRecordV1[]>;
|
|
33
33
|
//# sourceMappingURL=SessionAttachmentMapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionAttachmentMapper.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionAttachmentMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AA+G5C;;;;;;;GAOG;AACH,wBAAsB,
|
|
1
|
+
{"version":3,"file":"SessionAttachmentMapper.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionAttachmentMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAUH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAEV,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AA+G5C;;;;;;;GAOG;AACH,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,sBAAsB,EAAE,EAC/B,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAsBnC;AAED;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,sBAAsB,EAAE,EAClC,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CA2BnC;AAED;;GAEG;AACH,wBAAsB,kCAAkC,CACtD,QAAQ,EAAE,sBAAsB,EAAE,EAClC,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAsFnC"}
|
|
@@ -11,7 +11,7 @@ import fs from "fs-extra";
|
|
|
11
11
|
import path from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
import { isFileUIPart, isTextUIPart, } from "ai";
|
|
14
|
-
import {
|
|
14
|
+
import { parse_chat_message_markup } from "../../executor/messages/ChatMessageMarkup.js";
|
|
15
15
|
/**
|
|
16
16
|
* 从 `<file>` 标签中解析附件描述。
|
|
17
17
|
*/
|
|
@@ -19,7 +19,7 @@ function parseAttachmentLinesFromText(text) {
|
|
|
19
19
|
const raw = String(text || "");
|
|
20
20
|
if (!raw.trim())
|
|
21
21
|
return [];
|
|
22
|
-
return
|
|
22
|
+
return parse_chat_message_markup(raw).files.map((file) => ({
|
|
23
23
|
type: file.type,
|
|
24
24
|
path: file.path,
|
|
25
25
|
...(typeof file.caption === "string" && file.caption.trim()
|
|
@@ -64,7 +64,7 @@ function buildDataUrl(mediaType, buffer) {
|
|
|
64
64
|
const safeType = mediaType || "application/octet-stream";
|
|
65
65
|
return `data:${safeType};base64,${base64}`;
|
|
66
66
|
}
|
|
67
|
-
function resolveHydratableFilePath(
|
|
67
|
+
function resolveHydratableFilePath(project_root, rawPath) {
|
|
68
68
|
const raw = String(rawPath || "").trim();
|
|
69
69
|
if (!raw || raw.startsWith("data:") || /^https?:\/\//i.test(raw))
|
|
70
70
|
return null;
|
|
@@ -72,16 +72,16 @@ function resolveHydratableFilePath(projectRoot, rawPath) {
|
|
|
72
72
|
return fileURLToPath(raw);
|
|
73
73
|
if (path.isAbsolute(raw))
|
|
74
74
|
return path.resolve(raw);
|
|
75
|
-
const root = path.resolve(String(
|
|
75
|
+
const root = path.resolve(String(project_root || "").trim() || process.cwd());
|
|
76
76
|
const absPath = path.resolve(root, raw);
|
|
77
77
|
const rel = path.relative(root, absPath);
|
|
78
78
|
if (rel === "" || rel.startsWith("..") || path.isAbsolute(rel))
|
|
79
79
|
return null;
|
|
80
80
|
return absPath;
|
|
81
81
|
}
|
|
82
|
-
async function hydrateFileUrlPart(part,
|
|
82
|
+
async function hydrateFileUrlPart(part, project_root) {
|
|
83
83
|
const url = String(part.url || "").trim();
|
|
84
|
-
const filePath = resolveHydratableFilePath(
|
|
84
|
+
const filePath = resolveHydratableFilePath(project_root, url);
|
|
85
85
|
if (!filePath)
|
|
86
86
|
return part;
|
|
87
87
|
try {
|
|
@@ -128,7 +128,7 @@ async function hydrateFileUrlPartStrict(part, project_root) {
|
|
|
128
128
|
* - 已经是 data URL 或远程 URL 的附件保持原样。
|
|
129
129
|
* - 本地文件读取失败时直接报错,避免模型请求拿到不可访问的本地路径。
|
|
130
130
|
*/
|
|
131
|
-
export async function
|
|
131
|
+
export async function hydrate_user_prompt_file_parts(parts, project_root) {
|
|
132
132
|
if (!Array.isArray(parts) || parts.length === 0)
|
|
133
133
|
return [];
|
|
134
134
|
const out = [];
|
|
@@ -149,13 +149,13 @@ export async function hydrateUserPromptFileParts(parts, project_root) {
|
|
|
149
149
|
return out;
|
|
150
150
|
}
|
|
151
151
|
/**
|
|
152
|
-
*
|
|
152
|
+
* 将历史中的本地 file part 临时转换为模型可消费的 data URL。
|
|
153
153
|
*
|
|
154
154
|
* 关键点(中文)
|
|
155
155
|
* - 该函数只修改本轮内存消息,不回写历史。
|
|
156
156
|
* - 新历史保留 Agent 根目录相对路径,旧历史的 `file://` 仍继续兼容。
|
|
157
157
|
*/
|
|
158
|
-
export async function
|
|
158
|
+
export async function hydrate_file_url_parts_for_model(messages, project_root) {
|
|
159
159
|
if (!Array.isArray(messages) || messages.length === 0)
|
|
160
160
|
return messages;
|
|
161
161
|
const out = [];
|
|
@@ -172,7 +172,7 @@ export async function hydrateFileUrlPartsForModel(messages, projectRoot) {
|
|
|
172
172
|
nextParts.push(part);
|
|
173
173
|
continue;
|
|
174
174
|
}
|
|
175
|
-
const nextPart = await hydrateFileUrlPart(part,
|
|
175
|
+
const nextPart = await hydrateFileUrlPart(part, project_root);
|
|
176
176
|
if (nextPart !== part)
|
|
177
177
|
changed = true;
|
|
178
178
|
nextParts.push(nextPart);
|
|
@@ -184,10 +184,10 @@ export async function hydrateFileUrlPartsForModel(messages, projectRoot) {
|
|
|
184
184
|
/**
|
|
185
185
|
* 在 user 消息上注入 FileUIPart,以便多模态模型直接消费本地附件。
|
|
186
186
|
*/
|
|
187
|
-
export async function
|
|
187
|
+
export async function inject_file_parts_from_attachments(messages, project_root) {
|
|
188
188
|
if (!Array.isArray(messages) || messages.length === 0)
|
|
189
189
|
return messages;
|
|
190
|
-
const root = path.resolve(String(
|
|
190
|
+
const root = path.resolve(String(project_root || "").trim() || process.cwd());
|
|
191
191
|
const out = [];
|
|
192
192
|
for (const message of messages) {
|
|
193
193
|
if (!message || typeof message !== "object" || message.role !== "user") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionAttachmentMapper.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionAttachmentMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,YAAY,GAEb,MAAM,IAAI,CAAC;AAMZ,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionAttachmentMapper.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionAttachmentMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,YAAY,GAEb,MAAM,IAAI,CAAC;AAMZ,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAErF;;GAEG;AACH,SAAS,4BAA4B,CAAC,IAAY;IAKhD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;IAC/B,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,CAAC;IAC3B,OAAO,yBAAyB,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,E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BAC1C,MAAM,OAAO,GAAG,YAAY,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;gBACrD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC;gBAEnD,SAAS,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,MAAM;oBACZ,SAAS,EAAE,cAAc;oBACzB,QAAQ;oBACR,GAAG,EAAE,OAAO;iBACb,CAAC,CAAC;YACL,CAAC;YAAC,MAAM,CAAC;gBACP,SAAS;YACX,CAAC;QACH,CAAC;QAED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAClB,SAAS;QACX,CAAC;QAED,GAAG,CAAC,IAAI,CAAC;YACP,GAAG,OAAO;YACV,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,GAAG,SAAS,CAAC;SAChC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
import { type ModelMessage, type Tool } from "ai";
|
|
10
10
|
import { type SessionRecordV1 } from "../../executor/types/SessionRecords.js";
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* 过滤 Step 检查点返回的有效 User 消息。
|
|
13
13
|
*
|
|
14
14
|
* 关键点(中文)
|
|
15
|
-
* -
|
|
15
|
+
* - 用途:从运行期注入与 Session Queue 中挑出可并入推理上下文的 User 消息。
|
|
16
16
|
* - 输入:任意 SessionRecordV1[](可能混有 assistant/tool/action/空消息)。
|
|
17
|
-
* -
|
|
17
|
+
* - 输出:包含非空文本或任意其他 UI Part 的 User 消息数组。
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function pick_merged_user_messages(messages: SessionRecordV1[]): SessionRecordV1[];
|
|
20
20
|
/**
|
|
21
21
|
* 将 context 消息转换为模型消息。
|
|
22
22
|
*
|
|
@@ -25,5 +25,5 @@ export declare function pickMergedUserMessages(messages: SessionRecordV1[]): Ses
|
|
|
25
25
|
* - 输入:context 消息数组 + 可用工具集合。
|
|
26
26
|
* - 输出:可直接喂给 streamText 的 messages。
|
|
27
27
|
*/
|
|
28
|
-
export declare function
|
|
28
|
+
export declare function to_model_messages(messages: SessionRecordV1[], tools: Record<string, Tool>, project_root?: string): Promise<ModelMessage[]>;
|
|
29
29
|
//# sourceMappingURL=SessionMessageCodec.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageCodec.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"SessionMessageCodec.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,IAAI,EAEV,MAAM,IAAI,CAAC;AACZ,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,oCAAoC,CAAC;AAM5C;;;;;;;GAOG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,eAAe,EAAE,GAC1B,eAAe,EAAE,CAoBnB;AAED;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,eAAe,EAAE,EAC3B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,EAC3B,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,YAAY,EAAE,CAAC,CAoCzB"}
|
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
* - 附件注入下沉到 `SessionAttachmentMapper`。
|
|
7
7
|
* - 日志提取与输出下沉到 `SessionMessageLog`。
|
|
8
8
|
*/
|
|
9
|
-
import { convertToModelMessages,
|
|
9
|
+
import { convertToModelMessages, } from "ai";
|
|
10
10
|
import { is_session_message_record, } from "../../executor/types/SessionRecords.js";
|
|
11
|
-
import {
|
|
11
|
+
import { hydrate_file_url_parts_for_model, inject_file_parts_from_attachments, } from "../messages/SessionAttachmentMapper.js";
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* 过滤 Step 检查点返回的有效 User 消息。
|
|
14
14
|
*
|
|
15
15
|
* 关键点(中文)
|
|
16
|
-
* -
|
|
16
|
+
* - 用途:从运行期注入与 Session Queue 中挑出可并入推理上下文的 User 消息。
|
|
17
17
|
* - 输入:任意 SessionRecordV1[](可能混有 assistant/tool/action/空消息)。
|
|
18
|
-
* -
|
|
18
|
+
* - 输出:包含非空文本或任意其他 UI Part 的 User 消息数组。
|
|
19
19
|
*/
|
|
20
|
-
export function
|
|
20
|
+
export function pick_merged_user_messages(messages) {
|
|
21
21
|
// 如果不是数组,直接返回空数组,避免后续 filter 报错。
|
|
22
22
|
if (!Array.isArray(messages))
|
|
23
23
|
return [];
|
|
@@ -32,18 +32,8 @@ export function pickMergedUserMessages(messages) {
|
|
|
32
32
|
// 防御 3:parts 必须是数组。
|
|
33
33
|
if (!Array.isArray(message.parts))
|
|
34
34
|
return false;
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
// 只保留 text 类型 part。
|
|
38
|
-
.filter(isTextUIPart)
|
|
39
|
-
// 提取 text 字段并规整为字符串。
|
|
40
|
-
.map((part) => String(part.text ?? ""))
|
|
41
|
-
// 多段文本按换行拼接。
|
|
42
|
-
.join("\n")
|
|
43
|
-
// 去除首尾空白。
|
|
44
|
-
.trim();
|
|
45
|
-
// 只有非空文本才视为有效消息。
|
|
46
|
-
return Boolean(text);
|
|
35
|
+
// 空文本不单独构成输入;File、Data 等非文本 Part 本身就是有效内容。
|
|
36
|
+
return message.parts.some((part) => part.type !== "text" || String(part.text ?? "").trim().length > 0);
|
|
47
37
|
});
|
|
48
38
|
}
|
|
49
39
|
/**
|
|
@@ -54,7 +44,7 @@ export function pickMergedUserMessages(messages) {
|
|
|
54
44
|
* - 输入:context 消息数组 + 可用工具集合。
|
|
55
45
|
* - 输出:可直接喂给 streamText 的 messages。
|
|
56
46
|
*/
|
|
57
|
-
export async function
|
|
47
|
+
export async function to_model_messages(messages, tools, project_root) {
|
|
58
48
|
// 空输入快速返回,避免调用转换器的额外开销。
|
|
59
49
|
if (!Array.isArray(messages) || messages.length === 0)
|
|
60
50
|
return [];
|
|
@@ -63,9 +53,9 @@ export async function toModelMessages(messages, tools, projectRoot) {
|
|
|
63
53
|
if (model_messages.length === 0)
|
|
64
54
|
return [];
|
|
65
55
|
// 第一步(中文):在 user 消息上注入 file parts(多模态附件)。
|
|
66
|
-
const enrichedMessages = await
|
|
67
|
-
//
|
|
68
|
-
const hydratedMessages = await
|
|
56
|
+
const enrichedMessages = await inject_file_parts_from_attachments(model_messages, project_root);
|
|
57
|
+
// 第二步(中文):把历史里的本地文件 URL 在内存中 hydrate 成模型可消费的 data URL。
|
|
58
|
+
const hydratedMessages = await hydrate_file_url_parts_for_model(enrichedMessages, project_root);
|
|
69
59
|
// 第三步(中文):转换前先剔除 UI 层 id 字段,仅保留模型需要的数据结构。
|
|
70
60
|
const input = hydratedMessages.map((message) => {
|
|
71
61
|
// 解构去掉 id。
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageCodec.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,
|
|
1
|
+
{"version":3,"file":"SessionMessageCodec.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EACL,sBAAsB,GAIvB,MAAM,IAAI,CAAC;AACZ,OAAO,EACL,yBAAyB,GAE1B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,gCAAgC,EAChC,kCAAkC,GACnC,MAAM,+CAA+C,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,UA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BAAgB,GAAG,MAAM,gCAAgC,CAC7D,gBAAgB,EAChB,YAAY,CACb,CAAC;IAEF,0CAA0C;IAC1C,MAAM,KAAK,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7C,WAAW;QACX,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC;QAErC,UAAU;QACV,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,mBAAmB;IACnB,OAAO,MAAM,sBAAsB,CAAC,KAAK,EAAE;QACzC,uBAAuB;QACvB,GAAG,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,KAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,uBAAuB;QACvB,yBAAyB,EAAE,IAAI;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -11,9 +11,9 @@ import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords
|
|
|
11
11
|
/**
|
|
12
12
|
* 从 UI message 中提取 assistant 文本部分。
|
|
13
13
|
*/
|
|
14
|
-
export declare function
|
|
14
|
+
export declare function extract_assistant_text_for_log(message: SessionMessageRecordV1): string;
|
|
15
15
|
/**
|
|
16
16
|
* 立即输出 assistant 文本日志。
|
|
17
17
|
*/
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function log_assistant_message_now(logger: Logger, message: SessionMessageRecordV1): Promise<void>;
|
|
19
19
|
//# sourceMappingURL=SessionMessageLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageLog.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageLog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEjF;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"SessionMessageLog.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageLog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAEjF;;GAEG;AACH,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,sBAAsB,GAC9B,MAAM,CAOR;AAED;;GAEG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAOf"}
|
|
@@ -10,7 +10,7 @@ import { isTextUIPart } from "ai";
|
|
|
10
10
|
/**
|
|
11
11
|
* 从 UI message 中提取 assistant 文本部分。
|
|
12
12
|
*/
|
|
13
|
-
export function
|
|
13
|
+
export function extract_assistant_text_for_log(message) {
|
|
14
14
|
if (!Array.isArray(message.parts))
|
|
15
15
|
return "";
|
|
16
16
|
return message.parts
|
|
@@ -22,8 +22,8 @@ export function extractAssistantTextForLog(message) {
|
|
|
22
22
|
/**
|
|
23
23
|
* 立即输出 assistant 文本日志。
|
|
24
24
|
*/
|
|
25
|
-
export async function
|
|
26
|
-
const text =
|
|
25
|
+
export async function log_assistant_message_now(logger, message) {
|
|
26
|
+
const text = extract_assistant_text_for_log(message) || "-";
|
|
27
27
|
const normalized = text.replace(/\r\n/g, "\n");
|
|
28
28
|
const lines = normalized.split("\n");
|
|
29
29
|
const out = [`[assistant] ${lines[0] || "-"}`];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageLog.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionMessageLog.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAA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8,11 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords.js";
|
|
10
10
|
/**
|
|
11
|
-
* 从
|
|
11
|
+
* 从 step_result 提取按顺序写入同一条 assistant message 的 parts。
|
|
12
12
|
*/
|
|
13
|
-
export declare function
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
export declare function build_session_step_parts(params: {
|
|
14
|
+
step_index: number;
|
|
15
|
+
step_result?: unknown;
|
|
16
16
|
text: string;
|
|
17
17
|
visibility?: "visible" | "internal";
|
|
18
18
|
}): SessionMessageRecordV1["parts"];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStepEventMapper.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionStepEventMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAiGjF;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"SessionStepEventMapper.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/SessionStepEventMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAiGjF;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE;IAC/C,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;CACrC,GAAG,sBAAsB,CAAC,OAAO,CAAC,CA4ElC"}
|
|
@@ -15,14 +15,14 @@ function resolveToolName(value) {
|
|
|
15
15
|
const record = toRecord(value);
|
|
16
16
|
if (!record)
|
|
17
17
|
return "";
|
|
18
|
-
const
|
|
18
|
+
const tool_name = typeof record.toolName === "string"
|
|
19
19
|
? record.toolName
|
|
20
20
|
: typeof record.tool === "string"
|
|
21
21
|
? record.tool
|
|
22
22
|
: typeof record.name === "string"
|
|
23
23
|
? record.name
|
|
24
24
|
: "";
|
|
25
|
-
return String(
|
|
25
|
+
return String(tool_name || "").trim();
|
|
26
26
|
}
|
|
27
27
|
function resolveToolCallId(value) {
|
|
28
28
|
const record = toRecord(value);
|
|
@@ -105,11 +105,11 @@ function toDataPartType(type) {
|
|
|
105
105
|
return `data-acp-${type.replace(/_/g, "-")}`;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
-
* 从
|
|
108
|
+
* 从 step_result 提取按顺序写入同一条 assistant message 的 parts。
|
|
109
109
|
*/
|
|
110
|
-
export function
|
|
110
|
+
export function build_session_step_parts(params) {
|
|
111
111
|
const out = [];
|
|
112
|
-
const stepRecord = toRecord(params.
|
|
112
|
+
const stepRecord = toRecord(params.step_result) || {};
|
|
113
113
|
const toolCalls = Array.isArray(stepRecord.toolCalls) ? stepRecord.toolCalls : [];
|
|
114
114
|
const toolResults = Array.isArray(stepRecord.toolResults)
|
|
115
115
|
? stepRecord.toolResults
|
|
@@ -139,7 +139,7 @@ export function buildSessionStepParts(params) {
|
|
|
139
139
|
}
|
|
140
140
|
for (let index = 0; index < toolCalls.length; index += 1) {
|
|
141
141
|
const toolCall = toolCalls[index];
|
|
142
|
-
const
|
|
142
|
+
const tool_name = resolveToolName(toolCall) || "unknown_tool";
|
|
143
143
|
const toolCallId = resolveToolCallId(toolCall);
|
|
144
144
|
const input = resolveToolCallInput(toolCall);
|
|
145
145
|
const toolResult = toolCallId ? toolResultsByCallId.get(toolCallId) : undefined;
|
|
@@ -148,7 +148,7 @@ export function buildSessionStepParts(params) {
|
|
|
148
148
|
const output = resolveToolResultPayload(toolResult);
|
|
149
149
|
const errorText = resolveToolResultErrorText(toolResult);
|
|
150
150
|
out.push({
|
|
151
|
-
type: `tool-${
|
|
151
|
+
type: `tool-${tool_name}`,
|
|
152
152
|
...(toolCallId ? { toolCallId } : {}),
|
|
153
153
|
...(input !== undefined ? { input } : {}),
|
|
154
154
|
...(errorText
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionStepEventMapper.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionStepEventMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,
|
|
1
|
+
{"version":3,"file":"SessionStepEventMapper.js","sourceRoot":"","sources":["../../../src/executor/messages/SessionStepEventMapper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,SAAS,QAAQ,CAAC,KAAc;IAC9B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7E,OAAO,KAAsB,CAAC;AAChC,CAAC;AAED,SAAS,eAAe,CAAC,KAAc;IACrC,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IACvB,MAAM,SAAS,GACb,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ;QACjC,CAAC,CAAC,MAAM,CAAC,QAAQ;QACjB,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;YAC/B,CAAC,CAAC,MAAM,CAAC,IAAI;YACb,CAAC,CAAC,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;gBAC/B,CAAC,CAAC,M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M,MAAM,GAAG,wBAAwB,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,SAAS,GAAG,0BAA0B,CAAC,UAAU,CAAC,CAAC;QACzD,GAAG,CAAC,IAAI,CACN;YACE,IAAI,EAAE,QAAQ,SAAS,EAAE;YACzB,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACrC,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,GAAG,CAAC,SAAS;gBACX,CAAC,CAAC;oBACE,KAAK,EAAE,cAAc;oBACrB,SAAS;iBACV;gBACH,CAAC,CAAC;oBACE,KAAK,EAAE,kBAAkB;oBACzB,MAAM;iBACP,CAAC;SACoC,CAC7C,CAAC;IACJ,CAAC;IAED,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACzD,MAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAClC,MAAM,IAAI,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;QAC3C,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,GAAG,CAAC,IAAI,CACN;YACE,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;YAC1B,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC;SACO,CAC7C,CAAC;IACJ,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -16,14 +16,14 @@ type ToolCallSummary = {
|
|
|
16
16
|
/**
|
|
17
17
|
* 从 parts 数组中提取纯文本。
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function extract_text_from_parts(parts: SessionUserMessagePart[] | null | undefined): string;
|
|
20
20
|
/**
|
|
21
21
|
* 从 UIMessage 中提取纯文本。
|
|
22
22
|
*/
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function extract_text_from_ui_message(message: UIMessage | null | undefined): string;
|
|
24
24
|
/**
|
|
25
25
|
* 从 UIMessage 中提取 tool 调用记录。
|
|
26
26
|
*/
|
|
27
|
-
export declare function
|
|
27
|
+
export declare function extract_tool_calls_from_ui_message(message: UIMessage | null | undefined): ToolCallSummary[];
|
|
28
28
|
export {};
|
|
29
29
|
//# sourceMappingURL=UIMessageTransformer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIMessageTransformer.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/UIMessageTransformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,wBAAwB,CAAC;AAGpE,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwEF;;GAEG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"UIMessageTransformer.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/UIMessageTransformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AACZ,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,wBAAwB,CAAC;AAGpE,KAAK,eAAe,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAwEF;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,sBAAsB,EAAE,GAAG,IAAI,GAAG,SAAS,GACjD,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GACpC,MAAM,CAOR;AAED;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,SAAS,GAAG,IAAI,GAAG,SAAS,GACpC,eAAe,EAAE,CAwBnB"}
|
|
@@ -66,7 +66,7 @@ function extractToolOutput(part) {
|
|
|
66
66
|
/**
|
|
67
67
|
* 从 parts 数组中提取纯文本。
|
|
68
68
|
*/
|
|
69
|
-
export function
|
|
69
|
+
export function extract_text_from_parts(parts) {
|
|
70
70
|
if (!Array.isArray(parts))
|
|
71
71
|
return "";
|
|
72
72
|
return parts
|
|
@@ -78,7 +78,7 @@ export function extractTextFromParts(parts) {
|
|
|
78
78
|
/**
|
|
79
79
|
* 从 UIMessage 中提取纯文本。
|
|
80
80
|
*/
|
|
81
|
-
export function
|
|
81
|
+
export function extract_text_from_ui_message(message) {
|
|
82
82
|
const parts = toUiParts(message);
|
|
83
83
|
return parts
|
|
84
84
|
.filter(isTextUIPart)
|
|
@@ -89,7 +89,7 @@ export function extractTextFromUiMessage(message) {
|
|
|
89
89
|
/**
|
|
90
90
|
* 从 UIMessage 中提取 tool 调用记录。
|
|
91
91
|
*/
|
|
92
|
-
export function
|
|
92
|
+
export function extract_tool_calls_from_ui_message(message) {
|
|
93
93
|
const parts = toUiParts(message);
|
|
94
94
|
const out = [];
|
|
95
95
|
for (const part of parts) {
|
|
@@ -97,14 +97,14 @@ export function extractToolCallsFromUiMessage(message) {
|
|
|
97
97
|
const toolUiPart = isToolUIPart(part) ? part : null;
|
|
98
98
|
if (!toolUiPart)
|
|
99
99
|
continue;
|
|
100
|
-
const
|
|
101
|
-
if (!
|
|
100
|
+
const tool_name = resolveToolName(partObject, tryReadAiToolName(part));
|
|
101
|
+
if (!tool_name)
|
|
102
102
|
continue;
|
|
103
103
|
const rawInput = part.input;
|
|
104
104
|
const input = toToolInput(rawInput);
|
|
105
105
|
const output = extractToolOutput(partObject);
|
|
106
106
|
out.push({
|
|
107
|
-
tool:
|
|
107
|
+
tool: tool_name,
|
|
108
108
|
input,
|
|
109
109
|
output,
|
|
110
110
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UIMessageTransformer.js","sourceRoot":"","sources":["../../../src/executor/messages/UIMessageTransformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,GAEb,MAAM,IAAI,CAAC;AAuBZ,SAAS,SAAS,CAAC,OAAqC;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAqC;IAC/D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAc,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,QAAwC;IAC3D,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,UAAU,IAAI,OAAO,UAAU,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QA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AAa,EAAE,MAAM,EAAE,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE;gBACzD,CAAC,CAAC,SAAS,CAAC;IACpB,IAAI,SAAS,KAAK,SAAS;QAAE,OAAO,EAAE,CAAC;IACvC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,SAAS,CAAC,CAAC;IAC3B,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"UIMessageTransformer.js","sourceRoot":"","sources":["../../../src/executor/messages/UIMessageTransformer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,WAAW,EACX,YAAY,EACZ,YAAY,GAEb,MAAM,IAAI,CAAC;AAuBZ,SAAS,SAAS,CAAC,OAAqC;IACtD,OAAO,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5D,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAqC;IAC/D,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;IACrC,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QACzF,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAc,CAAC;IACxD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,QAAwC;IAC3D,MAAM,UAAU,G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jC,MAAM,GAAG,GAAsB,EAAE,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,IAA2B,CAAC;QAC/C,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACpD,IAAI,CAAC,UAAU;YAAE,SAAS;QAE1B,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC;QACvE,IAAI,CAAC,SAAS;YAAE,SAAS;QAEzB,MAAM,QAAQ,GAAI,IAA8B,CAAC,KAAK,CAAC;QACvD,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;QACpC,MAAM,MAAM,GAAG,iBAAiB,CAAC,UAAU,CAAC,CAAC;QAE7C,GAAG,CAAC,IAAI,CAAC;YACP,IAAI,EAAE,SAAS;YACf,KAAK;YACL,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -14,7 +14,7 @@ import { type SessionRecordV1, type SessionMessageRecordV1 } from "../../executo
|
|
|
14
14
|
* - session 正式历史应尽量保留 AI SDK 最终 assistant UIMessage。
|
|
15
15
|
* - 运行中 step/tool 的中断恢复由 inflight 快照承担,不再通过跳过最终 message 收口。
|
|
16
16
|
*/
|
|
17
|
-
export declare function
|
|
17
|
+
export declare function resolve_assistant_message_for_persistence(message: SessionRecordV1 | null | undefined): SessionMessageRecordV1 | null;
|
|
18
18
|
/**
|
|
19
19
|
* 提取策略(中文)
|
|
20
20
|
* - 倒序扫描:优先使用最后一次 `chat_send`,与最终用户感知一致。
|
|
@@ -22,5 +22,5 @@ export declare function resolveAssistantMessageForPersistence(message: SessionRe
|
|
|
22
22
|
* - 若 tool output 为空/非 JSON,走 best-effort 采用 input.text。
|
|
23
23
|
* - 若无 tool call,则回退到 message 文本内容。
|
|
24
24
|
*/
|
|
25
|
-
export declare function
|
|
25
|
+
export declare function pick_last_successful_chat_send_text(message: SessionRecordV1 | null | undefined): string;
|
|
26
26
|
//# sourceMappingURL=UserVisibleText.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserVisibleText.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/UserVisibleText.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAM5C;;;;;;GAMG;AACH,wBAAgB,
|
|
1
|
+
{"version":3,"file":"UserVisibleText.d.ts","sourceRoot":"","sources":["../../../src/executor/messages/UserVisibleText.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAM5C;;;;;;GAMG;AACH,wBAAgB,yCAAyC,CACvD,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC1C,sBAAsB,GAAG,IAAI,CAI/B;AAED;;;;;;GAMG;AACH,wBAAgB,mCAAmC,CACjD,OAAO,EAAE,eAAe,GAAG,IAAI,GAAG,SAAS,GAC1C,MAAM,CA+BR"}
|