PIPELINE. Descriptor lookup, build, encode, send, decode, interpret.
Six steps, five of them pure. The single impure one is a call through
IGimpTransport, which is why the whole pipeline is testable end to end
against a scripted double and why no test in this repo redefines a var.
Every exit is an Outcome. A caller cannot receive a naked exception from
here, and cannot receive nil: a transport that threw, a parameter that would
not coerce and an error raised inside GIMP all arrive in the same shape,
distinguished by :reason.
PIPELINE. Descriptor lookup, build, encode, send, decode, interpret. Six steps, five of them pure. The single impure one is a call through `IGimpTransport`, which is why the whole pipeline is testable end to end against a scripted double and why no test in this repo redefines a var. Every exit is an `Outcome`. A caller cannot receive a naked exception from here, and cannot receive nil: a transport that threw, a parameter that would not coerce and an error raised inside GIMP all arrive in the same shape, distinguished by `:reason`.
(invoke transport command-or-tool)(invoke transport command-or-tool args)Run command-or-tool with kebab-case args. Returns an Outcome.
Accepts either vocabulary for the command name, for the reason given on
catalog/descriptor.
Run `command-or-tool` with kebab-case `args`. Returns an `Outcome`. Accepts either vocabulary for the command name, for the reason given on `catalog/descriptor`.
(invoke! transport command-or-tool)(invoke! transport command-or-tool args)Like invoke, but throws on failure and returns the value on success.
For REPL and script use, where a Result-shaped answer is friction and a stack trace is what you wanted anyway. Never call this from a tool handler: an MCP client needs the error as data.
Like `invoke`, but throws on failure and returns the value on success. For REPL and script use, where a Result-shaped answer is friction and a stack trace is what you wanted anyway. Never call this from a tool handler: an MCP client needs the error as data.
(send-command transport gimp-command)Send an already-built GimpCommand through transport. Returns an Outcome.
Separate from invoke because the exec escape hatch and the doctor both
need to send a command that no descriptor describes.
Send an already-built `GimpCommand` through `transport`. Returns an `Outcome`. Separate from `invoke` because the exec escape hatch and the doctor both need to send a command that no descriptor describes.
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 |