#340

Add the ai engine, SSE writer, and Chat Completions codec

Draftlahfirwants to merge intofrom
  1. Rules alone cannot answer a request, and Chat Completions needs a wire format to read and write.
  2. Adds ai state, the engine that picks a rule or a default, an abortable SSE writer, and the Chat Completions codec.
  3. Builds on #339.