feat(monitoring): dispatch monitoring tasks to desktop via AMQP outbox
Replace SSE /desktop/events with priority AMQP dispatch for monitoring
runs, and add phase1/phase2 infrastructure so desktop workers can lease,
resume, report, skip, and cancel monitoring tasks over the existing
dispatch WebSocket.
- Add monitoring collect outbox worker and phase2 desktop task fields
- Add /desktop/monitoring/tasks/{lease,resume,result,skip,cancel} routes
- Introduce execution-devtools and network-observer on desktop runtime
- Refactor runtime-controller, LoginView, and doubao adapter for the new flow
- Add channelName column to tracking views
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -31,31 +31,31 @@ import (
|
||||
)
|
||||
|
||||
type App struct {
|
||||
Config *config.Config
|
||||
Logger *zap.Logger
|
||||
DB *pgxpool.Pool
|
||||
MonitoringDB *pgxpool.Pool
|
||||
RabbitMQ *rabbitmq.Client
|
||||
Redis *goredis.Client
|
||||
Engine *gin.Engine
|
||||
JWT *auth.Manager
|
||||
Sessions *auth.SessionStore
|
||||
LLM llm.Client
|
||||
RetrievalProvider retrieval.Provider
|
||||
VectorStore retrieval.VectorStore
|
||||
ObjectStorage objectstorage.Client
|
||||
AuditLogs *auditlog.AsyncWriter
|
||||
Config *config.Config
|
||||
Logger *zap.Logger
|
||||
DB *pgxpool.Pool
|
||||
MonitoringDB *pgxpool.Pool
|
||||
RabbitMQ *rabbitmq.Client
|
||||
Redis *goredis.Client
|
||||
Engine *gin.Engine
|
||||
JWT *auth.Manager
|
||||
Sessions *auth.SessionStore
|
||||
LLM llm.Client
|
||||
RetrievalProvider retrieval.Provider
|
||||
VectorStore retrieval.VectorStore
|
||||
ObjectStorage objectstorage.Client
|
||||
AuditLogs *auditlog.AsyncWriter
|
||||
GenerationStreams *stream.GenerationHub
|
||||
DesktopTaskStreams *stream.DesktopTaskHub
|
||||
DesktopDispatch *stream.DesktopDispatchHub
|
||||
Cache cache.Cache
|
||||
KolProfiles repository.KolProfileRepository
|
||||
KolPackages repository.KolPackageRepository
|
||||
KolMarketplace repository.KolMarketplaceRepository
|
||||
KolPrompts repository.KolPromptRepository
|
||||
KolSubscriptions repository.KolSubscriptionRepository
|
||||
KolAssists repository.KolAssistRepository
|
||||
KolPromptAsset *tenantapp.KolPromptAsset
|
||||
Cache cache.Cache
|
||||
KolProfiles repository.KolProfileRepository
|
||||
KolPackages repository.KolPackageRepository
|
||||
KolMarketplace repository.KolMarketplaceRepository
|
||||
KolPrompts repository.KolPromptRepository
|
||||
KolSubscriptions repository.KolSubscriptionRepository
|
||||
KolAssists repository.KolAssistRepository
|
||||
KolPromptAsset *tenantapp.KolPromptAsset
|
||||
}
|
||||
|
||||
func New(configPath string) (*App, error) {
|
||||
@@ -114,6 +114,8 @@ func New(configPath string) (*App, error) {
|
||||
desktopTaskStreams := stream.NewDesktopTaskHub(mqClient)
|
||||
desktopDispatchBindings := []string{
|
||||
cfg.RabbitMQ.DesktopDispatchPublishPrefix + ".*",
|
||||
cfg.RabbitMQ.DesktopDispatchMonitorPrefix + ".*",
|
||||
cfg.RabbitMQ.DesktopDispatchMonitorPrefix + ".*.*",
|
||||
}
|
||||
desktopDispatch := stream.NewDesktopDispatchHub(mqClient, logger, desktopDispatchBindings)
|
||||
appCache := cache.New(cfg.Cache.Driver, rdb)
|
||||
@@ -161,31 +163,31 @@ func New(configPath string) (*App, error) {
|
||||
})
|
||||
|
||||
return &App{
|
||||
Config: cfg,
|
||||
Logger: logger,
|
||||
DB: pool,
|
||||
MonitoringDB: monitoringPool,
|
||||
RabbitMQ: mqClient,
|
||||
Redis: rdb,
|
||||
Engine: engine,
|
||||
JWT: jwtMgr,
|
||||
Sessions: sessions,
|
||||
LLM: llmClient,
|
||||
RetrievalProvider: retrievalProvider,
|
||||
VectorStore: vectorStore,
|
||||
ObjectStorage: objectStorageClient,
|
||||
AuditLogs: auditLogs,
|
||||
Config: cfg,
|
||||
Logger: logger,
|
||||
DB: pool,
|
||||
MonitoringDB: monitoringPool,
|
||||
RabbitMQ: mqClient,
|
||||
Redis: rdb,
|
||||
Engine: engine,
|
||||
JWT: jwtMgr,
|
||||
Sessions: sessions,
|
||||
LLM: llmClient,
|
||||
RetrievalProvider: retrievalProvider,
|
||||
VectorStore: vectorStore,
|
||||
ObjectStorage: objectStorageClient,
|
||||
AuditLogs: auditLogs,
|
||||
GenerationStreams: generationStreams,
|
||||
DesktopTaskStreams: desktopTaskStreams,
|
||||
DesktopDispatch: desktopDispatch,
|
||||
Cache: appCache,
|
||||
KolProfiles: kolProfiles,
|
||||
KolPackages: kolPackages,
|
||||
KolMarketplace: kolMarketplace,
|
||||
KolPrompts: kolPrompts,
|
||||
KolSubscriptions: kolSubscriptions,
|
||||
KolAssists: kolAssists,
|
||||
KolPromptAsset: kolPromptAsset,
|
||||
Cache: appCache,
|
||||
KolProfiles: kolProfiles,
|
||||
KolPackages: kolPackages,
|
||||
KolMarketplace: kolMarketplace,
|
||||
KolPrompts: kolPrompts,
|
||||
KolSubscriptions: kolSubscriptions,
|
||||
KolAssists: kolAssists,
|
||||
KolPromptAsset: kolPromptAsset,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user