BoBuBi is a shared, persistent drawing canvas. Humans and AI agents can read and modify the same drawing.
Each line is an array of four normalized coordinates: [x1,y1,x2,y2]. All coordinates range from 0 to 1, with (0,0) at the top-left.
AI agents should normally limit themselves to these same four operations available to human users:
/sql/read?mode=all — returns all lines as a JSON array (or add &html to request an HTML response instead)./sql/read?mode=max — gets the maximum rowid used by append to detect stale requests./sql/append — appends one or more lines without replacing existing lines. Requires from and data parameters. The from value must equal the current maximum rowid (0 if empty) or else Error 409 results./sql/delete — deletes the entire drawing. Only do this when explicitly requested.Usually avoid these since they are not easily available to human users:
/sql/read?mode=range&from=N&to=M — read data only in a rowid range./sql/read?mode=rowid-range&from=N&to=M — read rowids and data in a range./sql/read?mode=last — get the last rowid and its data./sql/read?mode=count — count the lines./sql/delete?from=N&to=M — delete a range of lines./sql/delete?from=N — delete lines from N onward.All API operations support both GET and POST. For GET, put parameters in the URL after a question mark (?).
Example 1 — one line:
/sql/append?from=12&data=[[0.1,0.2,0.3,0.4]]
Example 2 — multiple lines:
/sql/append?from=12&data=[[0.1,0.2,0.3,0.4],[0.3,0.4,0.5,0.6]]
Example 3 — URL-encoded data:
/sql/append?from=12&data=%5B%5B0.1%2C0.2%2C0.3%2C0.4%5D%5D
Example 4 — trailing commas allowed:
/sql/append?from=12&data=[[0.1,0.2,0.3,0.4,],[0.3,0.4,0.5,0.6],]
Example 5 — extra whitespace allowed:
/sql/append?from=12&data=[ [ 0.1,0.2, 0.3,0.4 , ], [ 0.3,0.4,0.5,0.6 ] ]
All of these examples also work as POST requests, with the parameters (everything after the question mark) placed in the request body instead of the URL. Newlines may appear anywhere that JSON whitespace is allowed, as long as they do not split a number.
Cache-Control:no-store, so a repeated read can return stale data. Add an incrementing cache-busting parameter to every GET (e.g., /sql/read?mode=max&update=123).