25 Commits
Author SHA1 Message Date
CatoandClaude Fable 5.1 3fe57d0559 feat(answers): answers that read like the ChatGPT app's (0.13.0) (#24)
* feat(answers): answers that read like the ChatGPT app's (0.13.0)

Measured screen by screen against the ChatGPT app on a phone, and closed
in the package so every product gets it:

- Headings are signposts: a size up, with air above them, so a long answer
  can be scanned and found again.
- Options are cards: a numbered list whose items open with a bold name gets
  a tile badge, the name a size up, a hairline between cards, and a pill
  for a short tag written right after the name (`[Recommended]`). The
  instruction asks the model to mark the option it recommends that way.
- Sources are chips: a `[F2, F1]` handle is drawn after the sentence as
  "Fleet AGENTS.md +1", linked when the record has a link, and moved after
  the full stop when the model wrote it before.
- Links in the words that leave the site say so: dotted underline, arrow.
- A layered figure, `{"type":"stack"}`: full-width boxes top to bottom, a
  row of tiles where a layer has parts (icons from a closed list, never
  markup), the words that cross each arrow, an accent tone, a caption.
  `diagram` stays for an arbitrary graph.
- "Thought for 3m 38s ›" above an answer from `message.thinking`, closed by
  default; `live.steps` shows the same row open while a turn runs, with
  the newest step marked. `ThinkingRow` and `formatThinkingDuration` are
  exported; `thoughtFor`, `thought`, `thinking` join the thread labels.

Tests: tag and citation placement (core), stack validation and text form
(core), the whole answer rendered on the server (render), and the stack
fitting six tiles on a 390px phone with the thought line above (browser).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* fix(markdown): no space before the full stop when a citation chip moves after it

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
v0.13.0
2026-10-22 11:19:18 +02:00
CatoandClaude 3f1c299c9d fix(thread): 44px answer actions on one line; replies as one row on a phone (0.12.1) (#23)
Found while evig's public assistant moved onto chatkit, and fixed here so
every product gets it:

- The Copy · Listen · Share · Retry row sat at 36px while every other
  control in the chat is 44, and "Nochmals versuchen" broke across two
  lines at 390px. Each action is now a full-size target with its words on
  one line; the row wraps between buttons when it must.
- Below 40rem the suggested replies are ONE row that scrolls sideways with
  a fade where it runs on, the lead reply first and always on screen —
  never a wrapping box of pills that breaks into "two and an orphan"
  wherever the words run out. Wider, they still wrap.
- The browser test now counts .ck-action among the controls that must be
  44px.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
v0.12.1
2026-10-22 09:02:41 +02:00
Cato a18b573938 Add explicit audio playback to shared rich answers (0.12.0) (#22) v0.12.0 2026-10-21 20:09:47 +02:00
Cato 3f0ce27029 feat: visual answers with galleries, diagrams and guided choices (0.11.0) (#21) v0.11.0 2026-10-21 12:39:04 +02:00
CatoandClaude 04dd6f86b8 feat: under every answer — Copy, Listen, Share; sources as a sheet; replies that lead (0.10.0) (#20)
The pieces of the ChatGPT app the owner put beside ours (2026-10-21), done
once here so Loki, OrangeCat and every chat in the fleet get them:

- `AnswerActions`: the row under an answer. Copy; Listen, reading the answer
  as prose (`plainTextForSpeech`, from loki) with the browser's voice or the
  `speaker` an app passes (loki's studio voice), with a small player — Stop
  and the time so far — while it reads; Share through the system sheet
  where one exists. `ChatThread` renders it under every answer.
- Sources on a touch screen are ONE "Sources · n" button that opens a sheet
  with every record (label, detail, link); chips stay on a mouse. `Sheet`
  (the attach sheet's <dialog>, extracted) and `SourcesRow` are exported.
- `AttachMenu` takes `extra` rows under Camera · Photos · Files, and then
  opens the sheet on a mouse too — an app's "one of my things" has no file
  dialog to live in.
- The replies instruction makes the model lead: 2–4 replies on every answer,
  the recommended next step first, drawn as the lead (`ck-reply-lead`).
- An empty box is one row on the narrowest phone: the placeholder is cut at
  the edge, never wrapped into a clipped second line.

Browser checks cover the player, the sources sheet on a touch screen and
chips on a mouse, and the one-row placeholder at 320px.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
v0.10.0
2026-10-21 06:21:21 +02:00
CatoandClaude Fable 5.1 fc87000ed7 feat(markdown): answers that read like the ChatGPT app's (0.9.0) (#19)
* feat(markdown): answers that read like the ChatGPT app's (0.9.0)

Tables (sideways scroll on a phone, never a broken page), headings with
their level, nested and task lists, rules, web images. A list of named
things — every item opening with a bold lead — renders as cards: a badge
(the number, or the emoji the lead opens with), the name, the body. The
sources an answer cites are listed once under it as chips, from the
citations map; renderCitation lets an app keep its own source sheet.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* feat(markdown): renderSources slot for an app's own sources row

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
v0.9.0
2026-10-20 23:37:06 +02:00
CatoandClaude 6d6158981e fix(screen): declare the inset and viewport variables with defaults (0.8.2) (#18)
A consumer that audits chatkit's stylesheet for undeclared --ck-* reads
(loki's widget) failed on --ck-top-inset, --ck-bottom-inset and
--ck-viewport-height, which JS sets at runtime. They now carry defaults
on the root like every other variable.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
v0.8.2
2026-10-20 23:10:25 +02:00
CatoandClaude e9f8f8fd7e fix(screen): keep the header legible over the words, fade the top edge without one (0.8.1) (#17)
A title floating over half-faded words read as two lines on top of each
other in Loki's thread header. The header's gradient is now mostly page
behind the row itself and runs out in the strip below it. With no header
the thread's top edge fades instead of cutting a line in half.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
v0.8.1
2026-10-20 22:49:21 +02:00
CatoandClaude a9dede4719 feat(screen): ChatScreen — the conversation fills the display (0.8.0) (#16)
Header and composer float over the thread, like the ChatGPT and Claude
apps: words scroll under both and fade, header buttons are frosted pills
(ck-glass), the composer is a see-through pill. The scroller is padded by
the measured heights (--ck-top-inset / --ck-bottom-inset), so the last
answer rests above the composer. useStickToBottom now stays pinned
through size changes (a growing composer, insets measured after paint).
The user's bubble is neutral (--ck-bubble), not the accent.


Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

Co-authored-by: Claude <noreply@anthropic.com>
v0.8.0
2026-10-20 22:40:17 +02:00
CatoandClaude b8b613d0c8 feat(dictation): the words as they are heard, while the take is live (0.7.0) (#15)
A take was a pulsing dot, a wave and a timer for as long as the person
spoke, with nothing to show for it until the server answered. Now the
browser's recogniser runs beside the recording as a PREVIEW: finals then
the current guess, one line whose end is always in view (`liveText` on the
controller, `.ck-voice-live` in the bar), dimmed while the server
transcribes, replaced by the server's words when they land. On the browser
leg the same words show as interim results, and only the finals are
delivered.

The preview is never load-bearing: a recogniser that is missing, refuses
or says nothing leaves the wave on screen and the recording untouched, and
its failures are not fed to the problem line — the person is being
recorded fine, and "mic" or "unavailable" would be a lie about that.

`liveWords(finals, interim)` is the pure combiner, tested.


Claude-Session: https://claude.ai/code/session_01YKx4TPejLvFR9Uj4xrTf6Y

Co-authored-by: Claude <noreply@anthropic.com>
v0.7.0
2026-10-10 01:24:18 -07:00
CatoandClaude 699e49d179 fix(composer): an empty box is one line, at any width it was measured (0.6.1) (#14)
Chromium counts a textarea's placeholder in scrollHeight. A composer
emptied while it was narrow (a sheet still opening, a layout settling)
read its wrapped placeholder as content and grew to its 240px maximum
with nothing typed, and it stayed that way because the height was keyed
only on the value. On Loki's phone chat that was half the screen of
blank composer after a send.

- An empty box takes its natural one-line height.
- The box re-measures when its width changes (width only, so the
  height it sets cannot loop the observer).
- Browser check: empty the composer while it is 60px wide, widen it, and
  it is one line again (fails at 240px before this change).


Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-09 06:59:06 -07:00
CatoandClaude 163c879163 feat(thread): suggested replies — one tap sends the likely next message (0.6.0) (#13)
OrangeCat's Cat ends an answer with two to four tappable replies; it was the
most convenient control in any of the fleet's chats and existed nowhere else.
It now lives here so every product gets it from one place.

- REPLIES_INSTRUCTION: the prompt text that asks the model for a
  ```quick_replies block in the same turn (no second call, no latency)
- extractReplies(): parses it back out, deduplicated and capped, and hides
  an unfinished block while streaming so no one watches JSON appear
- ChatThread onReply: buttons under the latest answer only, never while a
  turn runs; the block is stripped from every answer even without onReply
- ChatReplies: the same buttons for apps that render their own thread


Claude-Session: https://claude.ai/code/session_01Mg5wrkfw95JWfmAz8yRT1j

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-09 05:26:52 -07:00
CatoandClaude Opus 5.5 0a82ec831e feat(composer): heldAttachments — an attachment the app holds can be sent alone (0.5.0) (#12)
An app with its own attachment model (orangecat: references to the person's
own listings, photos it shrinks and stages itself) shows them in `header`,
but the composer only counted its OWN attachments toward "may this send?".
A message that was only such an attachment could not be sent, which blocked
orangecat from adopting the Composer at all. heldAttachments adds the app's
count to the composer's wherever that is decided; attachmentOnlyText still
says what such a message means.

Render test covers it (mutation: ignoring the prop fails it). verify green,
browser checks included.


Claude-Session: https://claude.ai/code/session_01Nx1u7uUWsgi3MagxbmQmPN

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-08 07:43:03 -07:00
CatoandClaude Opus 5.5 70824785e8 fix(check): comments are not inputs (0.4.1) (#11)
* ci(publish): a merged version bump releases itself

Publishing waited for someone to push a v* tag after the merge. That step
is easy to forget and impossible from an agent session (the git proxy
refuses tag pushes), so 0.4.0 sat merged and unpublished — exactly the
"fix merged, nobody has it" gap the release was meant to close.

publish.yml now also runs on pushes to main and on dispatch; the existing
registry check makes every merge that did not change the version a green
no-op. A release from main tags the commit v<version> itself, so versions
stay traceable. The auto-merge sweep re-arms publish.yml after a
GITHUB_TOKEN merge, which starts no push workflow on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

* fix(check): comments are not inputs; 0.4.1

The first run across the fleet flagged one line in loki — a comment
recording the old bug (`<input accept="image/*,text/*…">`). Comment lines,
block comments and trailing comments are skipped now. "/*" counts as a
comment only after space, "{" or "(", because inside an accept value it
follows a letter ("image/*") — a test pins that a trailing comment cannot
hide the real input before it.

0.4.0 was never published; this ships as 0.4.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 04:52:55 -07:00
CatoandClaude fe40496a79 ci(publish): a merged version bump releases itself (#10)
Publishing waited for someone to push a v* tag after the merge. That step
is easy to forget and impossible from an agent session (the git proxy
refuses tag pushes), so 0.4.0 sat merged and unpublished — exactly the
"fix merged, nobody has it" gap the release was meant to close.

publish.yml now also runs on pushes to main and on dispatch; the existing
registry check makes every merge that did not change the version a green
no-op. A release from main tags the commit v<version> itself, so versions
stay traceable. The auto-merge sweep re-arms publish.yml after a
GITHUB_TOKEN merge, which starts no push workflow on its own.


Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 04:46:57 -07:00
CatoandClaude dce645fff5 feat: @bitbaum/chatkit/attach for any uploader, and the file-input check every app runs (0.4.0) (#9)
- `@bitbaum/chatkit/attach`: AttachMenu, ATTACH_SOURCE_INPUT, isTextFile,
  acceptFamilies and shrinkImage without the composer, so an app with no chat
  (avatars, product photos, receipts) uses the same picker instead of
  re-rolling a file input. AttachMenu takes `sources` (an image uploader offers
  Camera + Photos; one source skips the sheet) and a `trigger`.
- `chatkit-check-file-inputs` (bin): fails CI on a literal accept that mixes
  file families — the shape that hid screenshots on Android in loki, orangecat
  and evig. Same rule as the package (acceptFamilies), so there is one
  definition; a justified exception is marked on the line.
- shrinkImage moves out of the composer hook into src/image.ts (unchanged).
- README: install releases from npm, never a commit — heidi and substrata
  stayed on the broken paperclip because they pinned old versions.


Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 04:43:16 -07:00
CatoandClaude 5ed3095bad feat(dictation): a failed transcription keeps the take, says why, and retries in one tap (#8)
OrangeCat, 2026-10-07: dictating into a form ended in "Couldn't transcribe —
check your connection and try again" while the server had answered plainly
(busy, not configured…), and the words were gone — trying again meant saying
it all a second time. chatkit had the same two gaps.

- The server leg's refusal carries the server's own words: postAudio reads
  { error } / { message } / { error: { message } } into a TranscriptionError;
  an app's custom `transcribe` can throw one (or anything with `reason`).
  Exposed as `problemDetail`, shown beside the problem line, never instead.
- The take is KEPT when transcription fails: `canRetry` + `retry()` send the
  same audio again. Anything that moves on (a new take, a dismissal, a
  different problem) drops it. Same for a recording handed over as a file.
- Composer: the problem line shows the detail and a "Try again" button
  (label `retryTake`).
- Tests: reasonFromBody / reasonOf / TranscriptionError in core; in the
  browser, a 429 then a 200 — the reason shows, Try again resends the
  identical bytes, the problem clears.

0.3.2. No tag: consumers pin a commit.


Claude-Session: https://claude.ai/code/session_01BQdyreKqCfy8iwRBRUVm39

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-07 04:32:37 -07:00
CatoandClaude Opus 5.5 f9f906ba11 feat(composer): Camera / Photos / Files sheet instead of one mixed file input (#7)
* feat(composer): Camera / Photos / Files sheet instead of one mixed file input

On Android the paperclip opened a chooser of capture apps (Camera, Camera,
Recorder, "Photos & Videos") with no way to the file browser: one input with
a mixed accept (image/*,text/*,audio/*) is answered that way. Attaching a
screenshot to Loki was effectively impossible from a phone.

- AttachMenu: on a touch screen the paperclip opens a bottom sheet with three
  sources, each its own input (ATTACH_SOURCE_INPUT is the SSOT): Camera
  captures, Photos opens the system photo picker, Files has no accept and
  opens the real document browser. With a mouse it opens the dialog directly.
- isTextFile: Files takes anything, so what can be read inline is decided
  after the pick. A PDF gets a sentence instead of being pasted as bytes.
- The sheet is portalled to <body> so a composer inside a transformed or
  clipped panel still gets a full-screen sheet. react-dom becomes a peer.
- Tests: unit (sources, text detection), SSR (one input per source), browser
  (sheet on a phone, 44px targets, Escape, Photos picker accept, PDF note,
  direct dialog with a mouse). CHROMIUM_PATH lets the browser suite run
  against a preinstalled Chromium.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

* refactor(attach): the sheet is a native <dialog>, not a portal

showModal() renders in the top layer, so a composer inside a transformed or
clipped panel still gets a full-screen sheet without react-dom, and the
browser supplies Escape, the focus trap and focus restore. react-dom is no
longer a peer. A tap on the backdrop closes it (browser-tested).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-05 04:53:02 -07:00
CatoandClaude Fable 5.1 d0f276f09a feat(composer): recordings as files, and the next message while a turn runs (#6)
* feat(composer): a recording picked as a file is transcribed like a mic take

A voice memo from the phone's recorder, a taped meeting: dictation that
happened earlier. Until now the paperclip filtered audio out of the picker,
and a file that arrived anyway (Android hands over .m4a typeless) was
treated as text and rejected as too large — or, small enough, inlined as
bytes into a prompt.

With a server leg, the paperclip now accepts recordings. They go to the
same transcribeUrl as the mic, under their own name (Whisper reads the
container from the extension), in the order picked, and the words land in
the box like a mic take. Nothing is staged as an attachment: a memo is
words, not a file the model reads. `isAudioFile` recognises them by type
and, where the picker gives none, by extension.

Uploads are capped at MAX_AUDIO_FILE_BYTES (120 MB — an hour of phone memo
with room to spare) and refused in words before any bytes move; the fourth
DictationProblem, `fileTooLarge`, is the sentence. useDictation exposes
`transcribeFile` and `canTranscribeFile` for composers of their own.

Browser test: a typeless "Meine Aufnahme 12.m4a" picked on the demo posts
under its own name, fills the input, stages nothing.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtBnGxwf5ddXTzRNyjHVP7

* feat(composer): queue the next message while a turn runs

A send during a turn was refused: Send went dark, and the next thought
waited for a spinner to stop. The operator's reference chat takes it —
"Queue a message…" — and sends it when the turn ends.

`queue` keeps Send live while `sending`, beside Stop, and swaps the
placeholder. The app receives the message through `onSend` as usual and
owns the queue; the composer only stops refusing. Disabled and blocked
still refuse.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtBnGxwf5ddXTzRNyjHVP7

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-03 00:38:57 -07:00
CatoandClaude Opus 5.5 61ff545c91 fix(publish): install the browser the verify step's browser test needs (#5)
The v0.2.1 publish ran verify without Chromium and failed before npm.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-02 11:00:17 -07:00
CatoandClaude Opus 5.5 f2bc87db05 fix(markdown): a link inside bold or italic is still a link (0.2.1) (#4)
Models bold their links all the time — **[Chalco](/markets/chalco)** — and
the bold span held plain text, so the reader saw the raw markup (Substrata's
Ask, 2026-10-02). Bold and italic now carry their content parsed again;
plain emphasis renders exactly as before.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v0.2.1
2026-10-02 06:22:27 -07:00
CatoandClaude Opus 5.5 76935480b9 feat(attach): shrink screenshots in the browser (maxImageEdge) and say every attach problem in the reader's language (0.2.0) (#3)
From heidi's downscale.ts: a phone screenshot goes out as a ~1024px JPEG
instead of a multi-MB PNG — cheaper vision calls, and the full screenshot
never leaves the device. Attach notes become labels (attachNotes).
Browser test sends a 1290x2796 screenshot and asserts a 1024px JPEG
under the limit; mutation-checked (fails with maxImageEdge 0).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v0.2.0
2026-10-01 02:04:06 -07:00
CatoandClaude Opus 5.5 8ebc7a5c29 ci(publish): tag-driven npm Trusted Publishing, same workflow as speechkit/sitekit (#2)
Tag vX.Y.Z publishes via OIDC once NPM_PUBLISHING=on; until then a tag
runs green and says why. No token anywhere.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 13:17:39 -07:00
CatoandClaude Opus 5.5 ed759a8516 feat: chatkit v0.1 — one chat for every product (#1)
* feat: chatkit v0.1 — one chat for every product

The fleet had 13 chats in 10 repos, each written fresh, each missing what
another had fixed. This extracts loki /loki (composer, thread, messages,
markdown, attachments) and adds heidi's microphone and orangecat's keyboard fix:

- Composer: auto-growing 16px textarea, Enter/Shift+Enter/IME, Send and Stop
  in one slot, attachments with paste, mic always present, every label
  translatable, app-specific controls in slots.
- useDictation: browser recogniser first; missing or SILENT (4 s watchdog,
  bounded permission wait) -> record and transcribe on the server; a dead
  recogniser remembered 30 days; every failure shown in words.
- ChatThread/ChatMessage: stick-to-bottom + jump button, speaker names once two
  agents speak, Copy on answers, Retry on the last one, failed turns visible.
- Markdown with no HTML path; javascript: links stay text.
- styles.css: --ck-* variables defaulting to @bitbaum/design-tokens.
- verify = format, lint, types, build, 18 unit/render tests and 21 browser
  checks (390px + desktop, light + dark, a sentence through a fake mic past a
  silent recogniser). Browser checks mutation-tested (14px input, 60 s
  watchdog) — both fail as they should.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* fix(styles): --ck-* defaults at zero specificity on :root, so an app's own values win

Declared on the chat's elements they overrode any app setting --ck-* at the
root — the opposite of what the README promised. Found preparing loki, whose
colour variables are full OKLCH colours under the design-token names and so
must map them. New browser check: a :root --ck-accent reaches the chat.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
v0.1.0
2026-09-24 23:14:53 -07:00
CatoandClaude Opus 5.5 dcc8c61cd2 chore: start chatkit
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 07:38:34 +02:00