@@ -374,83 +374,11 @@ func (s *AgentPoolService) SetAgentStore(store AgentConfigStore) {
374374
375375// --- Agent CRUD ---
376376
377- func (s * AgentPoolService ) ListAgents () map [string ]bool {
378- statuses := map [string ]bool {}
379- agents := s .pool .List ()
380- for _ , a := range agents {
381- ag := s .pool .GetAgent (a )
382- if ag == nil {
383- continue
384- }
385- statuses [a ] = ! ag .Paused ()
386- }
387- return statuses
388- }
389-
390- func (s * AgentPoolService ) CreateAgent (config * state.AgentConfig ) error {
391- if config .Name == "" {
392- return fmt .Errorf ("name is required" )
393- }
394- return s .pool .CreateAgent (config .Name , config )
395- }
396-
397377func (s * AgentPoolService ) GetAgent (name string ) * agent.Agent {
398- return s .pool .GetAgent (name )
399- }
400-
401- func (s * AgentPoolService ) GetAgentConfig (name string ) * state.AgentConfig {
402- return s .pool .GetConfig (name )
403- }
404-
405- func (s * AgentPoolService ) UpdateAgent (name string , config * state.AgentConfig ) error {
406- old := s .pool .GetConfig (name )
407- if old == nil {
408- return fmt .Errorf ("agent not found: %s" , name )
409- }
410- return s .pool .RecreateAgent (name , config )
411- }
412-
413- func (s * AgentPoolService ) DeleteAgent (name string ) error {
414- return s .pool .Remove (name )
415- }
416-
417- func (s * AgentPoolService ) PauseAgent (name string ) error {
418- ag := s .pool .GetAgent (name )
419- if ag == nil {
420- return fmt .Errorf ("agent not found: %s" , name )
421- }
422- ag .Pause ()
423- return nil
424- }
425-
426- func (s * AgentPoolService ) ResumeAgent (name string ) error {
427- ag := s .pool .GetAgent (name )
428- if ag == nil {
429- return fmt .Errorf ("agent not found: %s" , name )
430- }
431- ag .Resume ()
432- return nil
433- }
434-
435- func (s * AgentPoolService ) GetAgentStatus (name string ) * state.Status {
436- return s .pool .GetStatusHistory (name )
437- }
438-
439- func (s * AgentPoolService ) GetAgentObservables (name string ) ([]coreTypes.Observable , error ) {
440- ag := s .pool .GetAgent (name )
441- if ag == nil {
442- return nil , fmt .Errorf ("agent not found: %s" , name )
443- }
444- return ag .Observer ().History (), nil
445- }
446-
447- func (s * AgentPoolService ) ClearAgentObservables (name string ) error {
448- ag := s .pool .GetAgent (name )
449- if ag == nil {
450- return fmt .Errorf ("agent not found: %s" , name )
378+ if s .pool == nil {
379+ return nil
451380 }
452- ag .Observer ().ClearHistory ()
453- return nil
381+ return s .pool .GetAgent (name )
454382}
455383
456384// Chat sends a message to an agent and returns immediately. Responses come via SSE.
@@ -616,10 +544,6 @@ func (s *AgentPoolService) collectAndCopyMetadata(metadata map[string]any, userI
616544 }
617545}
618546
619- func (s * AgentPoolService ) GetSSEManager (name string ) sse.Manager {
620- return s .pool .GetManager (name )
621- }
622-
623547func (s * AgentPoolService ) GetConfigMeta () state.AgentConfigMeta {
624548 return s .configMeta
625549}
@@ -667,88 +591,6 @@ func (s *AgentPoolService) ExportAgent(name string) ([]byte, error) {
667591 return nil , fmt .Errorf ("agent not found: %s" , name )
668592}
669593
670- // ImportAgent creates an agent from JSON config data.
671- func (s * AgentPoolService ) ImportAgent (data []byte ) error {
672- var cfg state.AgentConfig
673- if err := json .Unmarshal (data , & cfg ); err != nil {
674- return fmt .Errorf ("invalid agent config: %w" , err )
675- }
676- if cfg .Name == "" {
677- return fmt .Errorf ("agent name is required" )
678- }
679- if s .pool == nil {
680- // Distributed mode — save to DB only
681- if s .agentStore != nil {
682- return s .agentStore .SaveConfig (& agents.AgentConfigRecord {
683- Name : cfg .Name ,
684- ConfigJSON : string (data ),
685- Status : "active" ,
686- })
687- }
688- return fmt .Errorf ("cannot import agent: no pool or store available" )
689- }
690- return s .pool .CreateAgent (cfg .Name , & cfg )
691- }
692-
693-
694- // --- Collections ---
695-
696- func (s * AgentPoolService ) CollectionsBackend () collections.Backend {
697- return s .collectionsBackend
698- }
699-
700- func (s * AgentPoolService ) ListCollections () ([]string , error ) {
701- return s .collectionsBackend .ListCollections ()
702- }
703-
704- func (s * AgentPoolService ) CreateCollection (name string ) error {
705- return s .collectionsBackend .CreateCollection (name )
706- }
707-
708- func (s * AgentPoolService ) UploadToCollection (collection , filename string , fileBody io.Reader ) (string , error ) {
709- return s .collectionsBackend .Upload (collection , filename , fileBody )
710- }
711-
712- func (s * AgentPoolService ) ListCollectionEntries (collection string ) ([]string , error ) {
713- return s .collectionsBackend .ListEntries (collection )
714- }
715-
716- func (s * AgentPoolService ) GetCollectionEntryContent (collection , entry string ) (string , int , error ) {
717- return s .collectionsBackend .GetEntryContent (collection , entry )
718- }
719-
720- func (s * AgentPoolService ) SearchCollection (collection , query string , maxResults int ) ([]collections.SearchResult , error ) {
721- return s .collectionsBackend .Search (collection , query , maxResults )
722- }
723-
724- func (s * AgentPoolService ) ResetCollection (collection string ) error {
725- return s .collectionsBackend .Reset (collection )
726- }
727-
728- func (s * AgentPoolService ) DeleteCollectionEntry (collection , entry string ) ([]string , error ) {
729- return s .collectionsBackend .DeleteEntry (collection , entry )
730- }
731-
732- func (s * AgentPoolService ) AddCollectionSource (collection , sourceURL string , intervalMin int ) error {
733- return s .collectionsBackend .AddSource (collection , sourceURL , intervalMin )
734- }
735-
736- func (s * AgentPoolService ) RemoveCollectionSource (collection , sourceURL string ) error {
737- return s .collectionsBackend .RemoveSource (collection , sourceURL )
738- }
739-
740- func (s * AgentPoolService ) ListCollectionSources (collection string ) ([]collections.SourceInfo , error ) {
741- return s .collectionsBackend .ListSources (collection )
742- }
743-
744- func (s * AgentPoolService ) CollectionEntryExists (collection , entry string ) bool {
745- return s .collectionsBackend .EntryExists (collection , entry )
746- }
747-
748- func (s * AgentPoolService ) GetCollectionEntryFilePath (collection , entry string ) (string , error ) {
749- return s .collectionsBackend .GetEntryFilePath (collection , entry )
750- }
751-
752594// --- User Services ---
753595
754596// SetUserServicesManager sets the user services manager for per-user scoping.
0 commit comments