Expose native configuration scopes and independent comparisons
This commit is contained in:
@@ -20,19 +20,13 @@ func Execute(ctx context.Context, identity commandkit.Identity, args []string, s
|
||||
}
|
||||
|
||||
func newApp(identity commandkit.Identity) (*commandkit.App, error) {
|
||||
application := ckconfig.FromConfigKit("app", "Scriptorium application configuration.", loadApplication)
|
||||
framework := ckprompt.ConfigScope(loadEngine)
|
||||
configuration := ckconfig.Command(ckconfig.Suite[applicationInput, struct{}]{
|
||||
NewInput: func() applicationInput { return applicationInput{} },
|
||||
Scopes: []ckconfig.Scope[applicationInput, struct{}]{application, framework},
|
||||
})
|
||||
definitions := ckprompt.FromEngine(loadEngine)
|
||||
declarations := []commandkit.Declaration{
|
||||
commandkit.NewCommand(commandkit.CommandSpec[struct{}]{Name: "run", Summary: "Run a stored prompt.", Run: commandNotImplemented}),
|
||||
commandkit.NewCommand(commandkit.CommandSpec[serveInput]{Name: "serve", Summary: "Serve the HTTP API.", Flags: serveFlags(), Run: func(commandkit.Invocation, serveInput) commandkit.Outcome {
|
||||
return commandkit.Failure("Server startup is not implemented.")
|
||||
}}),
|
||||
configuration,
|
||||
configurationCommand(),
|
||||
commandkit.Completion("scriptorium"),
|
||||
}
|
||||
declarations = append(declarations, ckprompt.Declarations(definitions)...)
|
||||
|
||||
Reference in New Issue
Block a user