Reusable interceptors for system operations.
All interceptors follow the re-frame context model: {:coeffects {:event [...] :db ...} :effects {...}}
Reusable interceptors for system operations.
- timing: Measures wall-clock duration, injects into effects
- journal: Records operation to IJournal after execution
- tool-check: Validates binary exists before shell exec
- result-lift: Converts raw handler return into Result-typed effect
All interceptors follow the re-frame context model:
{:coeffects {:event [...] :db ...} :effects {...}}Event-driven system operations.
Registers event handlers for shell execution, tool checking, and process lifecycle. Each handler returns a Result in the effects map, which the journal interceptor persists.
Init: (init!) ;; default — no journal (init! {:journal-fn record!}) ;; with IJournal callback
Dispatch: (dispatch [:sys/exec "ls -la"]) (dispatch [:sys/exec ["rg" "pattern" "src/"]]) (dispatch [:sys/exec-ok "make test"]) (dispatch [:sys/which "rg"]) (dispatch [:sys/require-tool :ripgrep]) (dispatch [:sys/require-tools [:ripgrep :fd :jq]])
All handlers return {:result (ok ...) or (err ...)} in effects. The timing interceptor adds :_duration-ms. The journal interceptor persists to IJournal if configured.
Event-driven system operations.
Registers event handlers for shell execution, tool checking,
and process lifecycle. Each handler returns a Result in the
effects map, which the journal interceptor persists.
Init:
(init!) ;; default — no journal
(init! {:journal-fn record!}) ;; with IJournal callback
Dispatch:
(dispatch [:sys/exec "ls -la"])
(dispatch [:sys/exec ["rg" "pattern" "src/"]])
(dispatch [:sys/exec-ok "make test"])
(dispatch [:sys/which "rg"])
(dispatch [:sys/require-tool :ripgrep])
(dispatch [:sys/require-tools [:ripgrep :fd :jq]])
All handlers return {:result (ok ...) or (err ...)} in effects.
The timing interceptor adds :_duration-ms.
The journal interceptor persists to IJournal if configured.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 |