Wires the window-awareness modules to the product for the first time.
uia.rs and capture.rs were fully written and had no Tauri command at all;
their only caller anywhere was an #[ignore]d smoke test, so nothing in a
shipped build could reach them.
Six commands, all behind the ADR-0008 policy: the privacy switch, the
session list, start and stop, a window frame, and the window's UI
Automation text. The read takes a closure so the window handle never
leaves the policy module — there is no accessor that skips the switch, the
session lookup, the expiry check, or the rate limit.
Starting a session has an interaction problem worth naming: reading the
foreground window is the only selection mechanism these modules have, and
at the moment the user clicks the button, the foreground window is this
application. So the button gives them a few bounded seconds to bring the
target forward, and a window belonging to this process is refused rather
than captured — which is the most likely outcome if the delay elapses
while they are still on the settings page.
The panel sends either the window's text or its picture to the companion
slot. Text first in the UI order, deliberately: it is far less revealing
than a screenshot and usually enough to answer "what am I looking at".
The indicator in the shell is ADR-0008 item 5, which no project document
required. Reading someone's screen with no visible sign is
indistinguishable from spyware from the outside, and a stop control the
user has to go looking for is not a stop control. It polls rather than
waiting to be told, because an authorization can lapse on its own — and
when it cannot read the status it renders nothing, claiming neither that a
capture is live nor that one is not.
The app's own commands need no capability entries: only plugin commands go
through the ACL, which the existing commands working under `core:default`
alone already demonstrates.
Rust tests 110 -> 113, frontend 43 -> 47.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
F-33. A voice reply produced nothing at all: no marker, no event, no
error. Four independent gates each dropped it, and fixing any one alone
would have changed nothing observable.
The mapper reached `map_media` for image, record, file and video alike,
but its only emitting branch was gated on the frame being an image, and
the `attachment_saved` fallback rejected every other type outright. Both
now carry whatever type arrived, with the frame type as the marker's alt
text so the renderer knows what to expect before any bytes exist.
`pending_media` was also a single slot, so a second attachment in one
reply overwrote the first before it was paired; it is a bounded queue
now, and an `attachment_saved` with no id no longer consumes the media
frame still waiting for one.
The download judged a candidate path successful only if the bytes sniffed
as an image — this server answers unknown paths with its own text under
HTTP 200, so sniffing is load-bearing and cannot simply be dropped.
Audio and video signatures are recognised now, and a declared
Content-Type is trusted when it names media rather than only images.
SILK is included deliberately: it is what AstrBot relays for QQ and
WeChat voice, no browser decodes it, and recognising it is what lets the
UI say so instead of rendering a player whose play button does nothing.
The CSP had no `media-src`, so it fell back to `default-src 'self'` and
an `<audio src="blob:">` was refused — in release builds only, since the
dev server serves no CSP at all. That is the same divergence as F-04 and
the inline-script trap in pet.html, so the policy now has a test of its
own that pins each directive the app depends on, including that
script-src still refuses inline.
The renderer chose `<img>` unconditionally. The element now follows the
media type of the bytes that actually arrived, falling back to the
marker's declared kind for the placeholder and the failure message.
`map_media` also kept a private copy of the message-id handling that
included the reopen-suffix overwrite fixed earlier in `adopt_message_id`;
it shares the one implementation now.
Protocol tests 22 -> 26, Rust client 99 -> 101, frontend 35 -> 43. All
six mutations of the new assertions were confirmed to fail.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Switching the pet to the floating desktop mode made it vanish.
close_pet_window destroys the window rather than hiding it, and the app
closes it on startup whenever the pet renders inside the UI, so opening
the floating pet always went through the rebuild path — which honours
the config's `visible: false` and never showed what it had just built.
Only the already-exists path called show() and placed the window. Both
paths now share one helper.
The in-app pet also sat on an opaque card: .app-pet-overlay
.pet-window-embedded painted a 92% gradient with a border and a drop
shadow over a base class that is transparent. Verified against the real
stylesheet — the backdrop now computes to no image, no colour, no
border and no shadow, with the drag box unchanged at 188x226.
Also record the state of voice chat, window awareness and game
companionship, all three of which are in the declared product scope but
largely unwired: the voice path uses a Web Speech API that WebView2 does
not provide and points away from the architecture's server-side STT
design, the window capture and UI automation modules exist in Rust with
no command registered and no route to the companion, and game mode
toggles a window preference and produces no data at all.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The chat panel opened with three stacked blocks above the messages: a
title and subtitle naming the panel, a strip repeating the profile id,
session id and connection state, and the session pills. Only the last
carried anything the reader needed.
Move the slot tabs into the window title bar and delete the rest. The
tabs go there through a portal rather than by lifting state into the
shell, which keeps the slot selection and its status polling in the
panel that owns them; the quick chat and bubble windows have no title
bar, and they are slot-fixed already, so the tabs simply do not render
there.
The connection actions move onto the session row, which costs no height
because that row already exists. 刷新 is dropped: the status refreshes on
a 500ms poll, so the button did nothing the panel was not already doing.
重连, 断开 and 新对话 stay, since losing them would leave no way to
recover a dropped connection or start a conversation.
The panel now puts 82px above the messages instead of three blocks. The
title-bar rules carry [role="tab"] on purpose — the panel's own
.chat-slot[role=tab] rule sets a 2.75rem minimum and sits later in the
sheet, so an unqualified selector loses to it and the tabs overflow a
44px bar.
Verified against the real stylesheet: tabs 33px inside a 44px bar,
vertically centred, clear of both the title text and the window
controls; the removed blocks are absent from the DOM.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An attachment downloaded and then rendered as a broken image. A blob URL
is decoded according to the blob's type, so handing the webview
application/octet-stream makes img refuse bytes that are a perfectly
good PNG — and octet-stream is exactly what the client substitutes when
the server names no type.
Prefer a concrete image type from the server, otherwise identify the
format from its leading bytes. Every signature checked is a fixed marker
at a fixed offset, so this reads no user content, and a JSON error body
served with HTTP 200 is deliberately not mistaken for an image.
Whether that was the cause is not yet established, so the alternative is
made self-diagnosing rather than guessed at. The download outcome —
status, the type the server gave, the type the bytes indicate, and the
length — is now traced, and the frontend reports why an attachment did
not render instead of leaving a bare broken-image icon: a failed
download shows its error, and a payload the browser cannot decode says
so. Both paths were previously swallowed.
Refs: N-6.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adding an AstrBot connection asked for eleven fields. Three of them
reach nothing: the SSE URL has no consumer anywhere in networking (the
desktop transport builds its own endpoint and AstrBot never reads it),
the certificate fingerprint is stored but TLS pinning is not
implemented, and the role only decides a word in the profile list.
The form is now the four things an activation actually requires — server
address, adapter id, API key, slot — with everything else behind a
collapsed advanced section.
The adapter id is the remote username. It was previously entered twice,
once in the profile form and again in the credential card, and it is
what keeps two slots on one server from sharing a conversation, so the
field now says that.
Three values are derived rather than asked for. The display name falls
back to identity@host. The role follows the chosen slot. The insecure
HTTP approval appears only for an http:// address and is required there,
because normalize_url rejects such an address without it — showing it
unconditionally invited enabling it for an https:// endpoint that never
needed it.
Choosing a slot now does the whole job: it assigns the slot, sets the
role, and points startup auto-connect at it, replacing a separate slot
card interaction and a separate auto-connect slot dropdown that could
disagree with each other. The API key is enrolled in the same submit.
Both steps need the profile to exist, so they run after the save and
report their own failures rather than failing the save.
Verified in a browser against the real stylesheet: four fields plus a
collapsed advanced section, the insecure checkbox appears only for
http:// and carries required, and the display name placeholder resolves
to identity@host.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Three defects reported from real-machine testing, all rooted in the same
few conflicting CSS blocks, so they are fixed together — separating them
would leave intermediate states that render worse than either end.
The action buttons showed wrapped vertical text inside a 2rem box.
styles.css already defined .message-action-label, a clip-rect
screen-reader-only class clearly written for these buttons, but nothing
in the tree ever used it: ChatPanel rendered a bare span. Wire the class
up so the buttons are icon-only, and drop the border so they read as
plain icons rather than pills.
.chat-message-actions and its buttons were defined five times across the
stylesheet, three of those styling them as bordered pills that the final
block then partially overrode. Remove .chat-message-actions button from
the three pill rule groups and the small-screen grid rule, leaving one
definition next to .message-action-icon. .chat-runtime-actions and
.chat-stop-button keep the pill treatment; they are different controls.
The avatar rendered below its bubble instead of beside it.
.chat-message-row used align-items: flex-end, and .chat-message-content
is taller than the bubble because the action bar reserves a row, so the
avatar was pinned to the bottom of that taller box. Align to the top.
Removing visibility: hidden from the hidden action bar also closes F-40
(audit P2-24): visibility removed the buttons from the tab order, so
:focus-within could never fire and a keyboard user could never reveal
them. Opacity alone keeps them focusable.
Verified against the real stylesheet in a browser: avatar and bubble
tops differ by 0px, the button computes to 34x34 with 0px border, the
label measures 1x1, and focusing a button takes the bar from opacity 0
to 1.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Add configuration-only auto-connect rules, runtime operations slot lock
while tasks are active, and duplicate server-instance warnings without
silent Profile merge. Surface policy status to the settings UI and cover
the new boundaries with Rust and Vitest checks.