BOUNDARY (wiring). defprocedure makes one PDB procedure native to
hive-gimp; defprocedures does it for every row of a spec EDN resource.
For a ProcedureSpec the expansion installs three things, all keyed by
the spec's catalogue command so a re-evaluation replaces rather than
duplicates:
hive-gimp.catalog/register!), so the MCP gimp
tool and gimp_catalog list and run it;client/send-compensated method answering that command over exec
(hive-gimp.pdb/run-spec);client/invoke exactly as an MCP call does.Adding a procedure is a row in resources/hive_gimp/pdb/*.edn.
BOUNDARY (wiring). `defprocedure` makes one PDB procedure native to
hive-gimp; `defprocedures` does it for every row of a spec EDN resource.
For a `ProcedureSpec` the expansion installs three things, all keyed by
the spec's catalogue command so a re-evaluation replaces rather than
duplicates:
1. a catalogue row (`hive-gimp.catalog/register!`), so the MCP `gimp`
tool and `gimp_catalog` list and run it;
2. a `client/send-compensated` method answering that command over exec
(`hive-gimp.pdb/run-spec`);
3. a Clojure fn whose arglists are the procedure's required arguments,
with an optional trailing map for the rest, going through
`client/invoke` exactly as an MCP call does.
Adding a procedure is a row in `resources/hive_gimp/pdb/*.edn`.(defprocedure fn-sym spec-form)Make the PDB procedure described by spec-form (a ProcedureSpec,
evaluated at expansion) native, as the fn fn-sym.
Make the PDB procedure described by `spec-form` (a `ProcedureSpec`, evaluated at expansion) native, as the fn `fn-sym`.
(defprocedures path)defprocedure for every row of spec EDN resource path. Evaluates to the
catalogue commands it registered.
`defprocedure` for every row of spec EDN resource `path`. Evaluates to the catalogue commands it registered.
(docstring spec)The docstring a native fn carries for spec.
The docstring a native fn carries for `spec`.
(expansion fn-sym spec)The forms defprocedure expands to for fn-sym and a validated spec.
Arglists read [target <required args>] and [target <required args> opts].
The forms `defprocedure` expands to for `fn-sym` and a validated `spec`. Arglists read `[target <required args>]` and `[target <required args> opts]`.
(invoke target command args)Run catalogued command with kebab-case args on target (a session or
a transport). Returns an Outcome.
Run catalogued `command` with kebab-case `args` on `target` (a session or a transport). Returns an `Outcome`.
(read-specs path)The ProcedureSpecs in classpath resource path, validated.
The `ProcedureSpec`s in classpath resource `path`, validated.
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 |