Compose reusable configuration rules at the PromptKit path
This commit is contained in:
@@ -40,20 +40,20 @@ func (state *loaded) materializePrompts() error {
|
||||
}
|
||||
return metadata.Lookup(path)
|
||||
}
|
||||
applicationRoot, err := state.captureSchemaRoot(state.result.Config.SchemaRoot, configkit.Keys("schema_root"), lookupOrigin)
|
||||
applicationRoot, err := state.captureSchemaRoot(state.result.Config.PromptKit.SchemaRoot, configkit.Keys("promptkit", "schema_root"), lookupOrigin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
roots := make(map[string]*domain.ResourceBinding, len(state.result.Config.Collections))
|
||||
for _, name := range sortedKeys(state.result.Config.Collections) {
|
||||
collection := state.result.Config.Collections[name]
|
||||
root, err := state.captureSchemaRoot(collection.SchemaRoot, configkit.Keys("collections", name, "schema_root"), lookupOrigin)
|
||||
roots := make(map[string]*domain.ResourceBinding, len(state.result.Config.PromptKit.Collections))
|
||||
for _, name := range sortedKeys(state.result.Config.PromptKit.Collections) {
|
||||
collection := state.result.Config.PromptKit.Collections[name]
|
||||
root, err := state.captureSchemaRoot(collection.SchemaRoot, configkit.Keys("promptkit", "collections", name, "schema_root"), lookupOrigin)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
roots[name] = root
|
||||
}
|
||||
for _, resources := range resourceSets(&state.result.Config) {
|
||||
for _, resources := range resourceSets(&state.result.Config.PromptKit) {
|
||||
root := applicationRoot
|
||||
if selected := roots[resources.namespace]; resources.isCollection && selected != nil {
|
||||
root = selected
|
||||
|
||||
Reference in New Issue
Block a user