summaryrefslogtreecommitdiff
path: root/internal/hexaiaction/config_view.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-02 14:21:21 +0200
committerPaul Buetow <paul@buetow.org>2026-03-02 14:21:21 +0200
commit43456c479fe497ff1c857aadd66556863c81118c (patch)
treea1ab4027f4def044d27252c0b1b57a641d634ea3 /internal/hexaiaction/config_view.go
parent0928e675046fa5b4d4f2b030e7054cf91e864c41 (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.go18
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
+}