Add runtime prompt values to module outputs

This commit is contained in:
2026-06-15 20:23:02 +00:00
parent 4fac69c9f0
commit ff6aade42c
3 changed files with 59 additions and 6 deletions

View File

@@ -35,9 +35,10 @@ type ConfigItem struct {
}
type Output struct {
ID ID `json:"id"`
StanzaName string `json:"stanzaName"`
Value any `json:"value"`
ID ID `json:"id"`
StanzaName string `json:"stanzaName"`
Value any `json:"value"`
PromptValue any `json:"-" yaml:"-"`
}
type Snapshot struct {
@@ -45,6 +46,13 @@ type Snapshot struct {
Outputs []Output `json:"outputs"`
}
func (o Output) DataPackageValue() any {
if o.PromptValue != nil {
return o.PromptValue
}
return o.Value
}
func NewSnapshot(outputs []Output) (Snapshot, error) {
snapshot := Snapshot{
SchemaVersion: SnapshotSchemaVersion,