mirror of
https://github.com/bitbaum/loki.git
synced 2026-12-04 05:37:19 +01:00
feat/shared-knowledge-map
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
d0e7fa68a7 |
Feedback inbox as one view; a Claude conversation that finds its log; follow-ups and voice chat in Loki (#1027)
* feat(feedback): one integrated inbox instead of stacked widgets /feedback on a phone read as "a bunch of random elements": a lone bordered Studio requests button, two rows of pills, a line restating the chip just tapped, three bordered cards with grey headers, and rows whose status, context and buttons sat in different places and came in three heights and two fills. - Lens: Needs you · Under way · Shipped as one segmented control with counts. One list shows at a time; it opens on the first lens that holds something. An empty lens links to the lens that has work, never a dead end. - Filters: one line. Project chips scroll; source is a compact select; the loop's numbers and the Studio requests link share the line under the chips. - Rows: same anatomy for every phase. Context (status · project · page · who · age), message, one "why" line, then an action bar of one height: the labelled decision leads, icon utilities (note, resolve, archive) sit at the trailing edge. Under-way Resolve becomes an icon; "What changed" becomes a link on the agent's line. The "Watching this run" strip is gone, because the Watch panel already holds Terminal and Chat. - Dead .ui-inbox-fold rules removed; the fold now uses .ui-fb-fold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(terminal): the Claude conversation finds its log; a calmer phone chat The /terminal conversation view sat on "No conversation from this session yet" for sessions that were plainly running. - Runner (0.8.38): claudeProjectSlug now matches Claude Code — every non-alphanumeric becomes "-", not just "/" and ".". Workspace and worktree names may contain "_", and for those the transcript stream, the usage collector and the auth canary all looked in a folder that never exists. Slugs past 200 chars (Claude truncates and hashes them) match on prefix. - Runner: when it has the session but Claude has written no log, it says so once (an empty frame). The view tells apart "builder never answered", "Claude hasn't started here" and "nothing said yet", each with its own next step; the composer stays live in all of them. - Answers in the Claude conversation get the same row as Loki's chat: Copy, Listen and — where the phone has a share sheet — Share (AnswerActions, shared with MessageTurn). - Phone chrome: the Profile/Chat/Control/Terminal strip and its repeated project name are hidden on /terminal below md (the one-line header names the session); the agent chip drops in conversation view so the session name is readable; the Loki button says "Loki", not a second "Chat". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * feat(loki): suggested follow-ups and a hands-free voice conversation Two things the reference chat apps have and Loki's chat did not. - Suggested follow-ups: after an ordinary answer that ends the thread, up to three "↳ Make it longer" rows; a tap sends one as the next message. POST /api/loki/follow-ups asks the fast model once (feature "chat-follow-ups"); a slow or failed model answers [] and nothing shows. lib/loki/follow-ups.ts parses whatever comes back (numbering, bullets, quotes, a JSON array, a preamble) into clean tap targets — tested. - Talk: a filled pill beside the composer's controls (only while the box is empty — the mic beside send still dictates). It opens a full-screen voice chat: listen until you pause, send what you said through the normal send path, read the answer aloud, listen again. The mic is closed while the answer is read, so the phone never answers itself; a failed turn goes back to listening rather than to silence; 20s of quiet pauses it. Endpointing (lib/loki/voice-turn.ts) works on waveform RMS against an adaptive noise floor and ends a turn only on a pause AFTER speech — tested. Transcription is the composer's own server leg (/api/control/transcribe). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): voice chat passes lint — no setState in an effect body, workspace under its line cap The answer that arrives during a voice turn is read aloud from a deferred callback rather than the effect body (react-hooks/set-state-in-effect), and the voice screen takes the hook's state whole, so LokiWorkspace drops back under its 510-line max-lines-per-function ratchet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): answer first, never a wall of projects; thumbs-down files feedback From the owner's phone: "This all is making it unworkable. Flow should be easy and enjoyable." A plain message ("let's keep improving this interface") came back as "Which project should I run that on?" over seventeen two-column project tiles, and the thread title ran across the back arrow. - Loki always answers. When the message also reads like work, the answer carries one closed line under it — "Run this on a project…" (or "No project called X — run this on another…") — which opens the picker only when tapped. The blocking needs-project turn is gone; older threads that contain one still render it. - The picker is small wrapping chips, not 44px tiles in a grid. - Thread header: the title truncates instead of overflowing both edges (a centred flex child is as wide as its text, so `truncate` never engaged). - Thumbs-down under Loki's answers: one optional line on what was wrong, then Send. POST /api/loki/answer-feedback files it into Loki's own project (FEEDBACK_WIDGET_TOKEN, where the dogfood widget files), with the question and answer attached so it reads on its own in /feedback, and the reporter recorded so it shows in their /my-feedback. Not on the Claude Code conversation, which is not Loki's answer. Says plainly when the token is not provisioned. Report text: lib/loki/answer-report.ts, tested. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(feedback): scale widths, not arbitrary ones, in the row context line max-w-48 / max-w-40 are the same 12rem / 10rem on Tailwind's scale; the arbitrary values raised design-principles' one-off-layout ratchet. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE * fix(loki): answer report takes optional note/question, as the route sends them Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TDTqcifctAar8o5hcbD3pE --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
caa0e41c3b |
chore: add a formatter (#449)
* chore: add a formatter, matching the style this repo already writes singleQuote=false was chosen by counting this repo's own imports, not by fleet decree. The fleet is genuinely split and the two repos that already had a .prettierrc disagreed with each other, so there was no standard to restore. Quote style does not cross repo boundaries; having a gate does. Markdown is ignored for now — prettier rewraps prose, which would bury the real diff. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * style: format with prettier (1062 files) Mechanical. No behaviour change. This SHA is listed in .git-blame-ignore-revs so `git blame` skips it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * chore: teach git blame to skip the reformat Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> * fix(lint): reattach two guards the reformat detached Both effects were one-liners, so a trailing eslint-disable-line covered the setState call: useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ... prettier expanded the block. The comment stayed on the closing line while the call moved above it, so the guard protected nothing and the rule its author had deliberately silenced failed the build. This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line variant. Both come from the same fact: an eslint directive binds to a line number, so reformatting can silently unbind it, which makes 'mechanical, no behaviour change' false for any bulk reformat. * chore(desktop): bump the runner version the reformat requires desktop-release-drift enforces that anything built into Fleet Runner which differs from the last released tag must carry a version ahead of that tag — main read 0.8.15 and fleet-runner-v0.8.15 already shipped. A whole-repo reformat changes bytes under desktop/, so the gate fires. The alternative was adding desktop/ to .prettierignore, which would buy a quiet PR by carving a permanent hole in the formatter's coverage — the precise shape of silent drift this test was written to catch. Bumping is what the rule asks for and costs one patch release whose only content is whitespace. * chore: merge main and re-format A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR runs no checks at all while reporting nothing. Conflicts resolved to main, which is correct because this branch changes formatting and nothing else. * chore: leave desktop/ out of this reformat desktop-release-drift is right to refuse this. Everything under desktop/ is built into Fleet Runner, so changing it means shipping: bump the version AND add a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed Fleet Runner and wants to know what changed'. For a whitespace-only build the honest answer is 'nothing', so that release should not exist — and I should not write release notes claiming otherwise. I had bumped to 0.8.16 to get the gate green. That was the wrong direction: publishing a build to three OS runners to keep a formatting PR quiet. Reverted. desktop/ is excluded in .prettierignore with the reasoning recorded there, to be formatted alongside the next real runner change, where the bump and the notes are true anyway. --------- Co-authored-by: Claude Opus 5 <noreply@anthropic.com> |
||
|
|
f754eacf27 |
feat(orchestration): per-run token/cost accounting from agent transcripts (#133)
Item 1 of the ledger-and-loop build sequence: every dispatched Claude run now records what it consumed. - lib/usage/claude-transcript-usage: window-attributed usage from ~/.claude transcripts (dedup on message.id; slug handles dotted paths) - runner: usage-reporter ledger reports cumulative windows on the heartbeat cadence; poller tracks delivered Claude dispatches and now uses the corrected slug in detectAuthFailure (worktree dirs never matched before) - box: POST /api/orchestration/runs/:id/usage prices tokens via config/model-pricing (rate changes never need a runner release); freeze rule stops a session's next run leaking tokens backwards - schema: tokens_in/out/cache_read/cache_write, cost_usd, usage_detail, usage_updated_at on orchestration_runs (additive migration 0046) - UI: usage line on the run panel + Today recent-runs list - test: scripts/test/run-usage.ts (auto-discovered by test-unit) Co-authored-by: test <test@test> Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |