service library

The Claude Code driver as a service of its own, which only the airlock's user may call. It runs as its own user, so a seat's token is readable by this process and no other: not the airlock, not a loop.

A caller connects to the Unix socket, writes one call as JSON and closes its side:

{"signIn":"…","model":"…","systemPrompt":"…","request":"…"}

The service answers one JSON line per message and closes: any number of {"kind":"reported","progress":…} while the reply streams, then one {"kind":"finished","outcome":…}, the Outcome<ModelReply>. ClaudeCodeDriverSocket is that caller.

Who is calling is read from the socket as the kernel reports it, never from the call.

Classes

ClaudeCodeDriverService
ClaudeCodeDriverSocket
AsksTheModel in another process: passes each call to the service at socket and reports the reply as it streams back. Holds no secret.

Typedefs

CheckDriver = Future<String?> Function(Socket driver)
Looks at the driver on the other end of a connected socket, such as which release the kernel says it is, before any call is written to it. Returns why to refuse it, or null to go on.