Mount configuration fragments under PromptKit
This commit is contained in:
@@ -8,12 +8,13 @@ import (
|
||||
"path/filepath"
|
||||
|
||||
"go.maximumdirect.net/configkit"
|
||||
"go.maximumdirect.net/promptkit/internal/configuration"
|
||||
"go.maximumdirect.net/promptkit/internal/domain"
|
||||
"go.maximumdirect.net/promptkit/internal/filecatalog"
|
||||
)
|
||||
|
||||
// CollectionInput mounts source at the selected collection's configuration
|
||||
// destination, collections/<namespace>, and enables ConfigKit imports for that
|
||||
// destination, /promptkit/collections/<namespace>, and enables ConfigKit imports for that
|
||||
// input. An invalid namespace returns an error matching ErrInvalidConfig. The
|
||||
// source is not read or validated until ConfigKit loads it. Callers may adjust
|
||||
// the returned input, including its filesystem context or imports setting.
|
||||
@@ -23,11 +24,23 @@ func CollectionInput(namespace string, source configkit.Source) (configkit.Input
|
||||
}
|
||||
return configkit.Input{
|
||||
Source: source,
|
||||
Destination: configkit.Keys("collections", namespace),
|
||||
Destination: configkit.Keys("promptkit", "collections", namespace),
|
||||
Imports: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// SettingsInput mounts a wrapperless PromptKit settings fragment at /promptkit.
|
||||
// It does not acquire the source; callers may adjust the returned input.
|
||||
func SettingsInput(source configkit.Source) configkit.Input {
|
||||
return configkit.Input{Source: source, Destination: configkit.Keys("promptkit")}
|
||||
}
|
||||
|
||||
// BundledOpenRouterUnderlay selects the bundled OpenRouter settings fragment.
|
||||
// It does not acquire its source until ConfigKit loads it.
|
||||
func BundledOpenRouterUnderlay() configkit.Underlay {
|
||||
return configuration.BundledOpenRouterUnderlay()
|
||||
}
|
||||
|
||||
// DirectoryInputs selects the YAML files beneath an explicitly chosen host
|
||||
// directory as one strict-composition group. The returned order is deterministic;
|
||||
// it does not assign precedence among those files. Discovery is recursive over
|
||||
|
||||
Reference in New Issue
Block a user