diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-02 14:21:21 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-02 14:21:21 +0200 |
| commit | 43456c479fe497ff1c857aadd66556863c81118c (patch) | |
| tree | a1ab4027f4def044d27252c0b1b57a641d634ea3 /internal/hexaiaction/config_view.go | |
| parent | 0928e675046fa5b4d4f2b030e7054cf91e864c41 (diff) | |
hexaiaction: use sectioned config interface instead of full App (task 409)
Diffstat (limited to 'internal/hexaiaction/config_view.go')
| -rw-r--r-- | internal/hexaiaction/config_view.go | 18 |
1 files changed, 18 insertions, 0 deletions
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 +} |
