Capture prompts from identified lists

This commit is contained in:
2026-11-02 03:56:23 +00:00
parent 8e8f61f53f
commit c3ce15a4ab
4 changed files with 46 additions and 34 deletions

View File

@@ -323,11 +323,11 @@ type promptInputPresence struct {
description fieldState
}
func capturePromptMetadata(prompts map[string]promptConfig, basePath configkit.Path, namespace string, resolution *configkit.Resolution, destination map[string][]promptInputPresence) {
for _, id := range sortedKeys(prompts) {
inputs := prompts[id].Inputs
func capturePromptMetadata(prompts []promptConfig, basePath configkit.Path, namespace string, resolution *configkit.Resolution, destination map[string][]promptInputPresence) {
for promptIndex, prompt := range prompts {
inputs := prompt.Inputs
states := make([]promptInputPresence, len(inputs))
base := basePath.Key(id).Key("inputs")
base := basePath.Index(promptIndex).Key("inputs")
for index := range inputs {
path := base.Index(index)
states[index] = promptInputPresence{
@@ -335,7 +335,7 @@ func capturePromptMetadata(prompts map[string]promptConfig, basePath configkit.P
description: captureFieldState(path.Key("description"), resolution),
}
}
destination[indexedResourceID(namespace, id)] = states
destination[indexedResourceID(namespace, prompt.ID)] = states
}
}