@downcity/agent 1.1.338 → 1.1.400
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 +31 -15
- package/bin/agent/Agent.d.ts +42 -91
- package/bin/agent/Agent.d.ts.map +1 -1
- package/bin/agent/Agent.js +115 -200
- package/bin/agent/Agent.js.map +1 -1
- package/bin/agent/AgentModel.d.ts +8 -8
- package/bin/agent/AgentModel.d.ts.map +1 -1
- package/bin/agent/AgentModel.js +5 -5
- package/bin/agent/AgentModel.js.map +1 -1
- package/bin/agent/AgentSessions.d.ts +42 -28
- package/bin/agent/AgentSessions.d.ts.map +1 -1
- package/bin/agent/AgentSessions.js +80 -44
- package/bin/agent/AgentSessions.js.map +1 -1
- package/bin/agent/WorkspaceEntry.d.ts +82 -0
- package/bin/agent/WorkspaceEntry.d.ts.map +1 -0
- package/bin/agent/WorkspaceEntry.js +246 -0
- package/bin/agent/WorkspaceEntry.js.map +1 -0
- package/bin/agent/index.d.ts +5 -0
- package/bin/agent/index.d.ts.map +1 -0
- package/bin/agent/index.js +5 -0
- package/bin/agent/index.js.map +1 -0
- package/bin/city/host/CityHostRegistry.d.ts +44 -0
- package/bin/city/host/CityHostRegistry.d.ts.map +1 -0
- package/bin/city/host/CityHostRegistry.js +225 -0
- package/bin/city/host/CityHostRegistry.js.map +1 -0
- package/bin/city/index.d.ts +22 -0
- package/bin/city/index.d.ts.map +1 -0
- package/bin/city/index.js +10 -0
- package/bin/city/index.js.map +1 -0
- package/bin/city/runtime/City.d.ts +99 -0
- package/bin/city/runtime/City.d.ts.map +1 -0
- package/bin/city/runtime/City.js +376 -0
- package/bin/city/runtime/City.js.map +1 -0
- package/bin/city/transport/SerializedTransport.d.ts +30 -0
- package/bin/city/transport/SerializedTransport.d.ts.map +1 -0
- package/bin/city/transport/SerializedTransport.js +57 -0
- package/bin/city/transport/SerializedTransport.js.map +1 -0
- package/bin/city/transport/http/AgentHTTP.d.ts +66 -0
- package/bin/city/transport/http/AgentHTTP.d.ts.map +1 -0
- package/bin/city/transport/http/AgentHTTP.js +142 -0
- package/bin/city/transport/http/AgentHTTP.js.map +1 -0
- package/bin/city/transport/http/CityHTTP.d.ts +44 -0
- package/bin/city/transport/http/CityHTTP.d.ts.map +1 -0
- package/bin/city/transport/http/CityHTTP.js +171 -0
- package/bin/city/transport/http/CityHTTP.js.map +1 -0
- package/bin/city/transport/http/NodeHttpAdapter.d.ts +27 -0
- package/bin/city/transport/http/NodeHttpAdapter.d.ts.map +1 -0
- package/bin/city/transport/http/NodeHttpAdapter.js +57 -0
- package/bin/city/transport/http/NodeHttpAdapter.js.map +1 -0
- package/bin/city/transport/http/routes/RuntimeRoutes.d.ts +15 -0
- package/bin/city/transport/http/routes/RuntimeRoutes.d.ts.map +1 -0
- package/bin/city/transport/http/routes/RuntimeRoutes.js +38 -0
- package/bin/city/transport/http/routes/RuntimeRoutes.js.map +1 -0
- package/bin/city/transport/http/routes/SessionRoutes.d.ts +17 -0
- package/bin/city/transport/http/routes/SessionRoutes.d.ts.map +1 -0
- package/bin/city/transport/http/routes/SessionRoutes.js +417 -0
- package/bin/city/transport/http/routes/SessionRoutes.js.map +1 -0
- package/bin/city/transport/rpc/AgentRPC.d.ts +47 -0
- package/bin/city/transport/rpc/AgentRPC.d.ts.map +1 -0
- package/bin/city/transport/rpc/AgentRPC.js +89 -0
- package/bin/city/transport/rpc/AgentRPC.js.map +1 -0
- package/bin/city/transport/rpc/CityRPC.d.ts +26 -0
- package/bin/city/transport/rpc/CityRPC.d.ts.map +1 -0
- package/bin/city/transport/rpc/CityRPC.js +110 -0
- package/bin/city/transport/rpc/CityRPC.js.map +1 -0
- package/bin/city/transport/rpc/RpcServer.d.ts +30 -0
- package/bin/city/transport/rpc/RpcServer.d.ts.map +1 -0
- package/bin/city/transport/rpc/RpcServer.js +125 -0
- package/bin/city/transport/rpc/RpcServer.js.map +1 -0
- package/bin/city/transport/rpc/server/InternalHandlers.d.ts +22 -0
- package/bin/city/transport/rpc/server/InternalHandlers.d.ts.map +1 -0
- package/bin/city/transport/rpc/server/InternalHandlers.js +196 -0
- package/bin/city/transport/rpc/server/InternalHandlers.js.map +1 -0
- package/bin/city/transport/rpc/server/RequestDispatcher.d.ts +27 -0
- package/bin/city/transport/rpc/server/RequestDispatcher.d.ts.map +1 -0
- package/bin/city/transport/rpc/server/RequestDispatcher.js +38 -0
- package/bin/city/transport/rpc/server/RequestDispatcher.js.map +1 -0
- package/bin/city/transport/rpc/server/SdkSessionHandlers.d.ts +25 -0
- package/bin/city/transport/rpc/server/SdkSessionHandlers.d.ts.map +1 -0
- package/bin/city/transport/rpc/server/SdkSessionHandlers.js +146 -0
- package/bin/city/transport/rpc/server/SdkSessionHandlers.js.map +1 -0
- package/bin/city/transport/rpc/server/ServerTypes.d.ts +94 -0
- package/bin/city/transport/rpc/server/ServerTypes.d.ts.map +1 -0
- package/bin/city/transport/rpc/server/ServerTypes.js +9 -0
- package/bin/city/transport/rpc/server/ServerTypes.js.map +1 -0
- package/bin/city/transport/session/RemoteSessionConfig.d.ts +15 -0
- package/bin/city/transport/session/RemoteSessionConfig.d.ts.map +1 -0
- package/bin/city/transport/session/RemoteSessionConfig.js +23 -0
- package/bin/city/transport/session/RemoteSessionConfig.js.map +1 -0
- package/bin/city/transport/types/AgentHttpBinding.d.ts +24 -0
- package/bin/city/transport/types/AgentHttpBinding.d.ts.map +1 -0
- package/bin/city/transport/types/AgentHttpBinding.js +5 -0
- package/bin/city/transport/types/AgentHttpBinding.js.map +1 -0
- package/bin/city/transport/types/AgentHttpRuntime.d.ts +12 -0
- package/bin/city/transport/types/AgentHttpRuntime.d.ts.map +1 -0
- package/bin/city/transport/types/AgentHttpRuntime.js +7 -0
- package/bin/city/transport/types/AgentHttpRuntime.js.map +1 -0
- package/bin/city/transport/types/AgentRpcBinding.d.ts +27 -0
- package/bin/city/transport/types/AgentRpcBinding.d.ts.map +1 -0
- package/bin/city/transport/types/AgentRpcBinding.js +8 -0
- package/bin/city/transport/types/AgentRpcBinding.js.map +1 -0
- package/bin/city/transport/types/AgentRpcRuntime.d.ts +18 -0
- package/bin/city/transport/types/AgentRpcRuntime.d.ts.map +1 -0
- package/bin/city/transport/types/AgentRpcRuntime.js +7 -0
- package/bin/city/transport/types/AgentRpcRuntime.js.map +1 -0
- package/bin/city/transport/types/AgentSessionModelResolver.d.ts +11 -0
- package/bin/city/transport/types/AgentSessionModelResolver.d.ts.map +1 -0
- package/bin/city/transport/types/AgentSessionModelResolver.js +7 -0
- package/bin/city/transport/types/AgentSessionModelResolver.js.map +1 -0
- package/bin/city/transport/types/CityHttpRuntime.d.ts +36 -0
- package/bin/city/transport/types/CityHttpRuntime.d.ts.map +1 -0
- package/bin/city/transport/types/CityHttpRuntime.js +8 -0
- package/bin/city/transport/types/CityHttpRuntime.js.map +1 -0
- package/bin/city/transport/types/CityRpcRuntime.d.ts +17 -0
- package/bin/city/transport/types/CityRpcRuntime.d.ts.map +1 -0
- package/bin/city/transport/types/CityRpcRuntime.js +8 -0
- package/bin/city/transport/types/CityRpcRuntime.js.map +1 -0
- package/bin/city/transport/types/RpcProtocol.d.ts +24 -0
- package/bin/city/transport/types/RpcProtocol.d.ts.map +1 -0
- package/bin/city/transport/types/RpcProtocol.js +9 -0
- package/bin/city/transport/types/RpcProtocol.js.map +1 -0
- package/bin/city/types/City.d.ts +84 -0
- package/bin/city/types/City.d.ts.map +1 -0
- package/bin/city/types/City.js +7 -0
- package/bin/city/types/City.js.map +1 -0
- package/bin/city/types/PluginHostContext.d.ts +31 -0
- package/bin/city/types/PluginHostContext.d.ts.map +1 -0
- package/bin/city/types/PluginHostContext.js +11 -0
- package/bin/city/types/PluginHostContext.js.map +1 -0
- package/bin/city/types/SerializedTransport.d.ts +16 -0
- package/bin/city/types/SerializedTransport.d.ts.map +1 -0
- package/bin/city/types/SerializedTransport.js +3 -0
- package/bin/city/types/SerializedTransport.js.map +1 -0
- package/bin/executor/Executor.d.ts +4 -4
- package/bin/executor/Executor.d.ts.map +1 -1
- package/bin/executor/Executor.js +90 -34
- 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 +3 -3
- package/bin/executor/composer/system/default/DefaultSessionSystemComposer.js +1 -1
- package/bin/executor/composer/system/default/PromptRenderer.d.ts +3 -3
- package/bin/executor/composer/system/default/PromptRenderer.d.ts.map +1 -1
- package/bin/executor/composer/system/default/PromptRenderer.js +1 -1
- package/bin/executor/composer/system/default/SystemDomain.d.ts +3 -3
- package/bin/executor/composer/system/default/SystemDomain.d.ts.map +1 -1
- package/bin/executor/composer/system/default/SystemDomain.js +3 -3
- package/bin/executor/composer/system/default/SystemDomain.js.map +1 -1
- package/bin/executor/composer/system/default/SystemPromptAssets.js +2 -2
- 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/VariableReplacer.js +1 -1
- package/bin/executor/core-engine/CoreEngineContextCompaction.d.ts +6 -23
- package/bin/executor/core-engine/CoreEngineContextCompaction.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineContextCompaction.js +112 -344
- package/bin/executor/core-engine/CoreEngineContextCompaction.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineError.d.ts +1 -1
- package/bin/executor/core-engine/CoreEngineError.js +1 -1
- package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts +2 -3
- package/bin/executor/core-engine/CoreEngineLoopDecision.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineLoopDecision.js +1 -15
- package/bin/executor/core-engine/CoreEngineLoopDecision.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineMessageState.d.ts +16 -39
- package/bin/executor/core-engine/CoreEngineMessageState.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineMessageState.js +25 -60
- package/bin/executor/core-engine/CoreEngineMessageState.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineRunner.d.ts +10 -6
- package/bin/executor/core-engine/CoreEngineRunner.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineRunner.js +146 -234
- package/bin/executor/core-engine/CoreEngineRunner.js.map +1 -1
- package/bin/executor/core-engine/CoreEngineSignals.d.ts +20 -58
- package/bin/executor/core-engine/CoreEngineSignals.d.ts.map +1 -1
- package/bin/executor/core-engine/CoreEngineSignals.js +84 -304
- package/bin/executor/core-engine/CoreEngineSignals.js.map +1 -1
- package/bin/executor/messages/SessionAttachmentMapper.d.ts +6 -37
- package/bin/executor/messages/SessionAttachmentMapper.d.ts.map +1 -1
- package/bin/executor/messages/SessionAttachmentMapper.js +12 -243
- package/bin/executor/messages/SessionAttachmentMapper.js.map +1 -1
- package/bin/executor/messages/SessionMessageLog.d.ts +7 -14
- package/bin/executor/messages/SessionMessageLog.d.ts.map +1 -1
- package/bin/executor/messages/SessionMessageLog.js +11 -26
- package/bin/executor/messages/SessionMessageLog.js.map +1 -1
- package/bin/executor/messages/SessionModelMessages.d.ts +14 -0
- package/bin/executor/messages/SessionModelMessages.d.ts.map +1 -0
- package/bin/executor/messages/SessionModelMessages.js +187 -0
- package/bin/executor/messages/SessionModelMessages.js.map +1 -0
- package/bin/executor/model/ModelGenerate.d.ts +22 -0
- package/bin/executor/model/ModelGenerate.d.ts.map +1 -0
- package/bin/executor/model/ModelGenerate.js +54 -0
- package/bin/executor/model/ModelGenerate.js.map +1 -0
- package/bin/executor/model/ModelStepRunner.d.ts +70 -0
- package/bin/executor/model/ModelStepRunner.d.ts.map +1 -0
- package/bin/executor/model/ModelStepRunner.js +284 -0
- package/bin/executor/model/ModelStepRunner.js.map +1 -0
- package/bin/executor/services/ExecutorRecoveryPolicy.d.ts +4 -4
- package/bin/executor/services/ExecutorRecoveryPolicy.d.ts.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.d.ts +7 -2
- package/bin/executor/types/SessionHistoryMeta.d.ts.map +1 -1
- package/bin/executor/types/SessionHistoryMeta.js +1 -1
- package/bin/executor/types/SessionLoop.d.ts +1 -21
- package/bin/executor/types/SessionLoop.d.ts.map +1 -1
- package/bin/executor/types/SessionPrompts.d.ts +8 -7
- package/bin/executor/types/SessionPrompts.d.ts.map +1 -1
- package/bin/executor/types/SessionPrompts.js +1 -2
- package/bin/executor/types/SessionPrompts.js.map +1 -1
- package/bin/group/Group.d.ts +20 -0
- package/bin/group/Group.d.ts.map +1 -0
- package/bin/group/Group.js +42 -0
- package/bin/group/Group.js.map +1 -0
- package/bin/group/GroupSession.d.ts +103 -0
- package/bin/group/GroupSession.d.ts.map +1 -0
- package/bin/group/GroupSession.js +666 -0
- package/bin/group/GroupSession.js.map +1 -0
- package/bin/group/GroupSessions.d.ts +21 -0
- package/bin/group/GroupSessions.d.ts.map +1 -0
- package/bin/group/GroupSessions.js +89 -0
- package/bin/group/GroupSessions.js.map +1 -0
- package/bin/group/index.d.ts +9 -0
- package/bin/group/index.d.ts.map +1 -0
- package/bin/group/index.js +6 -0
- package/bin/group/index.js.map +1 -0
- package/bin/index.d.ts +28 -20
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +7 -9
- package/bin/index.js.map +1 -1
- package/bin/internal/AgentRuntime.d.ts +43 -0
- package/bin/internal/AgentRuntime.d.ts.map +1 -0
- package/bin/internal/AgentRuntime.js +179 -0
- package/bin/internal/AgentRuntime.js.map +1 -0
- package/bin/internal/GroupRuntime.d.ts +17 -0
- package/bin/internal/GroupRuntime.d.ts.map +1 -0
- package/bin/internal/GroupRuntime.js +66 -0
- package/bin/internal/GroupRuntime.js.map +1 -0
- package/bin/internal/index.d.ts +8 -0
- package/bin/internal/index.d.ts.map +1 -0
- package/bin/internal/index.js +8 -0
- package/bin/internal/index.js.map +1 -0
- package/bin/plugin/core/ActionScheduleExecutor.d.ts +3 -2
- package/bin/plugin/core/ActionScheduleExecutor.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleExecutor.js +14 -3
- package/bin/plugin/core/ActionScheduleExecutor.js.map +1 -1
- package/bin/plugin/core/ActionScheduleRuntime.d.ts +3 -1
- package/bin/plugin/core/ActionScheduleRuntime.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleRuntime.js +9 -8
- package/bin/plugin/core/ActionScheduleRuntime.js.map +1 -1
- package/bin/plugin/core/ActionScheduleStore.d.ts +7 -3
- package/bin/plugin/core/ActionScheduleStore.d.ts.map +1 -1
- package/bin/plugin/core/ActionScheduleStore.js +32 -9
- package/bin/plugin/core/ActionScheduleStore.js.map +1 -1
- package/bin/plugin/core/HookRegistry.d.ts +4 -6
- package/bin/plugin/core/HookRegistry.d.ts.map +1 -1
- package/bin/plugin/core/HookRegistry.js +8 -14
- package/bin/plugin/core/HookRegistry.js.map +1 -1
- package/bin/plugin/core/PluginActionExecution.d.ts +33 -0
- package/bin/plugin/core/PluginActionExecution.d.ts.map +1 -0
- package/bin/plugin/core/PluginActionExecution.js +168 -0
- package/bin/plugin/core/PluginActionExecution.js.map +1 -0
- package/bin/plugin/core/PluginActionFactory.d.ts +6 -3
- package/bin/plugin/core/PluginActionFactory.d.ts.map +1 -1
- package/bin/plugin/core/PluginActionFactory.js +3 -0
- package/bin/plugin/core/PluginActionFactory.js.map +1 -1
- package/bin/plugin/core/PluginContext.d.ts +14 -4
- package/bin/plugin/core/PluginContext.d.ts.map +1 -1
- package/bin/plugin/core/PluginContext.js +11 -2
- package/bin/plugin/core/PluginContext.js.map +1 -1
- package/bin/plugin/core/PluginHttpRoutes.d.ts +1 -1
- package/bin/plugin/core/PluginHttpRoutes.d.ts.map +1 -1
- package/bin/plugin/core/PluginHttpRoutes.js +1 -1
- package/bin/plugin/core/PluginHttpRoutes.js.map +1 -1
- package/bin/plugin/core/PluginRegistry.d.ts +41 -26
- package/bin/plugin/core/PluginRegistry.d.ts.map +1 -1
- package/bin/plugin/core/PluginRegistry.js +125 -107
- package/bin/plugin/core/PluginRegistry.js.map +1 -1
- package/bin/plugin/tool/PluginToolRuntime.d.ts.map +1 -1
- package/bin/plugin/tool/PluginToolRuntime.js +4 -1
- package/bin/plugin/tool/PluginToolRuntime.js.map +1 -1
- package/bin/plugin/tool/PluginToolSchemas.d.ts +22 -2
- package/bin/plugin/tool/PluginToolSchemas.d.ts.map +1 -1
- package/bin/plugin/tool/PluginToolSchemas.js +3 -4
- package/bin/plugin/tool/PluginToolSchemas.js.map +1 -1
- package/bin/plugin/tool/PluginTools.d.ts +5 -8
- package/bin/plugin/tool/PluginTools.d.ts.map +1 -1
- package/bin/plugin/tool/PluginTools.js +9 -8
- package/bin/plugin/tool/PluginTools.js.map +1 -1
- package/bin/plugin/types/ActionSchedule.d.ts +6 -0
- package/bin/plugin/types/ActionSchedule.d.ts.map +1 -1
- package/bin/remote/RemoteAgent.js +2 -2
- package/bin/remote/RemoteSession.d.ts +1 -1
- package/bin/remote/TransportFactory.d.ts +1 -1
- package/bin/remote/TransportFactory.js +2 -2
- package/bin/remote/transports/HttpRemoteAgentTransport.d.ts +1 -1
- package/bin/remote/transports/HttpRemoteAgentTransport.d.ts.map +1 -1
- package/bin/remote/transports/HttpRemoteAgentTransport.js +3 -3
- package/bin/remote/transports/HttpRemoteAgentTransport.js.map +1 -1
- package/bin/remote/transports/RpcClient.d.ts +1 -0
- package/bin/remote/transports/RpcClient.d.ts.map +1 -1
- package/bin/remote/transports/RpcClient.js +16 -0
- package/bin/remote/transports/RpcClient.js.map +1 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.d.ts +1 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.d.ts.map +1 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.js +2 -1
- package/bin/remote/transports/RpcRemoteAgentTransport.js.map +1 -1
- package/bin/session/DefaultSessionComposer.js +4 -4
- package/bin/session/DefaultSessionComposer.js.map +1 -1
- package/bin/session/Session.d.ts +9 -3
- package/bin/session/Session.d.ts.map +1 -1
- package/bin/session/Session.js +62 -53
- package/bin/session/Session.js.map +1 -1
- package/bin/session/SessionLoop.d.ts.map +1 -1
- package/bin/session/SessionLoop.js +23 -25
- package/bin/session/SessionLoop.js.map +1 -1
- package/bin/session/SessionMessages.d.ts +9 -11
- package/bin/session/SessionMessages.d.ts.map +1 -1
- package/bin/session/SessionMessages.js +56 -104
- package/bin/session/SessionMessages.js.map +1 -1
- package/bin/session/SessionQueue.d.ts +1 -1
- package/bin/session/SessionState.d.ts +3 -0
- package/bin/session/SessionState.d.ts.map +1 -1
- package/bin/session/SessionState.js +42 -12
- package/bin/session/SessionState.js.map +1 -1
- package/bin/session/SessionTitle.d.ts +6 -6
- package/bin/session/SessionTitle.d.ts.map +1 -1
- package/bin/session/SessionTitle.js +11 -39
- package/bin/session/SessionTitle.js.map +1 -1
- package/bin/session/browse/Browse.d.ts +6 -4
- package/bin/session/browse/Browse.d.ts.map +1 -1
- package/bin/session/browse/Browse.js +25 -43
- package/bin/session/browse/Browse.js.map +1 -1
- package/bin/session/control/SessionInteractions.d.ts +2 -2
- package/bin/session/control/SessionInteractions.d.ts.map +1 -1
- package/bin/session/control/SessionInteractions.js +68 -32
- package/bin/session/control/SessionInteractions.js.map +1 -1
- package/bin/session/execution/SessionAssistantOutputAdapter.d.ts +20 -17
- package/bin/session/execution/SessionAssistantOutputAdapter.d.ts.map +1 -1
- package/bin/session/execution/SessionAssistantOutputAdapter.js +35 -35
- package/bin/session/execution/SessionAssistantOutputAdapter.js.map +1 -1
- package/bin/session/execution/tools/SessionShellApprovalAdapter.d.ts +2 -2
- package/bin/session/execution/tools/SessionShellApprovalAdapter.d.ts.map +1 -1
- package/bin/session/execution/tools/SessionShellApprovalAdapter.js +20 -8
- package/bin/session/execution/tools/SessionShellApprovalAdapter.js.map +1 -1
- package/bin/session/messages/SessionAssistantMessageWriter.d.ts +42 -48
- package/bin/session/messages/SessionAssistantMessageWriter.d.ts.map +1 -1
- package/bin/session/messages/SessionAssistantMessageWriter.js +225 -543
- package/bin/session/messages/SessionAssistantMessageWriter.js.map +1 -1
- package/bin/session/messages/SessionJsonValue.d.ts +0 -10
- package/bin/session/messages/SessionJsonValue.d.ts.map +1 -1
- package/bin/session/messages/SessionJsonValue.js +0 -23
- package/bin/session/messages/SessionJsonValue.js.map +1 -1
- package/bin/session/messages/SessionMessageCompaction.d.ts +7 -3
- package/bin/session/messages/SessionMessageCompaction.d.ts.map +1 -1
- package/bin/session/messages/SessionMessageCompaction.js +69 -91
- package/bin/session/messages/SessionMessageCompaction.js.map +1 -1
- package/bin/session/messages/SessionMessageInteractionWriter.d.ts.map +1 -1
- package/bin/session/messages/SessionMessageInteractionWriter.js +22 -21
- package/bin/session/messages/SessionMessageInteractionWriter.js.map +1 -1
- package/bin/session/messages/SessionMessageText.d.ts +25 -0
- package/bin/session/messages/SessionMessageText.d.ts.map +1 -0
- package/bin/session/messages/SessionMessageText.js +52 -0
- package/bin/session/messages/SessionMessageText.js.map +1 -0
- package/bin/session/preview/SessionMessagePreview.d.ts +3 -3
- package/bin/session/preview/SessionMessagePreview.d.ts.map +1 -1
- package/bin/session/preview/SessionMessagePreview.js +10 -30
- package/bin/session/preview/SessionMessagePreview.js.map +1 -1
- package/bin/session/runtime/SessionTurnContext.d.ts.map +1 -1
- package/bin/session/runtime/SessionTurnContext.js +4 -2
- package/bin/session/runtime/SessionTurnContext.js.map +1 -1
- package/bin/session/storage/Metadata.d.ts +5 -3
- package/bin/session/storage/Metadata.d.ts.map +1 -1
- package/bin/session/storage/Metadata.js +26 -7
- package/bin/session/storage/Metadata.js.map +1 -1
- package/bin/tools/ask/AskQuestionsTool.d.ts +2 -16
- package/bin/tools/ask/AskQuestionsTool.d.ts.map +1 -1
- package/bin/tools/ask/AskQuestionsTool.js +21 -17
- package/bin/tools/ask/AskQuestionsTool.js.map +1 -1
- package/bin/types/action/ActionResult.d.ts +15 -10
- package/bin/types/action/ActionResult.d.ts.map +1 -1
- package/bin/types/action/ActionResult.js +2 -2
- package/bin/types/action/ActionResult.js.map +1 -1
- package/bin/types/agent/AgentOptions.d.ts +7 -14
- package/bin/types/agent/AgentOptions.d.ts.map +1 -1
- package/bin/types/agent/AgentSessionCollection.d.ts +42 -0
- package/bin/types/agent/AgentSessionCollection.d.ts.map +1 -0
- package/bin/types/agent/AgentSessionCollection.js +7 -0
- package/bin/types/agent/AgentSessionCollection.js.map +1 -0
- package/bin/types/agent/AgentStorage.d.ts +18 -0
- package/bin/types/agent/AgentStorage.d.ts.map +1 -0
- package/bin/types/agent/AgentStorage.js +8 -0
- package/bin/types/agent/AgentStorage.js.map +1 -0
- package/bin/types/agent/RemoteAgentOptions.d.ts +1 -1
- package/bin/types/agent/RemoteAgentPluginAction.d.ts +2 -2
- package/bin/types/agent/SessionActor.d.ts +15 -8
- package/bin/types/agent/SessionActor.d.ts.map +1 -1
- package/bin/types/agent/SessionTypes.d.ts +30 -11
- package/bin/types/agent/SessionTypes.d.ts.map +1 -1
- package/bin/types/agent/WorkspaceEntryOptions.d.ts +16 -0
- package/bin/types/agent/WorkspaceEntryOptions.d.ts.map +1 -0
- package/bin/types/agent/WorkspaceEntryOptions.js +8 -0
- package/bin/types/agent/WorkspaceEntryOptions.js.map +1 -0
- package/bin/types/executor/SessionAssistantOutput.d.ts +19 -17
- package/bin/types/executor/SessionAssistantOutput.d.ts.map +1 -1
- package/bin/types/executor/SessionAssistantOutput.js +2 -3
- package/bin/types/executor/SessionAssistantOutput.js.map +1 -1
- package/bin/types/executor/SessionToolExecutionContext.d.ts +8 -5
- package/bin/types/executor/SessionToolExecutionContext.d.ts.map +1 -1
- package/bin/types/executor/SessionToolExecutionContext.js +1 -1
- package/bin/types/executor/SessionTurnContext.d.ts +16 -16
- package/bin/types/executor/SessionTurnContext.d.ts.map +1 -1
- package/bin/types/group/DispatchStrategy.d.ts +62 -0
- package/bin/types/group/DispatchStrategy.d.ts.map +1 -0
- package/bin/types/group/DispatchStrategy.js +93 -0
- package/bin/types/group/DispatchStrategy.js.map +1 -0
- package/bin/types/group/Group.d.ts +61 -0
- package/bin/types/group/Group.d.ts.map +1 -0
- package/bin/types/group/Group.js +3 -0
- package/bin/types/group/Group.js.map +1 -0
- package/bin/types/group/GroupSession.d.ts +149 -0
- package/bin/types/group/GroupSession.d.ts.map +1 -0
- package/bin/types/group/GroupSession.js +3 -0
- package/bin/types/group/GroupSession.js.map +1 -0
- package/bin/types/group/GroupSessionStore.d.ts +77 -0
- package/bin/types/group/GroupSessionStore.d.ts.map +1 -0
- package/bin/types/group/GroupSessionStore.js +3 -0
- package/bin/types/group/GroupSessionStore.js.map +1 -0
- package/bin/types/plugin/AgentPluginContext.d.ts +25 -0
- package/bin/types/plugin/AgentPluginContext.d.ts.map +1 -0
- package/bin/types/plugin/AgentPluginContext.js +10 -0
- package/bin/types/plugin/AgentPluginContext.js.map +1 -0
- package/bin/types/plugin/PluginAction.d.ts +10 -8
- package/bin/types/plugin/PluginAction.d.ts.map +1 -1
- package/bin/types/plugin/PluginActionExecution.d.ts +31 -0
- package/bin/types/plugin/PluginActionExecution.d.ts.map +1 -0
- package/bin/types/plugin/PluginActionExecution.js +10 -0
- package/bin/types/plugin/PluginActionExecution.js.map +1 -0
- package/bin/types/plugin/PluginCommand.d.ts +5 -5
- package/bin/types/plugin/PluginCommand.d.ts.map +1 -1
- package/bin/types/plugin/PluginContext.d.ts +19 -8
- package/bin/types/plugin/PluginContext.d.ts.map +1 -1
- package/bin/types/plugin/PluginContext.js +1 -1
- package/bin/types/plugin/PluginDefinition.d.ts +6 -6
- package/bin/types/plugin/PluginExecutionContext.d.ts +4 -10
- package/bin/types/plugin/PluginExecutionContext.d.ts.map +1 -1
- package/bin/types/plugin/PluginExecutionContext.js +3 -5
- package/bin/types/plugin/PluginExecutionContext.js.map +1 -1
- package/bin/types/plugin/PluginHttp.d.ts +1 -1
- package/bin/types/plugin/PluginRuntime.d.ts +13 -8
- package/bin/types/plugin/PluginRuntime.d.ts.map +1 -1
- package/bin/types/plugin/PluginServices.d.ts +10 -0
- package/bin/types/plugin/PluginServices.d.ts.map +1 -0
- package/bin/types/plugin/PluginServices.js +3 -0
- package/bin/types/plugin/PluginServices.js.map +1 -0
- package/bin/types/plugin/PluginState.d.ts +3 -3
- package/bin/types/plugin/PluginState.d.ts.map +1 -1
- package/bin/types/plugin/PluginState.js +1 -1
- package/bin/types/plugin/PluginTool.d.ts +6 -4
- package/bin/types/plugin/PluginTool.d.ts.map +1 -1
- package/bin/types/rpc/RpcProtocol.d.ts +30 -8
- package/bin/types/rpc/RpcProtocol.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionAction.d.ts +6 -7
- package/bin/types/sdk/AgentSessionAction.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionAction.js +2 -3
- package/bin/types/sdk/AgentSessionAction.js.map +1 -1
- package/bin/types/sdk/AgentSessionPrompt.d.ts +7 -7
- package/bin/types/sdk/AgentSessionPrompt.d.ts.map +1 -1
- package/bin/types/sdk/AgentSessionPrompt.js +1 -4
- package/bin/types/sdk/AgentSessionPrompt.js.map +1 -1
- package/bin/types/session/SessionAction.d.ts +39 -0
- package/bin/types/session/SessionAction.d.ts.map +1 -0
- package/bin/types/session/SessionAction.js +8 -0
- package/bin/types/session/SessionAction.js.map +1 -0
- package/bin/types/session/SessionComposer.d.ts +10 -11
- package/bin/types/session/SessionComposer.d.ts.map +1 -1
- package/bin/types/session/SessionContent.d.ts +41 -0
- package/bin/types/session/SessionContent.d.ts.map +1 -0
- package/bin/types/session/SessionContent.js +8 -0
- package/bin/types/session/SessionContent.js.map +1 -0
- package/bin/types/session/SessionExecution.d.ts +9 -68
- package/bin/types/session/SessionExecution.d.ts.map +1 -1
- package/bin/types/session/SessionInteraction.d.ts +92 -58
- package/bin/types/session/SessionInteraction.d.ts.map +1 -1
- package/bin/types/session/SessionInteraction.js +11 -4
- package/bin/types/session/SessionInteraction.js.map +1 -1
- package/bin/types/session/SessionInteractions.d.ts +1 -1
- package/bin/types/session/SessionLocalState.d.ts +2 -2
- package/bin/types/session/SessionLoop.d.ts +5 -5
- package/bin/types/session/SessionLoop.d.ts.map +1 -1
- package/bin/types/session/SessionMessage.d.ts +27 -87
- package/bin/types/session/SessionMessage.d.ts.map +1 -1
- package/bin/types/session/SessionMessages.d.ts +14 -14
- package/bin/types/session/SessionMessages.d.ts.map +1 -1
- package/bin/types/session/SessionMutation.d.ts +2 -2
- package/bin/types/session/SessionOptions.d.ts +14 -9
- package/bin/types/session/SessionOptions.d.ts.map +1 -1
- package/bin/types/session/SessionOrigin.d.ts +19 -0
- package/bin/types/session/SessionOrigin.d.ts.map +1 -0
- package/bin/types/session/SessionOrigin.js +8 -0
- package/bin/types/session/SessionOrigin.js.map +1 -0
- package/bin/types/session/SessionPort.d.ts +16 -20
- package/bin/types/session/SessionPort.d.ts.map +1 -1
- package/bin/types/session/SessionSegment.d.ts +1 -1
- package/bin/types/session/SessionState.d.ts +9 -6
- package/bin/types/session/SessionState.d.ts.map +1 -1
- package/bin/types/session/SessionSystem.d.ts +1 -1
- package/bin/types/session/SessionTool.d.ts +12 -1
- package/bin/types/session/SessionTool.d.ts.map +1 -1
- package/bin/types/store/LocalStore.d.ts +19 -11
- package/bin/types/store/LocalStore.d.ts.map +1 -1
- package/bin/types/store/LocalStore.js +2 -2
- package/bin/types/store/SessionAttachmentStore.d.ts +4 -4
- package/bin/types/store/SessionAttachmentStore.js +3 -3
- package/bin/types/store/SessionDataStore.d.ts +85 -0
- package/bin/types/store/SessionDataStore.d.ts.map +1 -0
- package/bin/types/store/SessionDataStore.js +9 -0
- package/bin/types/store/SessionDataStore.js.map +1 -0
- package/bin/types/store/SessionStore.d.ts +24 -78
- package/bin/types/store/SessionStore.d.ts.map +1 -1
- package/bin/types/store/SessionStore.js +3 -3
- package/bin/types/tools/ToolActionExecutionContext.d.ts +30 -0
- package/bin/types/tools/ToolActionExecutionContext.d.ts.map +1 -0
- package/bin/types/tools/ToolActionExecutionContext.js +8 -0
- package/bin/types/tools/ToolActionExecutionContext.js.map +1 -0
- package/bin/types/tools/ask/AskQuestionsTool.d.ts +1 -1
- package/bin/utils/logger/Logger.d.ts +21 -9
- package/bin/utils/logger/Logger.d.ts.map +1 -1
- package/bin/utils/logger/Logger.js +18 -9
- package/bin/utils/logger/Logger.js.map +1 -1
- package/bin/workspace/WorkspacePaths.d.ts +3 -32
- package/bin/workspace/WorkspacePaths.d.ts.map +1 -1
- package/bin/workspace/WorkspacePaths.js +7 -46
- package/bin/workspace/WorkspacePaths.js.map +1 -1
- package/bin/workspace/store/JsonlSessionMessageStore.d.ts +1 -1
- package/bin/workspace/store/JsonlSessionMessageStore.d.ts.map +1 -1
- package/bin/workspace/store/LocalGroupSessionDataStore.d.ts +46 -0
- package/bin/workspace/store/LocalGroupSessionDataStore.d.ts.map +1 -0
- package/bin/workspace/store/LocalGroupSessionDataStore.js +197 -0
- package/bin/workspace/store/LocalGroupSessionDataStore.js.map +1 -0
- package/bin/workspace/store/LocalGroupSessionStore.d.ts +22 -0
- package/bin/workspace/store/LocalGroupSessionStore.d.ts.map +1 -0
- package/bin/workspace/store/LocalGroupSessionStore.js +75 -0
- package/bin/workspace/store/LocalGroupSessionStore.js.map +1 -0
- package/bin/workspace/store/LocalSessionAttachmentStore.d.ts +2 -2
- package/bin/workspace/store/LocalSessionAttachmentStore.d.ts.map +1 -1
- package/bin/workspace/store/LocalSessionAttachmentStore.js +2 -2
- package/bin/workspace/store/LocalSessionAttachmentStore.js.map +1 -1
- package/bin/workspace/store/LocalSessionDataStore.d.ts +45 -0
- package/bin/workspace/store/LocalSessionDataStore.d.ts.map +1 -0
- package/bin/workspace/store/LocalSessionDataStore.js +100 -0
- package/bin/workspace/store/LocalSessionDataStore.js.map +1 -0
- package/bin/workspace/store/LocalSessionStore.d.ts +38 -28
- package/bin/workspace/store/LocalSessionStore.d.ts.map +1 -1
- package/bin/workspace/store/LocalSessionStore.js +151 -51
- package/bin/workspace/store/LocalSessionStore.js.map +1 -1
- package/bin/workspace/store/LocalStorePaths.d.ts +31 -83
- package/bin/workspace/store/LocalStorePaths.d.ts.map +1 -1
- package/bin/workspace/store/LocalStorePaths.js +43 -101
- package/bin/workspace/store/LocalStorePaths.js.map +1 -1
- package/bin/workspace/store/SessionMessageStoreFactory.d.ts +1 -1
- package/bin/workspace/store/SessionMessageStoreFactory.d.ts.map +1 -1
- package/bin/workspace/store/SessionMessageStoreFactory.js +1 -1
- package/city-test/agent-http.test.mjs +326 -0
- package/city-test/city-container.test.mjs +156 -0
- package/city-test/city-host-registry.test.mjs +68 -0
- package/city-test/city-transport.test.mjs +282 -0
- package/city-test/group.test.mjs +739 -0
- package/city-test/session-model.test.mjs +169 -0
- package/city-test/transport-lifecycle.test.mjs +164 -0
- package/package.json +30 -17
- package/scripts/ModelClientMock.mjs +165 -0
- package/scripts/action-schedule-store.test.mjs +81 -11
- package/scripts/agent-compiler.mjs +10 -6
- package/scripts/agent-env-shell-sandbox.test.mjs +10 -10
- package/scripts/agent-env.test.mjs +6 -8
- package/scripts/agent-multi-workspace.test.mjs +213 -0
- package/scripts/agent-ready.test.mjs +71 -16
- package/scripts/agent-session-maintenance.test.mjs +15 -28
- package/scripts/agent-store.test.mjs +121 -22
- package/scripts/city-model-tool-loop.test.mjs +66 -195
- package/scripts/core-engine-context-compaction.test.mjs +65 -113
- package/scripts/core-engine-model-stream.test.mjs +87 -0
- package/scripts/executor-failure-result.test.mjs +13 -29
- package/scripts/file-tools.test.mjs +6 -6
- package/scripts/image-plugin-job.test.mjs +77 -40
- package/scripts/logger-isolation.test.mjs +2 -2
- package/scripts/multi-agent-plugin-isolation.test.mjs +11 -9
- package/scripts/plugin-tools.test.mjs +153 -18
- package/scripts/public-api-naming.test.mjs +0 -1
- package/scripts/rewrite-build-aliases.mjs +49 -0
- package/scripts/rpc-url-routing.test.mjs +29 -0
- package/scripts/search-tools.test.mjs +4 -4
- package/scripts/session-ask-question.test.mjs +23 -21
- package/scripts/session-attachments.test.mjs +11 -9
- package/scripts/session-compact-handle.test.mjs +6 -5
- package/scripts/session-composer.test.mjs +61 -18
- package/scripts/session-config-turn-boundary.test.mjs +123 -92
- package/scripts/session-dynamic-interaction.test.mjs +75 -0
- package/scripts/session-fork.test.mjs +35 -0
- package/scripts/session-list-title.test.mjs +14 -56
- package/scripts/session-messages.test.mjs +306 -1681
- package/scripts/session-shell-approval.test.mjs +16 -13
- package/scripts/session-system-blocks.test.mjs +1 -1
- package/scripts/session-title-event.test.mjs +38 -24
- package/scripts/session-tool-approval.test.mjs +17 -15
- package/scripts/session-turn-context.test.mjs +31 -28
- package/scripts/session-turn-failure.test.mjs +112 -110
- package/scripts/verify-build-aliases.mjs +32 -0
- package/scripts/workspace.test.mjs +146 -32
- package/src/agent/Agent.ts +138 -238
- package/src/agent/AgentModel.ts +9 -9
- package/src/agent/AgentSessions.ts +116 -65
- package/src/agent/WorkspaceEntry.ts +309 -0
- package/src/agent/index.ts +4 -0
- package/src/city/host/CityHostRegistry.ts +260 -0
- package/src/city/index.ts +49 -0
- package/src/city/runtime/City.ts +425 -0
- package/src/city/transport/SerializedTransport.ts +65 -0
- package/src/city/transport/http/AgentHTTP.ts +176 -0
- package/src/city/transport/http/CityHTTP.ts +196 -0
- package/src/city/transport/http/NodeHttpAdapter.ts +75 -0
- package/src/city/transport/http/routes/RuntimeRoutes.ts +51 -0
- package/src/city/transport/http/routes/SessionRoutes.ts +497 -0
- package/src/city/transport/rpc/AgentRPC.ts +111 -0
- package/src/city/transport/rpc/CityRPC.ts +138 -0
- package/src/city/transport/rpc/RpcServer.ts +158 -0
- package/src/city/transport/rpc/server/InternalHandlers.ts +223 -0
- package/src/city/transport/rpc/server/RequestDispatcher.ts +67 -0
- package/src/city/transport/rpc/server/SdkSessionHandlers.ts +166 -0
- package/src/city/transport/rpc/server/ServerTypes.ts +103 -0
- package/src/city/transport/session/RemoteSessionConfig.ts +34 -0
- package/src/city/transport/types/AgentHttpBinding.ts +25 -0
- package/src/city/transport/types/AgentHttpRuntime.ts +13 -0
- package/src/city/transport/types/AgentRpcBinding.ts +28 -0
- package/src/city/transport/types/AgentRpcRuntime.ts +20 -0
- package/src/city/transport/types/AgentSessionModelResolver.ts +13 -0
- package/src/city/transport/types/CityHttpRuntime.ts +45 -0
- package/src/city/transport/types/CityRpcRuntime.ts +27 -0
- package/src/city/transport/types/RpcProtocol.ts +32 -0
- package/src/city/types/City.ts +99 -0
- package/src/city/types/PluginHostContext.ts +40 -0
- package/src/city/types/SerializedTransport.ts +19 -0
- package/src/executor/Executor.ts +101 -43
- package/src/executor/README.md +11 -8
- package/src/executor/composer/system/SessionSystemComposer.ts +2 -2
- package/src/executor/composer/system/default/PromptRenderer.ts +2 -2
- package/src/executor/composer/system/default/SystemDomain.ts +5 -5
- package/src/executor/composer/system/default/assets/core.prompt.ts +1 -1
- package/src/executor/composer/system/default/assets/core.prompt.ts.txt +4 -12
- package/src/executor/core-engine/CoreEngineContextCompaction.ts +113 -427
- package/src/executor/core-engine/CoreEngineError.ts +1 -1
- package/src/executor/core-engine/CoreEngineLoopDecision.ts +1 -18
- package/src/executor/core-engine/CoreEngineMessageState.ts +32 -101
- package/src/executor/core-engine/CoreEngineRunner.ts +179 -281
- package/src/executor/core-engine/CoreEngineSignals.ts +98 -346
- package/src/executor/messages/SessionAttachmentMapper.ts +15 -273
- package/src/executor/messages/SessionMessageLog.ts +12 -25
- package/src/executor/messages/SessionModelMessages.ts +223 -0
- package/src/executor/model/ModelGenerate.ts +71 -0
- package/src/executor/model/ModelStepRunner.ts +381 -0
- package/src/executor/services/ExecutorRecoveryPolicy.ts +4 -4
- package/src/executor/types/SessionHistoryMeta.ts +8 -2
- package/src/executor/types/SessionLoop.ts +0 -26
- package/src/executor/types/SessionPrompts.ts +8 -8
- package/src/group/Group.ts +45 -0
- package/src/group/GroupSession.ts +728 -0
- package/src/group/GroupSessions.ts +104 -0
- package/src/group/index.ts +29 -0
- package/src/index.ts +108 -60
- package/src/internal/AgentRuntime.ts +229 -0
- package/src/internal/GroupRuntime.ts +89 -0
- package/src/internal/index.ts +33 -0
- package/src/plugin/core/ActionScheduleExecutor.ts +17 -5
- package/src/plugin/core/ActionScheduleRuntime.ts +16 -6
- package/src/plugin/core/ActionScheduleStore.ts +43 -12
- package/src/plugin/core/HookRegistry.ts +24 -14
- package/src/plugin/core/PluginActionExecution.ts +230 -0
- package/src/plugin/core/PluginActionFactory.ts +9 -3
- package/src/plugin/core/PluginContext.ts +25 -6
- package/src/plugin/core/PluginHttpRoutes.ts +2 -2
- package/src/plugin/core/PluginRegistry.ts +193 -107
- package/src/plugin/tool/PluginToolRuntime.ts +4 -1
- package/src/plugin/tool/PluginToolSchemas.ts +3 -4
- package/src/plugin/tool/PluginTools.ts +12 -8
- package/src/plugin/types/ActionSchedule.ts +6 -0
- package/src/remote/transports/HttpRemoteAgentTransport.ts +3 -3
- package/src/remote/transports/RpcClient.ts +17 -0
- package/src/remote/transports/RpcRemoteAgentTransport.ts +1 -0
- package/src/session/DefaultSessionComposer.ts +3 -3
- package/src/session/Session.ts +54 -42
- package/src/session/SessionLoop.ts +27 -34
- package/src/session/SessionMessages.ts +63 -121
- package/src/session/SessionState.ts +46 -21
- package/src/session/SessionTitle.ts +23 -40
- package/src/session/browse/Browse.ts +35 -63
- package/src/session/control/SessionInteractions.ts +72 -51
- package/src/session/execution/SessionAssistantOutputAdapter.ts +44 -45
- package/src/session/execution/tools/SessionShellApprovalAdapter.ts +20 -9
- package/src/session/messages/SessionAssistantMessageWriter.ts +259 -637
- package/src/session/messages/SessionJsonValue.ts +0 -23
- package/src/session/messages/SessionMessageCompaction.ts +78 -103
- package/src/session/messages/SessionMessageInteractionWriter.ts +22 -22
- package/src/session/messages/SessionMessageText.ts +73 -0
- package/src/session/preview/SessionMessagePreview.ts +15 -45
- package/src/session/runtime/SessionTurnContext.ts +11 -9
- package/src/session/storage/Metadata.ts +38 -9
- package/src/tools/ask/AskQuestionsTool.ts +28 -17
- package/src/types/action/ActionResult.ts +20 -11
- package/src/types/agent/AgentOptions.ts +6 -13
- package/src/types/agent/AgentSessionCollection.ts +61 -0
- package/src/types/agent/AgentStorage.ts +19 -0
- package/src/types/agent/RemoteAgentOptions.ts +1 -1
- package/src/types/agent/SessionActor.ts +9 -0
- package/src/types/agent/SessionTypes.ts +31 -11
- package/src/types/agent/WorkspaceEntryOptions.ts +18 -0
- package/src/types/executor/SessionAssistantOutput.ts +22 -17
- package/src/types/executor/SessionToolExecutionContext.ts +9 -4
- package/src/types/executor/SessionTurnContext.ts +11 -11
- package/src/types/group/DispatchStrategy.ts +165 -0
- package/src/types/group/Group.ts +64 -0
- package/src/types/group/GroupSession.ts +154 -0
- package/src/types/group/GroupSessionStore.ts +82 -0
- package/src/types/plugin/AgentPluginContext.ts +30 -0
- package/src/types/plugin/PluginAction.ts +7 -5
- package/src/types/plugin/PluginActionExecution.ts +36 -0
- package/src/types/plugin/PluginCommand.ts +5 -5
- package/src/types/plugin/PluginContext.ts +23 -7
- package/src/types/plugin/PluginExecutionContext.ts +6 -11
- package/src/types/plugin/PluginRuntime.ts +5 -0
- package/src/types/plugin/PluginServices.ts +11 -0
- package/src/types/plugin/PluginState.ts +2 -2
- package/src/types/plugin/PluginTool.ts +4 -1
- package/src/types/rpc/RpcProtocol.ts +24 -2
- package/src/types/sdk/AgentSessionAction.ts +8 -9
- package/src/types/sdk/AgentSessionPrompt.ts +8 -11
- package/src/types/session/SessionAction.ts +41 -0
- package/src/types/session/SessionComposer.ts +8 -13
- package/src/types/session/SessionContent.ts +52 -0
- package/src/types/session/SessionExecution.ts +9 -88
- package/src/types/session/SessionInteraction.ts +106 -73
- package/src/types/session/SessionLoop.ts +1 -1
- package/src/types/session/SessionMessage.ts +27 -94
- package/src/types/session/SessionMessages.ts +12 -9
- package/src/types/session/SessionOptions.ts +11 -4
- package/src/types/session/SessionOrigin.ts +21 -0
- package/src/types/session/SessionPort.ts +12 -20
- package/src/types/session/SessionState.ts +7 -4
- package/src/types/session/SessionTool.ts +12 -0
- package/src/types/store/LocalStore.ts +19 -11
- package/src/types/store/SessionAttachmentStore.ts +4 -4
- package/src/types/store/SessionDataStore.ts +109 -0
- package/src/types/store/SessionStore.ts +37 -94
- package/src/types/tools/ToolActionExecutionContext.ts +32 -0
- package/src/utils/logger/Logger.ts +33 -12
- package/src/workspace/WorkspacePaths.ts +7 -51
- package/src/workspace/store/JsonlSessionMessageStore.ts +2 -2
- package/src/workspace/store/LocalGroupSessionDataStore.ts +232 -0
- package/src/workspace/store/LocalGroupSessionStore.ts +90 -0
- package/src/workspace/store/LocalSessionAttachmentStore.ts +3 -3
- package/src/workspace/store/LocalSessionDataStore.ts +169 -0
- package/src/workspace/store/LocalSessionStore.ts +202 -86
- package/src/workspace/store/LocalStorePaths.ts +65 -147
- package/src/workspace/store/SessionMessageStoreFactory.ts +1 -1
- package/tsconfig.json +2 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/LICENSE +0 -183
- package/bin/agent/AgentState.d.ts +0 -45
- package/bin/agent/AgentState.d.ts.map +0 -1
- package/bin/agent/AgentState.js +0 -74
- package/bin/agent/AgentState.js.map +0 -1
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts +0 -48
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.d.ts.map +0 -1
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.js +0 -92
- package/bin/executor/core-engine/CoreEngineUiStreamCollector.js.map +0 -1
- package/bin/executor/messages/SessionMessageCodec.d.ts +0 -29
- package/bin/executor/messages/SessionMessageCodec.d.ts.map +0 -1
- package/bin/executor/messages/SessionMessageCodec.js +0 -75
- package/bin/executor/messages/SessionMessageCodec.js.map +0 -1
- package/bin/executor/messages/SessionStepEventMapper.d.ts +0 -19
- package/bin/executor/messages/SessionStepEventMapper.d.ts.map +0 -1
- package/bin/executor/messages/SessionStepEventMapper.js +0 -177
- package/bin/executor/messages/SessionStepEventMapper.js.map +0 -1
- package/bin/executor/messages/UIMessageTransformer.d.ts +0 -29
- package/bin/executor/messages/UIMessageTransformer.d.ts.map +0 -1
- package/bin/executor/messages/UIMessageTransformer.js +0 -114
- package/bin/executor/messages/UIMessageTransformer.js.map +0 -1
- package/bin/executor/messages/UserVisibleText.d.ts +0 -26
- package/bin/executor/messages/UserVisibleText.d.ts.map +0 -1
- package/bin/executor/messages/UserVisibleText.js +0 -65
- package/bin/executor/messages/UserVisibleText.js.map +0 -1
- package/bin/executor/types/SessionRecords.d.ts +0 -162
- package/bin/executor/types/SessionRecords.d.ts.map +0 -1
- package/bin/executor/types/SessionRecords.js +0 -51
- package/bin/executor/types/SessionRecords.js.map +0 -1
- package/bin/plugin/core/PluginActionRunner.d.ts +0 -24
- package/bin/plugin/core/PluginActionRunner.d.ts.map +0 -1
- package/bin/plugin/core/PluginActionRunner.js +0 -19
- package/bin/plugin/core/PluginActionRunner.js.map +0 -1
- package/bin/session/messages/SessionMessageCodec.d.ts +0 -23
- package/bin/session/messages/SessionMessageCodec.d.ts.map +0 -1
- package/bin/session/messages/SessionMessageCodec.js +0 -455
- package/bin/session/messages/SessionMessageCodec.js.map +0 -1
- package/bin/types/agent/AgentState.d.ts +0 -19
- package/bin/types/agent/AgentState.d.ts.map +0 -1
- package/bin/types/agent/AgentState.js +0 -9
- package/bin/types/agent/AgentState.js.map +0 -1
- package/bin/types/store/AgentStore.d.ts +0 -31
- package/bin/types/store/AgentStore.d.ts.map +0 -1
- package/bin/types/store/AgentStore.js +0 -9
- package/bin/types/store/AgentStore.js.map +0 -1
- package/bin/types/workspace/FileSystem.d.ts +0 -55
- package/bin/types/workspace/FileSystem.d.ts.map +0 -1
- package/bin/types/workspace/FileSystem.js +0 -9
- package/bin/types/workspace/FileSystem.js.map +0 -1
- package/bin/types/workspace/FileTool.d.ts +0 -181
- package/bin/types/workspace/FileTool.d.ts.map +0 -1
- package/bin/types/workspace/FileTool.js +0 -10
- package/bin/types/workspace/FileTool.js.map +0 -1
- package/bin/types/workspace/SearchTool.d.ts +0 -131
- package/bin/types/workspace/SearchTool.d.ts.map +0 -1
- package/bin/types/workspace/SearchTool.js +0 -10
- package/bin/types/workspace/SearchTool.js.map +0 -1
- package/bin/types/workspace/Workspace.d.ts +0 -24
- package/bin/types/workspace/Workspace.d.ts.map +0 -1
- package/bin/types/workspace/Workspace.js +0 -9
- package/bin/types/workspace/Workspace.js.map +0 -1
- package/bin/types/workspace/WorkspaceEnv.d.ts +0 -16
- package/bin/types/workspace/WorkspaceEnv.d.ts.map +0 -1
- package/bin/types/workspace/WorkspaceEnv.js +0 -9
- package/bin/types/workspace/WorkspaceEnv.js.map +0 -1
- package/bin/types/workspace/WorkspaceTools.d.ts +0 -20
- package/bin/types/workspace/WorkspaceTools.d.ts.map +0 -1
- package/bin/types/workspace/WorkspaceTools.js +0 -9
- package/bin/types/workspace/WorkspaceTools.js.map +0 -1
- package/bin/utils/cli/CliOutput.d.ts +0 -14
- package/bin/utils/cli/CliOutput.d.ts.map +0 -1
- package/bin/utils/cli/CliOutput.js +0 -98
- package/bin/utils/cli/CliOutput.js.map +0 -1
- package/bin/utils/cli/PrettyStatus.d.ts +0 -25
- package/bin/utils/cli/PrettyStatus.d.ts.map +0 -1
- package/bin/utils/cli/PrettyStatus.js +0 -77
- package/bin/utils/cli/PrettyStatus.js.map +0 -1
- package/bin/utils/logger/FormatRequest.d.ts +0 -29
- package/bin/utils/logger/FormatRequest.d.ts.map +0 -1
- package/bin/utils/logger/FormatRequest.js +0 -309
- package/bin/utils/logger/FormatRequest.js.map +0 -1
- package/bin/utils/logger/FormatResponse.d.ts +0 -46
- package/bin/utils/logger/FormatResponse.d.ts.map +0 -1
- package/bin/utils/logger/FormatResponse.js +0 -186
- package/bin/utils/logger/FormatResponse.js.map +0 -1
- package/bin/utils/logger/FormatShared.d.ts +0 -33
- package/bin/utils/logger/FormatShared.d.ts.map +0 -1
- package/bin/utils/logger/FormatShared.js +0 -215
- package/bin/utils/logger/FormatShared.js.map +0 -1
- package/bin/utils/object/DeepMerge.d.ts +0 -18
- package/bin/utils/object/DeepMerge.d.ts.map +0 -1
- package/bin/utils/object/DeepMerge.js +0 -37
- package/bin/utils/object/DeepMerge.js.map +0 -1
- package/bin/utils/object/ObjectGuards.d.ts +0 -17
- package/bin/utils/object/ObjectGuards.d.ts.map +0 -1
- package/bin/utils/object/ObjectGuards.js +0 -19
- package/bin/utils/object/ObjectGuards.js.map +0 -1
- package/bin/utils/path/AncestorFiles.d.ts +0 -17
- package/bin/utils/path/AncestorFiles.d.ts.map +0 -1
- package/bin/utils/path/AncestorFiles.js +0 -36
- package/bin/utils/path/AncestorFiles.js.map +0 -1
- package/bin/utils/storage/index.d.ts +0 -4
- package/bin/utils/storage/index.d.ts.map +0 -1
- package/bin/utils/storage/index.js +0 -17
- package/bin/utils/storage/index.js.map +0 -1
- package/bin/utils/string/EscapeRegExp.d.ts +0 -17
- package/bin/utils/string/EscapeRegExp.d.ts.map +0 -1
- package/bin/utils/string/EscapeRegExp.js +0 -19
- package/bin/utils/string/EscapeRegExp.js.map +0 -1
- package/bin/workspace/LocalFileSystem.d.ts +0 -44
- package/bin/workspace/LocalFileSystem.d.ts.map +0 -1
- package/bin/workspace/LocalFileSystem.js +0 -153
- package/bin/workspace/LocalFileSystem.js.map +0 -1
- package/bin/workspace/Workspace.d.ts +0 -53
- package/bin/workspace/Workspace.d.ts.map +0 -1
- package/bin/workspace/Workspace.js +0 -151
- package/bin/workspace/Workspace.js.map +0 -1
- package/bin/workspace/WorkspaceBase.d.ts +0 -41
- package/bin/workspace/WorkspaceBase.d.ts.map +0 -1
- package/bin/workspace/WorkspaceBase.js +0 -19
- package/bin/workspace/WorkspaceBase.js.map +0 -1
- package/bin/workspace/WorkspaceEnv.d.ts +0 -19
- package/bin/workspace/WorkspaceEnv.d.ts.map +0 -1
- package/bin/workspace/WorkspaceEnv.js +0 -50
- package/bin/workspace/WorkspaceEnv.js.map +0 -1
- package/bin/workspace/file/FileActionRuntime.d.ts +0 -14
- package/bin/workspace/file/FileActionRuntime.d.ts.map +0 -1
- package/bin/workspace/file/FileActionRuntime.js +0 -386
- package/bin/workspace/file/FileActionRuntime.js.map +0 -1
- package/bin/workspace/file/FileAtomicWriter.d.ts +0 -20
- package/bin/workspace/file/FileAtomicWriter.d.ts.map +0 -1
- package/bin/workspace/file/FileAtomicWriter.js +0 -50
- package/bin/workspace/file/FileAtomicWriter.js.map +0 -1
- package/bin/workspace/file/FileEncoding.d.ts +0 -34
- package/bin/workspace/file/FileEncoding.d.ts.map +0 -1
- package/bin/workspace/file/FileEncoding.js +0 -152
- package/bin/workspace/file/FileEncoding.js.map +0 -1
- package/bin/workspace/file/FilePathPolicy.d.ts +0 -26
- package/bin/workspace/file/FilePathPolicy.d.ts.map +0 -1
- package/bin/workspace/file/FilePathPolicy.js +0 -134
- package/bin/workspace/file/FilePathPolicy.js.map +0 -1
- package/bin/workspace/file/FileToolError.d.ts +0 -30
- package/bin/workspace/file/FileToolError.d.ts.map +0 -1
- package/bin/workspace/file/FileToolError.js +0 -78
- package/bin/workspace/file/FileToolError.js.map +0 -1
- package/bin/workspace/search/SearchActionRuntime.d.ts +0 -14
- package/bin/workspace/search/SearchActionRuntime.d.ts.map +0 -1
- package/bin/workspace/search/SearchActionRuntime.js +0 -359
- package/bin/workspace/search/SearchActionRuntime.js.map +0 -1
- package/bin/workspace/search/SearchToolError.d.ts +0 -26
- package/bin/workspace/search/SearchToolError.d.ts.map +0 -1
- package/bin/workspace/search/SearchToolError.js +0 -76
- package/bin/workspace/search/SearchToolError.js.map +0 -1
- package/bin/workspace/store/LocalAgentStore.d.ts +0 -43
- package/bin/workspace/store/LocalAgentStore.d.ts.map +0 -1
- package/bin/workspace/store/LocalAgentStore.js +0 -135
- package/bin/workspace/store/LocalAgentStore.js.map +0 -1
- package/bin/workspace/tool/FileToolSchemas.d.ts +0 -35
- package/bin/workspace/tool/FileToolSchemas.d.ts.map +0 -1
- package/bin/workspace/tool/FileToolSchemas.js +0 -73
- package/bin/workspace/tool/FileToolSchemas.js.map +0 -1
- package/bin/workspace/tool/FileTools.d.ts +0 -11
- package/bin/workspace/tool/FileTools.d.ts.map +0 -1
- package/bin/workspace/tool/FileTools.js +0 -61
- package/bin/workspace/tool/FileTools.js.map +0 -1
- package/bin/workspace/tool/SearchToolSchemas.d.ts +0 -24
- package/bin/workspace/tool/SearchToolSchemas.d.ts.map +0 -1
- package/bin/workspace/tool/SearchToolSchemas.js +0 -60
- package/bin/workspace/tool/SearchToolSchemas.js.map +0 -1
- package/bin/workspace/tool/SearchTools.d.ts +0 -11
- package/bin/workspace/tool/SearchTools.d.ts.map +0 -1
- package/bin/workspace/tool/SearchTools.js +0 -38
- package/bin/workspace/tool/SearchTools.js.map +0 -1
- package/bin/workspace/tool/WorkspaceTools.d.ts +0 -11
- package/bin/workspace/tool/WorkspaceTools.d.ts.map +0 -1
- package/bin/workspace/tool/WorkspaceTools.js +0 -22
- package/bin/workspace/tool/WorkspaceTools.js.map +0 -1
- package/scripts/core-engine-ui-stream-collector.test.mjs +0 -38
- package/scripts/openai-responses-continuation.test.mjs +0 -78
- package/src/agent/AgentState.ts +0 -96
- package/src/executor/core-engine/CoreEngineUiStreamCollector.ts +0 -136
- package/src/executor/messages/SessionMessageCodec.ts +0 -106
- package/src/executor/messages/SessionStepEventMapper.ts +0 -191
- package/src/executor/messages/UIMessageTransformer.ts +0 -152
- package/src/executor/messages/UserVisibleText.ts +0 -75
- package/src/executor/types/SessionRecords.ts +0 -217
- package/src/plugin/core/PluginActionRunner.ts +0 -36
- package/src/session/messages/SessionMessageCodec.ts +0 -495
- package/src/types/agent/AgentState.ts +0 -22
- package/src/types/store/AgentStore.ts +0 -52
- package/src/types/workspace/FileSystem.ts +0 -76
- package/src/types/workspace/FileTool.ts +0 -225
- package/src/types/workspace/SearchTool.ts +0 -156
- package/src/types/workspace/Workspace.ts +0 -27
- package/src/types/workspace/WorkspaceEnv.ts +0 -19
- package/src/types/workspace/WorkspaceTools.ts +0 -23
- package/src/utils/cli/CliOutput.ts +0 -128
- package/src/utils/cli/PrettyStatus.ts +0 -94
- package/src/utils/logger/FormatRequest.ts +0 -455
- package/src/utils/logger/FormatResponse.ts +0 -265
- package/src/utils/logger/FormatShared.ts +0 -258
- package/src/utils/object/DeepMerge.ts +0 -40
- package/src/utils/object/ObjectGuards.ts +0 -19
- package/src/utils/path/AncestorFiles.ts +0 -40
- package/src/utils/storage/index.ts +0 -19
- package/src/utils/string/EscapeRegExp.ts +0 -19
- package/src/workspace/LocalFileSystem.ts +0 -209
- package/src/workspace/Workspace.ts +0 -178
- package/src/workspace/WorkspaceBase.ts +0 -62
- package/src/workspace/WorkspaceEnv.ts +0 -54
- package/src/workspace/file/FileActionRuntime.ts +0 -433
- package/src/workspace/file/FileAtomicWriter.ts +0 -61
- package/src/workspace/file/FileEncoding.ts +0 -175
- package/src/workspace/file/FilePathPolicy.ts +0 -162
- package/src/workspace/file/FileToolError.ts +0 -99
- package/src/workspace/search/SearchActionRuntime.ts +0 -438
- package/src/workspace/search/SearchToolError.ts +0 -94
- package/src/workspace/store/LocalAgentStore.ts +0 -191
- package/src/workspace/tool/FileToolSchemas.ts +0 -77
- package/src/workspace/tool/FileTools.ts +0 -91
- package/src/workspace/tool/SearchToolSchemas.ts +0 -62
- package/src/workspace/tool/SearchTools.ts +0 -61
- package/src/workspace/tool/WorkspaceTools.ts +0 -31
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent 面向 SDK 用户的 Session 集合类型。
|
|
3
|
+
*
|
|
4
|
+
* Session 归 Agent 所有;Workspace 只在创建时声明本次执行使用的资源环境。
|
|
5
|
+
*/
|
|
6
|
+
import type { WorkspaceBase } from "@downcity/workspace";
|
|
7
|
+
import type { SessionOrigin } from "../session/SessionOrigin.js";
|
|
8
|
+
import type { AgentSession } from "./SessionActor.js";
|
|
9
|
+
import type { AgentCreateSessionInput } from "./SessionTypes.js";
|
|
10
|
+
import type { SessionPort } from "../session/SessionPort.js";
|
|
11
|
+
import type { AgentArchiveSessionInput, AgentArchiveSessionResult, AgentArchiveSessionsInput, AgentArchiveSessionsResult, AgentCleanArchiveResult, AgentListSessionsInput, AgentSessionSummaryPage } from "./SessionTypes.js";
|
|
12
|
+
/** 创建 Agent Session 的公开参数。 */
|
|
13
|
+
export interface AgentCreateSessionOptions extends AgentCreateSessionInput {
|
|
14
|
+
/** 本次 Session 可选使用的 Workspace 资源;未传入时使用内存执行上下文。 */
|
|
15
|
+
workspace?: WorkspaceBase;
|
|
16
|
+
/** 当前 Session 的创建来源;未填写时视为用户直接创建。 */
|
|
17
|
+
origin?: SessionOrigin;
|
|
18
|
+
}
|
|
19
|
+
/** Agent 公开的 Session 创建入口。 */
|
|
20
|
+
export interface AgentSessionCollection {
|
|
21
|
+
/** 在指定 Workspace 中创建一个属于当前 Agent 的 Session。 */
|
|
22
|
+
create(options?: AgentCreateSessionOptions): Promise<AgentSession>;
|
|
23
|
+
/** 在指定 Workspace 中恢复一个已经属于当前 Agent 的 Session。 */
|
|
24
|
+
get(session_id: string, options?: AgentCreateSessionOptions): Promise<AgentSession>;
|
|
25
|
+
/** 列出当前 Agent 的活动 Session。 */
|
|
26
|
+
list(input?: AgentListSessionsInput): Promise<AgentSessionSummaryPage>;
|
|
27
|
+
/** 归档一个 Session。 */
|
|
28
|
+
archive(input: AgentArchiveSessionInput): Promise<AgentArchiveSessionResult>;
|
|
29
|
+
/** 列出已归档 Session。 */
|
|
30
|
+
archived(input?: AgentArchiveSessionsInput): Promise<AgentArchiveSessionsResult>;
|
|
31
|
+
/** 清空已归档 Session。 */
|
|
32
|
+
clean_archive(): Promise<AgentCleanArchiveResult>;
|
|
33
|
+
/** 获取 Session runtime port。 */
|
|
34
|
+
runtime(session_id: string): SessionPort;
|
|
35
|
+
/** 返回当前 Agent 正在执行的 Session 标识。 */
|
|
36
|
+
list_executing_session_ids(): string[];
|
|
37
|
+
/** 永久删除 Session。 */
|
|
38
|
+
remove(session_id: string): Promise<boolean>;
|
|
39
|
+
/** 清空 Session 消息。 */
|
|
40
|
+
clear_messages(session_id: string): Promise<boolean>;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=AgentSessionCollection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentSessionCollection.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentSessionCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AAEvC,8BAA8B;AAC9B,MAAM,WAAW,yBAA0B,SAAQ,uBAAuB;IACxE,mDAAmD;IACnD,SAAS,CAAC,EAAE,aAAa,CAAC;IAC1B,qCAAqC;IACrC,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,8BAA8B;AAC9B,MAAM,WAAW,sBAAsB;IACrC,+CAA+C;IAC/C,MAAM,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEnE,iDAAiD;IACjD,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEpF,8BAA8B;IAC9B,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,qBAAqB;IACrB,QAAQ,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEjF,qBAAqB;IACrB,aAAa,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAElD,+BAA+B;IAC/B,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAAC;IAEzC,mCAAmC;IACnC,0BAA0B,IAAI,MAAM,EAAE,CAAC;IAEvC,oBAAoB;IACpB,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7C,qBAAqB;IACrB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACtD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentSessionCollection.js","sourceRoot":"","sources":["../../../src/types/agent/AgentSessionCollection.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent 级持久化存储。
|
|
3
|
+
*
|
|
4
|
+
* Agent 在 City 中使用持久化文件系统;未加入 City 时使用进程内文件系统。
|
|
5
|
+
* Workspace 只提供执行上下文,不拥有这份存储。
|
|
6
|
+
*/
|
|
7
|
+
import type { SessionStore } from "../store/SessionStore.js";
|
|
8
|
+
import type { FileSystem } from "@downcity/workspace";
|
|
9
|
+
/** Agent 持有的 Session、日志与调度共享存储。 */
|
|
10
|
+
export interface AgentStorage {
|
|
11
|
+
/** Agent 内部数据的稳定根路径。 */
|
|
12
|
+
root_path: string;
|
|
13
|
+
/** 受当前 Agent 根路径约束的文件能力。 */
|
|
14
|
+
files: FileSystem;
|
|
15
|
+
/** 当前 Agent 的 Session 集合存储。 */
|
|
16
|
+
sessions: SessionStore;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=AgentStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentStorage.d.ts","sourceRoot":"","sources":["../../../src/types/agent/AgentStorage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,mCAAmC;AACnC,MAAM,WAAW,YAAY;IAC3B,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,4BAA4B;IAC5B,KAAK,EAAE,UAAU,CAAC;IAClB,+BAA+B;IAC/B,QAAQ,EAAE,YAAY,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AgentStorage.js","sourceRoot":"","sources":["../../../src/types/agent/AgentStorage.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* - RemoteAgent 是远程 runtime 的瘦客户端,因此这里只描述远程调用协议。
|
|
6
6
|
* - 业务 action 的具体 payload 与 data 由目标 plugin 自己定义。
|
|
7
7
|
*/
|
|
8
|
-
import type { JsonValue } from "
|
|
9
|
-
import type { PluginActionResult } from "
|
|
8
|
+
import type { JsonValue } from "../common/Json.js";
|
|
9
|
+
import type { PluginActionResult } from "../plugin/PluginAction.js";
|
|
10
10
|
/**
|
|
11
11
|
* RemoteAgent 远程 plugin action 调用输入。
|
|
12
12
|
*/
|
|
@@ -5,14 +5,15 @@
|
|
|
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, AgentSessionSetOptions, AgentSessionStatus, AgentSessionSummaryPage, AgentSessionSystemSnapshot, RemoteSessionSetInput } from "
|
|
9
|
-
import type { SessionMutationSubscriber, SessionMutationUnsubscribe } from "
|
|
10
|
-
import type { RespondSessionInteractionInput, SessionInteractionResult, SessionPendingInteraction } from "
|
|
11
|
-
import type { ListSessionMessagesInput, SessionMessagePage } from "
|
|
12
|
-
import type { AgentSessionPromptInput } from "
|
|
13
|
-
import type { AgentSessionStopResult } from "
|
|
14
|
-
import type { AgentSessionCompactHandle } from "
|
|
15
|
-
import type { AgentSessionTurnHandle } from "
|
|
8
|
+
import type { AgentCreateSessionInput, AgentArchiveSessionInput, AgentArchiveSessionsInput, AgentArchiveSessionResult, AgentArchiveSessionsResult, AgentCleanArchiveResult, AgentListSessionsInput, AgentSessionConfigSnapshot, AgentSessionForkInput, AgentSessionInfo, AgentSessionSetInput, AgentSessionSetOptions, AgentSessionStatus, AgentSessionSummaryPage, AgentSessionSystemSnapshot, RemoteSessionSetInput } from "./SessionTypes.js";
|
|
9
|
+
import type { SessionMutationSubscriber, SessionMutationUnsubscribe } from "../session/SessionMutation.js";
|
|
10
|
+
import type { RespondSessionInteractionInput, SessionInteractionResult, SessionPendingInteraction } from "../session/SessionInteraction.js";
|
|
11
|
+
import type { ListSessionMessagesInput, SessionMessagePage } from "../session/SessionMessage.js";
|
|
12
|
+
import type { AgentSessionPromptInput } from "../sdk/AgentSessionPrompt.js";
|
|
13
|
+
import type { AgentSessionStopResult } from "../sdk/AgentSessionStop.js";
|
|
14
|
+
import type { AgentSessionCompactHandle } from "../sdk/AgentSessionCompact.js";
|
|
15
|
+
import type { AgentSessionTurnHandle } from "../sdk/AgentSessionTurn.js";
|
|
16
|
+
import type { SessionOrigin } from "../session/SessionOrigin.js";
|
|
16
17
|
/**
|
|
17
18
|
* SDK Session 集合入口。
|
|
18
19
|
*/
|
|
@@ -36,6 +37,10 @@ export interface AgentSessions<TSession extends AgentSessionActor = AgentSession
|
|
|
36
37
|
export interface AgentSessionActor {
|
|
37
38
|
/** 当前 session 稳定标识。 */
|
|
38
39
|
readonly id: string;
|
|
40
|
+
/** 当前 Session 创建时绑定的 Workspace ID;无 Workspace 时为空。 */
|
|
41
|
+
readonly workspace_id?: string;
|
|
42
|
+
/** 当前 Session 的创建来源。 */
|
|
43
|
+
readonly origin?: SessionOrigin;
|
|
39
44
|
/** 读取当前 session 详情。 */
|
|
40
45
|
get_info(): Promise<AgentSessionInfo>;
|
|
41
46
|
/** 追加一条新的 prompt。 */
|
|
@@ -73,6 +78,8 @@ export interface AgentSession extends AgentSessionActor {
|
|
|
73
78
|
readonly config: AgentSessionConfigSnapshot;
|
|
74
79
|
/** 写入当前 session 默认配置。 */
|
|
75
80
|
set(input: AgentSessionSetInput, options?: AgentSessionSetOptions): Promise<void>;
|
|
81
|
+
/** 修改当前 Session 的用户可见标题并发布 canonical mutation。 */
|
|
82
|
+
rename(title: string): Promise<string>;
|
|
76
83
|
/** 把当前 Session 首次生成后固定的完整 system 显式固化到 instruction.md。 */
|
|
77
84
|
snapshot(): Promise<void>;
|
|
78
85
|
/** 使用 Agent 当前 instruction 与 plugin 显式重新生成 Session system。 */
|
|
@@ -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,sBAAsB,EACtB,kBAAkB,EAClB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACV,yBAAyB,EACzB,0BAA0B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EAAE,qBAAqB,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnF,8BAA8B;IAC9B,IAAI,CAAC,KAAK,CAAC,EAAE,qBAAqB,GAAG,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAC3E"}
|
|
@@ -6,25 +6,29 @@
|
|
|
6
6
|
* - session actor 方法接口拆到 `SessionActor.ts`。
|
|
7
7
|
*/
|
|
8
8
|
import type { AgentModel } from "../../agent/AgentModel.js";
|
|
9
|
-
import type { SessionApprovalMode } from "
|
|
9
|
+
import type { SessionApprovalMode } from "../session/SessionInteraction.js";
|
|
10
|
+
import type { SessionOrigin } from "../session/SessionOrigin.js";
|
|
10
11
|
/**
|
|
11
|
-
* 新建
|
|
12
|
+
* 新建 Session 的输入参数。
|
|
13
|
+
*
|
|
14
|
+
* Session ID 由 AgentSessions 在创建时生成,调用方只能在恢复时通过
|
|
15
|
+
* `sessions.get(session_id)` 指定已有 ID。
|
|
12
16
|
*/
|
|
13
17
|
export interface AgentCreateSessionInput {
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
* 关键点(中文)
|
|
18
|
-
* - 传入时表达“创建意图”。
|
|
19
|
-
* - 若该 session 已存在,SDK 应直接报错,而不是静默复用。
|
|
20
|
-
* - 省略时由 SDK 自动生成稳定且不可推导的 session_id。
|
|
21
|
-
*/
|
|
22
|
-
session_id?: string;
|
|
18
|
+
/** 保持创建输入为无配置字段的协议对象。 */
|
|
19
|
+
readonly __create_session_input?: never;
|
|
23
20
|
}
|
|
24
21
|
/**
|
|
25
22
|
* Session 列表查询输入。
|
|
26
23
|
*/
|
|
27
24
|
export interface AgentListSessionsInput {
|
|
25
|
+
/**
|
|
26
|
+
* 只返回绑定到指定 Workspace 的 Session。
|
|
27
|
+
*
|
|
28
|
+
* 省略时查询当前 Agent 的全部 Session;传入时没有 Workspace metadata 的
|
|
29
|
+
* 历史 Session 不会匹配任何 Workspace。
|
|
30
|
+
*/
|
|
31
|
+
workspace_id?: string;
|
|
28
32
|
/**
|
|
29
33
|
* 当前页返回上限。
|
|
30
34
|
*
|
|
@@ -295,6 +299,8 @@ export interface AgentSessionSummary {
|
|
|
295
299
|
message_count: number;
|
|
296
300
|
/** 当前 session 绑定模型的可读标签。 */
|
|
297
301
|
model_label?: string;
|
|
302
|
+
/** 当前 Session 的创建来源。 */
|
|
303
|
+
origin?: SessionOrigin;
|
|
298
304
|
/** 当前 session 是否处于执行中。 */
|
|
299
305
|
executing?: boolean;
|
|
300
306
|
}
|
|
@@ -336,6 +342,12 @@ export interface AgentSessionForkInput {
|
|
|
336
342
|
* - 传入时复制到该消息为止(包含该消息)。
|
|
337
343
|
*/
|
|
338
344
|
message_id?: string;
|
|
345
|
+
/**
|
|
346
|
+
* 是否将 `message_id` 指向的锚点消息复制到新 Session。
|
|
347
|
+
*
|
|
348
|
+
* 省略时默认为 `true`;编辑并重新发送历史消息时传入 `false`,避免新旧消息同时出现。
|
|
349
|
+
*/
|
|
350
|
+
include_message?: boolean;
|
|
339
351
|
}
|
|
340
352
|
/**
|
|
341
353
|
* 归档单个 session 的输入参数。
|
|
@@ -354,6 +366,13 @@ export interface AgentArchiveSessionInput {
|
|
|
354
366
|
* 列出已归档 session 的输入参数。
|
|
355
367
|
*/
|
|
356
368
|
export interface AgentArchiveSessionsInput {
|
|
369
|
+
/**
|
|
370
|
+
* 只返回绑定到指定 Workspace 的归档 Session。
|
|
371
|
+
*
|
|
372
|
+
* 省略时查询当前 Agent 的全部归档 Session;传入时没有 Workspace metadata
|
|
373
|
+
* 的历史 Session 不会匹配任何 Workspace。
|
|
374
|
+
*/
|
|
375
|
+
workspace_id?: string;
|
|
357
376
|
/**
|
|
358
377
|
* 当前页返回上限。
|
|
359
378
|
*
|
|
@@ -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,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;
|
|
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,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,yBAAyB;IACzB,QAAQ,CAAC,sBAAsB,CAAC,EAAE,KAAK,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,UAAU,CAAC;IAEnB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,0BAA0B,CAAC;CACvC;AAED,oCAAoC;AACpC,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB;;;;;;OAMG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,kCAAkC;AAClC,MAAM,WAAW,0BAA0B;IACzC,uBAAuB;IACvB,aAAa,EAAE,mBAAmB,CAAC;CACpC;AAED,8BAA8B;AAC9B,MAAM,WAAW,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AAM,EAAE,CAAC;CAC/B"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkspaceEntry 装配参数。
|
|
3
|
+
*
|
|
4
|
+
* WorkspaceEntry 只表达 Agent 已进入某个 Workspace,不拥有 Agent 身份或 Plugin
|
|
5
|
+
* 定义。Workspace 资源的生命周期在离开时由该作用域统一关闭。
|
|
6
|
+
*/
|
|
7
|
+
import type { Agent } from "../../agent/Agent.js";
|
|
8
|
+
import type { WorkspaceBase } from "@downcity/workspace";
|
|
9
|
+
/** Agent 进入 Workspace 时使用的内部装配参数。 */
|
|
10
|
+
export interface WorkspaceEntryOptions {
|
|
11
|
+
/** 拥有当前作用域的 Agent。 */
|
|
12
|
+
agent: Agent;
|
|
13
|
+
/** 当前进入的项目资源容器。 */
|
|
14
|
+
workspace: WorkspaceBase;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=WorkspaceEntryOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceEntryOptions.d.ts","sourceRoot":"","sources":["../../../src/types/agent/WorkspaceEntryOptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEzD,qCAAqC;AACrC,MAAM,WAAW,qBAAqB;IACpC,sBAAsB;IACtB,KAAK,EAAE,KAAK,CAAC;IAEb,mBAAmB;IACnB,SAAS,EAAE,aAAa,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkspaceEntryOptions.js","sourceRoot":"","sources":["../../../src/types/agent/WorkspaceEntryOptions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG"}
|
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Executor 到 Session
|
|
2
|
+
* Executor 到 canonical Session Assistant Message 的输出端口。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 由 execution Adapter 完成,SessionMessages 仍是唯一 Assistant Message 事实源。
|
|
4
|
+
* 该端口直接消费 Downcity Model Protocol 事件,不定义或转发 UI-shaped chunk。
|
|
6
5
|
*/
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
import type {
|
|
10
|
-
|
|
6
|
+
import type { ModelStreamEvent } from "@downcity/type";
|
|
7
|
+
import type { SessionAssistantResultPart } from "../session/SessionContent.js";
|
|
8
|
+
import type { SessionAssistantMessagePart } from "../session/SessionMessage.js";
|
|
9
|
+
import type { SessionToolExecutionResult, SessionToolInputReady } from "../session/SessionTool.js";
|
|
10
|
+
/** Executor 写入当前 Turn Assistant Message 的稳定能力。 */
|
|
11
11
|
export interface SessionAssistantOutput {
|
|
12
|
-
/**
|
|
12
|
+
/** 开始一个模型 Step 的独立 Part 作用域。 */
|
|
13
13
|
begin_step(): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
14
|
+
/** 直接写入单个标准模型流事件。 */
|
|
15
|
+
write_model_event(event: ModelStreamEvent): Promise<void>;
|
|
16
|
+
/** 在 Tool 审批或执行前提交完整输入。 */
|
|
17
|
+
prepare_tool_input(input: SessionToolInputReady): Promise<void>;
|
|
18
|
+
/** 写入 Tool 执行终态。 */
|
|
19
|
+
write_tool_result(result: SessionToolExecutionResult): Promise<void>;
|
|
20
|
+
/** 使用模型流聚合出的 canonical Parts 校验当前 Step。 */
|
|
21
|
+
finish_step(parts: SessionAssistantMessagePart[]): Promise<void>;
|
|
18
22
|
/** 放弃当前未完成 Step 的临时作用域。 */
|
|
19
23
|
abort_step(): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
prepare_tool_input(input: SessionToolInputReady): Promise<void>;
|
|
22
|
-
/** User steer 已插入会话后,关闭它之前的当前 Assistant Message。 */
|
|
24
|
+
/** User steer 插入前关闭当前连续 Assistant Message。 */
|
|
23
25
|
close_current_message(): Promise<void>;
|
|
24
|
-
/** 把 Action
|
|
25
|
-
|
|
26
|
+
/** 把 Action 产生的封闭内容追加到当前 Assistant Message。 */
|
|
27
|
+
append_result_parts(parts: readonly SessionAssistantResultPart[]): Promise<void>;
|
|
26
28
|
/** 按 Turn 最终结果收口 Assistant 输出。 */
|
|
27
29
|
finish(input: {
|
|
28
30
|
/** Assistant 最终状态。 */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionAssistantOutput.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SessionAssistantOutput.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AACrF,OAAO,KAAK,EACV,0BAA0B,EAC1B,qBAAqB,EACtB,MAAM,gCAAgC,CAAC;AAExC,kDAAkD;AAClD,MAAM,WAAW,sBAAsB;IACrC,gCAAgC;IAChC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,qBAAqB;IACrB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1D,2BAA2B;IAC3B,kBAAkB,CAAC,KAAK,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,oBAAoB;IACpB,iBAAiB,CAAC,MAAM,EAAE,0BAA0B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE,2CAA2C;IAC3C,WAAW,CAAC,KAAK,EAAE,2BAA2B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjE,2BAA2B;IAC3B,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,8CAA8C;IAC9C,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,+CAA+C;IAC/C,mBAAmB,CAAC,KAAK,EAAE,SAAS,0BAA0B,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACjF,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"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Executor 到 Session
|
|
2
|
+
* Executor 到 canonical Session Assistant Message 的输出端口。
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* 由 execution Adapter 完成,SessionMessages 仍是唯一 Assistant Message 事实源。
|
|
4
|
+
* 该端口直接消费 Downcity Model Protocol 事件,不定义或转发 UI-shaped chunk。
|
|
6
5
|
*/
|
|
7
6
|
export {};
|
|
8
7
|
//# sourceMappingURL=SessionAssistantOutput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionAssistantOutput.js","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"SessionAssistantOutput.js","sourceRoot":"","sources":["../../../src/types/executor/SessionAssistantOutput.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 该对象由 Executor 在每个 Session step 绑定到 tool.execute。
|
|
6
|
-
* - Agent 工具读取 session_turn_context,Shell 工具只读取
|
|
6
|
+
* - Agent 工具读取 session_turn_context,Shell 工具只读取 shell_execution_context。
|
|
7
7
|
* - 上下文归属当前 Turn,不通过进程级或异步全局容器共享。
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import type { SessionTurnContext } from "
|
|
9
|
+
import type { ShellExecutionContext } from "@downcity/workspace/shell/types/ShellRuntime.js";
|
|
10
|
+
import type { SessionTurnContext } from "./SessionTurnContext.js";
|
|
11
|
+
import type { ToolActionExecutionContext } from "../tools/ToolActionExecutionContext.js";
|
|
11
12
|
/**
|
|
12
13
|
* Agent 与 Shell 工具共用的单次执行上下文。
|
|
13
14
|
*/
|
|
14
15
|
export interface SessionToolExecutionContext {
|
|
15
|
-
/**
|
|
16
|
-
|
|
16
|
+
/** 业务 Tool 读取的最小执行上下文。 */
|
|
17
|
+
action_execution_context: ToolActionExecutionContext;
|
|
18
|
+
/** 当前 Shell Tool 的 canonical 执行上下文。 */
|
|
19
|
+
shell_execution_context: ShellExecutionContext;
|
|
17
20
|
/** 当前工具调用所属的完整 Session Turn 上下文。 */
|
|
18
21
|
session_turn_context: SessionTurnContext;
|
|
19
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionToolExecutionContext.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionToolExecutionContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionToolExecutionContext.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionToolExecutionContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACtB,MAAM,iDAAiD,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6CAA6C,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,0BAA0B;IAC1B,wBAAwB,EAAE,0BAA0B,CAAC;IACrD,uCAAuC;IACvC,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,oCAAoC;IACpC,oBAAoB,EAAE,kBAAkB,CAAC;CAC1C"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 该对象由 Executor 在每个 Session step 绑定到 tool.execute。
|
|
6
|
-
* - Agent 工具读取 session_turn_context,Shell 工具只读取
|
|
6
|
+
* - Agent 工具读取 session_turn_context,Shell 工具只读取 shell_execution_context。
|
|
7
7
|
* - 上下文归属当前 Turn,不通过进程级或异步全局容器共享。
|
|
8
8
|
*/
|
|
9
9
|
export {};
|
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
* - 分区用于表达领域职责,不引入多套彼此独立的 Context。
|
|
7
7
|
* - 可变状态只能通过行为方法更新,消费者不能直接操作内部数组、lease 或 callback。
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
10
|
-
import type {
|
|
11
|
-
import type {
|
|
12
|
-
import type { SessionAssistantOutput } from "
|
|
13
|
-
import type { AgentPluginExecutionLease } from "
|
|
14
|
-
import type { PluginExecutionContext } from "
|
|
15
|
-
import type { AgentSessionActionCallback, AgentSessionActionEvent, AgentSessionActionRecord } from "
|
|
16
|
-
import type { SessionInteractionPort } from "
|
|
9
|
+
import type { ShellApprovalGateway } from "@downcity/workspace";
|
|
10
|
+
import type { SessionUserMessage } from "../session/SessionMessage.js";
|
|
11
|
+
import type { SessionAssistantResultPart } from "../session/SessionContent.js";
|
|
12
|
+
import type { SessionAssistantOutput } from "./SessionAssistantOutput.js";
|
|
13
|
+
import type { AgentPluginExecutionLease } from "../plugin/PluginRuntime.js";
|
|
14
|
+
import type { PluginExecutionContext } from "../plugin/PluginExecutionContext.js";
|
|
15
|
+
import type { AgentSessionActionCallback, AgentSessionActionEvent, AgentSessionActionRecord } from "../sdk/AgentSessionAction.js";
|
|
16
|
+
import type { SessionInteractionPort } from "../session/SessionInteraction.js";
|
|
17
17
|
/**
|
|
18
18
|
* 创建一个 Session Turn 上下文所需的稳定输入。
|
|
19
19
|
*
|
|
@@ -29,7 +29,7 @@ export interface SessionTurnContextInit {
|
|
|
29
29
|
/** 上游取消信号;上下文会把它转发到自身拥有的运行生命周期。 */
|
|
30
30
|
abort_signal?: AbortSignal;
|
|
31
31
|
/** 在 Step 检查点消费 Session 队列,并返回应并入模型上下文的 User 消息。 */
|
|
32
|
-
merge_step_input?: () => Promise<
|
|
32
|
+
merge_step_input?: () => Promise<SessionUserMessage[]>;
|
|
33
33
|
/** 判断是否仍有等待下一个 Step 消费的 User prompt。 */
|
|
34
34
|
has_pending_step_input?: () => boolean;
|
|
35
35
|
/** 消费一次 canonical history 重载请求。 */
|
|
@@ -85,20 +85,20 @@ export interface SessionTurnContext {
|
|
|
85
85
|
/** 释放当前 Step 持有的 Plugin lease。 */
|
|
86
86
|
release(): Promise<void>;
|
|
87
87
|
/** 为 Plugin 生成只包含稳定、只读运行快照的新对象。 */
|
|
88
|
-
plugin_execution_context(): PluginExecutionContext;
|
|
88
|
+
plugin_execution_context(call_id?: string): PluginExecutionContext;
|
|
89
89
|
};
|
|
90
90
|
/** 当前运行的动态 User 输入及延迟持久化输入。 */
|
|
91
91
|
readonly input: {
|
|
92
92
|
/** 在 Step 边界消费运行期注入消息与 Session 队列消息。 */
|
|
93
|
-
checkpoint(): Promise<
|
|
93
|
+
checkpoint(): Promise<SessionUserMessage[]>;
|
|
94
94
|
/** 判断是否有等待下一个 Step 消费的 Session prompt。 */
|
|
95
95
|
has_pending(): boolean;
|
|
96
96
|
/** 注入一条只影响当前运行、在下一 Step 生效的 User 消息。 */
|
|
97
|
-
inject_user_message(message:
|
|
97
|
+
inject_user_message(message: SessionUserMessage): void;
|
|
98
98
|
/** 延迟到 Assistant 结果落盘后再持久化一条 User 消息。 */
|
|
99
|
-
defer_user_message(message:
|
|
99
|
+
defer_user_message(message: SessionUserMessage): void;
|
|
100
100
|
/** 返回延迟持久化 User 消息的不可变快照。 */
|
|
101
|
-
deferred_user_messages(): readonly
|
|
101
|
+
deferred_user_messages(): readonly SessionUserMessage[];
|
|
102
102
|
/** 消费一次 canonical history 重载请求。 */
|
|
103
103
|
consume_history_reload(): boolean;
|
|
104
104
|
};
|
|
@@ -107,9 +107,9 @@ export interface SessionTurnContext {
|
|
|
107
107
|
/** canonical Assistant Message 的唯一写入端口。 */
|
|
108
108
|
readonly assistant?: SessionAssistantOutput;
|
|
109
109
|
/** 把 Action 产生的 Assistant Parts 加入当前 Step 收口队列。 */
|
|
110
|
-
enqueue_assistant_parts(parts: readonly
|
|
110
|
+
enqueue_assistant_parts(parts: readonly SessionAssistantResultPart[]): void;
|
|
111
111
|
/** 消费当前 Step 中等待写入 canonical Assistant Message 的 Parts。 */
|
|
112
|
-
take_assistant_parts():
|
|
112
|
+
take_assistant_parts(): SessionAssistantResultPart[];
|
|
113
113
|
/** 发布一条不进入 LLM 输入的 Session Action。 */
|
|
114
114
|
publish_action(event: AgentSessionActionEvent): Promise<void>;
|
|
115
115
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionTurnContext.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionTurnContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"SessionTurnContext.d.ts","sourceRoot":"","sources":["../../../src/types/executor/SessionTurnContext.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,iCA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B,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAAC;QAEtD,6BAA6B;QAC7B,sBAAsB,IAAI,SAAS,kBAAkB,EAAE,CAAC;QAExD,mCAAmC;QACnC,sBAAsB,IAAI,OAAO,CAAC;KACnC,CAAC;IAEF,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE;QACf,2CAA2C;QAC3C,QAAQ,CAAC,SAAS,CAAC,EAAE,sBAAsB,CAAC;QAE5C,mDAAmD;QACnD,uBAAuB,CAAC,KAAK,EAAE,SAAS,0BAA0B,EAAE,GAAG,IAAI,CAAC;QAE5E,2DAA2D;QAC3D,oBAAoB,IAAI,0BAA0B,EAAE,CAAC;QAErD,sCAAsC;QACtC,cAAc,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;KAC/D,CAAC;IAEF,iCAAiC;IACjC,QAAQ,CAAC,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAE/C,2BAA2B;IAC3B,QAAQ,CAAC,KAAK,EAAE;QACd,wCAAwC;QACxC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;KAClD,CAAC;CACH;AAED,YAAY,EACV,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,GACzB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** Group 调度策略:为当前消息上下文生成一组有依赖关系的成员投递节点。 */
|
|
2
|
+
import type { GroupMessage } from "./Group.js";
|
|
3
|
+
import type { Agent } from "../../agent/Agent.js";
|
|
4
|
+
import type { AgentModel } from "../../agent/AgentModel.js";
|
|
5
|
+
/** 一个投递节点内成员的发言方式。 */
|
|
6
|
+
export type DispatchResponseMode = "single" | "parallel";
|
|
7
|
+
/** 本次调度的触发来源。 */
|
|
8
|
+
export type DispatchTrigger = "user" | "auto";
|
|
9
|
+
/** 调度图中的一个成员投递节点。 */
|
|
10
|
+
export interface DispatchNode {
|
|
11
|
+
/** 当前调度图内的稳定节点标识。 */
|
|
12
|
+
readonly node_id: string;
|
|
13
|
+
/** 当前节点允许接收消息的成员标识。 */
|
|
14
|
+
readonly member_ids: readonly string[];
|
|
15
|
+
/** 当前节点只运行首个成员,还是允许全部成员并行运行。 */
|
|
16
|
+
readonly response_mode: DispatchResponseMode;
|
|
17
|
+
/** 当前节点依赖的前置节点标识;依赖完成后才能投递。 */
|
|
18
|
+
readonly depends_on_node_ids: readonly string[];
|
|
19
|
+
/** 注入成员 AgentSession 的发言约束。 */
|
|
20
|
+
readonly instruction: string;
|
|
21
|
+
}
|
|
22
|
+
/** 一次调度生成的当前最佳响应图。 */
|
|
23
|
+
export interface DispatchDecision {
|
|
24
|
+
/** 当前调度图中的投递节点。 */
|
|
25
|
+
readonly nodes: readonly DispatchNode[];
|
|
26
|
+
/** 当前图完成后是否允许唯一的 GroupSession auto dispatch 继续判断。 */
|
|
27
|
+
readonly terminal: boolean;
|
|
28
|
+
}
|
|
29
|
+
/** Group 调度策略协议。 */
|
|
30
|
+
export interface DispatchStrategy {
|
|
31
|
+
/** 根据触发来源、当前消息、历史和成员关系生成当前最佳响应图。 */
|
|
32
|
+
decide_dispatch(input: {
|
|
33
|
+
/** 本次调度由用户消息触发,还是由 GroupSession 自动收口触发。 */
|
|
34
|
+
readonly trigger: DispatchTrigger;
|
|
35
|
+
/** 当前待调度的 Group 消息;auto dispatch 时为本批新增消息中的最后一条。 */
|
|
36
|
+
readonly message: GroupMessage;
|
|
37
|
+
/** 当前 auto dispatch 尚未消费的新增消息。 */
|
|
38
|
+
readonly pending_messages: readonly GroupMessage[];
|
|
39
|
+
/** 当前 Group 已存在的消息历史。 */
|
|
40
|
+
readonly messages: readonly GroupMessage[];
|
|
41
|
+
/** 当前 Group 成员快照。 */
|
|
42
|
+
readonly members: readonly Agent[];
|
|
43
|
+
}): Promise<DispatchDecision> | DispatchDecision;
|
|
44
|
+
}
|
|
45
|
+
/** AI 调度策略的构造参数。 */
|
|
46
|
+
export interface AiDispatchStrategyOptions {
|
|
47
|
+
/** Group 用于理解群聊意图并生成调度图的模型。 */
|
|
48
|
+
readonly model?: AgentModel;
|
|
49
|
+
}
|
|
50
|
+
/** 使用 Group.model 理解群聊意图并通过内部 tool call 生成成员投递决定。 */
|
|
51
|
+
export declare class AiDispatchStrategy implements DispatchStrategy {
|
|
52
|
+
private readonly model?;
|
|
53
|
+
constructor(options?: AiDispatchStrategyOptions);
|
|
54
|
+
decide_dispatch(input: {
|
|
55
|
+
readonly trigger: DispatchTrigger;
|
|
56
|
+
readonly message: GroupMessage;
|
|
57
|
+
readonly pending_messages: readonly GroupMessage[];
|
|
58
|
+
readonly messages: readonly GroupMessage[];
|
|
59
|
+
readonly members: readonly Agent[];
|
|
60
|
+
}): Promise<DispatchDecision>;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=DispatchStrategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DispatchStrategy.d.ts","sourceRoot":"","sources":["../../../src/types/group/DispatchStrategy.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAKxD,sBAAsB;AACtB,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzD,iBAAiB;AACjB,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9C,qBAAqB;AACrB,MAAM,WAAW,YAAY;IAC3B,qBAAqB;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,uBAAuB;IACvB,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,gCAAgC;IAChC,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;IAC7C,+BAA+B;IAC/B,QA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