@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRecords.js","sourceRoot":"","sources":["../../../src/executor/types/SessionRecords.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA+JH;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAA2C;IAE3C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1D,OAAQ,OAA8B,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAA0D,EAC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EAAE,IAAI,UAAU;YAClE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACzC;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,OAA2C;IAE3C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC1D,OAAO,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Action 解析与执行辅助。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文):Plugin 对外调用协议只有 Action,不再提供 command 兼容层。
|
|
5
|
-
*/
|
|
6
|
-
import type { PluginContext } from "../../types/plugin/PluginContext.js";
|
|
7
|
-
import type { PluginAction, PluginActionResult } from "../../types/plugin/PluginAction.js";
|
|
8
|
-
import type { JsonValue } from "../../types/common/Json.js";
|
|
9
|
-
/** 按名称解析一个 Plugin Action。 */
|
|
10
|
-
export declare function resolve_plugin_action(plugin: {
|
|
11
|
-
actions?: Record<string, PluginAction<JsonValue, JsonValue>>;
|
|
12
|
-
}, action_name: string): PluginAction<JsonValue, JsonValue> | null;
|
|
13
|
-
/** 通过当前 Plugin Registry 执行一个 Action。 */
|
|
14
|
-
export declare function invoke_plugin_action(params: {
|
|
15
|
-
/** Plugin 稳定名称。 */
|
|
16
|
-
plugin_name: string;
|
|
17
|
-
/** Action 稳定名称。 */
|
|
18
|
-
action_name: string;
|
|
19
|
-
/** 可选 JSON 输入。 */
|
|
20
|
-
payload?: JsonValue;
|
|
21
|
-
/** 当前 Agent Plugin Context。 */
|
|
22
|
-
context: PluginContext;
|
|
23
|
-
}): Promise<PluginActionResult<JsonValue>>;
|
|
24
|
-
//# sourceMappingURL=PluginActionRunner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginActionRunner.d.ts","sourceRoot":"","sources":["../../../src/plugin/core/PluginActionRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACvF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAExD,6BAA6B;AAC7B,wBAAgB,qBAAqB,CACnC,MAAM,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;CAAE,EACxE,WAAW,EAAE,MAAM,GAClB,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,GAAG,IAAI,CAG3C;AAED,wCAAwC;AACxC,wBAAsB,oBAAoB,CAAC,MAAM,EAAE;IACjD,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,+BAA+B;IAC/B,OAAO,EAAE,aAAa,CAAC;CACxB,GAAG,OAAO,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC,CAMzC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Plugin Action 解析与执行辅助。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文):Plugin 对外调用协议只有 Action,不再提供 command 兼容层。
|
|
5
|
-
*/
|
|
6
|
-
/** 按名称解析一个 Plugin Action。 */
|
|
7
|
-
export function resolve_plugin_action(plugin, action_name) {
|
|
8
|
-
const key = String(action_name || "").trim();
|
|
9
|
-
return key ? plugin.actions?.[key] ?? null : null;
|
|
10
|
-
}
|
|
11
|
-
/** 通过当前 Plugin Registry 执行一个 Action。 */
|
|
12
|
-
export async function invoke_plugin_action(params) {
|
|
13
|
-
return await params.context.plugins.run_action({
|
|
14
|
-
plugin: params.plugin_name,
|
|
15
|
-
action: params.action_name,
|
|
16
|
-
payload: params.payload,
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=PluginActionRunner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PluginActionRunner.js","sourceRoot":"","sources":["../../../src/plugin/core/PluginActionRunner.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,6BAA6B;AAC7B,MAAM,UAAU,qBAAqB,CACnC,MAAwE,EACxE,WAAmB;IAEnB,MAAM,GAAG,GAAG,MAAM,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC7C,OAAO,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AACpD,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAS1C;IACC,OAAO,MAAM,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;QAC7C,MAAM,EAAE,MAAM,CAAC,WAAW;QAC1B,MAAM,EAAE,MAAM,CAAC,WAAW;QAC1B,OAAO,EAAE,MAAM,CAAC,OAAO;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SessionMessage 与 AI SDK UIMessage 的内部投影转换。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - SessionMessage 是唯一持久化事实;UIMessage 只在 Executor/Composer 边界临时构造。
|
|
6
|
-
* - action/error 不转换为模型消息。
|
|
7
|
-
* - part_id 只服务 Session Message identity,不传入模型协议。
|
|
8
|
-
*/
|
|
9
|
-
import type { UIMessage } from "ai";
|
|
10
|
-
import type { SessionAssistantMessage, SessionAssistantMessagePart, SessionMessage, SessionUserMessagePart } from "../../types/session/SessionMessage.js";
|
|
11
|
-
import type { SessionMessageRecordV1, SessionRecordV1 } from "../../executor/types/SessionRecords.js";
|
|
12
|
-
import type { SessionContextSnapshot } from "../../types/session/SessionSegment.js";
|
|
13
|
-
/** 把 canonical Session 历史快照投影为内部 UIMessage records。 */
|
|
14
|
-
export declare function to_executor_history(session_id: string, snapshot: Readonly<SessionContextSnapshot>): SessionRecordV1[];
|
|
15
|
-
/** 把 Session Message 投影成 Executor 可消费的 UIMessage。 */
|
|
16
|
-
export declare function to_executor_ui_message(message: SessionMessage): SessionMessageRecordV1 | null;
|
|
17
|
-
/** 把 AI SDK user parts 转换成可持久化 Session parts。 */
|
|
18
|
-
export declare function from_ui_user_parts(parts: UIMessage["parts"] | null | undefined): SessionUserMessagePart[];
|
|
19
|
-
/** 把最终 AI SDK assistant parts 转换成 Session parts。 */
|
|
20
|
-
export declare function from_ui_assistant_parts(parts: UIMessage["parts"] | null | undefined): SessionAssistantMessagePart[];
|
|
21
|
-
/** 提取 Assistant Message 的最终可见文本。 */
|
|
22
|
-
export declare function extract_session_assistant_text(message: SessionAssistantMessage | null | undefined): string;
|
|
23
|
-
//# sourceMappingURL=SessionMessageCodec.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageCodec.d.ts","sourceRoot":"","sources":["../../../src/session/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAMpC,OAAO,KAAK,EACV,uBAAuB,EACvB,2BAA2B,EAC3B,cAAc,EAEd,sBAAsB,EACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,sBAAsB,EAEtB,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAEhF,uDAAuD;AACvD,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,QAAQ,CAAC,sBAAsB,CAAC,GACzC,eAAe,EAAE,CAyBnB;AAED,qDAAqD;AACrD,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,cAAc,GACtB,sBAAsB,GAAG,IAAI,CAmC/B;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3C,sBAAsB,EAAE,CAwC1B;AAED,oDAAoD;AACpD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAC3C,2BAA2B,EAAE,CAuJ/B;AAED,oCAAoC;AACpC,wBAAgB,8BAA8B,CAC5C,OAAO,EAAE,uBAAuB,GAAG,IAAI,GAAG,SAAS,GAClD,MAAM,CAMR"}
|
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SessionMessage 与 AI SDK UIMessage 的内部投影转换。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - SessionMessage 是唯一持久化事实;UIMessage 只在 Executor/Composer 边界临时构造。
|
|
6
|
-
* - action/error 不转换为模型消息。
|
|
7
|
-
* - part_id 只服务 Session Message identity,不传入模型协议。
|
|
8
|
-
*/
|
|
9
|
-
import { to_session_json_object, to_session_json_value, to_session_provider_metadata, } from "../../session/messages/SessionJsonValue.js";
|
|
10
|
-
/** 把 canonical Session 历史快照投影为内部 UIMessage records。 */
|
|
11
|
-
export function to_executor_history(session_id, snapshot) {
|
|
12
|
-
const records = [];
|
|
13
|
-
if (snapshot.summary) {
|
|
14
|
-
records.push({
|
|
15
|
-
id: snapshot.summary.summary_id,
|
|
16
|
-
role: "assistant",
|
|
17
|
-
metadata: {
|
|
18
|
-
v: 1,
|
|
19
|
-
ts: snapshot.summary.created_at,
|
|
20
|
-
session_id: session_id,
|
|
21
|
-
source: "compact",
|
|
22
|
-
kind: "summary",
|
|
23
|
-
extra: {
|
|
24
|
-
visibility: "internal",
|
|
25
|
-
summaryThroughSequence: snapshot.summary.through_sequence,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
parts: [{ type: "text", text: snapshot.summary.text }],
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
for (const message of snapshot.messages) {
|
|
32
|
-
const record = to_executor_ui_message(message);
|
|
33
|
-
if (record)
|
|
34
|
-
records.push(record);
|
|
35
|
-
}
|
|
36
|
-
return records;
|
|
37
|
-
}
|
|
38
|
-
/** 把 Session Message 投影成 Executor 可消费的 UIMessage。 */
|
|
39
|
-
export function to_executor_ui_message(message) {
|
|
40
|
-
if (message.type !== "user" && message.type !== "assistant")
|
|
41
|
-
return null;
|
|
42
|
-
const metadata = {
|
|
43
|
-
v: 1,
|
|
44
|
-
ts: message.updated_at,
|
|
45
|
-
session_id: message.session_id,
|
|
46
|
-
turn_id: message.turn_id,
|
|
47
|
-
source: message.type === "user"
|
|
48
|
-
? "ingress"
|
|
49
|
-
: message.kind === "summary"
|
|
50
|
-
? "compact"
|
|
51
|
-
: "egress",
|
|
52
|
-
kind: message.type === "assistant" && message.kind === "summary"
|
|
53
|
-
? "summary"
|
|
54
|
-
: "normal",
|
|
55
|
-
extra: {
|
|
56
|
-
sequence: message.sequence,
|
|
57
|
-
revision: message.revision,
|
|
58
|
-
visibility: message.visibility,
|
|
59
|
-
...(message.type === "user"
|
|
60
|
-
? { inputType: message.input_type }
|
|
61
|
-
: { status: message.status }),
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
return {
|
|
65
|
-
id: message.message_id,
|
|
66
|
-
role: message.type,
|
|
67
|
-
metadata,
|
|
68
|
-
parts: message.type === "user"
|
|
69
|
-
? to_ui_user_parts(message.parts)
|
|
70
|
-
: to_ui_assistant_parts(message.parts),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
/** 把 AI SDK user parts 转换成可持久化 Session parts。 */
|
|
74
|
-
export function from_ui_user_parts(parts) {
|
|
75
|
-
if (!Array.isArray(parts))
|
|
76
|
-
return [];
|
|
77
|
-
return parts.flatMap((part, index) => {
|
|
78
|
-
if (!part || typeof part !== "object")
|
|
79
|
-
return [];
|
|
80
|
-
const candidate = part;
|
|
81
|
-
if (candidate.type === "text") {
|
|
82
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
83
|
-
return [{
|
|
84
|
-
part_id: `user-text:${index + 1}`,
|
|
85
|
-
type: "text",
|
|
86
|
-
text: String(candidate.text || ""),
|
|
87
|
-
state: "done",
|
|
88
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
89
|
-
}];
|
|
90
|
-
}
|
|
91
|
-
if (candidate.type === "file") {
|
|
92
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
93
|
-
return [{
|
|
94
|
-
part_id: `user-file:${index + 1}`,
|
|
95
|
-
type: "file",
|
|
96
|
-
url: String(candidate.url || ""),
|
|
97
|
-
media_type: String(candidate.mediaType || "application/octet-stream"),
|
|
98
|
-
...(typeof candidate.filename === "string"
|
|
99
|
-
? { filename: candidate.filename }
|
|
100
|
-
: {}),
|
|
101
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
102
|
-
}];
|
|
103
|
-
}
|
|
104
|
-
if (String(candidate.type || "").startsWith("data-")) {
|
|
105
|
-
const data_id = typeof candidate.id === "string" ? candidate.id : undefined;
|
|
106
|
-
return [{
|
|
107
|
-
part_id: `user-data:${index + 1}`,
|
|
108
|
-
type: "data",
|
|
109
|
-
data_type: String(candidate.type),
|
|
110
|
-
data: to_session_json_value(candidate.data),
|
|
111
|
-
...(data_id !== undefined ? { data_id } : {}),
|
|
112
|
-
}];
|
|
113
|
-
}
|
|
114
|
-
return [];
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
/** 把最终 AI SDK assistant parts 转换成 Session parts。 */
|
|
118
|
-
export function from_ui_assistant_parts(parts) {
|
|
119
|
-
if (!Array.isArray(parts))
|
|
120
|
-
return [];
|
|
121
|
-
return parts.flatMap((part, index) => {
|
|
122
|
-
if (!part || typeof part !== "object")
|
|
123
|
-
return [];
|
|
124
|
-
const candidate = part;
|
|
125
|
-
const type = String(candidate.type || "");
|
|
126
|
-
if (type === "text" || type === "reasoning") {
|
|
127
|
-
const text = String(candidate.text || "");
|
|
128
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
129
|
-
// 关键点(中文):AI SDK 会为只有 start/end、没有 delta 的流生成空占位 Part。
|
|
130
|
-
// 纯空占位不保存;但 Responses API 的 reasoning 即使没有可见文本,
|
|
131
|
-
// 也可能通过 itemId / encrypted content 与后续 message 形成必须原子重放的协议组。
|
|
132
|
-
if (text.length === 0 &&
|
|
133
|
-
!(type === "reasoning" && provider_metadata !== undefined))
|
|
134
|
-
return [];
|
|
135
|
-
return [{
|
|
136
|
-
part_id: `${type}:${index + 1}`,
|
|
137
|
-
sequence: index + 1,
|
|
138
|
-
type: type,
|
|
139
|
-
text,
|
|
140
|
-
state: candidate.state === "streaming" ? "streaming" : "done",
|
|
141
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
142
|
-
}];
|
|
143
|
-
}
|
|
144
|
-
if (type === "file") {
|
|
145
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
146
|
-
return [{
|
|
147
|
-
part_id: `file:${index + 1}`,
|
|
148
|
-
sequence: index + 1,
|
|
149
|
-
type: "file",
|
|
150
|
-
url: String(candidate.url || ""),
|
|
151
|
-
media_type: String(candidate.mediaType || "application/octet-stream"),
|
|
152
|
-
...(typeof candidate.filename === "string"
|
|
153
|
-
? { filename: candidate.filename }
|
|
154
|
-
: {}),
|
|
155
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
156
|
-
}];
|
|
157
|
-
}
|
|
158
|
-
if (type === "source-url") {
|
|
159
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
160
|
-
return [{
|
|
161
|
-
part_id: `source:${String(candidate.sourceId || index + 1)}`,
|
|
162
|
-
sequence: index + 1,
|
|
163
|
-
type: "source",
|
|
164
|
-
source_type: "url",
|
|
165
|
-
source_id: String(candidate.sourceId || `source-${index + 1}`),
|
|
166
|
-
url: String(candidate.url || ""),
|
|
167
|
-
...(typeof candidate.title === "string" ? { title: candidate.title } : {}),
|
|
168
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
169
|
-
}];
|
|
170
|
-
}
|
|
171
|
-
if (type === "source-document") {
|
|
172
|
-
const provider_metadata = to_session_provider_metadata(candidate.providerMetadata);
|
|
173
|
-
return [{
|
|
174
|
-
part_id: `source:${String(candidate.sourceId || index + 1)}`,
|
|
175
|
-
sequence: index + 1,
|
|
176
|
-
type: "source",
|
|
177
|
-
source_type: "document",
|
|
178
|
-
source_id: String(candidate.sourceId || `source-${index + 1}`),
|
|
179
|
-
media_type: String(candidate.mediaType || "application/octet-stream"),
|
|
180
|
-
title: candidate.title === undefined || candidate.title === null
|
|
181
|
-
? "Document"
|
|
182
|
-
: String(candidate.title),
|
|
183
|
-
...(typeof candidate.filename === "string"
|
|
184
|
-
? { filename: candidate.filename }
|
|
185
|
-
: {}),
|
|
186
|
-
...(provider_metadata !== undefined ? { provider_metadata } : {}),
|
|
187
|
-
}];
|
|
188
|
-
}
|
|
189
|
-
if (type === "step-start") {
|
|
190
|
-
return [{
|
|
191
|
-
part_id: `step:${index + 1}`,
|
|
192
|
-
sequence: index + 1,
|
|
193
|
-
type: "step-start",
|
|
194
|
-
}];
|
|
195
|
-
}
|
|
196
|
-
if (type === "dynamic-tool" || type.startsWith("tool-")) {
|
|
197
|
-
const state = String(candidate.state || "");
|
|
198
|
-
const call_provider_metadata = to_session_provider_metadata(candidate.callProviderMetadata);
|
|
199
|
-
const result_provider_metadata = to_session_provider_metadata(candidate.resultProviderMetadata);
|
|
200
|
-
const tool_metadata = to_session_json_object(candidate.toolMetadata);
|
|
201
|
-
return [{
|
|
202
|
-
part_id: String(candidate.toolCallId || `tool:${index + 1}`),
|
|
203
|
-
sequence: index + 1,
|
|
204
|
-
type: "tool",
|
|
205
|
-
tool_call_id: String(candidate.toolCallId || `tool:${index + 1}`),
|
|
206
|
-
tool_name: String(candidate.toolName || "").trim() ||
|
|
207
|
-
type.replace(/^tool-/, "") ||
|
|
208
|
-
"unknown",
|
|
209
|
-
state: state === "output-available"
|
|
210
|
-
? "completed"
|
|
211
|
-
: state === "output-error" || state === "output-denied"
|
|
212
|
-
? "failed"
|
|
213
|
-
: state === "approval-requested"
|
|
214
|
-
? "waiting-user"
|
|
215
|
-
: state === "input-streaming"
|
|
216
|
-
? "input-streaming"
|
|
217
|
-
: state === "input-available"
|
|
218
|
-
? "ready"
|
|
219
|
-
: "running",
|
|
220
|
-
...(candidate.input !== undefined
|
|
221
|
-
? { input: to_session_json_value(candidate.input) }
|
|
222
|
-
: {}),
|
|
223
|
-
...(candidate.output !== undefined
|
|
224
|
-
? { output: to_session_json_value(candidate.output) }
|
|
225
|
-
: {}),
|
|
226
|
-
...(typeof candidate.errorText === "string"
|
|
227
|
-
? { error: candidate.errorText }
|
|
228
|
-
: {}),
|
|
229
|
-
...(candidate.rawInput !== undefined
|
|
230
|
-
? { raw_input: to_session_json_value(candidate.rawInput) }
|
|
231
|
-
: {}),
|
|
232
|
-
...(typeof candidate.title === "string" ? { title: candidate.title } : {}),
|
|
233
|
-
...(tool_metadata !== undefined ? { tool_metadata } : {}),
|
|
234
|
-
...(typeof candidate.dynamic === "boolean"
|
|
235
|
-
? { dynamic: candidate.dynamic }
|
|
236
|
-
: { dynamic: type === "dynamic-tool" }),
|
|
237
|
-
...(typeof candidate.preliminary === "boolean"
|
|
238
|
-
? { preliminary: candidate.preliminary }
|
|
239
|
-
: {}),
|
|
240
|
-
...(call_provider_metadata !== undefined
|
|
241
|
-
? { call_provider_metadata }
|
|
242
|
-
: {}),
|
|
243
|
-
...(result_provider_metadata !== undefined
|
|
244
|
-
? { result_provider_metadata }
|
|
245
|
-
: {}),
|
|
246
|
-
...(typeof candidate.providerExecuted === "boolean"
|
|
247
|
-
? { provider_executed: candidate.providerExecuted }
|
|
248
|
-
: {}),
|
|
249
|
-
}];
|
|
250
|
-
}
|
|
251
|
-
if (type.startsWith("data-")) {
|
|
252
|
-
const data_id = typeof candidate.id === "string" ? candidate.id : undefined;
|
|
253
|
-
return [{
|
|
254
|
-
part_id: `data:${data_id ?? String(index + 1)}`,
|
|
255
|
-
sequence: index + 1,
|
|
256
|
-
type: "data",
|
|
257
|
-
data_type: type,
|
|
258
|
-
data: to_session_json_value(candidate.data),
|
|
259
|
-
...(data_id !== undefined ? { data_id } : {}),
|
|
260
|
-
}];
|
|
261
|
-
}
|
|
262
|
-
return [];
|
|
263
|
-
});
|
|
264
|
-
}
|
|
265
|
-
/** 提取 Assistant Message 的最终可见文本。 */
|
|
266
|
-
export function extract_session_assistant_text(message) {
|
|
267
|
-
if (!message)
|
|
268
|
-
return "";
|
|
269
|
-
return message.parts
|
|
270
|
-
.flatMap((part) => part.type === "text" ? [part.text] : [])
|
|
271
|
-
.join("")
|
|
272
|
-
.trim();
|
|
273
|
-
}
|
|
274
|
-
function to_ui_user_parts(parts) {
|
|
275
|
-
return parts.map((part) => {
|
|
276
|
-
if (part.type === "text") {
|
|
277
|
-
return {
|
|
278
|
-
type: "text",
|
|
279
|
-
text: part.text,
|
|
280
|
-
state: part.state,
|
|
281
|
-
...(part.provider_metadata !== undefined
|
|
282
|
-
? { providerMetadata: part.provider_metadata }
|
|
283
|
-
: {}),
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
if (part.type === "file") {
|
|
287
|
-
return {
|
|
288
|
-
type: "file",
|
|
289
|
-
url: part.url,
|
|
290
|
-
mediaType: part.media_type,
|
|
291
|
-
...(part.filename !== undefined ? { filename: part.filename } : {}),
|
|
292
|
-
...(part.provider_metadata !== undefined
|
|
293
|
-
? { providerMetadata: part.provider_metadata }
|
|
294
|
-
: {}),
|
|
295
|
-
};
|
|
296
|
-
}
|
|
297
|
-
return {
|
|
298
|
-
type: part.data_type,
|
|
299
|
-
data: part.data,
|
|
300
|
-
...(part.data_id !== undefined ? { id: part.data_id } : {}),
|
|
301
|
-
};
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
function to_ui_assistant_parts(parts) {
|
|
305
|
-
return parts.map((part) => {
|
|
306
|
-
if (part.type === "text" || part.type === "reasoning") {
|
|
307
|
-
return {
|
|
308
|
-
type: part.type,
|
|
309
|
-
text: part.text,
|
|
310
|
-
state: part.state,
|
|
311
|
-
...(part.provider_metadata !== undefined
|
|
312
|
-
? { providerMetadata: part.provider_metadata }
|
|
313
|
-
: {}),
|
|
314
|
-
};
|
|
315
|
-
}
|
|
316
|
-
if (part.type === "file") {
|
|
317
|
-
return {
|
|
318
|
-
type: "file",
|
|
319
|
-
url: part.url,
|
|
320
|
-
mediaType: part.media_type,
|
|
321
|
-
...(part.filename !== undefined ? { filename: part.filename } : {}),
|
|
322
|
-
...(part.provider_metadata !== undefined
|
|
323
|
-
? { providerMetadata: part.provider_metadata }
|
|
324
|
-
: {}),
|
|
325
|
-
};
|
|
326
|
-
}
|
|
327
|
-
if (part.type === "data") {
|
|
328
|
-
return {
|
|
329
|
-
type: part.data_type,
|
|
330
|
-
data: part.data,
|
|
331
|
-
...(part.data_id !== undefined ? { id: part.data_id } : {}),
|
|
332
|
-
};
|
|
333
|
-
}
|
|
334
|
-
if (part.type === "source") {
|
|
335
|
-
if (part.source_type === "url") {
|
|
336
|
-
return {
|
|
337
|
-
type: "source-url",
|
|
338
|
-
sourceId: part.source_id,
|
|
339
|
-
url: part.url,
|
|
340
|
-
...(part.title !== undefined ? { title: part.title } : {}),
|
|
341
|
-
...(part.provider_metadata !== undefined
|
|
342
|
-
? { providerMetadata: part.provider_metadata }
|
|
343
|
-
: {}),
|
|
344
|
-
};
|
|
345
|
-
}
|
|
346
|
-
return {
|
|
347
|
-
type: "source-document",
|
|
348
|
-
sourceId: part.source_id,
|
|
349
|
-
mediaType: part.media_type,
|
|
350
|
-
title: part.title,
|
|
351
|
-
...(part.filename !== undefined ? { filename: part.filename } : {}),
|
|
352
|
-
...(part.provider_metadata !== undefined
|
|
353
|
-
? { providerMetadata: part.provider_metadata }
|
|
354
|
-
: {}),
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
if (part.type === "step-start") {
|
|
358
|
-
return { type: "step-start" };
|
|
359
|
-
}
|
|
360
|
-
if (part.type === "interaction") {
|
|
361
|
-
return {
|
|
362
|
-
type: "data-session-interaction",
|
|
363
|
-
id: part.interaction_id,
|
|
364
|
-
data: {
|
|
365
|
-
interaction_id: part.interaction_id,
|
|
366
|
-
interaction_type: part.interaction_type,
|
|
367
|
-
status: part.status,
|
|
368
|
-
request: part.request,
|
|
369
|
-
...(part.response !== undefined ? { response: part.response } : {}),
|
|
370
|
-
...(part.resolved_at !== undefined
|
|
371
|
-
? { resolved_at: part.resolved_at }
|
|
372
|
-
: {}),
|
|
373
|
-
...(part.cancel_reason !== undefined
|
|
374
|
-
? { cancel_reason: part.cancel_reason }
|
|
375
|
-
: {}),
|
|
376
|
-
},
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
if (!("tool_call_id" in part)) {
|
|
380
|
-
throw new Error(`Unsupported Assistant part: ${part.type}`);
|
|
381
|
-
}
|
|
382
|
-
const has_input = part.input !== undefined || part.input_text !== undefined;
|
|
383
|
-
const input = part.input !== undefined
|
|
384
|
-
? part.input
|
|
385
|
-
: part.input_text !== undefined
|
|
386
|
-
? parse_json(part.input_text)
|
|
387
|
-
: part.raw_input !== undefined
|
|
388
|
-
? undefined
|
|
389
|
-
: {};
|
|
390
|
-
const tool_identity_fields = part.dynamic === false
|
|
391
|
-
? { type: `tool-${part.tool_name}` }
|
|
392
|
-
: { type: "dynamic-tool", toolName: part.tool_name };
|
|
393
|
-
const call_provider_fields = {
|
|
394
|
-
...(part.call_provider_metadata !== undefined
|
|
395
|
-
? { callProviderMetadata: part.call_provider_metadata }
|
|
396
|
-
: {}),
|
|
397
|
-
...(part.provider_executed !== undefined
|
|
398
|
-
? { providerExecuted: part.provider_executed }
|
|
399
|
-
: {}),
|
|
400
|
-
...(part.title !== undefined ? { title: part.title } : {}),
|
|
401
|
-
...(part.tool_metadata !== undefined
|
|
402
|
-
? { toolMetadata: part.tool_metadata }
|
|
403
|
-
: {}),
|
|
404
|
-
};
|
|
405
|
-
if (part.state === "completed") {
|
|
406
|
-
return {
|
|
407
|
-
...tool_identity_fields,
|
|
408
|
-
toolCallId: part.tool_call_id,
|
|
409
|
-
state: "output-available",
|
|
410
|
-
input,
|
|
411
|
-
output: part.output,
|
|
412
|
-
...call_provider_fields,
|
|
413
|
-
...(part.preliminary !== undefined
|
|
414
|
-
? { preliminary: part.preliminary }
|
|
415
|
-
: {}),
|
|
416
|
-
...(part.result_provider_metadata !== undefined
|
|
417
|
-
? { resultProviderMetadata: part.result_provider_metadata }
|
|
418
|
-
: {}),
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
if (part.state === "failed") {
|
|
422
|
-
return {
|
|
423
|
-
...tool_identity_fields,
|
|
424
|
-
toolCallId: part.tool_call_id,
|
|
425
|
-
state: "output-error",
|
|
426
|
-
input,
|
|
427
|
-
...(part.raw_input !== undefined ? { rawInput: part.raw_input } : {}),
|
|
428
|
-
errorText: part.error || "Tool failed",
|
|
429
|
-
...call_provider_fields,
|
|
430
|
-
...(part.result_provider_metadata !== undefined
|
|
431
|
-
? { resultProviderMetadata: part.result_provider_metadata }
|
|
432
|
-
: {}),
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
|
-
return {
|
|
436
|
-
...tool_identity_fields,
|
|
437
|
-
toolCallId: part.tool_call_id,
|
|
438
|
-
state: part.state === "input-streaming" ? "input-streaming" : "input-available",
|
|
439
|
-
...(has_input ? { input } : {}),
|
|
440
|
-
...call_provider_fields,
|
|
441
|
-
};
|
|
442
|
-
});
|
|
443
|
-
}
|
|
444
|
-
function parse_json(input) {
|
|
445
|
-
const value = String(input || "").trim();
|
|
446
|
-
if (!value)
|
|
447
|
-
return {};
|
|
448
|
-
try {
|
|
449
|
-
return JSON.parse(value);
|
|
450
|
-
}
|
|
451
|
-
catch {
|
|
452
|
-
return value;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
//# sourceMappingURL=SessionMessageCodec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SessionMessageCodec.js","sourceRoot":"","sources":["../../../src/session/messages/SessionMessageCodec.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,wCAAwC,CAAC;AAehD,uDAAuD;AACvD,MAAM,UAAU,mBAAmB,CACjC,UAAkB,EAClB,QAA0C;IAE1C,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACrB,OAAO,CAAC,IAAI,CAAC;YACX,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU;YAC/B,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE;gBACR,CAAC,EAAE,CAAC;gBACJ,EAAE,EAAE,QAAQ,CAAC,OAAO,CAAC,UAAU;gBAC/B,UAAU,EAAE,UAAU;gBACtB,MAAM,EAAE,SAAS;gBACjB,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE;oBACL,UAAU,EAAE,UAAU;oBACtB,sBAAsB,EAAE,QAAQ,CAAC,OAAO,CAAC,gBAAgB;iBAC1D;aACF;YACD,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;SACvD,CAAC,CAAC;IACL,CAAC;IACD,KAAK,MAAM,OAAO,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACxC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|
|
1
|
-
/**
|
|
2
|
-
* AgentState 内部装配参数。
|
|
3
|
-
*
|
|
4
|
-
* 职责说明(中文)
|
|
5
|
-
* - 只描述 AgentState 启动 PluginRegistry 长期运行时所需的稳定引用。
|
|
6
|
-
* - 工具注册与 Session 同步由 Agent 负责,AgentState 只负责生命周期。
|
|
7
|
-
*/
|
|
8
|
-
import type { PluginRegistry } from "../../plugin/core/PluginRegistry.js";
|
|
9
|
-
import type { PluginContext } from "../../types/plugin/PluginContext.js";
|
|
10
|
-
/**
|
|
11
|
-
* AgentState 构造参数。
|
|
12
|
-
*/
|
|
13
|
-
export interface AgentStateOptions {
|
|
14
|
-
/** 当前 Agent 共用的执行上下文。 */
|
|
15
|
-
context: PluginContext;
|
|
16
|
-
/** 当前 Agent 唯一的 PluginRegistry 实例。 */
|
|
17
|
-
plugins: PluginRegistry;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=AgentState.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentState.js","sourceRoot":"","sources":["../../../src/types/agent/AgentState.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Store 类型。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - AgentSessions 只通过该接口管理 Session 生命周期和索引。
|
|
6
|
-
* - 接口不暴露物理目录,避免 Session 领域重新依赖路径约定。
|
|
7
|
-
*/
|
|
8
|
-
import type { AgentArchiveSessionResult, AgentArchiveSessionsInput, AgentArchiveSessionsResult, AgentCleanArchiveResult, AgentListSessionsInput, AgentSessionSummaryPage } from "../../types/agent/SessionTypes.js";
|
|
9
|
-
import type { SessionStore } from "../../types/store/SessionStore.js";
|
|
10
|
-
/** Agent 领域持久化入口。 */
|
|
11
|
-
export interface AgentStore {
|
|
12
|
-
/** 返回指定 Session 的稳定持久化视图。 */
|
|
13
|
-
session(session_id: string): SessionStore;
|
|
14
|
-
/** 判断活动 Session 是否存在。 */
|
|
15
|
-
has_session(session_id: string): Promise<boolean>;
|
|
16
|
-
/** 永久删除活动 Session 的全部领域数据。 */
|
|
17
|
-
remove_session(session_id: string): Promise<boolean>;
|
|
18
|
-
/** 清空活动 Session 的 Message 数据。 */
|
|
19
|
-
clear_session_messages(session_id: string): Promise<boolean>;
|
|
20
|
-
/** 返回活动 Session 摘要页。 */
|
|
21
|
-
list_sessions(input: AgentListSessionsInput | undefined, executing_session_ids: ReadonlySet<string>): Promise<AgentSessionSummaryPage>;
|
|
22
|
-
/** 将活动 Session 原子迁入归档区。 */
|
|
23
|
-
archive_session(session_id: string): Promise<AgentArchiveSessionResult>;
|
|
24
|
-
/** 返回已归档 Session 摘要页。 */
|
|
25
|
-
list_archived_sessions(input?: AgentArchiveSessionsInput): Promise<AgentArchiveSessionsResult>;
|
|
26
|
-
/** 永久删除全部归档 Session。 */
|
|
27
|
-
clean_archive(): Promise<AgentCleanArchiveResult>;
|
|
28
|
-
/** 刷新并释放当前 Store 持有的资源。 */
|
|
29
|
-
dispose(): Promise<void>;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=AgentStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"AgentStore.d.ts","sourceRoot":"","sources":["../../../src/types/store/AgentStore.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,qBAAqB;AACrB,MAAM,WAAW,UAAU;IACzB,6BAA6B;IAC7B,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,YAAY,CAAC;IAE1C,yBAAyB;IACzB,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAElD,8BAA8B;IAC9B,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAErD,iCAAiC;IACjC,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAE7D,wBAAwB;IACxB,aAAa,CACX,KAAK,EAAE,sBAAsB,GAAG,SAAS,EACzC,qBAAqB,EAAE,WAAW,CAAC,MAAM,CAAC,GACzC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAEpC,2BAA2B;IAC3B,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAExE,yBAAyB;IACzB,sBAAsB,CACpB,KAAK,CAAC,EAAE,yBAAyB,GAChC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IAEvC,wBAAwB;IACxB,aAAa,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAAC;IAElD,2BAA2B;IAC3B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B"}
|