feat: встроенные агенты opencode (analyst, dev) через go:embed, распаковка по умолчанию в ./agents рядом с бинарём
All checks were successful
CI / test (push) Successful in 38s
CI / build-and-package (amd64, darwin) (push) Successful in 34s
CI / build-and-package (amd64, linux) (push) Successful in 33s
CI / build-and-package (amd64, windows) (push) Successful in 35s
CI / build-and-package (arm64, darwin) (push) Successful in 35s
CI / build-and-package (arm64, linux) (push) Successful in 34s

This commit is contained in:
Hermes
2026-08-15 15:41:26 +05:00
parent 9e7c95e1d8
commit 2b761aa0bc
6 changed files with 154 additions and 0 deletions

18
internal/agents/embed.go Normal file
View File

@@ -0,0 +1,18 @@
package agents
// WriteTo распаковывает всех встроенных агентов в каталог dir.
import (
"os"
"path/filepath"
)
func writeFile(dir, name string, data []byte) error {
if err := os.MkdirAll(dir, 0o755); err != nil {
return err
}
p := filepath.Join(dir, name)
if err := os.WriteFile(p, data, 0o644); err != nil {
return err
}
return nil
}