3434POLICY_PATH = ROOT / "config" / "ulysses" / "hermes-stack.json"
3535MANAGED_SHELL_START = "# >>> diogenes services >>>"
3636MANAGED_SHELL_END = "# <<< diogenes services <<<"
37+ DIOGENES_SEARXNG_URL = "http://localhost:7070"
3738
3839
3940class IntegrationError (RuntimeError ):
@@ -1659,6 +1660,31 @@ def _integrate_workspace() -> None:
16591660 )
16601661
16611662
1663+ def _integrate_searxng () -> None :
1664+ """Point Diogenes at the SearXNG instance managed by Services.
1665+
1666+ Upstream's standalone default is port 8080, while the managed workstation
1667+ service is intentionally published on loopback port 7070. Persist the
1668+ latter through Diogenes' own settings API so web search and Deep Research
1669+ share the same live backend without rewriting an operator's provider
1670+ choice.
1671+ """
1672+ from src .settings import load_settings , save_settings
1673+
1674+ settings = dict (load_settings ())
1675+ settings ["search_url" ] = DIOGENES_SEARXNG_URL
1676+ save_settings (settings )
1677+
1678+
1679+ def _diogenes_searxng_current () -> bool :
1680+ try :
1681+ from src .settings import get_setting
1682+
1683+ return get_setting ("search_url" ) == DIOGENES_SEARXNG_URL
1684+ except Exception :
1685+ return False
1686+
1687+
16621688def _integrate_firecrawl () -> None :
16631689 _set_config_value ("default" , "FIRECRAWL_API_URL" , "http://localhost:3002" )
16641690 _set_config_value ("default" , "FIRECRAWL_API_KEY" , "fc-local" )
@@ -1773,6 +1799,8 @@ def _contract_current(
17731799 and _config_value ("default" , "web.use_gateway" ) is False
17741800 and _shell_environment_current ()
17751801 )
1802+ if integration == "diogenes-searxng" :
1803+ return _diogenes_searxng_current ()
17761804 if integration == "hermes-camofox" :
17771805 return bool (
17781806 _config_value ("default" , "CAMOFOX_URL" )
@@ -1872,7 +1900,9 @@ def integrate(runtime_id: str) -> bool:
18721900 print (f"{ item ['label' ]} : integration is current{ suffix } . Nothing to do." )
18731901 return False
18741902
1875- if integration == "hermes-firecrawl" :
1903+ if integration == "diogenes-searxng" :
1904+ _integrate_searxng ()
1905+ elif integration == "hermes-firecrawl" :
18761906 _integrate_firecrawl ()
18771907 elif integration == "hermes-camofox" :
18781908 _integrate_camofox_browser ()
@@ -1948,6 +1978,8 @@ def integrate(runtime_id: str) -> bool:
19481978 next_step = (
19491979 "Review ~/.config/persephone, then start its installed user service when ready."
19501980 if integration == "persephone"
1981+ else "Diogenes web search and Deep Research now share the managed SearXNG endpoint."
1982+ if integration == "diogenes-searxng"
19511983 else "Continue configuring or restart Hermes when ready."
19521984 )
19531985 print (f"{ item ['label' ]} : integration applied. { next_step } " )
@@ -1958,6 +1990,7 @@ def integrate_all() -> None:
19581990 # Dependency ordering mirrors the verified host: service routing, MCP
19591991 # substrates, isolated Librarian profile, Retrieval, then curated skills.
19601992 ordered = (
1993+ "searxng.search" ,
19611994 "firecrawl.api" ,
19621995 "camofox.browser" ,
19631996 "context.mode.mcp" ,
0 commit comments