Chapter 13: third-party, the borrowed post office
The daemon asks Jev questions, and asking Jev well takes more code than you would think: building the exact request bytes, checking that the answer really answers what was asked, retrying the failures worth retrying and not the others, and keeping count of what it all costs. Several projects ask Jev, and rather than each writing that for itself, they share one client: jevcrates, a separate repository, included here as a git submodule.
A submodule is a repository inside a repository, pinned at one exact
commit. git clone --recurse-submodules fetches both; in a clone made
without it, git submodule update --init fetches it afterwards.
From jevcrates the daemon uses two crates:
jev-protocol: the vocabulary of questions and answers.Choice,ScoreandQuestionsbuild whatjudge.rsasks;ModelId::pinnedpins the model;Usage::dollarsprices an answer at the published rate.jev-http: the native client.Jev::from_envreadsTYPESAFE_API_KEY(and returns nothing when it is unset, which is how the daemon knows to sayno key),asksends one request over HTTP/2, and the shared spend ledger under$XDG_STATE_HOME/jevadmits or refuses every request againstGuards.
No second Jev client lives in this repository.
Aside: the relative URL.
.gitmodulesnames jevcrates as../jevcrates.git, relative to wherever jevhooks itself came from. Clone jevhooks from https://lmjtfy.fun/jevhooks.git and the submodule comes from the same site; clone it from GitHub and it comes from GitHub. One line, both ways work.
Try it.
git submodule statusshows the commit jevhooks pins. Then read on in jevcrates' own guide, jevcrates/, which starts with how to depend on it from a project of your own. (Its chapters are numbered as a sequel to the lmjtfy site's guide, where it was first written down, so they start at 16.)
That is the end of this guide. You have followed an event from Claude Code raising it, through the mod, the routing and the daemon, to Jev and back.
For the people who maintain it
jevcrates is a separate Cargo workspace. The root Cargo.toml excludes this
folder (exclude = ["third-party"]) and depends on jev-http and
jev-protocol by path. There is no README of this repository's inside
jevcrates/, because it is another repository's tree: its own are there.
In this folder
| Path | What |
|---|---|
| jevcrates/ | The submodule: deizel/jevcrates, at the commit jevhooks pins. |
← Previous: Chapter 12, jevhooks-daemon/src/ · Up: jevhooks