22import json
33import time
44
5+ from resource_secretary .apps import discover_applications
56from resource_secretary .providers import discover_providers
67from resource_secretary .providers .mock import discover_mock_providers
78
@@ -15,19 +16,20 @@ class WorkerBase:
1516 ask secretary. We provide it here so that a hub can use it to generate
1617 its dual mode (acting as worker AND hub.)
1718 """
19+
1820 def jsonify_response (self , result ):
1921 """
2022 Ensure we get the text, and separate and parse tool calls,
2123 which the agent will return in a verbose mode.
2224 """
23- print (' result' )
25+ print (" result" )
2426 print (result )
2527 print (type (result ))
2628 if isinstance (result , dict ):
2729 return result
2830 if not isinstance (result , str ) and hasattr (result , "content" ):
2931 result = result .content [0 ].text
30-
32+
3133 # Audit the tool calls (Did the agent just get lucky?)
3234 calls = []
3335 if "CALLS" in result :
@@ -47,11 +49,14 @@ def init_providers(self, mock=False):
4749 Probe the local system on startup. E.g., "we found spack, flux, etc."
4850 These can be faux (mock) or real discovered providers
4951 """
52+ # We can use apps in mock or regular
53+ apps = discover_applications ()
5054 logger .info ("📡 Probing local system for resource providers..." )
5155 if mock :
5256 self .catalog = discover_mock_providers (self .worker_id , choice = mock )
5357 else :
5458 self .catalog = discover_providers ()
59+ self .catalog .update (apps )
5560
5661 def register_agent_tools (self ):
5762 """
0 commit comments