Skip to content

CatCup Tavern 0.5.0

Choose a tag to compare

@github-actions github-actions released this 28 Nov 20:24
· 2 commits to main since this release
c6a84b0

Early-access release. Moves your existing data in and handles single-character and group roleplay end to end. The Windows installer is unsigned, and what works and what does not says exactly where the line is.

The appearance release. Every colour, typeface, size, radius and shadow in the interface is now a theme token a skin can set; a skin is a .catcup file a person can install, make in the app and export again; and a character can be created from nothing instead of only imported.

Added

  • A character can start in the app. Every card in CatCup arrived from a file: CharacterEditor renders only once a card exists, and routes/characters.ts had no create endpoint, so authoring meant writing the card elsewhere or hand-authoring JSON. New character in the library — and in the empty state, where a first-time install now has somewhere to begin besides the sample — asks for a name and an optional first message, creates the card and opens the existing editor on it, which is where its other eleven fields live. The endpoint is POST /api/characters, and its body is the editor's own field set with name made required, so creation and editing cannot drift about what a card is. The new card is a PNG carrying a generated placeholder portrait — a hue derived from the name, its initials, and the app's border — because the library is a grid of pictures and a card with no picture is a hole in it; a name already in use gets a numeric suffix and never overwrites, checked against both scopes since an id has to be free everywhere. Verified live: created in the dialog, opened in the editor with its initials on the tile, exported to PNG, re-imported, and every field survived.
  • A skin can be made without a text editor. Settings → Appearance had install, review and remove, and no way to create one unless you could write JSON: the format was complete and the tools that use it were not. New skin opens a form over the token whitelist with a live preview. The field list is SKIN_TOKENS itself — grouped as the schema groups it, with a test holding the two lists to the same variables — so a token added to the whitelist appears as a field and a name outside it has no field at all. Colours get a picker beside a free-text field, because the format accepts oklch() and color-mix() and a picker cannot express them; everything else is text. Clearing a field removes the token rather than writing a default, so a skin that changes two colours writes two lines and every other property keeps inheriting the built-in theme. The preview is a SkinSurface wearing the draft through the same skinCustomProperties → toInstalledSkin path an installed skin takes, and the contrast readout is the same checkSkin over the same pairs the install sheet runs, updating as values change and blocking nothing. Editing an installed skin loads its manifest and keeps the fields the form does not own. Verified in a browser against a throwaway data folder: surface #12212e and a display face changed, preview updated while :root stayed #1b1410, saved, applied, and the window took both.
  • A skin exports as a .catcup. GET /api/skins/:id/export writes manifest.json, the stylesheet and every media file the install declared, through one ZIP writer beside the existing reader. The media index is rebuilt from what the install recorded, because the asset ids and types are the part of it a file name cannot supply. Verified round trip: export, delete, import through the installer, and the skin came back with the same id, name, colour and font.
  • fflate has one writer as well as one reader. apps/server/src/packs/zip.ts is the counterpart to archive.ts: the manifest first, assets stored uncompressed because pictures and fonts are already compressed and re-compressing a woff2 gives some readers a file they cannot parse.

Changed

  • A chat's rename and delete are shared by both conversation views. The second cut of stage C: ChatView and GroupChatView each carried their own copy of the rename handler, the delete handler, the rename modal and the delete confirmation. They now share hooks/useChatActions.ts and components/RenameChatDialog.tsx. Only two things genuinely differed — useRenameChat resolves to the chat while useRenameGroupChat resolves to { chat, group }, and the two views select a chat through different callbacks (the group's also records the group's chat_id) — so each is a one-line adapter at the call site rather than a branch inside the hook.
  • A label that pointed at nothing now points at its field. The group's rename dialog said htmlFor="chat-name" while its input was id="group-chat-name", so clicking the label did nothing and the input had no accessible name from it. Found while comparing the two copies, which is the kind of defect an extraction surfaces. The shared dialog takes its id as a required prop, so the pair cannot drift apart again.
  • The two conversation views share the transcript's behaviour instead of copying it. ChatView and GroupChatView are 1,025 and 1,113 lines, and 606 of those lines were identical — the same scroll effects, the same dependencies, the same biome-ignore above each. Following the newest line, jumping to it on a chat switch, and stopping the previous chat's audio now live in hooks/useTranscript.ts. This is a behaviour-preserving extraction and nothing else: no layout, no rendering and no interaction changed, and the views still own the parts where they genuinely differ. It is the first piece of stage C, being done as a series of verified extractions rather than one rewrite, because 56.7% similarity is not the same thing as 56.7% that should be shared.
  • No confirmation is a browser dialog any more. Fourteen call sites still used window.confirm, which blocks the thread and draws the operating system's box: on Windows a white system prompt in the middle of a dark panel, identical in no way to the app around it, and unreachable by any theme. Every one now goes through confirm({...}) — a promise the caller awaits, drawn by the app's own ConfirmDialog, and each newly names the object and says what stops working rather than only that it cannot be undone. Two discard guards also stopped being exceptions: a half-written director scene, an edited world info entry and an edited quick reply set now ask in the app's voice. docs/DESIGN.md has required this since stage B; the rule is now true, and the tree's only mention of window.confirm is the comment explaining why not.
  • text-muted/70 and its two relatives are gone. Opacity on muted text reads at 3.0:1 where plain muted reads 4.81 — docs/DESIGN.md had banned it since stage A while 39 places used it. They use text-muted. The rule is now checkable rather than aspirational: both the tint and the size it was used at are gone from the tree.
  • A test that failed at random now has the time it needs. auth.test.ts's desktop-session cases re-import the whole app for each case, so one of them pays for the tokenizer vocabulary — about 2.5 s alone, and occasionally past the 5 s default beside a full suite on a loaded machine. Two of them timed out in roughly one run in four while this release was being prepared. The describe block now carries a 20 s timeout, the pattern im/conversation.test.ts already uses, because the limit was the problem rather than the behaviour.

Fixed

  • Editing a skin no longer deletes the stylesheet and media it shipped with. installSkin removed both whenever a caller passed none, and two of the three callers never had any to pass — the editor saves tokens, and a bare manifest.json has no archive to read a sheet out of. A packaged skin survived an edit with its colours changed and its stylesheet gone. An omitted argument now means "keep"; null and [] still mean "remove", which is what the pack reader passes for a package that carries none.
  • A skin's stylesheet is stored as its author wrote it. The loader used to wrap the sheet in [data-skin] and rewrite its url()s before storing it, which made the stored file a document generated for the browser rather than the package member it arrived as — and would have made every export carry a stylesheet the author never wrote. The wrap, the rewrite and the @font-face emission now happen in GET /api/skins/:id/css, where a browser is the audience; what is stored is what came in, checked and refused if it cannot be verified, as it was already.
  • A saved skin stays the skin being edited. Found in the browser and not by a test: the editor decided which skin it was from the prop it opened with, so a skin saved for the first time kept the New skin title, left its id editable, and disabled Export although the file existed. It now holds its own last save as the base for the next one, which also closes a narrower window where a second Save, before the refetched list arrived, would have built from a bare manifest and dropped a packaged skin's css and assets.
  • A surface skin restyles one view and nothing else. The format has allowed the scope since #190; the code only ever handled app. SkinSurface writes a skin's tokens inline on a wrapper — so they inherit downwards and stop there — sets the data-skin attribute the server's scoped stylesheet selects on, and loads that stylesheet only while the surface is mounted. The Appearance panel now refuses to make a surface skin the window skin, because writing it to ui.skinId would set it on :root and leak into the very area the scope protects; it offers a preview box instead, which is the first real user of the mechanism. Verified live: inside the box --color-surface was #0d2b1f, --color-amber #4ade80, --radius-xl 2px, while the window around it stayed #1b1410, #e2a55a, 0.75rem.
  • A skin brings its own pictures and typeface. The format has always allowed a media index; now it is read, type-checked and served. Only the files the install declared are reachable — the served set is the index, not the folder, so a file dropped in by hand is not a way in, and a path that escapes answers 404. A file type the host cannot speak is refused at install rather than left for a browser with nosniff on to guess wrong. A tokens.font value that names a path becomes an @font-face from the skin's own media route, under a family derived from the skin and asset ids, so it cannot collide with a built-in face. Verified end to end: a package carrying a 482 KB PNG and a 132 KB woff2 installed, both served with their own content types, and the skin's face reached loaded with --font-display pointing at it.
  • A skin can carry a stylesheet, and the app checks it before it runs. The format has always allowed one css file; now it is read, validated and applied. The validator refuses rather than sanitises — no @import, no @namespace, no @font-face, and every url() must be a data: URL or a path inside the skin's own media — because the property it protects is one sentence: a skin cannot make a request. A url("https://tracker/?pack=gr") tells a third party that a person has a pack, from an app that otherwise contacts nothing it did not start. A refusal names the file, the line and what to do. The loader wraps the sheet in its own scope rather than trusting it to be scoped, and lifts a top-level @media out so it is not nested inside a selector; a selector naming html cannot reach outside. Verified in the running app: with the scope present the rule applied (gold), with it removed the app's own colour came back.
  • A .catcup is finally a container, and the skin installer reads one. POST /api/skins/import takes a .catcup or a bare manifest.json and decides by the ZIP signature rather than the file name. The reader is the one from RFC 0007: manifest.json is read alone first under a 10 MB cap, the header is validated before anything else in the archive is touched, an unknown format is refused by name with the list this build reads, and a catcup.card is routed to the card importer instead of being called invalid. The archive limits — 200 entries, 25 MB per entry, 60 MB total — moved out of the CharX reader into one shared module, so a second format cannot pick its own; and an archive past a limit is now refused outright rather than returned missing files it would later be accused of not having. Every refusal names what is wrong and what to do, because the first live run showed them all arriving as "Internal server error".
  • Skins are files, and they survive a reload. The first version installed one into browser memory, so closing the tab lost it. A skin now lives at skins/<id>.json under the profile, stored as the manifest it arrived as — editing the file still reaches the theme, and removing one is removing one file — with four routes and validation on every write. Building it also fixed a bug the live check caught and a test would not have: the code that applied the skin sat inside the Appearance panel, which only mounts when someone opens Settings → Appearance, so a saved skin came back as the built-in theme until that panel was visited. It runs at the app root now, and a selected skin whose file is gone clears to the built-in palette rather than leaving the last one applied.
  • The desktop shell carries a content security policy. tauri.conf.json had "csp": null, so the webview enforced nothing: any script that reached the page ran with no constraint beyond what the code did. The policy allows the page's own origin, the data: SVG the noise layer is drawn from, the blob: URLs a TTS or image preview creates, and inline styles — which a skin needs, because a skin is a <style> element — and refuses everything else, including every request that is not to the app's own origin. That last part is what makes the skin format's "no remote url()" rule a boundary rather than a promise our parser makes. The web and LAN shapes still send no header; there is no XSS sink to send one against yet, and it belongs to the M5 hardening pass.
  • Skins, end to end: install one and the interface wears it. A skin is a catcup.skin manifest, read from a .catcup file or a bare manifest.json; Settings → Appearance lists what is installed, applies one, and shows a review sheet before it is accepted. The value is applied by writing the skin's tokens into the document, so the whole window changes — colours, type, spacing, elevation — with no rebuild, no per-skin component and no conditional anywhere in the interface. A token outside the format's whitelist is refused by name at install; a value that could escape its declaration ({, }, ;, url()) is refused too. Every install runs a contrast pass and lists every pair under 4.5:1, worst first, without blocking — the app's own palette shipped wine at 2.24:1 as error text for two years, and this is the check that would have caught it. The selection is stored as an id, so editing a skin's file still reaches the theme, and an id that no longer resolves shows the built-in palette with one line saying why. The file picker reads a bare manifest for now; the .catcup container loader is the next slice.
  • The app finally loads the fonts it names. --font-sans began with "Inter" and nothing ever loaded it, so the app rendered in Segoe UI on Windows and the system UI font on macOS — the same markup, two different products, and a landing page promising a typeface the app did not show. Inter (400–700) and Newsreader (300–600) now ship as woff2 in apps/web/public/fonts, latin and latin-ext subsets, with an @font-face in styles.css and a preload for the two files the first paint needs. Newsreader is the face the landing page already used for headings, so the product and its front page now share one design. Both are SIL OFL 1.1; NOTICE records the licence and that the files are redistributed unmodified. This is also what makes a skin able to change the typeface: a theme cannot swap a font the app does not carry.
  • Static assets carry cache headers. Nothing did, so every font, icon and hashed bundle was re-downloaded on each load. Fonts, icons and /assets/ are now immutable for a year; everything else, index.html above all, is no-cache, so a self-updating app never serves a previous build's shell from cache.
  • One container for everything CatCup owns: .catcup, discriminated by its manifest. RFC 0007 settles the file format the interface work has been building toward. Every CatCup-owned file is a .catcup — a character card, a skin, a game pack, and later a world info book, a preset, a collection — and manifest.json's format field says which. That is one OS file association, one drag-and-drop target and one picker list instead of five code sites per new kind, and it retires today's confusing state where .catcup is only a renamed .charx: an archive with no manifest still imports as a card, so nothing on disk needs converting, and .charx, .png and .json keep importing as foreign formats. A skin's manifest is JSON tokens checked against a fixed whitelist, with one optional stylesheet that is validated and refused rather than sanitised — no @import, no remote url(), no @font-face, wrapped in its own scope by the loader. A game pack declares its state before anything writes it, namespaces every key and id, verifies every media id at install, and loads through a review sheet that writes nothing until accepted. The document also schedules the Tauri CSP that turns "no request leaves the machine" from a promise the parser makes into a property the runtime enforces. Proposed, not built.
  • A readable colour for errors, and a type and elevation scale a theme can move. Error copy was painted in wine, which sits at 2.24:1 on a panel — under every accessibility floor — in 32 places. It now uses a new danger token (6.8:1) with wine kept for the fill behind it, so a warning reads as text and still looks like a warning. Three shadow roles replace Tailwind's frozen literals (shadow-card, shadow-raised, shadow-float), and the 184 arbitrary font sizes became four named ones (text-caption, text-footnote, text-code, text-body). The page glow, the noise layer, the scrollbar, the generated avatar and the brand halo moved from literals to variables. Nothing visible changes in the default theme; what changes is that every one of those can now be reached by a theme file.
  • A NUL byte in a source file is now a lint failure. Twice in one afternoon a patch that meant to write a backslash-zero escape wrote a literal control character instead, and the same edit lost a backslash from a regex. Both times the code typechecked and its tests passed — the only signal was git diff calling the file binary, which is a poor way to find out. pnpm lint now also runs scripts/check-nul.mjs, which names the file and line, so CI catches it before a reviewer has to read Bin 4830 -> 5289 bytes.
  • Switching settings sections no longer throws away unsaved edits. The leave guard knew two sections by name — Providers and Generation — while eight other panels held local drafts of their own. Changing section remounts the panel, so edits to Memory, Images, TTS, Instant messaging, Persona, Quick Replies, Regex, World Info, the prompt order or the World Info entry editor were gone, with no prompt and no undo. Every panel that saves with a button now registers a SettingsDraftHandle (isDirty / save / discard) with the dialog, and the guard, Save and continue and Discard changes cover all of them. A panel also states its own dirty state beside its Save button — "Unsaved changes." / "Saved." — and disables Save while clean, so the state is visible before the switch rather than only after it.
  • Self-update actually works from the next release on. 0.4.0's and 0.3.2's latest.json each advertised a download URL that answers 404, so Check for Updates… failed on every installed copy and the release page looked fine. The manifest URL was built from the bundler's on-disk name — CatCup Tavern_0.4.0_x64-setup.exe — while gh release upload substitutes every character outside [A-Za-z0-9._-] with . and stores CatCup.Tavern_0.4.0_x64-setup.exe. The publish step now uploads the installer first, reads the stored name back from the release listing, builds the URL from that, and then fetches the URL it just wrote: a release whose manifest does not answer 200 or 206 fails instead of publishing. Both names get the same substitution before comparing, so the match survives a change in gh's renaming rule either way.
    The two manifests that were already published were corrected in place on 2026-11-27: only the url field changed, and the signature, version and release notes are byte-identical to what shipped. Each was then checked the way an installed app checks it — fetch the file the manifest names, verify its signature against the pinned key — and both pass, so a copy installed from 0.3.2 or 0.4.0 updates normally with no reinstall. Recorded in docs/LIMITATIONS.md and docs/DESKTOP.md. M4's "updates and file associations work" criterion stays open until one release built by the fixed workflow updates an installed app end to end.