Value objects for hive-gimp, malli first — the JVM face of them.
The DEFINITIONS live in hive-gimp.shape, which is portable: a malli
schema is a vector and a map, so it needs no host. This namespace is the
part that needs malli, which is compiling a schema into a function
(m/validator) and rendering a failure (m/explain + humanize).
Every schema is re-exported here under its old name, so schema/Descriptor
and schema/descriptor? mean exactly what they meant before the split and
nothing downstream had to move.
Everything downstream is defined in terms of these, and the suite is
synthesized from them rather than hand-written: deftrifecta-from-schema
needs an :in schema, so a function that takes a VALUE gets generated
coverage for free while a function that takes an id or a bag of positional
arguments gets none. That is the reason the promote layer here is written
over Descriptor and GimpCommand rather than over a command name.
Two vocabularies meet in these value objects and must not be confused:
WIRE snake_case strings, the GIMP plugin's own contract. :wire,
GimpCommand, RawResponse. JSON keys stay strings.
HIVE kebab-case keywords, what a Clojure caller and an MCP client see.
:name, Invocation.
hive-gimp.command is the only place the two are allowed to touch.
Value objects for hive-gimp, malli first — the JVM face of them.
The DEFINITIONS live in `hive-gimp.shape`, which is portable: a malli
schema is a vector and a map, so it needs no host. This namespace is the
part that needs malli, which is compiling a schema into a function
(`m/validator`) and rendering a failure (`m/explain` + humanize).
Every schema is re-exported here under its old name, so `schema/Descriptor`
and `schema/descriptor?` mean exactly what they meant before the split and
nothing downstream had to move.
Everything downstream is defined in terms of these, and the suite is
synthesized from them rather than hand-written: `deftrifecta-from-schema`
needs an `:in` schema, so a function that takes a VALUE gets generated
coverage for free while a function that takes an id or a bag of positional
arguments gets none. That is the reason the promote layer here is written
over `Descriptor` and `GimpCommand` rather than over a command name.
Two vocabularies meet in these value objects and must not be confused:
WIRE snake_case strings, the GIMP plugin's own contract. `:wire`,
`GimpCommand`, `RawResponse`. JSON keys stay strings.
HIVE kebab-case keywords, what a Clojure caller and an MCP client see.
`:name`, `Invocation`.
`hive-gimp.command` is the only place the two are allowed to touch.(explain ?schema value)Human-readable explanation of why value fails ?schema, or nil when it
conforms. Used in error paths, never in hot paths.
Human-readable explanation of why `value` fails `?schema`, or nil when it conforms. Used in error paths, never in hot paths.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |