Artifact a006ada0a15ad9f74ce1eea92d8f400fac887c7e00600d7a488c579519bbffc5:
- File
src/commands.h
— part of check-in
[c55dfbb163]
at
2026-11-19 23:39:49
on branch images
— Images, as Pi's
User messages, steering and follow-ups, and tool results can carry images. Journal version 9 keeps their bytes in SQLite (pic_image, deduplicated by SHA3-256, deflated only when smaller) linked by pic_attachment, written in the same transaction as the entry; pic check covers them. Each adapter sends its native shape (Anthropic base64 blocks, Chat image_url data URLs, Responses input_image); a model whose catalog input lacks images gets Pi's placeholders. pic ask --image PATH, the RPC images field and the read tool on image files add them; the Pi and HTML exports include them. (user: dmestas, size: 903) [annotate] [blame] [check-ins using] [more...]
/* --commands (commands.c): while pic runs a request, Pi's RPC command lines * on a descriptor (stdin) steer it. Supported: steer, follow_up (prompt * templates expanded; Pi's images field attached), clear_queue, abort (Ctrl-C's cancel), * set_steering_mode and set_follow_up_mode ("all" or "one-at-a-time"). * Each gets Pi's response line on the events' out; anything else is an * error response and the run goes on. The descriptor is read only when pic * waits (net.h's side descriptor) and at each step of the loop, never inside * a transaction; accepted messages are journaled before the response. */ #ifndef PIC_COMMANDS_H #define PIC_COMMANDS_H #include "pic.h" /* expand returns a template's expansion of TEXT (malloc'd), or NULL to keep it. */ void pic_commands_start(pic_store *s, int fd, char *(*expand)(void *ctx, const char *text), void *ctx); void pic_commands_stop(void); #endif