Liking cljdoc? Tell your friends :D

hive-gimp.pdb.native

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.

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`.
raw docstring

defprocedurecljmacro

(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`.
sourceraw docstring

defprocedurescljmacro

(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.
sourceraw docstring

docstringclj

(docstring spec)

The docstring a native fn carries for spec.

The docstring a native fn carries for `spec`.
sourceraw docstring

expansionclj

(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]`.
sourceraw docstring

invokeclj

(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`.
sourceraw docstring

read-specsclj

(read-specs path)

The ProcedureSpecs in classpath resource path, validated.

The `ProcedureSpec`s in classpath resource `path`, validated.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close