@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
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
* - RemoteAgent 与 Session 数据结构拆到独立类型文件。
|
|
7
7
|
*/
|
|
8
8
|
import type { Tool } from "ai";
|
|
9
|
-
import type { Shell } from "@downcity/shell";
|
|
10
9
|
import type { AgentModel } from "../../agent/AgentModel.js";
|
|
10
|
+
import type { Workspace } from "../../workspace/Workspace.js";
|
|
11
11
|
import type { Plugin } from "../../types/plugin/PluginDefinition.js";
|
|
12
12
|
import type { AgentManagedSession, SessionOptions } from "../../types/session/SessionOptions.js";
|
|
13
13
|
/**
|
|
14
14
|
* Agent 可使用的 Session 类。
|
|
15
15
|
*
|
|
16
16
|
* 关键点(中文)
|
|
17
|
-
* - 传 class,而不是传实例,保证 Agent 可以按
|
|
17
|
+
* - 传 class,而不是传实例,保证 Agent 可以按 session_id 创建多个 session。
|
|
18
18
|
* - 自定义类可继承默认 `Session`,并在构造函数里注入自己的 Composer。
|
|
19
19
|
*/
|
|
20
20
|
export type AgentSessionConstructor = new (options: SessionOptions) => AgentManagedSession;
|
|
@@ -26,28 +26,27 @@ export interface AgentOptions {
|
|
|
26
26
|
* 当前 agent 的稳定标识。
|
|
27
27
|
*
|
|
28
28
|
* 关键点(中文)
|
|
29
|
-
* - 用于 `.downcity/agents/<
|
|
29
|
+
* - 用于 `.downcity/agents/<agent_id>/...` 目录分区。
|
|
30
30
|
* - 应保持稳定、可 URL 编码、尽量不要依赖展示名称。
|
|
31
31
|
*/
|
|
32
32
|
id: string;
|
|
33
|
-
/** 当前 agent 绑定的项目根目录。 */
|
|
34
|
-
path: string;
|
|
35
33
|
/**
|
|
36
|
-
* 当前
|
|
34
|
+
* 当前 Agent 可以访问的项目资源与安全边界。
|
|
37
35
|
*
|
|
38
36
|
* 关键点(中文)
|
|
39
|
-
* -
|
|
40
|
-
* -
|
|
37
|
+
* - Workspace 统一持有项目根目录、文件/搜索能力与可选 Shell。
|
|
38
|
+
* - 每个 Workspace 实例只能绑定一个 Agent,并由 Agent dispose 统一释放。
|
|
39
|
+
* - 多个 Agent 可以指向同一物理目录,但必须分别创建 Workspace 实例。
|
|
41
40
|
*/
|
|
42
|
-
|
|
41
|
+
workspace: Workspace;
|
|
43
42
|
/**
|
|
44
|
-
* 当前 agent
|
|
43
|
+
* 当前 agent 默认可用的工具集合。
|
|
45
44
|
*
|
|
46
45
|
* 关键点(中文)
|
|
47
|
-
* -
|
|
48
|
-
* -
|
|
46
|
+
* - tools 归属于 agent 级,而不是 session 级。
|
|
47
|
+
* - session 运行时会直接复用这份工具集合。
|
|
49
48
|
*/
|
|
50
|
-
|
|
49
|
+
tools?: Record<string, Tool>;
|
|
51
50
|
/**
|
|
52
51
|
* 调用方显式传入的静态基础指令。
|
|
53
52
|
*
|
|
@@ -83,15 +82,6 @@ export interface AgentOptions {
|
|
|
83
82
|
* - 如果需要自定义 Composer,请在自定义 Session 类内部传给 `super({ composer })`。
|
|
84
83
|
* - 该能力仅适用于本地 `Agent`。
|
|
85
84
|
*/
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 当前 agent 的显式环境变量覆盖项。
|
|
89
|
-
*
|
|
90
|
-
* 关键点(中文)
|
|
91
|
-
* - 这里表示宿主显式注入给 agent 的基础 env。
|
|
92
|
-
* - `Agent` 会在这份基础 env 之上继续叠加项目 `.env`。
|
|
93
|
-
* - 覆盖后的最终值会成为 Agent 运行时 env,但不会回写到宿主环境。
|
|
94
|
-
*/
|
|
95
|
-
env?: Record<string, string>;
|
|
85
|
+
session_class?: AgentSessionConstructor;
|
|
96
86
|
}
|
|
97
87
|
//# sourceMappingURL=AgentOptions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentOptions.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentOptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AgentOptions.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentOptions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,mCAAmC,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,KACpC,OAAO,EAAE,cAAc,KACpB,mBAAmB,CAAC;AAEzB;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;OAOG;IACH,SAAS,EAAE,SAAS,CAAC;IAErB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAE7B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAEhC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;;;;;OAQG;IACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,uBAAuB,CAAC;CAEzC"}
|
|
@@ -2,27 +2,18 @@
|
|
|
2
2
|
* AgentState 内部装配参数。
|
|
3
3
|
*
|
|
4
4
|
* 职责说明(中文)
|
|
5
|
-
* - 只描述 AgentState
|
|
6
|
-
* -
|
|
5
|
+
* - 只描述 AgentState 启动 PluginRegistry 长期运行时所需的稳定引用。
|
|
6
|
+
* - 工具注册与 Session 同步由 Agent 负责,AgentState 只负责生命周期。
|
|
7
7
|
*/
|
|
8
|
-
import type { Tool } from "ai";
|
|
9
|
-
import type { Shell } from "@downcity/shell";
|
|
10
|
-
import type { AgentSessions } from "../../agent/AgentSessions.js";
|
|
11
8
|
import type { PluginRegistry } from "../../plugin/core/PluginRegistry.js";
|
|
12
|
-
import type {
|
|
9
|
+
import type { PluginContext } from "../../types/plugin/PluginContext.js";
|
|
13
10
|
/**
|
|
14
11
|
* AgentState 构造参数。
|
|
15
12
|
*/
|
|
16
13
|
export interface AgentStateOptions {
|
|
17
14
|
/** 当前 Agent 共用的执行上下文。 */
|
|
18
|
-
context:
|
|
15
|
+
context: PluginContext;
|
|
19
16
|
/** 当前 Agent 唯一的 PluginRegistry 实例。 */
|
|
20
17
|
plugins: PluginRegistry;
|
|
21
|
-
/** 当前 Agent 唯一的 Session 集合。 */
|
|
22
|
-
sessions: AgentSessions;
|
|
23
|
-
/** 当前 Agent 与 Session 共享的可变工具集合。 */
|
|
24
|
-
tools: Record<string, Tool>;
|
|
25
|
-
/** 当前 Agent 持有的可选 Shell 实例。 */
|
|
26
|
-
shell?: Shell;
|
|
27
18
|
}
|
|
28
19
|
//# sourceMappingURL=AgentState.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AgentState.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"AgentState.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,OAAO,EAAE,aAAa,CAAC;IAEvB,sCAAsC;IACtC,OAAO,EAAE,cAAc,CAAC;CAEzB"}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* AgentState 内部装配参数。
|
|
3
3
|
*
|
|
4
4
|
* 职责说明(中文)
|
|
5
|
-
* - 只描述 AgentState
|
|
6
|
-
* -
|
|
5
|
+
* - 只描述 AgentState 启动 PluginRegistry 长期运行时所需的稳定引用。
|
|
6
|
+
* - 工具注册与 Session 同步由 Agent 负责,AgentState 只负责生命周期。
|
|
7
7
|
*/
|
|
8
8
|
export {};
|
|
9
9
|
//# sourceMappingURL=AgentState.js.map
|
|
@@ -37,10 +37,10 @@ export type RemoteAgentPluginActionResult = PluginActionResult<JsonValue> & {
|
|
|
37
37
|
/**
|
|
38
38
|
* Runtime 回传的 plugin 名称。
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
plugin_name?: string;
|
|
41
41
|
/**
|
|
42
42
|
* Runtime 回传的 action 名称。
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
action_name?: string;
|
|
45
45
|
};
|
|
46
46
|
//# sourceMappingURL=RemoteAgentPluginAction.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RemoteAgentPluginAction.d.ts","sourceRoot":"","sources":["../../../src/types/agent/RemoteAgentPluginAction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACvC,kBAAkB,CAAC,SAAS,CAAC,GAAG;IAC9B;;OAEG;IACH,
|
|
1
|
+
{"version":3,"file":"RemoteAgentPluginAction.d.ts","sourceRoot":"","sources":["../../../src/types/agent/RemoteAgentPluginAction.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;;OAIG;IACH,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACvC,kBAAkB,CAAC,SAAS,CAAC,GAAG;IAC9B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -5,12 +5,13 @@
|
|
|
5
5
|
* - 这里只描述 session 的可调用能力。
|
|
6
6
|
* - session 的数据结构、history/system payload 放在 `SessionTypes.ts`。
|
|
7
7
|
*/
|
|
8
|
-
import type { AgentCreateSessionInput, AgentArchiveSessionInput, AgentArchiveSessionsInput, AgentArchiveSessionResult, AgentArchiveSessionsResult, AgentCleanArchiveResult, AgentListSessionsInput, AgentSessionConfigSnapshot, AgentSessionForkInput, AgentSessionInfo, AgentSessionSetInput, AgentSessionSummaryPage, AgentSessionSystemSnapshot } from "../../types/agent/SessionTypes.js";
|
|
8
|
+
import type { AgentCreateSessionInput, AgentArchiveSessionInput, AgentArchiveSessionsInput, AgentArchiveSessionResult, AgentArchiveSessionsResult, AgentCleanArchiveResult, AgentListSessionsInput, AgentSessionConfigSnapshot, AgentSessionForkInput, AgentSessionInfo, AgentSessionSetInput, AgentSessionStatus, AgentSessionSummaryPage, AgentSessionSystemSnapshot, RemoteSessionSetInput } from "../../types/agent/SessionTypes.js";
|
|
9
9
|
import type { SessionMutationSubscriber, SessionMutationUnsubscribe } from "../../types/session/SessionMutation.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { RespondSessionInteractionInput, SessionInteractionResult, SessionPendingInteraction } from "../../types/session/SessionInteraction.js";
|
|
11
11
|
import type { ListSessionMessagesInput, SessionMessagePage } from "../../types/session/SessionMessage.js";
|
|
12
12
|
import type { AgentSessionPromptInput } from "../../types/sdk/AgentSessionPrompt.js";
|
|
13
13
|
import type { AgentSessionStopResult } from "../../types/sdk/AgentSessionStop.js";
|
|
14
|
+
import type { AgentSessionCompactHandle } from "../../types/sdk/AgentSessionCompact.js";
|
|
14
15
|
import type { AgentSessionTurnHandle } from "../../types/sdk/AgentSessionTurn.js";
|
|
15
16
|
/**
|
|
16
17
|
* SDK Session 集合入口。
|
|
@@ -45,31 +46,29 @@ export interface AgentSessionActor {
|
|
|
45
46
|
* 把一次显式历史压缩加入当前 Session 的有序输入队列。
|
|
46
47
|
*
|
|
47
48
|
* 关键点(中文)
|
|
48
|
-
* -
|
|
49
|
-
* -
|
|
49
|
+
* - 返回句柄表示 Command 已成功入队。
|
|
50
|
+
* - `handle.finished` 在压缩真正完成或失败后兑现。
|
|
50
51
|
*/
|
|
51
|
-
compact(): Promise<
|
|
52
|
+
compact(): Promise<AgentSessionCompactHandle>;
|
|
52
53
|
/** 订阅当前 session 的未来事件。 */
|
|
53
54
|
subscribe(subscriber: SessionMutationSubscriber): SessionMutationUnsubscribe;
|
|
54
55
|
/** 读取当前 session messages 分页。 */
|
|
55
56
|
messages(input?: ListSessionMessagesInput): Promise<SessionMessagePage>;
|
|
56
57
|
/** 读取当前 session 生效的 system 快照。 */
|
|
57
58
|
system(): Promise<AgentSessionSystemSnapshot>;
|
|
58
|
-
/** 列出当前 Session
|
|
59
|
-
|
|
60
|
-
/** 读取当前 Session
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
|
|
64
|
-
/** 处理当前 Session 的 pending 工具审批。 */
|
|
65
|
-
resolve_approval(input: ResolveSessionApprovalInput): Promise<SessionApprovalResult>;
|
|
59
|
+
/** 列出当前 Session 正在等待用户响应的 Interaction。 */
|
|
60
|
+
interactions(): Promise<SessionPendingInteraction[]>;
|
|
61
|
+
/** 读取当前 Session 的运行与安全状态。 */
|
|
62
|
+
status(): Promise<AgentSessionStatus>;
|
|
63
|
+
/** 提交当前 Session 的 Interaction 用户响应。 */
|
|
64
|
+
respond(input: RespondSessionInteractionInput): Promise<SessionInteractionResult>;
|
|
66
65
|
}
|
|
67
66
|
/**
|
|
68
67
|
* 本地 Agent 返回的公开 session 接口。
|
|
69
68
|
*/
|
|
70
69
|
export interface AgentSession extends AgentSessionActor {
|
|
71
|
-
/** 当前 session 所属
|
|
72
|
-
readonly
|
|
70
|
+
/** 当前 session 所属 agent_id。 */
|
|
71
|
+
readonly agent_id: string;
|
|
73
72
|
/** 当前 session 配置快照。 */
|
|
74
73
|
readonly config: AgentSessionConfigSnapshot;
|
|
75
74
|
/** 写入当前 session 默认配置。 */
|
|
@@ -85,6 +84,8 @@ export interface AgentSession extends AgentSessionActor {
|
|
|
85
84
|
* 远程 Agent 返回的公开 session 接口。
|
|
86
85
|
*/
|
|
87
86
|
export interface RemoteAgentSession extends AgentSessionActor {
|
|
87
|
+
/** 写入当前远程 Session 的可序列化动态配置。 */
|
|
88
|
+
set(input: RemoteSessionSetInput): Promise<void>;
|
|
88
89
|
/** 从当前远程 session 创建一个分叉会话。 */
|
|
89
90
|
fork(input?: AgentSessionForkInput | string): Promise<RemoteAgentSession>;
|
|
90
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionActor.d.ts","sourceRoot":"","sources":["../../../src/types/agent/SessionActor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,uBAAuB,EACvB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"SessionActor.d.ts","sourceRoot":"","sources":["../../../src/types/agent/SessionActor.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,EAC1B,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EACV,8BAA8B,EAC9B,wBAAwB,EACxB,yBAAyB,EAC1B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,KAAK,EACV,wBAAwB,EACxB,kBAAkB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,aAAa,CAAC,QAAQ,SAAS,iBAAiB,GAAG,YAAY;IAC9E,oBAAoB;IACpB,MAAM,CAAC,KAAK,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3D,wBAAwB;IACxB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAE3C,gCAAgC;IAChC,IAAI,CAAC,KAAK,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAEvE,oBAAoB;IACpB,OAAO,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAE7E,0BAA0B;IAC1B,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEjF,uBAAuB;IACvB,aAAa,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,uBAAuB;IACvB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,uBAAuB;IACvB,QAAQ,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAEtC,qBAAqB;IACrB,MAAM,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAExE,oCAAoC;IACpC,IAAI,IAAI,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAExC;;;;;;OAMG;IACH,OAAO,IAAI,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAE9C,0BAA0B;IAC1B,SAAS,CACP,UAAU,EAAE,yBAAyB,GACpC,0BAA0B,CAAC;IAE9B,gCAAgC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAExE,kCAAkC;IAClC,MAAM,IAAI,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAE9C,0CAA0C;IAC1C,YAAY,IAAI,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAAC;IAErD,6BAA6B;IAC7B,MAAM,IAAI,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAEtC,uCAAuC;IACvC,OAAO,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACnF;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,iBAAiB;IACrD,8BAA8B;IAC9B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B,uBAAuB;IACvB,QAAQ,CAAC,MAAM,EAAE,0BAA0B,CAAC;IAE5C,yBAAyB;IACzB,GAAG,CAAC,KAAK,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD,0DAA0D;IAC1D,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B,8DAA8D;IAC9D,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B,4BAA4B;IAC5B,IAAI,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACrE;AAED;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,iBAAiB;IAC3D,gCAAgC;IAChC,GAAG,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD,8BAA8B;IAC9B,IAAI,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3E"}
|
|
@@ -6,20 +6,20 @@
|
|
|
6
6
|
* - session actor 方法接口拆到 `SessionActor.ts`。
|
|
7
7
|
*/
|
|
8
8
|
import type { AgentModel } from "../../agent/AgentModel.js";
|
|
9
|
-
import type {
|
|
9
|
+
import type { SessionApprovalMode } from "../../types/session/SessionInteraction.js";
|
|
10
10
|
/**
|
|
11
11
|
* 新建 session 的输入参数。
|
|
12
12
|
*/
|
|
13
13
|
export interface AgentCreateSessionInput {
|
|
14
14
|
/**
|
|
15
|
-
* 可选显式
|
|
15
|
+
* 可选显式 session_id。
|
|
16
16
|
*
|
|
17
17
|
* 关键点(中文)
|
|
18
18
|
* - 传入时表达“创建意图”。
|
|
19
19
|
* - 若该 session 已存在,SDK 应直接报错,而不是静默复用。
|
|
20
|
-
* - 省略时由 SDK 自动生成稳定且不可推导的
|
|
20
|
+
* - 省略时由 SDK 自动生成稳定且不可推导的 session_id。
|
|
21
21
|
*/
|
|
22
|
-
|
|
22
|
+
session_id?: string;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Session 列表查询输入。
|
|
@@ -45,7 +45,7 @@ export interface AgentListSessionsInput {
|
|
|
45
45
|
* 关键词过滤。
|
|
46
46
|
*
|
|
47
47
|
* 说明(中文)
|
|
48
|
-
* - 推荐用于匹配 `
|
|
48
|
+
* - 推荐用于匹配 `session_id`、标题与预览文本。
|
|
49
49
|
* - 属于轻量包含匹配,不承诺复杂搜索语义。
|
|
50
50
|
*/
|
|
51
51
|
query?: string;
|
|
@@ -61,7 +61,43 @@ export interface AgentSessionSetInput {
|
|
|
61
61
|
* - SDK 只接受宿主已经解析完成的运行时模型实例。
|
|
62
62
|
* - 模型选择、ID 与持久化全部由宿主负责。
|
|
63
63
|
*/
|
|
64
|
-
model
|
|
64
|
+
model?: AgentModel;
|
|
65
|
+
/**
|
|
66
|
+
* 当前 Session 的安全策略。
|
|
67
|
+
*
|
|
68
|
+
* 关键点(中文)
|
|
69
|
+
* - configured 值在 `set()` 返回前被 Session 接受。
|
|
70
|
+
* - 执行面在下一 Session Step 检查点原子提交该值。
|
|
71
|
+
*/
|
|
72
|
+
security?: AgentSessionSecurityConfig;
|
|
73
|
+
}
|
|
74
|
+
/** 可通过本地或远程 Session 动态更新的安全策略。 */
|
|
75
|
+
export interface AgentSessionSecurityConfig {
|
|
76
|
+
/** 高风险操作是否需要用户逐次审批。 */
|
|
77
|
+
approval_mode: SessionApprovalMode;
|
|
78
|
+
}
|
|
79
|
+
/** 远程 Session 可序列化的动态配置输入。 */
|
|
80
|
+
export interface RemoteSessionSetInput {
|
|
81
|
+
/** 当前远程 Session 的安全策略。 */
|
|
82
|
+
security: AgentSessionSecurityConfig;
|
|
83
|
+
}
|
|
84
|
+
/** Session 当前安全状态。 */
|
|
85
|
+
export interface AgentSessionSecurityStatus {
|
|
86
|
+
/** Session 已接受的 configured 审批模式。 */
|
|
87
|
+
approval_mode: SessionApprovalMode;
|
|
88
|
+
/** 执行面在最近 Step 检查点提交的审批模式。 */
|
|
89
|
+
effective_approval_mode: SessionApprovalMode;
|
|
90
|
+
}
|
|
91
|
+
/** Session 当前运行状态。 */
|
|
92
|
+
export interface AgentSessionStatus {
|
|
93
|
+
/** 当前状态所属 Session 标识。 */
|
|
94
|
+
session_id: string;
|
|
95
|
+
/** Session 当前是否正在执行 Turn。 */
|
|
96
|
+
state: "idle" | "running";
|
|
97
|
+
/** 当前正在执行的 Turn 标识;空闲时省略。 */
|
|
98
|
+
active_turn_id?: string;
|
|
99
|
+
/** 当前 Session 的安全状态。 */
|
|
100
|
+
security: AgentSessionSecurityStatus;
|
|
65
101
|
}
|
|
66
102
|
/**
|
|
67
103
|
* Session 当前配置快照。
|
|
@@ -70,14 +106,10 @@ export interface AgentSessionConfigSnapshot {
|
|
|
70
106
|
/** 当前 session 绑定的默认模型实例。 */
|
|
71
107
|
model?: AgentModel;
|
|
72
108
|
/** 当前模型的轻量可读标签。 */
|
|
73
|
-
|
|
109
|
+
model_label?: string;
|
|
74
110
|
/** 当前模型支持的总上下文窗口长度,单位为 token。 */
|
|
75
111
|
model_context_window?: number;
|
|
76
112
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Session records视图类型。
|
|
79
|
-
*/
|
|
80
|
-
export type AgentSessionRecordsView = "message" | "timeline";
|
|
81
113
|
/**
|
|
82
114
|
* Session 时间线事件。
|
|
83
115
|
*/
|
|
@@ -105,28 +137,28 @@ export interface AgentSessionTimelineEvent {
|
|
|
105
137
|
* 说明(中文)
|
|
106
138
|
* - 仅 `tool-call` / `tool-result` 这类事件通常会携带该字段。
|
|
107
139
|
*/
|
|
108
|
-
|
|
140
|
+
tool_name?: string;
|
|
109
141
|
/**
|
|
110
142
|
* 当前 action 标题。
|
|
111
143
|
*
|
|
112
144
|
* 说明(中文)
|
|
113
145
|
* - 仅 `role=action` 的事件通常会携带该字段。
|
|
114
146
|
*/
|
|
115
|
-
|
|
147
|
+
action_title?: string;
|
|
116
148
|
/**
|
|
117
149
|
* 当前 action 描述。
|
|
118
150
|
*
|
|
119
151
|
* 说明(中文)
|
|
120
152
|
* - 仅 `role=action` 的事件通常会携带该字段。
|
|
121
153
|
*/
|
|
122
|
-
|
|
154
|
+
action_description?: string;
|
|
123
155
|
/**
|
|
124
156
|
* 当前 action 状态。
|
|
125
157
|
*
|
|
126
158
|
* 说明(中文)
|
|
127
159
|
* - 仅 `role=action` 的事件通常会携带该字段。
|
|
128
160
|
*/
|
|
129
|
-
|
|
161
|
+
action_state?: string;
|
|
130
162
|
}
|
|
131
163
|
/**
|
|
132
164
|
* Session system block 来源类型。
|
|
@@ -161,12 +193,12 @@ export interface AgentSessionSystemBlock {
|
|
|
161
193
|
* 当前 session 的稳定上下文信息。
|
|
162
194
|
*/
|
|
163
195
|
export interface AgentSessionSystemSessionInfo {
|
|
164
|
-
/** 当前 session 所属
|
|
165
|
-
|
|
196
|
+
/** 当前 session 所属 agent_id。 */
|
|
197
|
+
agent_id: string;
|
|
166
198
|
/** 当前 session 唯一标识。 */
|
|
167
|
-
|
|
199
|
+
session_id: string;
|
|
168
200
|
/** 当前 agent 绑定的项目根目录。 */
|
|
169
|
-
|
|
201
|
+
project_root: string;
|
|
170
202
|
/**
|
|
171
203
|
* 当前 session 首次创建时间。
|
|
172
204
|
*
|
|
@@ -174,7 +206,7 @@ export interface AgentSessionSystemSessionInfo {
|
|
|
174
206
|
* - 这是 session 初始化时落盘的稳定参考时间,按 Date/ISO 字符串对外展示。
|
|
175
207
|
* - 它不是每轮运行的当前时间,不会随着后续 turn 执行而改变。
|
|
176
208
|
*/
|
|
177
|
-
|
|
209
|
+
created_at: string;
|
|
178
210
|
/**
|
|
179
211
|
* 当前 session 初始化时解析到的系统时区。
|
|
180
212
|
*
|
|
@@ -188,8 +220,8 @@ export interface AgentSessionSystemSessionInfo {
|
|
|
188
220
|
* 当前 session 首次生成后固定的完整 system prompt 快照。
|
|
189
221
|
*/
|
|
190
222
|
export interface AgentSessionSystemSnapshot {
|
|
191
|
-
/** 当前
|
|
192
|
-
|
|
223
|
+
/** 当前 session_id。 */
|
|
224
|
+
session_id: string;
|
|
193
225
|
/**
|
|
194
226
|
* 当前 session 的稳定上下文信息。
|
|
195
227
|
*
|
|
@@ -206,17 +238,17 @@ export interface AgentSessionSystemSnapshot {
|
|
|
206
238
|
* Session 摘要。
|
|
207
239
|
*/
|
|
208
240
|
export interface AgentSessionSummary {
|
|
209
|
-
/** 当前 session 所属
|
|
210
|
-
|
|
241
|
+
/** 当前 session 所属 agent_id。 */
|
|
242
|
+
agent_id: string;
|
|
211
243
|
/** 当前 session 唯一标识。 */
|
|
212
|
-
|
|
244
|
+
session_id: string;
|
|
213
245
|
/**
|
|
214
246
|
* 当前 session 可读标题。
|
|
215
247
|
*
|
|
216
248
|
* 说明(中文)
|
|
217
249
|
* - 标题持久化在 session `meta.json` 顶层。
|
|
218
250
|
* - SDK 只在模型成功生成标题时写入,不再从首条用户消息生成 fallback。
|
|
219
|
-
* - 标题允许为空,调用方需要展示占位文案时可自行回退到 `
|
|
251
|
+
* - 标题允许为空,调用方需要展示占位文案时可自行回退到 `session_id`。
|
|
220
252
|
*/
|
|
221
253
|
title?: string;
|
|
222
254
|
/**
|
|
@@ -226,15 +258,15 @@ export interface AgentSessionSummary {
|
|
|
226
258
|
* - 通常来自最后一条用户可见消息的裁剪文本。
|
|
227
259
|
* - 适合用于侧边栏、列表卡片或 session picker。
|
|
228
260
|
*/
|
|
229
|
-
|
|
261
|
+
preview_text?: string;
|
|
230
262
|
/** 当前 session 首次创建时间(ms)。 */
|
|
231
|
-
|
|
263
|
+
created_at?: number;
|
|
232
264
|
/** 当前 session 最近一次更新时间(ms)。 */
|
|
233
|
-
|
|
265
|
+
updated_at?: number;
|
|
234
266
|
/** 当前 session 已落盘消息数。 */
|
|
235
|
-
|
|
267
|
+
message_count: number;
|
|
236
268
|
/** 当前 session 绑定模型的可读标签。 */
|
|
237
|
-
|
|
269
|
+
model_label?: string;
|
|
238
270
|
/** 当前 session 是否处于执行中。 */
|
|
239
271
|
executing?: boolean;
|
|
240
272
|
}
|
|
@@ -260,62 +292,8 @@ export interface AgentSessionSummaryPage {
|
|
|
260
292
|
*/
|
|
261
293
|
total: number;
|
|
262
294
|
/** 下一页游标。 */
|
|
263
|
-
nextCursor?: string;
|
|
264
|
-
/** 是否仍有更多结果。 */
|
|
265
|
-
hasMore: boolean;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Session records 读取输入。
|
|
269
|
-
*/
|
|
270
|
-
export interface AgentSessionRecordsInput {
|
|
271
|
-
/** 当前页返回上限。 */
|
|
272
|
-
limit?: number;
|
|
273
|
-
/** 分页游标。 */
|
|
274
|
-
cursor?: string;
|
|
275
|
-
/**
|
|
276
|
-
* 返回顺序。
|
|
277
|
-
*
|
|
278
|
-
* 说明(中文)
|
|
279
|
-
* - `asc`:从旧到新
|
|
280
|
-
* - `desc`:从新到旧
|
|
281
|
-
*/
|
|
282
|
-
order?: "asc" | "desc";
|
|
283
|
-
/**
|
|
284
|
-
* 返回视图类型。
|
|
285
|
-
*
|
|
286
|
-
* 说明(中文)
|
|
287
|
-
* - `message`:原始 session 消息
|
|
288
|
-
* - `timeline`:适合直接渲染 UI 的平铺事件
|
|
289
|
-
*/
|
|
290
|
-
view?: AgentSessionRecordsView;
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Session records 分页结果。
|
|
294
|
-
*/
|
|
295
|
-
export interface AgentSessionRecordsPage {
|
|
296
|
-
/** 当前读取所对应的 session 信息。 */
|
|
297
|
-
session: AgentSessionInfo;
|
|
298
|
-
/** 当前页实际返回视图。 */
|
|
299
|
-
view: AgentSessionRecordsView;
|
|
300
|
-
/**
|
|
301
|
-
* 当前页数据列表。
|
|
302
|
-
*
|
|
303
|
-
* 说明(中文)
|
|
304
|
-
* - `view=message` 时返回 `SessionRecordV1[]`
|
|
305
|
-
* - `view=timeline` 时返回 `AgentSessionTimelineEvent[]`
|
|
306
|
-
*/
|
|
307
|
-
items: SessionRecordV1[] | AgentSessionTimelineEvent[];
|
|
308
|
-
/**
|
|
309
|
-
* 过滤前后的总条数。
|
|
310
|
-
*
|
|
311
|
-
* 说明(中文)
|
|
312
|
-
* - 对 `view=message` 表示消息条数。
|
|
313
|
-
* - 对 `view=timeline` 表示时间线事件条数。
|
|
314
|
-
*/
|
|
315
|
-
total: number;
|
|
316
|
-
/** 下一页游标。 */
|
|
317
295
|
next_cursor?: string;
|
|
318
|
-
/**
|
|
296
|
+
/** 是否仍有更多结果。 */
|
|
319
297
|
has_more: boolean;
|
|
320
298
|
}
|
|
321
299
|
/**
|
|
@@ -329,7 +307,7 @@ export interface AgentSessionForkInput {
|
|
|
329
307
|
* - 省略时复制当前 session 的完整消息历史。
|
|
330
308
|
* - 传入时复制到该消息为止(包含该消息)。
|
|
331
309
|
*/
|
|
332
|
-
|
|
310
|
+
message_id?: string;
|
|
333
311
|
}
|
|
334
312
|
/**
|
|
335
313
|
* 归档单个 session 的输入参数。
|
|
@@ -367,7 +345,7 @@ export interface AgentArchiveSessionsInput {
|
|
|
367
345
|
* 关键词过滤。
|
|
368
346
|
*
|
|
369
347
|
* 说明(中文)
|
|
370
|
-
* - 推荐用于匹配 `
|
|
348
|
+
* - 推荐用于匹配 `session_id`、标题与预览文本。
|
|
371
349
|
* - 属于轻量包含匹配,不承诺复杂搜索语义。
|
|
372
350
|
*/
|
|
373
351
|
query?: string;
|
|
@@ -377,9 +355,9 @@ export interface AgentArchiveSessionsInput {
|
|
|
377
355
|
*/
|
|
378
356
|
export interface AgentArchiveSessionResult {
|
|
379
357
|
/** 被归档的 session id。 */
|
|
380
|
-
|
|
358
|
+
session_id: string;
|
|
381
359
|
/** 归档时间戳(ms)。 */
|
|
382
|
-
|
|
360
|
+
archived_at: number;
|
|
383
361
|
}
|
|
384
362
|
/**
|
|
385
363
|
* 列出已归档 session 的结果。
|
|
@@ -391,6 +369,6 @@ export interface AgentArchiveSessionsResult extends AgentSessionSummaryPage {
|
|
|
391
369
|
*/
|
|
392
370
|
export interface AgentCleanArchiveResult {
|
|
393
371
|
/** 被永久删除的归档 session id 列表。 */
|
|
394
|
-
|
|
372
|
+
removed_session_ids: string[];
|
|
395
373
|
}
|
|
396
374
|
//# sourceMappingURL=SessionTypes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionTypes.d.ts","sourceRoot":"","sources":["../../../src/types/agent/SessionTypes.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionTypes.d.ts","sourceRoot":"","sources":["../../../src/types/agent/SessionTypes.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executor 到 Session canonical Message 的 Assistant 输出端口。
|
|
3
|
+
*
|
|
4
|
+
* 该端口集中隔离 AI SDK 流协议。SessionLoop 只装配端口,不解析 Chunk,具体转换
|
|
5
|
+
* 由 execution Adapter 完成,SessionMessages 仍是唯一 Assistant Message 事实源。
|
|
6
|
+
*/
|
|
7
|
+
import type { UIMessage, UIMessageChunk } from "ai";
|
|
8
|
+
import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords.js";
|
|
9
|
+
import type { SessionToolInputReady } from "../../types/session/SessionTool.js";
|
|
10
|
+
/** 单次 Turn 的 Assistant 输出写入端口。 */
|
|
11
|
+
export interface SessionAssistantOutput {
|
|
12
|
+
/** 开始一个 Provider Step 的独立 Part 作用域。 */
|
|
13
|
+
begin_step(): Promise<void>;
|
|
14
|
+
/** 写入一个 AI SDK 流式 Chunk。 */
|
|
15
|
+
write_chunk(chunk: UIMessageChunk): Promise<void>;
|
|
16
|
+
/** 使用 Provider 最终快照校验并补齐当前 Step metadata。 */
|
|
17
|
+
finish_step(message: SessionMessageRecordV1): Promise<void>;
|
|
18
|
+
/** 放弃当前未完成 Step 的临时作用域。 */
|
|
19
|
+
abort_step(): Promise<void>;
|
|
20
|
+
/** 在 Tool 实现执行前提交完整输入。 */
|
|
21
|
+
prepare_tool_input(input: SessionToolInputReady): Promise<void>;
|
|
22
|
+
/** User steer 已插入会话后,关闭它之前的当前 Assistant Message。 */
|
|
23
|
+
close_current_message(): Promise<void>;
|
|
24
|
+
/** 把 Action 产生的完整 Parts 追加到当前 canonical Assistant Message。 */
|
|
25
|
+
append_parts(parts: UIMessage["parts"]): Promise<void>;
|
|
26
|
+
/** 按 Turn 最终结果收口 Assistant 输出。 */
|
|
27
|
+
finish(input: {
|
|
28
|
+
/** Assistant 最终状态。 */
|
|
29
|
+
status: "completed" | "failed" | "stopped";
|
|
30
|
+
/** 失败时写入 Assistant Message 的错误文本。 */
|
|
31
|
+
error?: string;
|
|
32
|
+
}): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=SessionAssistantOutput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionAssistantOutput.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AACpD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAE5E,kCAAkC;AAClC,MAAM,WAAW,sBAAsB;IACrC,uCAAuC;IACvC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,4BAA4B;IAC5B,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,6CAA6C;IAC7C,WAAW,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5D,2BAA2B;IAC3B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,0BAA0B;IAC1B,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,oDAAoD;IACpD,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,8DAA8D;IAC9D,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACvD,kCAAkC;IAClC,MAAM,CAAC,KAAK,EAAE;QACZ,sBAAsB;QACtB,MAAM,EAAE,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;QAC3C,qCAAqC;QACrC,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionAssistantOutput.js","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -3,18 +3,18 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 该对象由 Executor 在每个 Session step 绑定到 tool.execute。
|
|
6
|
-
* - Agent 工具读取
|
|
7
|
-
* -
|
|
6
|
+
* - Agent 工具读取 session_turn_context,Shell 工具只读取 shell_run_context。
|
|
7
|
+
* - 上下文归属当前 Turn,不通过进程级或异步全局容器共享。
|
|
8
8
|
*/
|
|
9
9
|
import type { ShellToolRunContext } from "@downcity/shell/types/ShellRuntime.js";
|
|
10
|
-
import type {
|
|
10
|
+
import type { SessionTurnContext } from "../../types/executor/SessionTurnContext.js";
|
|
11
11
|
/**
|
|
12
12
|
* Agent 与 Shell 工具共用的单次执行上下文。
|
|
13
13
|
*/
|
|
14
14
|
export interface SessionToolExecutionContext {
|
|
15
15
|
/** 当前 Shell tool 调用的显式上下文。 */
|
|
16
16
|
shell_run_context: ShellToolRunContext;
|
|
17
|
-
/** 当前工具调用所属的完整 Session
|
|
18
|
-
|
|
17
|
+
/** 当前工具调用所属的完整 Session Turn 上下文。 */
|
|
18
|
+
session_turn_context: SessionTurnContext;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=SessionToolExecutionContext.d.ts.map
|