Documentation
¶
Overview ¶
Package form contains a presentation-only JSON Schema argument editor. It never authenticates, calls a tool, submits a write, or applies schema defaults.
Index ¶
Constants ¶
const MaxInputBytes = 8 << 20
MaxInputBytes matches the existing CLI's bounded JSON input. Oversized edits are rejected atomically, never truncated by the underlying widgets.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is an argument draft. SetArguments starts a fresh, clean draft; Arguments returns a detached object only after complete schema validation.
func New ¶
func New(input schema.JSONSchema, rawJSON bool) Model
New creates a form without filling defaults or inventing required values. rawJSON locks live/unreviewed schemas to exact JSON-object input.
func (Model) Arguments ¶
Arguments validates the complete original schema, including constraints that cannot be represented by a typed control. Diagnostics never contain values.
func (Model) Dirty ¶
Dirty includes invalid and currently omitted edits, so navigating away never silently loses an unfinished draft. Only SetArguments resets the baseline.
func (*Model) SetArguments ¶
SetArguments accepts even a schema-invalid draft (e.g. after schema drift), but rejects non-JSON values without changing the existing form. It retains unknown properties; only Arguments performs full input validation.