1# Chapter 13: third-party, the borrowed post office
2
3The daemon asks Jev questions, and asking Jev well takes more code than you
4would think: building the exact request bytes, checking that the answer
5really answers what was asked, retrying the failures worth retrying and
6not the others, and keeping count of what it all costs. Several projects
7ask Jev, and rather than each writing that for itself, they share one
8client: **jevcrates**, a separate repository, included here as a git
9submodule.
10
11A submodule is a repository inside a repository, pinned at one exact
12commit. `git clone --recurse-submodules` fetches both; in a clone made
13without it, `git submodule update --init` fetches it afterwards.
14
15From jevcrates the daemon uses two crates:
16
17- **`jev-protocol`**: the vocabulary of questions and answers. `Choice`,
18  `Score` and `Questions` build what `judge.rs` asks; `ModelId::pinned`
19  pins the model; `Usage::dollars` prices an answer at the published rate.
20- **`jev-http`**: the native client. `Jev::from_env` reads
21  `TYPESAFE_API_KEY` (and returns nothing when it is unset, which is how
22  the daemon knows to say `no key`), `ask` sends one request over HTTP/2,
23  and the shared spend ledger under `$XDG_STATE_HOME/jev` admits or refuses
24  every request against `Guards`.
25
26No second Jev client lives in this repository.
27
28> **Aside: the relative URL.** `.gitmodules` names jevcrates as
29> `../jevcrates.git`, relative to wherever jevhooks itself came from.
30> Clone jevhooks from <https://lmjtfy.fun/jevhooks.git> and
31> the submodule comes from the same site; clone it from GitHub and it comes
32> from GitHub. One line, both ways work.
33
34> **Try it.** `git submodule status` shows the commit jevhooks pins. Then
35> read on in jevcrates' own guide, [jevcrates/](jevcrates/), which
36> starts with how to depend on it from a project of your own. (Its
37> chapters are numbered as a sequel to the lmjtfy site's guide, where it
38> was first written down, so they start at 16.)
39
40That is the end of this guide. You have followed an event from Claude Code
41raising it, through the mod, the routing and the daemon, to Jev and back.
42
43## For the people who maintain it
44
45jevcrates is a separate Cargo workspace. The root `Cargo.toml` excludes this
46folder (`exclude = ["third-party"]`) and depends on `jev-http` and
47`jev-protocol` by path. There is no README of this repository's inside
48`jevcrates/`, because it is another repository's tree: its own are there.
49
50### In this folder
51
52| Path | What |
53| --- | --- |
54| [jevcrates/](jevcrates/) | The submodule: `deizel/jevcrates`, at the commit jevhooks pins. |
55
56← Previous: [Chapter 12, jevhooks-daemon/src/](../crates/jevhooks-daemon/src/) · Up: [jevhooks](../)