mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-06 04:18:11 +01:00
2c18d1f4deae4be21db0f03b61ba8592d2aa64ba
85
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8ab96666d7 |
Use shared audio playback and describe Cat's real creative Studio (#1382)
* Play audio in Loki and ground Cat Studio capabilities in the working first version * Minify shared widget CSS before inlining to retain the download budget |
||
|
|
55141f4614 | Send widget guided choices through the conversation handler (#1379) | ||
|
|
9901e004d8 |
Use the shared visual answer engine in AI chats (#1364)
* feat: adopt shared visual AI answers * test: preserve all citations in one sources sheet per answer * feat: negotiate visual answers with public chat clients * fix: preserve complete visual widget answers and bounded history * fix: keep visitors' literal messages in rich chat history * style: normalize widget history formatting * fix(widget): keep chatkit out of the panel bundle The panel (public/widget.js) imported richAnswerText from @bitbaum/chatkit, pulling a dependency into every customer page load and failing widget-self-contained. Use a dependency-free copy in widget/rich-history.ts with a parity test against chatkit. * style: format widget visual answer test --------- Co-authored-by: catomean <catomean@users.noreply.github.com> |
||
|
|
3024426a65 |
fix: Voice says why studio voices are off, Watching says each thing once, Prompts in words (#1358)
* fix(prompts): one card per saved prompt, schedules in words, dialogs that say why
What the owner found on /prompts from an Android phone, item by item:
1. Saved prompts: saving the same name + words again no longer inserts a
row — POST /api/prompts answers with the prompt already saved
(existing: true); the form opens it, the default's save button says
"Already in your prompts". A card that stands for identical copies says
how many and offers "Remove N extra copies" — one explicit tap, the
caller's own rows only, the same soft delete as Delete
(DELETE /api/prompts/<id>/copies). Same name with different words says
"2 versions with this name, worded differently".
2. Filters: the scope filter is a <Segmented> (All / Any project / One
project) sitting with the category row on the list they both filter,
under "Loki's prompts". Category counts follow the scope. Filter chip
rows on a phone get a wider fade, snap to a chip's start and leave room
after the last chip, so the edge reads as "more" rather than a cut word.
3. New prompt: Create stays disabled until there is a name and a prompt,
and says what is missing beside it. Opening or closing the form never
saved anything; the copy glyph on every default card did, in one tap
with no label on a phone — it is now a labelled "save a copy" button.
4. Schedule: pick Every day / Weekdays / Every week / Every month, a day
and a time; Loki writes the cron (lib/cron-words), with "Write it as a
cron line instead" for experts. The schedule reads back in words with
the time zone it runs in ("Every Monday at 10:00, Zurich time
(Europe/Zurich)") and a link to change it; the zone is sent with the
job. The API refuses a cron line the scheduler cannot read, in words.
Create is the primary button and says why when it cannot be pressed.
5. Run: a prompt that names {{project_name}} asks for a project whatever
its scope (a saved copy is global), defaulting to the project in use;
the prompt is shown only once complete. Each action says in one line
who does the work; Send to terminal works for any of your projects
(tab-inject starts or queues the session) and says why when it cannot.
Project pickers list projectTitle(), not folder keys.
6. Category chips are neutral (ui-tag-neutral); the ui-cat-* rainbow and
the featured star's amber are gone. "control" was a second id for the
fleet prompts — one category now, "Fleet control".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(voice): spoken sentences start with a capital and name a repeated project once
The briefing read "one run is waiting for a builder: loki ... three runs
failed: loki, loki and loki". Sentences now open with a capital, and the
runs' projects are said once each: "Three runs failed on loki.", "Four runs
failed: loki three times and heidi once." The same for runs waiting for a
builder, agents working, and the announcements between turns.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(voice): say why the studio voice is off, with the link that fixes it
POST /api/voice/speak answered 502 with Groq's reason only in the server
console, and the phone fell back to its own voice in silence, so every voice
in the picker sounded the same. Groq's refusal is now classified
(lib/voice/tts-failure: terms gate, bad key, limit, model gone, vendor down,
no key) into one plain sentence and, where one exists, the link that fixes
it — for the Orpheus terms gate, Groq's voice page and "press Accept". The
route returns it in the 502/503 body and records it in debug_logs (once per
reason per half hour) so System shows it. The speaker reports the fallback
to the page; useStudioVoiceStatus keeps it for the tab's session and
StudioVoiceNotice shows it. The phone-voice fallback stays.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* feat(voice): change Loki's voice by saying so, and answer questions about voice mode truthfully
"I don't like your voice, can I change your voice" was answered like a
generic chatbot ("in most voice-enabled AI chat apps... look in settings").
Now "use Troy", "change your voice to Diana", "other voice" and
"switch voice" are a spoken command (config/no-screen.ts, lib/voice/commands)
that the phone answers itself; with no name it lists the voices. A question
that does reach Loki carries voiceModeContext (lib/voice/self.ts), built from
the SSOT: the voices by name, how to change one, the three switches with the
same one-line notes the screen shows (NO_SCREEN_OPTIONS), every command, the
current settings and why studio voices are off, if they are.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(voice): a music bed a phone can actually play, and keep its sound awake
The bed sat at about -38 dBFS RMS alone and -50 under the voice, every note
98-370 Hz behind a 900 Hz low-pass: below what a phone speaker or many
earbuds reproduce, so "music bed on" was silence. It is now an octave
higher (196-740 Hz), about 12 dB louder, ducks by 10 dB instead of 11 more on
top, and earcons sit above it. The AudioContext is resumed inside the Start
tap, on every tap on the circle or headphone button, on return to the page,
and when the phone suspends it mid-session.
useSoundscape also returned a new object every render, so effects keyed on
it re-ran ~20 times a second while listening: the gain was re-ramped every
frame and the 20-second fleet poll was cleared before it could fire. It is
memoized now.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(voice): one h1 per screen, End clear of the feedback launcher, voices as an even grid
- Speaking screen: an h1 below md, where the app top bar steps aside; the
start screen's big "Voice" is no longer a second h1 beside the top bar's.
- The speaking screen sets data-fc-place="tab", so the feedback launcher
and its Watching pill become the slim edge handle instead of sitting on
End; End is larger, with room below it, and the stage scrolls rather than
pushing End off a short screen.
- The voice picker is a <Segmented> grid of four columns (seven voices as
4 + 3, the last two cells wide) instead of a chip row cut off at the edge;
the setting groups have real headings.
- The unclear note under the switches is one short line under each switch,
shared with what Loki is told about itself.
- The page wires the studio-voice notice (under the picker and under the
circle, said aloud once), the spoken voice change, the page's state sent
with each question, and the sound resume on every tap.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* fix(widget): one card per finding, settled page checks, honest fix status, a count that means what needs you
Watching on Loki's own /voice from an Android phone showed six problems in
one panel. Each is fixed where it starts:
- Notices no longer stack. A page's checks own ONE card (checksSlot), which
each new reading replaces in place and a clean reading takes back
(thread.ts pushNoticed / dropNoticed); a remark whose words are already on
screen is not said again; a finding's signature ignores its count and its
placeholder example (findingKind), and the card names its page.
- The heading miscount: the check counted headings inside aria-hidden and
inert subtrees, and measured the page once, mid-swap — /voice's setup
screen (top bar h1 + page h1) leaving for its speaking screen (immersive
mode hides the top bar: no h1). Checks now count only rendered elements and
run once the page has held still, twice, keeping only what both readings
agree on (settledPageChecks / stableChecks). The Voice page itself now has
one h1 on each screen.
- A fix Watch started that failed no longer promises it "goes live by
itself": it says the fix did not finish, and "Open it in Loki to see why"
is a real link to that run's Watch page (owner-view ownerTap; watch-fix
now resolves a failed run's Watch page even without a live page).
- Self-watch: "I couldn't check on your changes just now" replaces the old
sentence; a request that lived through the page being put away (a phone
locking) is never a failure; background reads count only after three
failures in a row; the changes route always answers with CORS headers and
logs what failed.
- The header's one number is what waits on the owner's decision (failed
attempts, saved notes, notes not started, changes said but not saved),
counted by the server over ALL of the owner's rows, not inside the newest
twelve; the open list shows every one of them first. Nothing waiting:
just "Watching".
- The save receipt never quotes a cut sentence: several changes are listed
one per line under it, clamped to whole lines with "Show all".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* docs(changelog): voice, Watching and Prompts fixes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
9031430125 |
feat(feedback): a client's seat on the site itself; visitors follow notes without an account (#1337)
* feat(feedback): a client's seat on the site itself; visitors follow notes without an account Step 3 — the seat reaches the site: - A member pass (#loki-member=) names the person, not the owner. Their project page's Open link and the widget's sign-in door give it to anyone on the project who does not build it. The widget stays the ordinary panel and sends it with each note; ingest files it through the same path as asking in Loki, so a client's note on the site builds on their allowance and goes live on their word. Membership is read when used. - The owner's own link is no longer what a client is sent: the preview's share card offers Invite them as Client. - An approved /change request seats its requester as the site's client (5 changes a month), and their request page says where to ask. Step 4 — the way back without an account: - The tracking link opens on the note's status (the My feedback card), for six months; an account is optional, below it. - A visitor who leaves an email gets the link by mail (three a day per address), and again in the shipped mail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * chore(widget): keep the conversation within its length limit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * chore(widget): hand the passes on through one helper Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * test(feedback): the shared reporter card and the six-month link Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
8e8ffa0b82 |
feat(change): see your own site changed in under a minute, before any account (#1328)
A stranger on /change now taps "Show it on my site" and gets their live homepage, photographed by Loki's browser, then the same spot with what they asked for drawn on it, compared with a slider. No account, no repository, no build: the widget's "Show me" edits (same closed vocabulary, same sanitising) applied in a headless page on the server, never in their site. - widget/instant-page.ts bundles the widget's outline + applyPreview for that page (public/instant-page.js, built with the widget). It is evaluated, not injected, so a site's own CSP cannot block it. - page-picture: withLivePage shares the picture's queue, private-network guard and patience with a caller that photographs more than once. - POST /api/site-consult/preview streams NDJSON: their site the moment it exists (~5 s), then before/after. The address must pass the consultation first. It spends the owner's AI on purpose, behind a per-visitor and an everyone-per-hour limit and the owner's daily budget. - The preview prompt drops its "was just changed for" line when nothing was. Claude-Session: https://claude.ai/code/session_01HyfPCAeTFi2sjpVY44Y1JJ Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
adfbdcfe07 |
fix(session): the builder updates, the sheet changes things, one box, a preview is the site (#1305)
The owner used Loki from a phone (2026-10-18) and could not tell whether
anything worked. Four separate faults, each passing every check:
The cloud builder ran code days behind the app. Its restart waits for
every agent to be idle, and autopilot refilled the queue the instant one
finished: ten consecutive deploys (23:38 → 09:12) found "2 agent(s)
working — deferring restart". Hence "Model: not known yet" of an answer
the screen was showing. Now, while the cloud runner's heartbeat version is
behind the deploy's, the commands route hands it no work-starting
commands (dispatch, launch_agent, auto_continue, browser_task) — a
person's own words into a session still go through — so the idle moment
comes, the restart lands, the queue resumes on the new code. Server-side
on purpose: a runner-side rule would have waited for the very restart it
was meant to allow. Control's builder line says "a newer version waits
for its agents to finish" meanwhile.
An agent renamed a preview site, committed, and reported "the work lives
only on this machine — tell Loki where this preview's remote should
live". The box contract says push or fail loudly; a preview folder is
served from disk and has no remote by design, so the change had been live
since the save and the owner read a failure and a chore. Every dispatch
to a preview folder now carries "Where this goes" (lib/previews/
delivery-note), and the contract has the same section.
The session sheet's Change and Set typed /model and /effort into the
terminal and closed; Claude Code drew its picker behind the conversation
and nothing on screen moved. Each row now lists its choices; a tap sends
the command with the choice named (/model sonnet, /effort high), the
sheet stays open and says what is changing, and settles when the log
names it. The sheet is built like the Settings sheet.
The session box had a 26px library button beside 44px round ones, a 36px
chip and a 34px Keys pill, the microphone second from the left in one
view and beside Send in the other, and "claude" on the tab beside
"Message Claude…". One row, one size, one order in both views; the
agent's name everywhere (terminal-strip-tabs badgeNames).
Widget: the owner's change list reads what needs them first (the line
counted nine, the list showed none); "9 needs you" → "9 need you"; a
failed call is named ("my call to Loki to save your note failed… Your
words are still here — press it again") instead of "one of my calls to
Loki failed — nothing for you to do".
Tests: runner-update-hold, preview-delivery-note, owner-changes-order,
session-sheet-browser (new); builder-presence, widget-changes,
widget-self-report, inject-context-boundaries extended.
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
44def109a9 |
feat(widget): a spoken walk read as a list, whole sentences, talk from the launcher, per-page builds (#1302)
* feat(widget): one Talk bar, status header, read-back, per-page builds - One Talk to Loki bar above a one-line message box; the box shows its tools only once used. The second Talk button in the thread is gone. - The owner's header is the status (Watching / 2 to look at), Pause, close: no second logo, no page line. Opening on a phone no longer raises the keyboard. - A spoken note is read back as a list per part of the page, with Read it back (speech) and Edit. - Build all starts saved notes as one build per page (dispatchFeedbackBatch, shared with the project batch route). - Regex literals use \u escapes; a test fails on non-ASCII in the bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa * feat(widget): a walk read as a list, whole sentences, talk from the launcher - Loki's read of a spoken note is a list: one change or question per line, with where it applies, editable, ✕ to drop. The part on screen is background; a line names a part only when it was pointed at. - Save files each change as its own note, with only the moments it came from, on the page it was said on. Questions stay on the card for Ask. - Whisper's segments are joined into whole sentences before they are placed under a heading, so a sentence is never cut across two parts. - The owner can start talking from a microphone beside the launcher without opening the panel (widget/quick-talk.ts). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
da75cbd356 |
fix(phone): one row of widget header, room to type, the tab not the pill, one menu (#1297)
* fix(phone): one row of widget header, room to type, the tab not the pill, one menu The owner on a phone, on Loki's own Control (2026-10-18): "this looks disgusting… why is it so crowded?" Widget panel (owner): - The status line IS the header: the brand row and the page name above it are gone for the owner (a visitor keeps them). Close sits at its end. - The line carries one number of one named thing: "11 changes need you", "2 being built", "noticed 2 things" — not "4 to look at · 11 needs you". It wraps to a second line on a narrow phone instead of cutting the noun. - Typing is one state however the keyboard is drawn. Loki's pages shrink for the keyboard (interactive-widget=resizes-content), so the inset check never fired, the sheet stayed at 68% of a halved viewport and the thread was a one-pixel sliver. A focused box now fills what is visible and steps the extras aside; the sheet resets on close. Launcher: the phone bottom bar asks for the edge tab (data-fc-place="tab"), so the "Watching" pill no longer floats over Control's cards. An open dialog still wins over a later region's tab (resolvePlaceDirective). One menu on a phone: the Profile/Chat/Control/Terminal strip no longer renders below md (the bottom bar is the menu there), nor on /control, where it named one remembered project above a page about all of them. Control: "Default agent and model" moved into the Settings sheet the foot already opens, and the foot is the page's last line (shown with no projects too). The sort and Select row of the project list is desk-only. Tests: new widget-owner-phone-browser (fails on the old header and on the old sheet); nav-surfaces and phone-chrome guards updated to the new rules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * fix(widget): keep buildShadowCSS within the function-length limit The owner-header rules took buildShadowCSS to 516 lines (limit 510); the same rules, compacted onto two lines in the file's own one-line style. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * test(widget): wait for each state, not a clock, in the owner phone test CI runs it beside every other unit test on two cores, where the owner's changes arrive late; fixed half-second sleeps failed there (its own output showed only a closing brace). It now waits for the status line, the typing state and the edge tab, and prints a one-line reason last if it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * fix(widget): the keyboard, not the focus, decides the typing layout CI's fonts left the thread 44px at 320px with the keyboard up: the composer's "This page / Point to area" row cost the room. It steps aside while the keyboard is up, with the starters. And the typing layout now follows the keyboard (the visible area well below its tallest), not focus alone: Android's back key drops the keyboard but keeps focus in the box, and the extras then come back. The phone test checks both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx * test(widget): the thread must show what it holds, not be 60px tall CI's thread held 44px of text and showed all 44px — content-sized, not squeezed. The check is now what the bug was: a thread showing less than min(60px, what it holds). The original sliver (1px of 64px) still fails it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
09e04ab4ed |
feat(widget): Loki reads a spoken note before it is saved (#1299)
The owner walked Petvity for 43 seconds on 2026-10-18 — the home page, Features, the dashboard, Settings — saying the design was inconsistent and asking Loki to look at it all and say what it thought, then asked whether Loki had heard them at all. It had, and it had watched: every page and part was noted. But the card was every word verbatim under each part of the page, including "No, no, I'm just making a coffee", said twice to someone in the room; it led with Save and Fix it now for what was a question; it sat under three "Loki noticed" cards, one of them repeating the same finding; and replaying the walk showed every sentence filed one page early. Loki reads it first (widget/walk-read.ts, POST /api/widget/understand, guarded like /api/widget/advise): - The card says what it heard: "Loki heard you · 0:43 across 4 pages". - The box leads with the ask, editable; what was not meant for Loki is named as "Left out"; the words as spoken stay under "Word for word" with "Use my exact words instead". Whatever is saved, the words as spoken still travel with it in each moment's `said`. - A question leads with Ask Loki, answered about every page of the walk (the walk is sent as the review session); a change leads with Save (owner, then Fix it now) or Save feedback (visitor). - Nothing waits on the read: while it comes and when it fails, the card is the words as spoken with the buttons as before; words edited before it arrives are never replaced. - The card is brought into view from its top when it appears and when the read redraws it, without throwing the phone keyboard up again. Walk alignment: a page change is noted the moment the address changes (a site's own links change it without an event; polled every 250 ms while recording, popstate too). It used to wait for scrolling to settle, so the first words on each new page landed under the page before. A site-wide finding (the page's language) is said on the first page of a visit, not on every page (onceSiteWide in watch-trail.ts). Tests: widget-walk-read (rules, prompt, wiring), widget-walk-read-browser (the owner's walk replayed at 390 and 320: question, change, and words edited before the read), widget-browse-voice-browser updated for the new header and the read-fails path. Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
ee54011517 |
feat(widget): plain words, and talking as the way in (#1296)
The owner (2026-10-18): make it easy to understand, easy to use, pleasant and exciting. - What Loki notices is said in plain words. "2 tap target(s) are under 24px and crowded… at 7×48" reads "2 buttons are small and close to others, so a thumb easily hits the wrong one"; "<html lang>" reads "the page does not say which language it is in". The exact finding stays the fix request a builder gets and the key a finding is recognised by (plain-checks.ts; widget-plain-checks pins both, and that every template page-checks writes has a rule). - Before anything is said, the panel opens with one big, friendly "Talk to Loki" card: scroll around and say what you'd change. Talking was a small mic among the composer's tools. - The owner's greeting is one short sentence; a change going live is announced with "Done —". Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
d079f972ab |
feat(widget): one widget everywhere, the state in every shape, record now and build later (#1295)
The owner (2026-10-18): the widget looked different on different pages
and sites, it should always be clear when Loki is watching, and they want
to record comments while it watches and implement them afterwards.
One widget, everywhere
- Loki's own site draws the same panel every customer site gets, not the
chatkit view (data-fc-chat="kit" stays an opt-in).
- No Loki page hides the launcher any more: the project workspace, the
agent conversation, inspection, the project loading state and an open
/loki conversation were "hidden" — no launcher, or the watch top bar
instead. They show the edge tab. feedback-widget-reach fails on any
page that hides it, in either the literal or the expression form;
only an open dialog and the sign-in wall may.
The state in every shape
- The owner's edge tab carries the same live dot and ring as the corner
pill, at full weight.
- The owner's pill sits in a bottom corner or becomes the tab; it no
longer climbs to the middle or top of the screen (Heidi at 390px).
Record now, build later
- After a voice note the owner's card leads with Save (then Fix it now,
Ask). Saved notes lead the status line ("Watching · 3 notes saved"),
and "Build all 3 saved notes" starts each as its own build, oldest
first: POST /api/widget/owner/build, rule in lib/feedback/saved-notes.ts.
- The owner check for the widget's owner routes is one helper,
lib/widget/owner-request.ts, used by owner/changes and owner/build.
Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
5e7f1c1924 |
feat(projects): a Builder changes the site without the owner, and the invite says so (#1280)
The owner's words, 2026-10-17: Manu is a doctor; joining should take no explaining, and when he is a Builder his feedback should go to Loki, not to George. The machinery existed — a pass on the site's feedback button makes a note build at once — but Loki handed the pass only to the owner, recorded nobody as the reporter, told the owner nothing, and the invite page named a role without explaining it. - The invite page is the manual: what the project is (its description and site), how you change it in three lines, what happens to what you ask for, one button. The owner opening their own link reads the same page with "This is what the person you send it to will read". - After joining, the project leads with the same three lines (MemberGuide) and an "Open <site>" button. For a Builder that link carries the pass. - Who gets a pass is one rule, mayHoldPass (owner and every Builder); the project page issues it by that rule. A viewer's or a client's note, like a stranger's, waits for the owner. - Ingest records the pass holder as the reporter, so the owner's inbox reads "Manu Rigner asked for this on your site" with "Manu Rigner · Builder", and Manu's own list knows his notes. The owner is told by push and Telegram when a Builder's note starts (notifyBuilderAsked) — told, not asked. - The site's sign-in door reads "I own or build this site", and ROLE_LABELS says in plain words what each role means for what you ask for. Walked at 320, 390 and 1440 on a local stack with a stand-in Petvity site carrying the widget: George makes a Builder link; Manu reads it signed out, joins, lands on the guide, opens the site from Loki, asks for a change in the widget — the row is his, source owner, and the build is attempted at once; George's inbox names him. Eve joins as a Viewer, her note from the site is a visitor's and waits for George. No overflow, no page errors. Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
8749efd100 |
feat(widget): say the state on screen, one button to open, a calmer panel (#1279)
The owner on their phone (2026-10-17): it should be clear on screen when Loki is watching and when it is recording, opening it should be easy, and the panel was too crowded and intimidating to use. Watching - The owner's launcher is ONE button that says its state in a word at every width: "● Watching" with a live dot and a ring, or "Paused". A tap opens Loki. Its second half, "Point", was the labelled, bigger part on a phone, so the obvious tap pointed instead of opening; pointing is "Point to area" in the composer. Recording - A red edge round the whole screen while Loki listens (it takes no taps; grey while it writes it down), a red-bordered dock that says "Recording 0:12", and a one-line hint instead of four. The panel - One status line instead of two rows: "Watching · 2 to look at · 4 live › Pause"; opening it shows what Loki noted and where each change is. - One microphone: the header's "Voice note" and the composer's "Record" did nearly the same thing. "Talk" in the composer is talk-while- scrolling, which also covers plain dictation; in chatkit it takes the tool row in place of chatkit's own mic. - "Fix it" and "Ask" instead of "Request a fix" and "Chat with Loki". - "Continue in Loki" appears once something has been said. - The visitor's phone launcher is 44px, the minimum tap target. Docs (widget/README.md, docs/architecture/feedback-widget.md, docs/development/contextual-voice-feedback.md) and the browser tests follow the new controls; new pure helpers watchHeadline and changesHeadline are unit-tested. Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
afaf8c9b43 |
fix(widget): no dead-end notes, no "LOKI / Loki", no stacked assistants (#1266)
Three things the widget did wrong on production, found by using it: - A visitor's note about Loki itself got a receipt with no link: only the owner's build had a way to follow. Self-reported notes now carry the same claim link api/feedback hands out, so the person can follow it in their own My feedback. The claim path has one spelling (feedbackClaimPath). - On Loki's own site the header read "LOKI / Loki": the brand line, then document.title. pageLabel drops the brand segment and keeps the page's name, falling back to the path, then Home. - A corner holding the host's own floating button (substrata's ASK, Heidi's pill) was climbed: two assistants stacked as one tower at 390px, and ours floated 300px up the edge at 1280px. That corner is now the host's: the launcher takes the other corner if it is clear, else the edge tab. Tab bars and composers are not floats and are stepped around as before; a side named by the host or the visitor is kept. The install prompt no longer tells builders to add data-fc-bottom to stack them. Browser fixtures 4/4b fail against the current production bundle and pass with this one. Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
6d40764c8a |
fix(widget): Send stays reachable on the real sites, not only the fixture (#1256)
#1251 went live and I re-measured production instead of trusting the tests. Fixed on Substrata 390×760 and Loki's own site; still broken on orangecat.ch at 390×667 and Solon at 360×640, where a tap on Send still hit "Made with Loki" — and the footer I said would share one line still took two. Two causes the test fixture could not show: - The phone rule that makes the starters one swipe row lost to the base `.starters { flex-wrap: wrap }` rule, which comes later in the file with the same specificity. On the real sites the starters were still a 129px stack. Now `.convo > .starters`, which wins. - "Made with Loki — build something of your own →" alone is wider than a phone, so the footer wrapped to two 39px rows. On a phone it reads "Made with Loki →"; the rest of the sentence stays on wider screens. And a priority, so content can never again push the composer out: the thread gives way first (flex-shrink 9999), then the starters (now allowed to shrink, clipped), never the composer. Verified by serving this build into the REAL production pages (orangecat, Solon, Substrata at 390×667 / 360×640 / 390×760 / 320×568 / 390×844 / 1280×720): every tap on Send reaches Send. widget-embed-browser now also asserts the causes on phones (starters one row, footer one line) and adds 320×568; it fails 4 times without this change and passes 78/78 with it. Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
f309b23ae0 |
fix(widget): a tap on Send reaches Send, at every height (#1251)
Found in production on 2026-10-17 by driving the live widget the way a phone
visitor does, and filed through the widget itself ("Loki itself", feedback
ddf6e248):
- substrata.orangecat.ch at 390×760: the composer scrolled with the
conversation and opened half below the fold, so a tap where Send is drawn
hit "Made with Loki — build something of your own" — a new tab, the note
unsent. After sending, the composer was gone below the footer entirely.
- loki.orangecat.ch at 1280×720/860 (the chatkit composer): Send sat below
the panel's scroll box, under the footer.
Cause: .convo was itself a scroll box holding the thread (96px floor), the
starters and the composer; whenever they did not fit, the whole column
scrolled. In chatkit mode two plain block wrappers (.kit-host > .fc-kit-root)
took their content's height, so the thread never shrank at all.
- Only the thread scrolls; it may shrink to nothing, the composer may not.
- The chatkit wrappers pass the room down.
- On phones the starter chips are one row to swipe (they were a 140px stack
on a 517px sheet), and the two footer links share one line.
- Self-watch now checks Send by what a tap HITS when the panel opens. It
only checked sideways overflow, which passed while production was broken.
- Both browser suites check Send's reachability at 390×667, 360×640 and
1280×720 (plus 390×760); every test used to open the panel 800px tall,
which is how this hid. Reproduced first: classic failed at 390×667 and
360×640 (hit: made-with), chatkit at 1280×720.
Also: CLAUDE.md said to attach the fleet kits with read access. For a public
repo that attaches nothing and codeload stays 403; the push attach is what
opens it (whenkit 403 → 200).
Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
3e0fdffd28 |
fix(widget): a walk deep in a section names that section, not the page title (#1241)
Walking the live Petvity home page to its bottom with the live widget (fake microphone, writes caught locally), the last moment was recorded as "Petvity — The global platform for pet care": the "Free, forever" heading had scrolled off the top and no heading was on screen, so inView fell back to document.title. The person was still in that section, and the agent was told nothing about where they were. inView now picks the last heading that starts above the reading line, on screen or scrolled past, then the first heading on screen, then the title. The browser test scrolls the fixture down to its footer after Mark and asserts the moment stays "Pricing" with the deeper scroll; the old code fails it with the fixture's title. Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
87e4fec420 |
feat(widget): walk and talk — what was seen per moment, taps by their label, takes that chain, pictures Loki takes afterwards (#1239)
* feat(widget): walk and talk — what was seen per moment, taps by their label, takes that chain, pictures Loki takes afterwards The owner (2026-10-17): "I can scroll through the site and click different things while recording an audio … and as I comment, automatically the screenshots or whatever else needs to be taken, so the changes will be made in the most effective way possible." A page cannot film itself on a phone without a permission prompt, so the widget still takes no pictures. What it now takes, honestly, at the start, when scrolling settles, on every tap on the site and on Mark: the part of the page in view, the text at the reading line, how far the page is scrolled, and the control that was tapped — by its own label (aria-label, alt, title, text; a field by its label or placeholder), never by what was typed into it. Whisper's timings put each sentence under the part that was in view when it was said, as before; beside the note now travels the structured list of moments (widget/moments-contract.ts: said → seen, clamped on both sides, scripts/test/widget-server-caps-mirror.ts holds them together). - A walk is no longer one take: at the upload cap the recorder hands straight into the next take (the microphone stays granted), the clock keeps counting from the start of the walk, and Done joins the takes on one clock (joinTakes). Up to ten takes, about eighteen minutes. - Ingest validates and stores the moments (site_feedback.moments, migration 0108); the fix prompt renders them as a fenced WALK, one line per moment, so the agent knows what "this button" was. - The owner's row lists the walk (components/feedback/MomentsWalk) and a tap on "See what they saw" has Loki open that very view on the server — the page, scrolled to the tapped control or to the same scroll — and take the picture (/api/feedback/[id]/moment/[n] over page-picture.ts, which now takes a scroll position). The decision card says "4 parts of the page · tapped 2 things" so the owner knows a walk is behind it. Checked in real Chromium: a click on the host's own button while recording becomes a moment with that button's label and selector, Mark marks the part in view, the scroll is kept, the password field's value never travels; the owner and visitor flows at 320 and 390px pass as before. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 * chore(drizzle): regenerate the moments migration as 0109 on top of #1238 #1238 landed its own 0108 (site_feedback.read) first, so the moments column moves to 0109 and its snapshot is generated from main's. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TNLstupcdvsPfTjy8yjR67 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
95383b92db |
Improve a live site as a private preview; consultation reads the whole site and talks (#1234)
* feat(change): improve a live site as a private preview, with a site tour and a consultation that talks
"Improve this site" created a GitHub repository per click and a kickoff that
told the agent to "treat the repository as possibly empty" — for a site that
already exists. Two clicks made two repos (center-com, center-com-2), and the
owner had nothing to show their client but a run log.
- /change builds a PREVIEW (lib/previews/from-website): folder + local git,
<name>.orangecat.ch behind the access code, widget on it. No repository until
the client says yes; servers without previews fall back to the repo path.
Repeat submits resume the same preview. An access code is created when the
operator has none.
- The brief starts from the live site and asks for improvements.html, a tour
of what changed (live page vs new page), so the client SEES the improvement.
"Watch it work" shows the link, code, tour and a copy-ready client message.
- The consultation reads the homepage AND the pages it links to
(site-consult/crawl, bounded, same SSRF-guarded fetch), with site-wide checks:
broken links, duplicate titles, thin pages.
- It is a conversation now: what Loki read, its advice on what to fix first,
what already works, then two one-tap questions whose answers become brief
lines from config.
- Loki chat's read_website reads up to five linked pages and returns the
consultation as advice.
Fixes from the owner's screenshots:
- Owner launcher on phones drops the "Loki · watching" label and fades while
scrolling — it was covering "It worked" and card buttons.
- Tapped labels no longer glue count badges on ("Feedback to triage11").
- The widget no longer files Loki's own app polls (/api/feedback/summary) or
navigation-cut requests as its failures ("never answered after 0.3s").
- Live-check evidence speaks as Loki, not "The provided page text…".
- Watch: "Waiting to start · started just now / Queued" → "Next in line ·
asked just now / Waiting for a builder to pick it up."
- Session box: an agent's "request access to the widget storage and dump
submissions" suggestion is replaced by the Attach-feedback action.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zCRuBPv8KpyTPkh6JsSYt
* fix(feedback): keep evidence wording pure so the inbox client bundle builds
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zCRuBPv8KpyTPkh6JsSYt
* test(widget): read the owner launcher's words, not its pixels
On phones the owner label is now hidden so it stops covering the page; the
accessible name still says Loki is watching.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016zCRuBPv8KpyTPkh6JsSYt
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
73df3dbece |
feat(widget): speak while scrolling, ask or send after, editors sign in (#1230)
What the owner hit on evig.orangecat.ch, fixed as one flow: - A long voice note looked cut off. It was not lost: the receipt quoted 300 characters and was the only copy shown. The receipt now quotes the start (at a word) and folds the whole note under "Show all you sent". - Speaking while scrolling: one dock (Listening · Mark · Done · ✕). Loki notes the part of the page in view at the start, when scrolling settles and on Mark; Whisper's sentence timings put each sentence under the part that was in view. No video, no screenshots, and the dock says so. The clock warns in the last 15 seconds before the 1:50 cap. - After speaking: "What you said", editable, never sent by itself. Ask Loki, or send it (visitor), or Build it / Save note (owner). - The aim button is "Point", labelled, everywhere. This page / Whole site / Point / Loki each say what they mean, and the placeholder follows. - Sign in: the header button explains what happens; "Create one free" keeps the way back to the site; sign-in follows the API redirect for real. The project's editors now get the owner's panel (one rule, lib/feedback/pass-holder.ts, for every widget route). Claude-Session: https://claude.ai/code/session_018LMe5Uv6mfWJibAiCaNbbk Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
25ae3de0e5 |
Make the Loki site widget one clear conversation (#1229)
* Improve widget conversation and mobile feedback flow * Update widget layout assertion for simplified header |
||
|
|
9d5d0c4694 |
feat(widget): Loki's own look, in Loki's light or dark mode, with one scroll (#1227)
* feat(widget): Loki's own look, in Loki's light or dark mode, with one scroll The site widget took its colours from the fleet's shared tokens, whose accent is OrangeCat's warm orange, and was dark only: on a client's light site the owner saw an orange-ringed black panel and asked why Loki's widget looked like OrangeCat. - Themes are generated from Loki's own globals.css, light and dark. The accent is the ink; the warm colour is only the focus ring and a picked element's outline on the host page. - Every widget stylesheet reads var(--lk-*), defined for both modes on the shadow host; widget/theme-mode.ts picks one. The owner gets the mode they chose in Loki (user_preferences.theme, saved by ThemeSync via PUT /api/me/theme, returned with their changes and remembered per site); everyone else gets their device's setting, followed live. - The panel is one column with one scroll area (the thread) between a fixed header and composer. The whole card used to scroll too, which hid the composer below a laptop's fold and nested scrolls on phones. - The desktop card no longer greys out the site it invites you to use; the phone sheet opens at two thirds of the screen with a lighter scrim. - About is a segmented control that fits a 320px phone on one line. - The walkthrough card follows the same mode; its ring uses the highlight so it reads on light and dark sites. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LMe5Uv6mfWJibAiCaNbbk * fix(widget): the launcher is findable — Loki's mark at full strength On the owner's phone, signed out of the owner pass, AOZ showed a grey pencil at 38% opacity and 85% size, and the owner said the widget was gone. Without the launcher there is no way to the sign-in that brings owner mode back. The resting launcher is now Loki's spiral at full strength with a hairline and a soft lift off the page, on phones and desktop; it still fades while the page scrolls. Also: the user_theme migration is renumbered 0107 after main's 0106. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LMe5Uv6mfWJibAiCaNbbk * fix(widget): keep the shared chat's thread bounded however chatkit nests it CI's widget-kit-browser (needs @bitbaum/chatkit, so it only runs there) failed one check: the chat thread no longer had a max-height once the panel became a flex column. The flex layout bounds it only when the wrap is a direct child, so the cap is back as a backstop, and the test now pins the outcome — the thread scrolls and ends inside a card that fits the screen — instead of the mechanism. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018LMe5Uv6mfWJibAiCaNbbk --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
1cdd92a8ad |
fix(widget): Loki on the site answers what was asked (#1222)
On a client's site the owner said a description field had no microphone and asked, twice, whether the site used the fleet's packages. Loki gave the same advice about one textarea twice, in German to an English question, and its Review called the minutes spent talking to it "the page never responded for 194 s" with an invented endpoint. - The advisor now sees how the site is built: the packages its code uses, the kickoff's plan, and the owner's build conventions (src/config/build-conventions.ts, also carried by every dispatch). - Naming a package is no longer treated as "explaining how to edit"; a point about every form is answered as a rule across the site; no repeated answers; replies follow the language of the latest message. - What the owner says to Loki is a `talk` step in Watch's trail, so a Review reads that time as conversation; Review may not name an endpoint the evidence does not show. - Loki's unasked page read skips test data and replaces the previous read instead of stacking one per page. - First build convention: fields where people describe something get a microphone from @bitbaum/chatkit; short fields never do. Claude-Session: https://claude.ai/code/session_018LMe5Uv6mfWJibAiCaNbbk Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
f2a9d47606 |
Show a labelled Speak action in the site widget (#1220)
* Make browse-and-speak visible in the widget header * Keep widget header actions compatible with style checks |
||
|
|
f617c3ca48 |
Speak while browsing and explicitly turn review notes into fixes (#1218)
* Capture contextual voice notes while browsing a site * Preserve unfinished page reads across reloads |
||
|
|
dd097d147a |
Keep the mobile assistant off content and clarify project status (#1188)
* fix: keep mobile assistant clear of content and clarify project status * test: prove owner target overlap independently of font widths |
||
|
|
3ec983c94e |
fix(widget): the feedback button is always on screen unless someone switched it off (#1169)
The launcher could disappear in five different ways, and three of them were side effects nobody chose: - the phone's bottom nav carried data-fc-place="hidden", and that nav is on every app page, so on a phone the button was gone everywhere; - /terminal hid it at every width, and the desktop terminal had no Feedback button of its own; - /loki was excluded from the widget entirely; - on a crowded page the avoid pass hid it for visitors whenever every corner slot was blocked, with no signal. The rule is now one sentence: the launcher is on screen, as the corner button or as a slim edge tab, unless someone switched it off on purpose. - New shape, the edge tab: when no corner slot is clear it docks flush to the side edge (mid-height, or the nearest height that covers no control) instead of vanishing. Pages can ask for it with data-fc-place="tab". - /terminal and /loki use the tab. /loki is back in the widget's routes. The phone nav no longer hides the launcher; it climbs above the nav. - Off and on is one switch: Loki.hide() / Loki.show() / Loki.hidden plus a loki:visibility event. The account menu offers "Hide feedback button" / "Show feedback button", in step with the widget's own long-press menu. The operator's pause and a host's data-fc-place="hidden" still work. Tests: widget-host-avoid-browser gains the tab (wall of controls, tab region mounted/unmounted) and the hide/show switch; these fail on the old bundle and pass on this one. widget-placement covers chooseTabTop and the new directive. feedback-widget-reach and phone-chrome pin the new page rules. Claude-Session: https://claude.ai/code/session_01XpakL9C3TESU4H45fXMFfc Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0dc521df93 |
feat(terminal): Loki tells you what to type, and typing it is one click (#1164)
* feat(terminal): Loki tells you what to type, and typing it is one click
A person looking at the terminal did not know what to do: the agent said
"Please run /login", or they wanted Opus instead of the current model, and
nothing on the page said the answer is a command. The summary offered prose
tasks, and a command sent through Inject was wrapped in project context, so
"/model opus" reached the agent as a sentence about a model.
- config/agent-commands.ts is the one list of each CLI's own commands
(sign in, choose a model, free up memory, start fresh), in plain words.
- lib/terminal-commands.ts reads the screen: signed out, out of quota,
memory nearly full, or a menu waiting on a choice. TerminalActions shows
the sentence and a button that types the command or key into the session.
- The Loki panel knows the commands too. "What's going on?" and every Ask
carry them with the screen, and a step that is a command ("→ /model opus")
becomes a button that types it instead of an Inject draft.
- A draft that is exactly a known command is typed, never injected. "/" in
the Prompt box lists the agent's commands above the prompt library, and
the panel has the full list one click away.
- Clicking or tapping the read-only terminal switches to Type and puts the
cursor where keys go, so the screen can be worked in directly.
- Copy no longer says "tap" to people on a computer: gesture-neutral wording
where possible, usePressVerb() (and widget/press.ts) where the gesture is
the instruction, "pressed" when narrating what someone did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
* test(widget): the watch remark names the control as pressed, not tapped
The widget's narration now says "pressed", which is true on a phone and a
computer alike; this browser assertion still expected the old word.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZqZujmXpupVDC1Hi5Jbsx
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
58ee6e8c78 |
feat(widget): the conversation drawn by the shared chat (chatkit), on Loki's own widget first (#1162)
The widget's chat was the fleet's own hand-rolled chat; with data-fc-chat="kit" it is now drawn by @bitbaum/chatkit, the thread and composer Loki's own chat renders, over the same conversation model. - widget/chat/: a separate lazy chunk (public/widget-chat.js, ~24 KB gzipped, Preact standing in for React), fetched on first open, carrying the tag's nonce. chatkit's CSS is rewritten for the shadow root (:root -> :host, rem -> px) and coloured from the boot theme. - widget/conversation-kit.ts maps the model's snapshot to what chatkit draws; Fix this, the changes, the confirmation card, the About chips and Continue in Loki go into chatkit's slots as the widget's own nodes. - A chunk that cannot load leaves the panel's own view: no dead end. - /widget-chat.js is public in the auth proxy, like /widget.js. - Tests: widget-kit-browser (34 checks: ask, card, screenshot, fallback, phone width, host hotkeys, weight budget), widget-chat-css, and widget-self-contained now guards the chunk/panel seam. Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
3ff287e215 |
refactor(widget): the conversation's rules live in a model the next view can share (#1160)
* refactor(widget): the conversation's rules live in a model the next view can share Step one of moving the widget's chat onto chatkit, the chat Loki itself uses. - widget/conversation-model.ts: thread, pending, error, confirmation card, and every call (ask, build, deliver, self-report) — no DOM, snapshot() + subscribe(). conversation.ts now draws it, same markup and classes, so nothing on any site changes. - main.ts: while the panel is open, keys stop at the shadow root on their way out instead of on document in the capture phase. The old stop kept every key from controls inside the panel that listen for themselves — fine for today's composer, which main.ts fed by hand; fatal for any real component (a composer's Enter, a dialog's Escape). Escape with focus behind the panel still closes it. Tests: widget-conversation-model (new, 25), widget-embed-browser +4 (host hotkeys never see panel typing; a control inside still gets its keys — fails on the old handler; Enter asks; Escape closes), watch-browser 81/81, host-avoid 24/24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck * test: source checks follow the conversation's calls into the model 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> |
||
|
|
dffe839661 |
One chat across projects, and the Loki panel works with a phone keyboard (#1149)
* feat(loki): one chat across projects — the named project wins, and the switch shows A Loki chat already moves between projects: name one and the next answer works there, and the scope follows. Two edges remained. - The fast paths (business plan, profile update, screenshot) put the selection before a project named in the message. The selection now follows whatever project the last answer used, so "write the business plan for orangecat" sent after a loki build went to loki. resolveFleetCommandProjectKey now lets the named project win, as resolveDispatchTargets already does. - The switch was silent — only the thread header's label changed. The thread now draws a quiet "Now on X" rule above the message that moved the chat to another project (lib/loki/project-switches.ts, tested). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HsFC4ZgDDsMo61aFghG1xd * fix(widget): on a phone, the panel stands on the keyboard; scope tabs on one row Owner's phone, 2026-10-11: with the keyboard up, the Loki panel's "Build it / Ask Loki" buttons were under the keys and the thread was a sliver. Android Chrome lays the keyboard OVER the page (the layout viewport keeps its height), so a sheet pinned to bottom:0 with a vh height sits behind it. - sheet.ts follows the visual viewport: keyboardInset() says how much the keyboard covers (tested; <80px is a toolbar, not a keyboard), and the sheet then stands on the keyboard with its height capped to what is visible. While typing, the starters and the way into Loki step aside (.panel.kb) and come back when the keyboard goes. - The "About · This page · Whole site · An element · Loki itself" row wrapped onto two lines with the label floating beside both. On phones it is one sideways-scrolling row; the label goes (the group keeps its aria-label). The rule sits after the base .seg rule, which it overrides. Checked in Chromium at 390×800 with a simulated 330px keyboard: the panel ends at the keyboard (470px) and Ask Loki sits at 367–399px, where it was at 625px — under the keys — before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HsFC4ZgDDsMo61aFghG1xd --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
fca81031b0 |
feat(widget): the widget reports on itself, to Loki (#1142)
* feat(widget): the widget reports on itself, to Loki Watch mode reads the host page and is careful never to blame the site for Loki's own work: the widget's own requests, errors and layout were left out of what it says — which meant dropped. Nobody heard about a panel that did not fit a phone unless the operator was the one holding it. - A fourth "About" chip, "Loki itself": a note about the panel goes to Loki's own project (FEEDBACK_WIDGET_TOKEN's), never to the site's builder, with the same screenshot attach. About bar extracted to widget/about-bar.ts. - Self-watch (owner, while watching): the widget's own errors, its calls to Loki failing or over 20s, and a panel wider than the screen are filed to the same place automatically — once per kind per tab, said in one line in the conversation, and never looping through the report call itself. A 4xx is Loki answering on purpose, not a defect. Watch now hands own-requests over instead of discarding them. - New public route /api/widget/self-report: host fcw_ token + origin allowlist, owner pass required for anything the widget noticed unasked, one row per kind per site via noticeKey. - The owner's top bar steps aside while the site has a modal open: it sat on top of "Choose a model" on the operator's phone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa * feat(widget): Loki's own owner's self-reports start the fix on the spot A self-report filed by Loki's OWN owner — using Loki's widget on one of their sites — is the owner's word on their own product, and the owner's word is the decision (api/feedback): a note, a crash or a panel that did not fit starts a build into Loki there and then, and the receipt reads "On it … built into Loki itself" with Follow the build →. A slow or failed call to Loki only files; its duplicate count is the signal. Anyone else's waits in the inbox. The receipt wording moves to widget/receipt.ts (pure, tested) — the thread renderer was over the lint's line cap. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa * test(widget): the About row has four chips now Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E1qoQ9syUYXCRNbyrpqPGa --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
aad44a5333 |
feat(widget): Loki remembers what it noticed — no second commissioning (#1132)
Watch mode forgot its own remarks the moment the tab closed: the next visit
noticed the same missing heading or the same tiny text, offered "Fix this"
again, and pressing it commissioned the same work twice. The content hash
could not catch it — every filing carries the watched steps with "(Ns ago)"
on each line, so no two filings of one finding ever hashed the same.
- A remark carries its signature as a key (widget/watch-trail.ts:
checksSignature / noticeSignature / the read's `${path}|read`). "Fix
this" files it with the note (`noticeKey`), and so does a failure Watch
files itself. Ingest honours the key only with a valid owner pass and
dedupes by it BEFORE the content hash (bumpDuplicateFeedbackByNotice):
a second press lands on the open row and is counted, not built again.
- Migration 0090: site_feedback.notice_key + index.
- /api/widget/owner/changes answers `known`: every keyed row, open or
settled, with the owner's own status words — beyond the twelve the
strip shows.
- widget/known-fixes.ts (pure): the row that answers for a key (the open
one, else the newest — an old closed row cannot silence a live fix);
the verdict: in flight or closed → silent, live → "again", unknown →
say; the card's chip ("Being fixed · Building", "Needs you", "Fixed 3
Oct"). Watch looks before it speaks (awaits the first read of the
owner's fixes, 4 s at most) and skips the model read for a page whose
read-fix is in flight.
- The noticed card shows where its fix is instead of a second button; a
live fix that is back reads "Loki noticed — again … It is back" with
"Fix again". Cards follow the fix as it moves while the panel is open.
- Tests: scripts/test/known-fixes.ts (6), widget-thread (key survives a
reload), widget-changes (route shape), and two browser cases in
widget-watch-browser (a fix in flight is not noticed again; a live one
that recurs says so and files its key). Changelog.
Claude-Session: https://claude.ai/code/session_01YKx4TPejLvFR9Uj4xrTf6Y
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
e2884193fb |
feat(autopilot,widget): the night asks first; one Loki on the owner's site (#1128)
* feat(autopilot): the night asks first — evening plan with its price, approve or allow Nothing runs at night that the owner has not seen. Every evening (19:00 UTC, crons/autopilot-plan) Loki makes tonight's plan with names and a price on it — which fixes, which site, how many runs, what it would cost from the owner's own last runs — and puts it in the approval queue as one autopilot_plan row: Approve / Reject on Control (TonightCard), Telegram and /approvals. The night (02:30 UTC) claims the approved plan and runs exactly that, re-checked; undecided at 02:30 it expires and the morning note says nothing was built. The one way a night runs unasked is an allowance set in Settings → Agent: "Nights run without asking" for a week, a month or three months, optionally under a dollar cap a night (beacon_settings.night_allow_until / night_cost_cap_usd, migration 0087). Under it the row is approved on the owner's behalf and they are told the evening before. A night over the cap asks again. Free things stay free: filing away stale reports and moving stuck rows to the cloud spend nothing, undo in one tap, and happen with or without a yes. The plan and the note are assembled from counts — no model call in a timer. - src/config/autopilot-night.ts: NightProposal, estimateNightCost, nightProposalText, nightAllowance, NIGHT_APPROVAL, nightRunAt, upcomingNight, allowanceDaysLeft (all pure, tested) - src/lib/autopilot-night.ts: proposeNightFor / proposeAutopilotNight; runNightFor now claims the approved plan (claimApprovedActionsByType) and retires late-approved plans for past nights - AUTOPILOT_PLAN action type, deferred on approval; the Telegram card drops Edit for it (a plan is yes or no) - GET /api/autopilot/tonight + TonightCard replace the late-night "go to sleep" strip (LateNightAutopilot, lib/late-night retired) - docs: paths.md, telegram-notifications.md, CHANGELOG Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4 * feat(widget): one Loki on the owner's site — the launcher never hides, ◎ is its other half, "This screen" marks the view Owner, 2026-10-10, on a phone: "when it says Loki is watching, and then there is another widget … where the aim symbol is … I don't know when one appears and when the other appears. Are they competing elements?" They were: the owner's launcher ("Loki · watching" + a ◎ beside it) hid whenever the avoid pass found every corner busy — on a phone, most scrolls — and a "Loki is watching" bar took its place at the top, without the ◎. Now the owner has exactly one of it: - the owner's launcher is never hidden by the avoid pass (their site, their corner — long-press moves it) and never fades on scroll; - the ◎ is the launcher's other half, flush against it with the shared edge squared, and present whether Loki watches or is paused; - the top bar remains only for a page that hides the launcher outright (data-fc-place="hidden") and carries the same ◎. Show Loki this screen: the pick bar offers "This screen" beside tapping an element — it marks the blocks in the viewport (picker.ts visibleBlocks), the way a screenshot would frame them, and the conversation opens with them attached: say what to change, ask Loki, or build it. Browser test (widget-watch-browser): the ◎ is flush, stays while paused, the launcher stays with every corner blocked and no bar appears, This screen marks and attaches. README, architecture doc and CHANGELOG say so. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4 --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
7e5b9e1506 |
feat(watch,feedback): Loki reads the page, and /feedback speaks one language (#1120)
Watch reads the page - The page checks measure (type size, targets, labels). They cannot see that a page says nothing first, that two controls mean one thing, or that its parts were thrown together — the owner saw exactly that on their own pages and asked why Loki had not. Watch now also READS each page once per visit, unasked, as a first-time visitor on a phone: purpose, hierarchy, content, fit, function (READ_RUBRIC in widget-advise/advisor.ts; the server applies it, the widget only sets `read: true`). At most three findings, each quoting the page; silence when fine, said in the notes as "read it — nothing stands out". The findings land as a notice with the same "Fix this" as any other. - The review starter reads "Review my last few minutes": it is the review of the taps trail, which the page read is not. /feedback: one vocabulary - Lenses: Needs you · Under way · Done (was "Shipped" — the rows in it said "Done"). - A deployed fix awaiting the owner's look is "Live — check it", in the warning tone, never green: a green "Shipped · confirm" chip under the "Needs you" heading beside the Done lens's green chips was the page saying two things with one colour. Badge colour now follows who acts, like the lenses: amber yours, red broke, green nothing waits on you. - "41 done" in the metrics line, "Show all N done". docs/paths.md - Who comes, what they want, the fewest taps — six paths, each with what broke it and what is still owed, and the rules they impose. The product contract the screens are held to; user-flow-audit.md stays the route-by-route health matrix beneath it. Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4 Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
8757d532b6 |
feat(widget): fixes go as one change, watch sees what taps do, ◎ shows Loki (#1112)
The owner, on loki.orangecat.ch from a phone (2026-10-09): "if it proposes
five fixes and I click fix, where is it going? … how do I keep track?",
"I don't know when it's noticing something", "it should be easy to draw
its attention", and the panel still had a lot going on.
- Suggested changes are ONE decision (widget/suggestions.ts): every row
ticked, a tap unticks, "Build these 3 as one change →" files one note —
one agent, one PR, one row in Your changes. It used to be a Build per
row: N runs queued in the project's one lane with nothing saying so.
The owner's builds start without a confirmation card ("Edit first"
opens it); a visitor's still confirm.
- Your changes: one summary line that opens ("1 building · 1 in line ·
1 live"); each row is its own link. A change waiting behind another
reads "In line" (owner-view.ts), not "Starting".
- Watch sees what a tap DID: for 1.5 s after a tap on a button or link it
waits for the page to change, ask the server or navigate, notes which
("↳ It asked the server"), and says at once — after one tap, not three
— when nothing visibly happened.
- ◎ beside the launcher while watching: point at anything on the page,
the panel opens with it attached.
- Phone sheet (widget/sheet.ts): drag the top up for full screen, down to
peek at the page, further to put it away.
- Shorter greeting.
- Tests: widget-suggestions, widget-sheet, widget-changes (summary, In
line), widget-thoughts (results); watch-browser covers the tap results
and the one-change build. Unit 360/360; watch/embed/host-avoid browser
suites pass locally.
Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
5bc05bbef4 |
feat: the first day is the whole product — three ways in, /build, your website in onboarding, Loki on it, help when a build stalls, and the owner's phone fixes (#1110)
* feat(widget): the owner's way into Loki — Continue in Loki, an advisor that knows whose site it is, a header that fits a phone On 2026-10-09 the owner of heidi.orangecat.ch opened the widget on their phone and asked for one new page. The widget treated them as a stranger: it told them which heading to insert and to "keep the structure in a data file (JSON/YAML)", wrote five invented sentences in the site's own language, and answered "switch to Loki so I can develop it there with either chat or terminal" with the same advice a third time. The owner's sign-in lived only behind "Watch". Once signed in, Review + Stop watching pushed ✕ off the right edge of the screen. - widget/continue.ts + src/lib/widget/continue.ts: the thread as one message (newest kept, ≤1800 chars) and where it lands in Loki. - GET /api/widget/continue: signs the person in if needed, checks getProjectAccess on the widget's project, resolves the project key and redirects into /loki?project=&q= or /terminal?project=&view=terminal; a stranger goes back to the site with #loki-owner-denied. - widget/conversation.ts: "Continue in Loki · Chat → · Terminal →" under the composer for the owner; one sign-in link for anyone else after their first message; "This is my site — sign in with Loki →" under Loki's greeting, on the first screen. The owner pass travels with each question. - /api/widget/advise + advisor.ts: the pass is verified as ingest verifies it; with it the advisor knows the person OWNS the site and Build this builds. For everyone, four hands-off rules: never explain how to edit the site, never write its content, a build request becomes the one change to tap, and "take this into Loki" is answered with where that control is. - widget/theme.ts: the header's text column shrinks before the actions do; Stop watching stays on one line; the continue row wraps on a phone. - widget/main.ts: the owner is not offered to hide their own tool. - scripts/test/widget-continue.ts (new), widget-advise.ts: pinned. - docs/architecture/feedback-widget.md: the row and the route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * feat(widget): the loop closes on the site — Your changes, a live announcement, an honest Follow link "On it — Loki tells you when" was the end of the widget's story, and on the site Loki never told anyone: the telling went to push and Telegram, the page the owner came back to said nothing, and "Follow the build" toured the unchanged page with "let me show you what changed". - widget/changes.ts: "Your changes" above the thread for the owner — the project's recent changes with one word each (Building · On its way · Live · Needs you …), See it → once live, Open in Loki → when something needs them, asked for on arrival and every 30 s while something moves. A change this browser saw building that is now live is announced once: in the thread when the panel is open, beside the launcher (bubble + unread) when it is not. - POST /api/widget/owner/changes: the one read with the owner pass. Same attachFeedbackWork the inbox uses, then src/lib/feedback/owner-view.ts writes the owner's words; the work view never leaves the server. No valid pass → no rows. - /feedback/<id>/watch-fix lands on the inbox row while the change is still being built; the walkthrough only once it is live. - The owner's repeated note keeps its follow link. - widget/continue-row.ts, widget/greeting.ts: split out of createConversation (the lint rule caps it at 510 lines; CI caught it at 543). - scripts/test/widget-changes.ts (new); widget-continue.ts updated. - docs/architecture/feedback-widget.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * fix(widget): the owner's door is not an .act — the embed test counts those widget-embed-browser asserts exactly one "as written" link (.act) under the visitor's last message; the sign-in door under the greeting shared the class and made it two. Its own class, same look. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * feat(public): three ways in — build it yourself, with a partner, or let the studio — and every stranger's door ends at /build The ways to get something built were scattered: the landing page offered only "Start a project", hiring the studio was a word in the nav, the partner directory was reachable from OrangeCat's careers page and nowhere here, and a stranger who watched a fix land on someone else's site was sent to a bare homepage. "Start a project" at the bottom of six marketing pages went to sign-IN, and so did a stranger arriving with a brief. - src/config/build-paths.ts: the one list — yourself (sign-up), with a partner (bitbaum.orangecat.ch/partners/), the studio (the commission config's hire address) — plus buildPageHref/fromHost. - /build (public, allowlisted): the invitation, naming the site the person came from (validated host only) and the three doors (BuildPaths cards). - Landing: the "Three ways in" section after "Who it is for"; the closing line and FinalCta name the other two ways; FinalCta → sign-up. - /change and /take send a signed-out person to sign-up with the brief kept. - Widget: "Made with Loki — build something of your own →" as the last line for anyone who is not the owner (/build?from=<host>); the tour's "Get this for your site" lands on /build naming the site; the concierge gets the same door (appended last — the test addresses the others by index). - scripts/test/build-paths.ts pins all of it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * fix(widget): /api/widget/continue is public — it signs the person in itself Live, the merged route answered a bare 401: the session middleware caught it before the route could send the person to sign-in. Same list entry as /api/widget/owner, pinned by widget-continue.ts. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * test(audit): /build is measured by the responsive audit A new page has to be a decision — measured, or excluded with a reason. Measured: it is a public page a stranger lands on from a phone. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * fix(widget): yours means yours, a review that picks three, the composer above the keyboard From the owner's phone on 2026-10-09: - "Your changes" listed a stranger's "so nice picture!" as the owner's own request. The strip now shows what the owner asked for and what Loki filed itself; visitors' notes are counted ("3 notes from visitors, in Loki →"). - Review answered with five nits (alt text, a renamed button, a table) and five identical buttons. The rubric now asks for at most three changes a visitor would notice or that fix something broken, and says none is fine. - With the keyboard open the box being typed into sat half behind it; it scrolls into view once the keyboard has settled. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * feat: the first day is the whole product — your website in onboarding, Loki on it, help doors when a build stalls, the terminal hand-off with its text, a launcher that stays in the corner From the owner's phone on 2026-10-09, and the three follow-ups named then: - Onboarding asks for the website (optional). A project created with one (`liveUrl` on POST /api/user-projects) gets its widget token at once, so the token's origin is the site's; the new step "Put Loki on your site" shows the one line to paste, lets an agent add it when there is a repo, and opens the site with the owner pass (`openSiteUrl` on the token route). Finishing lands on the project, not Control. A refused project no longer advances the step in silence. - A stalled build and a failed kickoff offer the other two ways to get it built — find a partner, hire the studio — from the same list as the landing page (GetHelpLine), the studio with the brief. - "Continue in Loki → Terminal" carries the thread: /terminal?q= prefills the rail's composer as an unsent draft, and opens the rail sheet on a phone (the same path ?explain=1 takes). - The launcher stays in the corner: a near slot over plain text beats a free slot mid-page (heidi.orangecat.ch: the site's own bar took one corner and the launcher floated beside a heading). A near sheet still sends it climbing. - Page checks: a small-caps label by design is not a defect, 11.84px is not under 12, and one kind of finding is one card (the signature drops counts and examples; "30 pieces" then "6 pieces" were two cards). Tests: onboarding-site-step.ts (new), widget-placement.ts, widget-watch.ts, widget-continue.ts, build-paths.ts; all widget browser suites pass locally. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * refactor(widget): keepInViewOnFocus lives in dom.ts — createConversation back under the 510-line cap after the merge Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * fix(widget): import keepInViewOnFocus — the panel threw at mount and boot swallowed it An unimported identifier compiles fine with esbuild and fails at run time; boot's catch hid it, so the launcher rendered and the panel never opened. Caught by widget-embed-browser. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
be5752994c |
feat(widget): one integrated panel — watch says what it sees, in Loki's own spiral (#1111)
* feat(widget): watch says what it sees, in Loki's own spiral
From the owner's phone on heidi.orangecat.ch (2026-10-09): "It's not clear
what it thinks when it watches", and the logo is barely used.
- What Loki sees: one row under the panel header ("Watching · 2 pages,
1 tap · nothing wrong so far") that opens into the trail worded as notes
— pages opened, taps, what the page sent, what it noticed. Each settled
page now records a `look` step even when clean, so "looked, all fine"
is visible instead of silent. widget/thoughts.ts (pure) +
thoughts-view.ts.
- The status light is the logo's spiral, generated from
src/config/brand-mark.ts into widget/brand-mark.generated.ts (the widget
may not import src/). It turns slowly while watching, spins while Loki
thinks (header and the pending answer), and goes still and grey when
paused — in the launcher, the panel header and the walkthrough card.
- Loki's answers render paragraphs, bullets, headings and bold
(widget/rich-text.ts) from text nodes — "* The headline …" no longer
shows its asterisks.
- Tests: widget-thoughts, widget-rich-text, widget-brand-mark (drift);
watch/embed/host-avoid browser suites pass locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4
* feat(widget): one surface, not a stack of boxes and buttons
"No Frankenstein elements. Integrated experience. Not a bunch of big
unaligned buttons" (owner, 2026-10-09). The panel had grown one bordered
control at a time; this is a layout pass over all of it, with one rule:
at most one filled accent button per region, every other action is
quiet text aligned in its row.
- Header: who and where, and ✕. Review and Stop watching are gone from
it — Review is the conversation's first suggestion, and watching is
shown AND paused from the notes row (Pause / Resume), status and its
control together. A visitor keeps one quiet "Watch".
- Notes and Your changes are hairline strips, not nested cards.
- Thread: Loki's words are prose on the panel; yours are a pill.
Noticed/sent remarks carry a left rule instead of a box.
- Suggested changes: a hairline list, "Build this →" as accent text at
each row's end (was five filled buttons down the right edge). "Fix
this →" and "Why does it matter?" sit on one baseline.
- Composer: ONE card — About tabs (underlined when chosen), the words,
screenshots, then tools left and Build it / Ask Loki right, compact.
- Starters and links share one pill style; buttons are compact; the
ghost button has no frame.
- Tests follow the moved controls (watch-browser: Review via the
starter, Pause/Resume via the notes row; theme test checks the new
rules). watch/embed/host-avoid browser suites pass locally.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011L2dmcydDLYAiNQwK4XcF4
---------
Co-authored-by: Claude <noreply@anthropic.com>
|
||
|
|
6c6380efb7 |
feat(widget): the owner's way into Loki — Continue in Loki, an advisor that knows whose site it is, a header that fits a phone (#1107)
* feat(widget): the owner's way into Loki — Continue in Loki, an advisor that knows whose site it is, a header that fits a phone On 2026-10-09 the owner of heidi.orangecat.ch opened the widget on their phone and asked for one new page. The widget treated them as a stranger: it told them which heading to insert and to "keep the structure in a data file (JSON/YAML)", wrote five invented sentences in the site's own language, and answered "switch to Loki so I can develop it there with either chat or terminal" with the same advice a third time. The owner's sign-in lived only behind "Watch". Once signed in, Review + Stop watching pushed ✕ off the right edge of the screen. - widget/continue.ts + src/lib/widget/continue.ts: the thread as one message (newest kept, ≤1800 chars) and where it lands in Loki. - GET /api/widget/continue: signs the person in if needed, checks getProjectAccess on the widget's project, resolves the project key and redirects into /loki?project=&q= or /terminal?project=&view=terminal; a stranger goes back to the site with #loki-owner-denied. - widget/conversation.ts: "Continue in Loki · Chat → · Terminal →" under the composer for the owner; one sign-in link for anyone else after their first message; "This is my site — sign in with Loki →" under Loki's greeting, on the first screen. The owner pass travels with each question. - /api/widget/advise + advisor.ts: the pass is verified as ingest verifies it; with it the advisor knows the person OWNS the site and Build this builds. For everyone, four hands-off rules: never explain how to edit the site, never write its content, a build request becomes the one change to tap, and "take this into Loki" is answered with where that control is. - widget/theme.ts: the header's text column shrinks before the actions do; Stop watching stays on one line; the continue row wraps on a phone. - widget/main.ts: the owner is not offered to hide their own tool. - scripts/test/widget-continue.ts (new), widget-advise.ts: pinned. - docs/architecture/feedback-widget.md: the row and the route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * feat(widget): the loop closes on the site — Your changes, a live announcement, an honest Follow link "On it — Loki tells you when" was the end of the widget's story, and on the site Loki never told anyone: the telling went to push and Telegram, the page the owner came back to said nothing, and "Follow the build" toured the unchanged page with "let me show you what changed". - widget/changes.ts: "Your changes" above the thread for the owner — the project's recent changes with one word each (Building · On its way · Live · Needs you …), See it → once live, Open in Loki → when something needs them, asked for on arrival and every 30 s while something moves. A change this browser saw building that is now live is announced once: in the thread when the panel is open, beside the launcher (bubble + unread) when it is not. - POST /api/widget/owner/changes: the one read with the owner pass. Same attachFeedbackWork the inbox uses, then src/lib/feedback/owner-view.ts writes the owner's words; the work view never leaves the server. No valid pass → no rows. - /feedback/<id>/watch-fix lands on the inbox row while the change is still being built; the walkthrough only once it is live. - The owner's repeated note keeps its follow link. - widget/continue-row.ts, widget/greeting.ts: split out of createConversation (the lint rule caps it at 510 lines; CI caught it at 543). - scripts/test/widget-changes.ts (new); widget-continue.ts updated. - docs/architecture/feedback-widget.md. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z * fix(widget): the owner's door is not an .act — the embed test counts those widget-embed-browser asserts exactly one "as written" link (.act) under the visitor's last message; the sign-in door under the greeting shared the class and made it two. Its own class, same look. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01N1Yw4cCwXWRP2S5Hj62u2Z --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
17e63d1396 |
feat(widget): one designed piece — the launcher is the status, Loki stops crying wolf, the panel fits (#1106)
Found by using the live widget on loki.orangecat.ch as owner, not by tests: - The composer overflowed in every real browser: with a mic present, Record + Screenshots + Send as feedback pushed Ask Loki out of the 372px panel (the test browser has no mic, so nothing caught it). Tools are icons at rest, the row wraps; widget-embed-browser now fakes a mic and fails at 1200/390/320 if the panel scrolls sideways or any button sits outside it (proven against the #1099 CSS: 6 failures). - The top bar covered the site's own navigation. For the owner the LAUNCHER is now the status: "Loki · watching", an unread count of what Loki said while the panel was closed, the newest remark in a bubble beside it. The bar is the fallback, shown only when neither launcher nor panel can be seen. - Loki cried wolf on Loki's own page: "15 links have no name" (innerText is "" under content-visibility:auto, and ?? never fell back) and "25 tap targets too small" (WCAG 2.5.8's spacing exception ignored). Now 0 and 1 (a really crowded 154x16 link); examples name a link's address instead of "a". Pinned by fixtures that fail with the old code. - A remark arriving mid-tap moved the button away (it happened live): the thread follows new messages only if you were at the bottom or acted yourself; opening the panel lands on the newest message. - "On it" was a dead end: owner builds now return followUrl (Loki's Watch the fix page for that item) and the receipt says "Follow the build →". widget/README.md now opens with the design model and the rules that resolve its trade-offs. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
61c240ea24 |
feat(watch): Share in the walkthrough's header from the first beat (#1100)
Operator, 2026-10-08: watched all fourteen beats, saw no way to send them, copied the address bar (the plain page — the tour token leaves it on start) and asked how sharing could work at all. Share was only on the last card. It now sits in the header for the whole walkthrough; where the clipboard is refused the link appears, selected, under the header (once). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
1d2523625c |
feat(widget): feedback back in front; Loki speaks up when something is wrong; Stop watching is one tap (#1099)
After #1092 feedback was hidden (Send to builder only appeared after asking Loki), the page / whole site / element choice had become a toggle chip, stopping Watch was only "Pause" on the top bar, and Loki only counted what it saw. - About: This page / Whole site / An element is one segmented control again, and the composer has Send as feedback (straight to the confirmation, no AI) beside Ask Loki. - Watch speaks up: every notice (failed request, slow answer, the site's console error, slow load, a freeze after a tap, content jumping), every automatic fix, and the page checks after each page settles become a "Loki noticed" message in the conversation, in plain words naming the tap that led there, with Fix this (the request written out) and Why does it matter (asks the advisor with the session). Rule-based (explainNotice / explainChecks) - no background model call - and said once per visit. - The bar says what Loki noticed, with Show (open the conversation) and Stop watching / Watch again; the header has Review + Stop watching, or Watch again. Stopped, nothing is recorded and nothing is said. Tests: widget-watch 12 cases (explainers), widget-thread (noticed restore), widget-watch-browser 50/50 (remark in words + Fix this, no repeat after reload, header Stop watching records and says nothing - fails with the guard removed), widget-embed-browser 47/47 (element feedback straight to the builder, no AI call). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6bf344efb6 |
feat(watch): "Not quite" and "Show me" on the walkthrough; done fixes keep Watch + Share (#1090)
* feat(watch): "Not quite" and "Show me" on the walkthrough; done fixes keep Watch + Share Operator, 2026-10-08: "do 1 and 2" — say a fix is not quite right from the walkthrough itself, and see an idea on the live page before it is built. - Not quite (owner + reporter, never a shared link): typed or spoken (the widget's mic), filed as a follow-up on the same page. The owner's starts the fix at once via startOwnerBuild, now shared with Report's owner-pass path (lib/feedback/owner-build.ts); the reporter's goes to the inbox. - Show me: /api/widget/preview turns the words into a few edits from a closed vocabulary (style, text, hide, insert, css) against the page outline; widget/preview.ts sanitizes them (tag/attribute allow-list, no url()/@import/expression, no handlers or javascript: links), applies them in the owner's browser only and undoes them exactly. "Build this" sends the words plus what the preview showed. Charged to the owner's AI budget, rate-limited, never available to a viewer ticket. - Done fixes keep "Watch the fix" + Share on the row; the last card gets "Copy page link" for sharing the site without a walkthrough. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(owner-build): read the shared owner-build module, and pin that 'Not quite' uses it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
6be6045295 |
feat(widget): one conversation with Loki; Watch in the header (#1092)
* feat(widget): one conversation with Loki; Watch is in the header for anyone who owns the site The panel was three tools sharing a box: Request a change (a form), Ask Loki (an advisor) and Chat, behind tabs and scope chips, each with a history that vanished on close - and Watch could only be switched on by arriving through one link on the project page in Loki, so an owner simply visiting their site never saw it. Now: - One thread (widget/conversation.ts). Type, speak, paste a screenshot or point at an element; Loki answers about this page (one tap: whole site). Every suggested change, and your own message as written, has Send to builder / Build this, which opens a confirmation card in the thread; the receipt (building / track link) lands in the thread. - The thread is kept per tab (widget/thread.ts, validated on restore), so it survives the site's own page loads. - Watch in the header: Review for the owner; for anyone else an explainer with "This is my site - sign in with Loki", via GET /api/widget/owner, which checks ownership of the widget's project and returns to the same page with a pass. The return URL must be on the project's own site (ownerReturnUrl), so the route cannot hand a pass to someone else's page; a non-owner lands back with a plain explanation. - data-fc-modes now only picks who answers: advisor (default), the studio concierge (chat), or none (report). The owner always gets the advisor. - widget/loki-api.ts holds the two calls; advise.ts and chat.ts are gone. Tests: widget-thread (new), owner-note-builds (return-URL guard), widget-embed-browser 41/41, widget-watch-browser 40/40, widget-host-avoid-browser 24/24. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(widget): style guard follows the panel's real controls; comment no longer reads as an import Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c48ffba2ae |
feat(watch): share a fix's walkthrough with anyone; a cleaner last card (#1083)
* feat(watch): share a fix's walkthrough with anyone; a cleaner last card
"How can I share these?" (operator, 2026-10-08). A walkthrough is not a
video: it is a signed ticket in the live page's fragment that the widget
plays on the real site. Owner tickets last a day and carry the maintainer's
reasoning, so there was nothing safe to hand on.
- Share: a long-lived share token (own HMAC domain, 90 days) behind the
public /w/<token>, which mints a fresh VIEWER ticket on every open and
redirects to the live page. The viewer's story is the request and the
live demonstration in plain words: no reasoning, PR or reporter
screenshot. Share buttons in Loki's inbox (next to Watch the fix) and on
the walkthrough's last card (share sheet, else clipboard, else the link).
- Same walkthrough for everyone: planned steps are kept per fix, audience
and page outline, so a link passed around doesn't re-plan per viewer
(or spend the owner's AI budget per viewer).
- The last card: one short question and one decision with Share beside it,
Replay and the code change as quiet links, close as an x in the corner.
It no longer repeats the agent's change log, and firstSentence no longer
cuts at an abbreviation ("...115/115 browser checks incl.").
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* style(docs): format the share sentence
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
||
|
|
edb1249552 |
feat(watch): Review: Loki judges what you just did on your site (#1081)
* feat(watch): Review — Loki judges what you just did on your site and suggests what to improve Watch mode only acted when something broke. It now also notices what a demanding reviewer would (4xx, slow requests, console errors, slow loads, main-thread freezes, layout shift, pauses between steps) plus measured page checks (unnamed controls, unlabeled fields, tiny tap targets, missing alt, broken images, sideways scroll, h1/lang). The pill counts them; Review sends the session to Ask, which judges it through errors, design, engineering, process and product - every point cited from the session - and each change is one tap from a request that carries the watched steps. The trail now survives page loads within a tab, so a multi-page site reads as one visit. No model runs until Review is pressed. The report POST is now one helper (widget/send-report.ts) shared by Send and the automatic fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(watch): Review never blames the site for Loki's own work; plain-text answers Found by looking at the 390px render, not by the tests: - opening Loki's own Review panel scored a 0.27 layout shift against the site (Chrome reports shadow-DOM sources with a null node) - only shifts pinned on a site node count now; - the widget's own boot registered as 'the page froze 369ms' - a freeze now counts only when it overlaps the second after a tap on the site; - the review asked for **bold** lenses and the widget shows text, so clients saw literal asterisks - plain-text rubric + plainAnswer() on every reply; - '404 in 0.0s' - duration only when slow. The browser test now proves the detectors fire on real jank (a Load more that freezes and pushes content down) AND stay quiet for Loki's own panel. The 'typed values never leave the page' checks were vacuous (fill() never taps the field) - they tap the filled field now and fail under mutation. Docs: the architecture table described Watch as 'still a seam'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> |
||
|
|
c65ead0f6b |
feat(feedback): Watch the fix tells the story; the reporter gets their own (#1074)
The walkthrough could only show WHERE a change was: it had the report, the handoff's one line and a PR title. The owner asked for how it was solved, why so, what the alternatives were and who it helps. - Design note: every fix prompt asks the agent for a `## Walkthrough` section in the PR description (problem, change, why, considered, helps, where, a plain line for the reporter). fix-note.ts holds the field list once, rendering both the instruction and the parser; the fix ledger keeps the parsed note on FixShipping.pr.note. - Chapters: buildTourBeats turns report + screenshot + note + live steps into a ~60s story. The widget plays it with Back / Pause / Next, reading time scaled to each caption, the reporter's own screenshot as the before picture, and no second click when going back. - Reporter audience: tour tokens carry an audience inside the signed payload (owner tokens unchanged, so old links still work; reporter tokens last 7 days). /my-feedback offers "Watch your fix" on a live fix. The reporter's story keeps their words, the live demo and the plain line — no reasoning, PR or repository. Claude-Session: https://claude.ai/code/session_01MqXhtjrmVb4vKE6oKSyHVg Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
f7ba763c62 |
fix(widget): keep the Watch-the-fix caption above host chrome (#1071)
The caption card had no z-index (only the cursor layer did), so any positioned host element painted over it: Substrata's floating ASK button and phone tab bar covered the card and its "Looks right" button at 390px. The card now takes the top z-index and lifts above a full-width bottom bar, measured from what is painted at the bottom edge. Claude-Session: https://claude.ai/code/session_01MqXhtjrmVb4vKE6oKSyHVg Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
4636709cba |
feat(widget): watch mode catches dead buttons; Report on the pill (#1029)
Two gaps in watch mode, both "it's broken but nothing failed": - A button that does nothing. Three taps on the same button or link within five seconds, with no page change and no request leaving in between, files a report: "I tapped button “Save” three times and nothing happened." A request that merely starts clears the count, so a slow working button is not mistaken for a dead one; tapping a field to focus it never counts. - Report on the pill opens the note with the same trail attached, for anything that looks wrong without failing. Pure rule in watch-trail.ts (nextTapStreak, trailDiagnostics), tested; the browser test now also proves a working button tapped three times files nothing, a dead one files one report naming it, and Report opens the note with the trail attached (17/17). Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE Co-authored-by: Claude <noreply@anthropic.com> |