solutions: Solutions Guide engine (catalog, rules, wizard state, native config, knowledge index, CLI)
New nested module yetano.dev/yetano/core/solutions: loads the catalog in assets/solutions on top of the Big Picture, evaluates questions and conditions, resolves packages/modules/capabilities, generates native configuration from typed fragments with per-value origins, and builds architecture graph, plan, lock file and handbook. Knowledge index with yetano: references, search and lint (incl. manual sections). CLI with yet's conventions (solution, task, knowledge, open), standalone as yetano-solutions. No execution, no network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
586e76889c
commit
2481a0dd27
48 files changed
+10304
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// Command yetano-solutions runs the Solutions Guide commands on their own
|
||||
// (CI of the catalog, development). In a normal installation the same
|
||||
// commands are part of yet: yet solution, yet task, yet knowledge, yet open.
|
||||
//
|
||||
// yetano-solutions solution list --catalog assets/solutions
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os"
|
||||
"os/signal"
|
||||
|
||||
"yetano.dev/yetano/core"
|
||||
"yetano.dev/yetano/core/paths"
|
||||
"yetano.dev/yetano/core/solutions/cli"
|
||||
)
|
||||
|
||||
var version = "dev"
|
||||
|
||||
func main() {
|
||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
|
||||
defer stop()
|
||||
// instances, sessions and presets are user data: core/paths' data
|
||||
// directory (nothing is created until something is saved)
|
||||
storeDir := os.Getenv("YETANO_SOLUTIONS_HOME")
|
||||
if storeDir == "" {
|
||||
if r, err := paths.For(core.Application{Name: "yetano-solutions", Kind: core.CLI}); err == nil {
|
||||
if d, err := r.DataDir(); err == nil {
|
||||
storeDir = d
|
||||
}
|
||||
}
|
||||
}
|
||||
os.Exit(cli.Run(ctx, os.Args[1:], cli.Env{
|
||||
Stdin: os.Stdin, Stdout: os.Stdout, Stderr: os.Stderr,
|
||||
Interactive: isTerminal(os.Stdin) && isTerminal(os.Stdout),
|
||||
Program: "yetano-solutions",
|
||||
StoreDir: storeDir,
|
||||
Version: version,
|
||||
}))
|
||||
}
|
||||
|
||||
// isTerminal: a character device that is not the null device (/dev/null
|
||||
// is a character device too, and must never start an interactive wizard).
|
||||
func isTerminal(f *os.File) bool {
|
||||
st, err := f.Stat()
|
||||
if err != nil || st.Mode()&os.ModeCharDevice == 0 {
|
||||
return false
|
||||
}
|
||||
if null, err := os.Stat(os.DevNull); err == nil && os.SameFile(st, null) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
Reference in new issue
Block a user