From 43456c479fe497ff1c857aadd66556863c81118c Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 2 Mar 2026 14:21:21 +0200 Subject: hexaiaction: use sectioned config interface instead of full App (task 409) --- internal/hexaiaction/config_view.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 internal/hexaiaction/config_view.go (limited to 'internal/hexaiaction/config_view.go') diff --git a/internal/hexaiaction/config_view.go b/internal/hexaiaction/config_view.go new file mode 100644 index 0000000..127ef6f --- /dev/null +++ b/internal/hexaiaction/config_view.go @@ -0,0 +1,18 @@ +package hexaiaction + +import "codeberg.org/snonux/hexai/internal/appconfig" + +// actionConfig narrows dependencies to the config sections needed by actions. +type actionConfig interface { + CoreSection() appconfig.CoreConfig + ProviderSection() appconfig.ProviderConfig + PromptSection() appconfig.PromptConfig +} + +func actionConfigAsApp(cfg actionConfig) appconfig.App { + app := appconfig.App{} + app.ApplyCoreSection(cfg.CoreSection()) + app.ApplyProviderSection(cfg.ProviderSection()) + app.ApplyPromptSection(cfg.PromptSection()) + return app +} -- cgit v1.2.3