Skip to content

theme-types: the GUI's contracts as of 0.8.15 (4ab6eae) - #20

Open
connorburgess wants to merge 1 commit into
spacesheep-dev:mainfrom
connorburgess:theme-types/gui-0.8.15
Open

connorburgess wants to merge 1 commit into
spacesheep-dev:mainfrom
connorburgess:theme-types/gui-0.8.15

Conversation

@connorburgess

Copy link
Copy Markdown
Contributor

What

@sessionpipe-gui/theme-types (packages/shared-types): the eight mirrored shared/*.ts files are copied again, verbatim, from GUI commit 4ab6eae (0.8.15, v0.8.15-4), the same refresh #9 did for 0.8.0. Six files change (api.ts, attachments.ts, contrast.ts, theme-api.ts, skins-builtin.ts, skin-api.ts); color-theme.ts and plugin-api.ts were already identical. The README's pin line now names 4ab6eae (0.8.15), its export list names MARKS, promptWords and PromptItem, and the changelog has a line under Unreleased.

What a theme author gets from it:

  • Pictures in a prompt. The mirror's composePrompt(message, items, local) and the ThemeApi.control.attach doc still told a theme to write a remote image's URL, with the board's ?k= key, into the prompt's text. The GUI's current copy is composePrompt(message, items): it writes only paths on the GUI's own machine, and says no URL is ever written, because a prompt's text goes to the model and to every sink that takes prompts. attach's doc now says the same. splitAttachments also reads a machine's "Attached files" block and spacesheep's Talk block, and returns PromptItem (AttachmentRef | SavedFileRef | LinkPictureRef).
  • The focus ring. contrast.ts gains MARKS (--focus ≥ 3:1 on --bg and --bg-2) and a stock --focus in STOCK_TEXT_TOKENS, and textTierWarnings measures it. The built-in skins' --focus is the ink colour, not orange.
  • Wire types. api.ts adds arrangements, UploadedFile, LocalMachineSettings, the limited relay state, the unconfirmed outcome, and unfollowed / unheard / answer / nonce on a control row, among others.

No export was removed or renamed. composePrompt loses its third parameter, splitAttachments returns the wider union, and AttachmentRef gains kind?: never; nothing in this repo calls or builds either (git grep outside packages/shared-types finds only the changelog line, and the built bundles in dist/ contain neither name).

Why

The package's README calls it a verbatim copy of the GUI's contracts that "must be kept in sync by hand", pinned to aebf57d (0.8.0). Against the GUI's main (4ab6eae), six of its eight files no longer matched, and the image contract it taught is the one the GUI dropped so that the board's key never goes into prompt text.

Proof

Every file byte-for-byte against the GUI:

api.ts identical to GUI 4ab6eae
attachments.ts identical to GUI 4ab6eae
contrast.ts identical to GUI 4ab6eae
skin-api.ts identical to GUI 4ab6eae
skins-builtin.ts identical to GUI 4ab6eae
theme-api.ts identical to GUI 4ab6eae
color-theme.ts identical to GUI 4ab6eae
plugin-api.ts identical to GUI 4ab6eae

npm run typecheck && npm run lint && npm run build && npm test on this branch:

> @sessionpipe-gui/theme-canvas@0.3.0 typecheck
> tsc -p tsconfig.json --noEmit
> @sessionpipe-gui/theme-office@0.3.0 typecheck
> tsc -p tsconfig.json --noEmit
> @sessionpipe-gui/plugin-ping-a-human@0.3.0 typecheck
> tsc -p tsconfig.json --noEmit

> biome check .
Checked 91 files in 75ms. No fixes applied.
Found 3 warnings.        (office.css:801, office.css:844, plugin-ping-a-human index.ts:225; the same three as main)

> @sessionpipe-gui/theme-canvas@0.3.0 test
> playwright test
  43 passed (26.6s)

> @sessionpipe-gui/color-themes@0.3.0 test
all good

> @sessionpipe-gui/plugin-ping-a-human@0.3.0 test
> node --test test/*.test.mjs
# tests 12
# pass 12
# fail 0

> @sessionpipe-gui/skin-paper-serif@0.3.0 test
all good
> @sessionpipe-gui/skin-spacesheep@0.3.0 test
all good
> @sessionpipe-gui/skin-spacesheep-vivid@0.3.0 test
all good

dist/ is not tracked, so the build changes no committed file.

#19 (check.mjs --skin measures an unset text tier at its stock value) is also mine and also touches CHANGELOG.md; its check.mjs reads STOCK_TEXT_TOKENS and TEXT_TIERS from this package's contrast.ts. This branch merges cleanly into both main and #19's head (git merge-tree --write-tree, no conflicts), and with both applied, check.mjs and check.mjs --skin on the three bundled skins still say "all good", with output identical to #19 alone (every bundled skin sets its own --focus). Once both land, --skin also fills an unset --focus with its new stock value when a skin sets only the ground, as the GUI's skin list now does. Teaching check.mjs the MARKS floor by name is a separate follow-up, not part of this pull request.

Also out of scope: canvas comments that call unheard and unconfirmed "newer than this repo's copy of the wire types" (packages/canvas/src/window.ts, test/map.spec.ts) are now out of date, and canvas does not yet use unfollowed. Both are follow-ups for canvas.

Checklist

  • Every commit is signed off (git commit -s): the DCO is the only paperwork.
  • npm run typecheck && npm run lint && npm run build && npm test pass.
  • New source files start with // SPDX-License-Identifier: Apache-2.0; anything bundled from a third party is in THIRD_PARTY_NOTICES.md and NOTICE. (No new files; the copied files keep the GUI's SPDX line.)
  • No token, real address, hostname or home path in code, fixtures or screenshots.
  • A line under Unreleased in CHANGELOG.md if a person would notice.

Symptom: packages/shared-types calls itself a verbatim copy of the GUI's
shared/ contracts, pinned to GUI aebf57d (0.8.0), but six of its eight
files no longer match the GUI's main. A theme written against the mirror
learns an image contract the GUI has dropped: `composePrompt(message,
items, local)` and the `ThemeApi.control.attach` doc tell it to put a
remote image's URL, with the board's `?k=` key, into the prompt's text,
while the GUI now writes only local paths and says no URL is ever written,
since a prompt's text goes to the model and to every sink that takes
prompts. The mirror's contrast.ts also leaves out the focus-ring floor
(`MARKS`, `--focus` in `STOCK_TEXT_TOKENS`) the GUI's skin list now
measures, and its built-in skins carry the old orange `--focus`.

Cause: the copy had not been refreshed since GUI 0.8.0.

Fix: copy the eight shared/*.ts files from GUI commit 4ab6eae (0.8.15,
v0.8.15-4) over the mirror; color-theme.ts and plugin-api.ts were already
identical. The README pins the mirror to 4ab6eae and names the new
contrast and attachments exports in its list, and the changelog
records the refresh under Unreleased. No export was removed or renamed;
`composePrompt` loses its third parameter and `splitAttachments` returns
the wider `PromptItem`, and nothing in this repo calls either.

Signed-off-by: Connor Burgess <connorburgesscodes@gmail.com>
@graphide-review

Copy link
Copy Markdown

Open in GraphideGraphide review

TL;DR

  • Theme authors get the GUI's latest shared definitions. Pictures added to a prompt now use only paths on the GUI's own machine, never a web link carrying the board's key, and the built-in skins' focus highlight changes from orange to the ink colour.
  • The review found no problems.
  • Safe to ship: the review's verdict is Merge, with top confidence (5 of 5).

Merge  nothing found that needs a look first

Six of the eight mirrored files in packages/shared-types are copied again, unchanged, from the GUI. In attachments.ts, composePrompt drops its local parameter and writes only local paths, never a URL carrying the board's key. In the same file, splitAttachments now also reads a machine's "Attached files" block and spacesheep's Talk block, and returns a PromptItem union. The file also gains promptWords, humanSize and the upload-message constants. contrast.ts adds MARKS, which holds the focus ring to at least 3:1, and a stock --focus in STOCK_TEXT_TOKENS, which textTierWarnings now measures. The built-in skins' --focus changes from orange to the ink colour. api.ts adds arrangements, UploadedFile, LocalMachineSettings, the limited relay state, the unconfirmed outcome, and the unfollowed, unheard, answer and nonce fields on a control row, along with new routes and stream frames. theme-api.ts rewrites the attach docs to match.

No findings sure enough to post from reading the change.

Merge confidence 5 of 5

Where to read first
  1. packages/shared-types/attachments.ts:38 - composePrompt loses its third parameter and writes only local paths; the new attachmentLines and BLOCK_LINE_RE are just below
  2. packages/shared-types/attachments.ts:111 - new splitSavedFiles and splitTalkPictures, which splitAttachments (line 162) runs before its own block detection
  3. packages/shared-types/contrast.ts:66 - MARKS, the stock --focus values, and textTierWarnings measuring them
  4. packages/shared-types/api.ts:1704 - ControlOutcome gains unconfirmed; ControlActivity gains unfollowed, unheard, answer and nonce (read by canvas window.ts and the ping-a-human plugin)
  5. packages/shared-types/theme-api.ts:169 - attach's doc now says to name an image by its path only
  6. packages/shared-types/skins-builtin.ts:46 - the built-in skins' --focus moves to the ink colour
Tests and reach

Reach: no graph yet, so this review could not trace what the change reaches.

Stages: 232 s
Stage State Seconds
diff done 0.0
reach skipped 100.5
risks skipped 0.0
ci skipped 0.0
find done 132.0
agent skipped 0.0
slop skipped 0.0
scenarios skipped 0.0
verify skipped 0.0
prove skipped 0.0
score done 0.0

Reviewed 808601f in 232 s · graph check: no graph yet, so this review ran without it · Full report · For agents: gr review findings spacesheep-dev/sessionpipe-gui-themes 20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant