mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 21:28:22 +01:00
stop-sealed
6
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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>
|
||
|
|
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> |
||
|
|
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>
|
||
|
|
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> |
||
|
|
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> |