Commit Graph
1304 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 c99eb81833 perf(sse): event-driven SSE — file watcher + Postgres LISTEN + failed command surfacing
Replace 2s polling loop with three event sources:
- File watcher on /tmp/agent-* sentinels (local, <50ms latency)
- Postgres LISTEN/NOTIFY on project_states (Vercel, ~200ms)
- HTTP push from daemon → SSE bus → immediate wake (both paths)
Fallback tick reduced: 10s local, 5s Vercel (was 2s unconditional).
Failed commands (ok=false in last 10min) now surface in AttentionBar
with per-item dismiss via localStorage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:32:39 +02:00
g-butandClaude Sonnet 4.6 8475bbb4f3 feat(projects): next_step attribute — inline editor + card display
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 10:28:41 +02:00
g-butandClaude Sonnet 4.6 a0b85c2559 refactor(projects): SSOT health config, ui-tab classes, design token fixes
Merge three duplicated health-signal tables (ISSUE_DISPLAY, HEALTH_BADGE_STYLE,
HEALTH_BADGE_ICON) into a single HEALTH_SIGNAL_CONFIG in project-badges.tsx.
Extract ui-tab/ui-tab-active/ui-tab-badge classes to globals.css, replacing
inline conditional strings in ProjectDetailTabBar. Fix accent-[var()] violation
with ui-range-accent, bg-black/20 with bg-surface-overlay. Improve loading
state to distinguish initial vs. background refetch, better error message.
Fix Escape key to skip when drawer is open; truncate long status filter chips.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 09:37:19 +02:00
g-butandClaude Sonnet 4.6 3d4a1d00b1 perf(daemon): long-poll for commands, change-detection for state push
Command pickup latency: 5s → ~100ms. The API now holds requests for up to
25s (local) / 8s (remote Vercel) until a command arrives, eliminating the
sleep-then-poll cycle. The push loop skips the POST when state is unchanged
(md5 hash comparison), cutting idle DB writes from ~30/min to near zero.
After each command execution, a background push fires immediately so the UI
reflects results without waiting for the next push cycle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 09:28:41 +02:00
g-butandClaude Sonnet 4.6 501444622e fix(control): truthful state labels and SSOT for card/tile badges
Four truth issues fixed:
- "Closing" state was missing from both ProjectCardHeader and ProjectTile —
  both fell through to "Ready" label + grey dot. Now shows "Closing" with
  amber warning dot/tag matching the card's warning border.
- isClosing was never passed to ProjectCardHeader so a Closing case could
  never fire even if added.
- "Open tabs" metric showed 0 when daemon was offline (zellijTabs is empty
  with no daemon push). Now shows "—" with "daemon offline" note.
- stateLabel + stateTagClass duplicated independently in ProjectCardHeader
  and ProjectTile. Moved to control-presenter.ts (SSOT, derived from tone).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:56:58 +02:00
g-butandClaude Sonnet 4.6 f2790f069d fix(mobile): prompt category chips scroll horizontally on mobile
8 category chips in flex-wrap stacked into 3+ rows on narrow screens.
Apply the same horizontal-scroll pattern used on Projects/Events/SummaryBar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:44:41 +02:00
g-butandClaude Sonnet 4.6 a7bd065ea5 fix(mobile): project/event filter chips scroll horizontally on mobile
Long status chip labels (e.g. project maturity descriptions) no longer
wrap into multi-row stacks on narrow screens — single scrollable row with
hidden scrollbar, wraps back to grid on sm+.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:40:22 +02:00
g-butandClaude Sonnet 4.6 5865cfc132 fix(mobile): Today page UX — horizontal summary bar + 44px touch targets
- SummaryBar: scrolls horizontally on mobile (no-wrap + overflow-x-auto,
  hidden scrollbar) so all pills fit in one row instead of 3; wraps
  normally on sm+. Shorten "105 contacts need attention" → "105 contacts".
  Add min-h-11/shrink-0 to Pill links and Brief Ivy button.
- LogConversationButton, QuickCaptureButton, IvyDispatchButton (plan/wrap):
  add min-h-11 sm:min-h-0 so trigger buttons meet 44px touch target on mobile.
- ui-btn-row-action (CommitmentItem check/edit/delete): add
  min-h-11 min-w-11 sm:min-h-0 sm:min-w-0 for mobile touch targets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:24:01 +02:00
g-butandClaude Sonnet 4.6 a0f25945e2 feat(responsive): mobile UX pass — control hierarchy, auth card, homepage spacing
Control page: metrics (Control Inventory) now appear first on mobile via CSS
order swap; BrainConfig hero moves below. Description text hidden on small
screens. Desktop two-column layout unchanged (xl:order-none reverts to
source order).

Auth: .ui-auth-card padding tightened to p-6 on mobile (was p-8 everywhere).

Homepage: hero/section spacing halved on mobile (pt-16, mt-16, pb-16) so
content fits without excessive blank space on 375px viewports.

MobileNav: close-sheet button increased from p-1.5 to p-3 (28px → 40px
touch target, approaching the 44px minimum).

.app-main bottom padding reduced pb-24→pb-20 to match actual nav height.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 08:06:03 +02:00
g-butandClaude Sonnet 4.6 ebffb35271 fix(shell): sidebar collapse toggle missing on md–xl screens
The footer expand button was only rendered when `collapsed=true`, leaving
no way to collapse an expanded sidebar on viewports between 768–1279px
(where the brand-header toggle is hidden by `xl:inline-flex`).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 07:46:14 +02:00
g-butandClaude Sonnet 4.6 4b40dbf5ef feat(shell): sticky sidebar, light/dark toggle, x.ai-style hover labels
- Remove forcedTheme="dark" — enable system preference + user toggle
- Sidebar is now position:sticky height:100svh, never scrolls away
- Collapsed nav items show portal tooltips (escape overflow clipping)
  using createPortal to document.body with slide-in animation
- Theme toggle in sidebar footer (sun/moon, persisted via next-themes)
- Footer utility buttons get hover tooltips when collapsed

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 07:24:31 +02:00
g-butandClaude Sonnet 4.6 0bc9cd8893 fix(orchestration): claude adapter run route now clears stale closing sentinel
Inject route and codex/gemini adapter both unlink closing sentinel on non-lifecycle
dispatch to prevent the UI from staying in "Closing…" state if user re-dispatches
after a close_session was sent but not yet consumed by the stop hook. Claude adapter
path in /api/orchestration/run was missing this step.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 04:51:13 +02:00
g-butandClaude Sonnet 4.6 86679e6b3a fix(control): SSE lockAt never patched — beacon could race with web auto-continue
mergeProjectPatches updated readyAt from SSE but dropped lockAt, so
isBeaconActive stayed false while the beacon popup was showing. Web UI
auto-continue countdown would start even with beacon open, risking
double-injection. Also add lockAt to the SSE change-detection predicate
so a lock-only change (e.g. lock expiry without readyAt change) propagates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 04:43:27 +02:00
g-butandClaude Sonnet 4.6 5d514730b1 fix(hook-bridge): patch_project_state was always 401 — add Bearer auth
Route used getSessionUserId() (cookie-only); hook bridge sent no auth header.
Switch route to getApiUserId() (cookie + Bearer) and read COCKPIT_DAEMON_TOKEN
from env or .env.local fallback in patch_project_state curl call.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 04:27:37 +02:00
g-butandClaude Sonnet 4.6 f11ca5233f fix(orchestration): claude adapter now writes current-prompt file on run
The claude adapter path injected the prompt but never wrote stateFile.prompt(),
so the UI showed no "Running: [task]" banner for any orchestration intent
(next_best, custom, etc.) dispatched via onRunWithBrain. Codex/gemini and the
inject route both wrote it; the claude run path was the only gap.

Added the write in the else branch (excluding hard_stop/close_session which
end sessions rather than start tracked prompts) — mirrors the inject route's
pattern and what the daemon now does for cloud-queued tasks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 04:12:53 +02:00
g-butandClaude Sonnet 4.6 5e4af110b8 fix(cloud): daemon now pushes session content (done/next/health/tests) to DB
In cloud mode (Vercel), session content was never populated in DB —
the runtime-state route only accepted agent/lifecycle fields, and the
daemon only pushed those. The UI showed empty done/next/health/tests
in the ReadyBanner and ClosedBanner for all cloud-mode users.

Daemon reads ~/.claude/sessions/<tab>.md per project each push cycle and
merges sessionDone/Next/Tests/Todos/Health/UpdatedAt into the payload when
the file exists. Route extended to accept and pass these fields through to
upsertProjectState (absent = skip, present = update).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 03:55:03 +02:00
g-butandClaude Sonnet 4.6 6d7d413f4a fix(orchestration): server-side queue pop now respects session health gate
When sessionHealth is critical or sessionTests contain "fail", the server
no longer pops from the queue for next_best intent — mirroring the client-side
sessionHealthBlocksQueue() check. Previously the UI said "AI picks recovery
task — queue paused" but the server still ran queue items.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 03:25:20 +02:00
g-butandClaude Sonnet 4.6 8c6bd56b35 fix(orchestration): write close_session sentinel in run route — matches inject route
Without this, dispatching close_session via onRunWithBrain (ReadyBanner or direct)
injected the prompt but never wrote the agent-session-closed-<tab> sentinel.
The stop hook would then fire as a normal stop (readyAt + beacon popup) instead
of writing closedAt, leaving the UI in the wrong state after a clean session close.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 03:01:23 +02:00
g-butandClaude Sonnet 4.6 8a018188c8 fix(control): orch-ready banner no longer silently drops non-mapped prompt keys
The isOrchReady ReadyBanner wrapped onSend with a mapClaudePromptToIntent
guard that returned early for any key not in CLAUDE_PROMPT_TO_INTENT (e.g.
browser_test, health_check, unblock). Clicking those buttons did nothing.

The parent onSend (send in use-project-card-actions) already handles
non-orchestration keys by calling onInject directly — the guard was
redundant. Removed the wrapper and pass onSend through unchanged.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 02:41:56 +02:00
g-butandClaude Sonnet 4.6 6b509aff26 fix(queue): enqueue also writes file immediately
enqueue only called setQueue, relying on the effect cycle to write the file.
If the queue was empty and auto-continue fired before the next render, the
file would show an empty queue and next_best would run instead of the newly
queued item. Now enqueue reads the current localStorage state and calls
writeToFile directly, same as remove/shift.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 02:24:53 +02:00
g-butandClaude Sonnet 4.6 d3d5f7ee93 fix(queue): write reorder/edit/mergeItems immediately — same as remove
reorder, edit, and mergeItems only updated the file via the React effect
cycle, while remove and shift wrote synchronously. If auto-continue fires
in the gap between a drag-reorder and the next render, the agent receives
items in the old order. All three mutations now read from localStorage and
call writeToFile directly before the state update, matching the remove path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 02:21:38 +02:00
g-butandClaude Sonnet 4.6 311c93d187 fix(registry): add getCodexAvailability() — codex now checked like gemini
Codex had available: true hardcoded while gemini used getGeminiAvailability()
to probe the binary. On machines without codex, resolveNextAvailableAgent()
would wrongly suggest codex as the fallback, causing switch attempts to fail.
Now both agents gate on commandExistsInPath() + config-dir heuristic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 02:15:22 +02:00
g-butandClaude Sonnet 4.6 4609e63666 fix(ssot): unify session handoff todos format across all dispatch paths
agent-config.ts (buildPromptWithSession), renderers.ts (openclaw path),
and cockpit-daemon.sh (_resolve_prompt) all emitted "todos: <count>"
while agent-hook-bridge.sh, install-beacon.sh, and prompt-library.ts
all emitted "todos: <count> TODOs". Agents dispatched from the web UI
would write "todos: 0" while beacon-fired agents wrote "todos: 0 TODOs",
producing inconsistent session files depending on which dispatch path ran.

Standardised on "todos: <count> TODOs" (the format present in all actual
session files and the majority of the emit sites).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 02:02:09 +02:00
g-butandClaude Sonnet 4.6 61c4fd6112 fix(control): enforce dark mode; cap and sanitize recent-prompt chips
Three fixes found via browser inspection of the Control panel:

1. ThemeProvider: add forcedTheme="dark" — localStorage "light" was
   overriding defaultTheme and rendering the entire app in light mode
2. SidebarFooter: remove ThemeToggle — no theme switching in a dark-only
   product; it was the root cause of the stale localStorage value
3. project-intent-panel: cap idle-state recent prompts at 5 (was
   unlimited); collapse whitespace/newlines in chip preview text so
   multiline prompts don't blow out the chip height

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-19 01:48:42 +02:00
g-butandClaude Sonnet 4.6 aa3a7430b5 fix(control): reliable agent switch — poll /proc + Ctrl+C fallback
The fixed 900ms sleep before launching a replacement agent was fragile:
if Claude was stuck on a permission dialog or context-limit screen, the
/exit command wouldn't land and the new agent's launch command would be
typed into the running Claude session.

New behaviour:
- After sending the quit command, poll /proc every 200ms for up to 2s
  until the outgoing agent process disappears from the project directory.
- If still running after 2s (stuck on a prompt), send Ctrl+C (key 3)
  as a harder interrupt, then wait 600ms before launching.
- Also adds sendRawKey() to zellij.ts for raw keycode injection without
  characters, and removes the duplicate userId null-check in cloud mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 23:29:18 +02:00
g-butandClaude Sonnet 4.6 0261c57bfd fix(auth): surface NextAuth ?error= param as user-facing message on sign-in
OAuth failures (OAuthAccountNotLinked, AccessDenied) redirect back to
/sign-in?error=... but the form previously ignored the error param,
leaving users with no feedback after a failed OAuth attempt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 21:22:53 +02:00
g-butandClaude Sonnet 4.6 0980f31745 fix(groq): extend callGroqText with systemPrompt; remove duplicate in ivy route
callGroqText in lib/groq.ts now accepts an optional systemPrompt so all
callers share the same fetch logic and model constant (GROQ_FAST_MODEL).

ivy/route.ts had a local callGroq that hardcoded "llama-3.3-70b-versatile"
and duplicated the fetch call — replaced with callGroqText + GROQ_FAST_MODEL.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 20:13:32 +02:00
g-butandClaude Sonnet 4.6 6c7c2bc4a1 fix(ssot): complete route SSOT — 3 missed hardcodes + delete dead verify-email API route
settings/page.tsx line 31, auth.config.ts /sign-out check, and
verify-email/[token]/page.tsx redirects were still using string literals.
All now use ROUTES.* from config/auth.ts.

Deleted src/app/api/auth/verify-email/[token]/route.ts — unreferenced dead
code (email links go to /verify-email/[token] page, not the API route).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:33:57 +02:00
g-butandClaude Sonnet 4.6 faed05deb1 fix(auth): DRY — centralize appUrl() in email.ts; use query layer in reset-password
appUrl() was defined identically in 4 files (forgot-password, register,
resend-verification, email.ts). Exported from email.ts; other 3 now import it.

reset-password was calling db.update(users) directly, bypassing
updateUserPasswordHash() that already exists in db/queries/users.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:18:15 +02:00
g-butandClaude Sonnet 4.6 6b37f926c9 fix(observability): surface silent DB write errors in orchestration routes
All .catch(() => {}) on fire-and-forget DB writes (upsertProjectState,
createOrchestrationEvent, insertPromptHistory, appendDevLog) now log via
console.error so failures appear in Vercel/journalctl logs. Responses are
still non-blocking — only visibility changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 19:08:47 +02:00
g-butandClaude Sonnet 4.6 177640b119 fix(ssot): replace all hardcoded route strings with ROUTES.* constants
Completes the centralization started in 60c858d — 11 files, 20+ occurrences
of /sign-in, /today, /onboarding, and /sign-out now all import from
src/config/auth.ts ROUTES, making route renames a one-file change.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 18:15:43 +02:00
g-butandClaude Sonnet 4.6 e342e8728e fix(css): exclude CLAUDE.md from Tailwind scanning to fix CSS compile crash
Tailwind v4 auto-scans all project files including CLAUDE.md, which contains
`shadow-[var(--*)]` as a violation example. Tailwind generates CSS for this,
producing invalid `var(--*)` that crashes the PostCSS parser and causes all
CSS to fail loading on both dev and production.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 16:33:45 +02:00
g-butandClaude Sonnet 4.6 60c858dc89 fix(build): lazy-init Resend SDK to fix Vercel build crash; centralize auth routes
Resend SDK throws at construction when given an empty string API key, which
crashed next build on routes that import email.ts. Fix: lazy-initialize via
getResend() so the Resend instance is only created at send time, not module
evaluation time.

Route SSOT: create src/config/auth.ts with ROUTES and PUBLIC_NAV_LINKS constants.
Replace 25+ hardcoded "/sign-in", "/today", "/onboarding" etc. strings across
all auth pages, public pages, AuthShell, SignInForm, and SidebarFooter. Nav
links for public surface (landing + auth) now come from one place.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 15:44:09 +02:00
g-butandClaude Sonnet 4.6 d2ee8b993a feat(auth): resend SDK + styled emails, email verification, Groq fallback for Ivy
- Upgrade email.ts to resend SDK with sendEmailFire (fire-and-forget) and sendEmail (awaitable)
- Add styled HTML templates for verification, welcome, and password reset emails
- Add email_verification_tokens table + queries (mirrors password-reset-tokens pattern)
- Register route now sends verification + welcome emails after sign-up
- Add /verify-email/[token] page and /api/auth/verify-email/[token] route to consume tokens
- Add /verify-email page (success, expired-link, and resend states)
- Add /api/auth/resend-verification route with rate limiting
- Add verify-email to proxy public route exclusions
- Add Groq (llama-3.3-70b-versatile) fallback to /api/ivy when openclaw is unavailable

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 14:56:15 +02:00
g-butandClaude Sonnet 4.6 e72623d803 feat(auth): add Google and X OAuth providers; fix production email login
Login fix: production Neon user existed but had no email set (created via
owner-key flow). Updated the record directly — email and fresh password
hash now match local credentials.

Google OAuth: added Google provider behind GOOGLE_CLIENT_ID/SECRET env
vars. Sign-in page shows "Continue with Google" button when both are set.

X OAuth: added Twitter provider behind TWITTER_CLIENT_ID/SECRET env vars.
Sign-in page shows "Continue with X" button when both are set.

Both new providers use allowDangerousEmailAccountLinking so existing
email+password accounts link automatically on first OAuth sign-in.
Providers are conditionally spread into the providers array — absent
env vars = provider simply doesn't exist, no runtime error.

SignInForm: unified oauthLoading state across all three OAuth buttons
(only one can be in-flight at a time); replaced single githubLoading bool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 14:02:54 +02:00
g-butandClaude Sonnet 4.6 54c3711e4c fix(thoughts): render inline markdown in articles — bold, italic, code, links
Articles had **bold**, *italic*, `code`, and [link](url) rendering as raw
markdown syntax. Added ri() inline-render helper that splits text on those
four patterns and maps each part to the appropriate React element. Applied
to paragraphs, list items, blockquote lines, and headings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 13:13:44 +02:00
g-butandClaude Sonnet 4.6 5b6734948b fix(modal): restore scroll in RunModal and AskIvyModal broken by ui-modal-scrollable
The design refactor replaced className="flex flex-col max-h-[85vh]" with
className="ui-modal-scrollable". But ui-modal-scrollable included overflow-hidden,
which silently overrode the Modal panel's own overflow-y-auto — making all content
past the viewport clip with no scroll.

Fix:
- ui-modal-scrollable: drop flex-col + overflow-hidden; keep max-height + overflow-y-auto
  so it is useful for simple whole-panel-scroll overrides
- RunModal, AskIvyModal: className="flex flex-col" — the panel's own max-h-[calc(100vh-2rem)]
  already caps height; flex-col is all that's needed for sticky header/footer layout

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:58:25 +02:00
g-butandClaude Sonnet 4.6 7dc02db372 refactor(design): finish arbitrary-value elimination round 2
globals.css:
- Add .ui-modal-scrollable (max-height: --modal-max-height, flex-col, overflow-hidden)
- Add .ui-focus-ring-negative (error-state border + glow, used for mic/recording inputs)

Components:
- RunModal.tsx, AskIvyModal.tsx: max-h-[85vh] flex flex-col → ui-modal-scrollable
- AskIvyModal.tsx: inline shadow-[0_0_0_3px_color-mix(...)] → ui-focus-ring-negative

audit grep now returns zero results for all tracked violation patterns.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:51:08 +02:00
g-butandClaude Sonnet 4.6 1416d5b7c5 refactor(design): eliminate all SSOT/DRY violations; write design philosophy
globals.css:
- Add --text-nano (8px), --modal-max-height (85vh), --page-min-height (60vh) tokens
- Add .ui-empty-page class (centers error/empty/placeholder pages)
- Add .ui-channel-* classes (WhatsApp/Telegram/Phone/In-person brand colors)
- Add .ui-lang-* classes (TypeScript/JS/Python/Go/Rust/Ruby/C#/Java badge colors)

Components — eliminate every flagged violation:
- channels.ts: raw Tailwind color strings → ui-channel-* class names
- onboarding/page.tsx: LANG_COLORS raw classes → ui-lang-* class names
- MobileNav.tsx, modal.tsx: shadow-[var(--shadow-panel-strong)] → shadow-panel-strong
- HabitHeatmap.tsx: text-[8px] → text-nano
- ready-banner.tsx, page.tsx, whitepaper/page.tsx: text-[10px] → text-micro
- not-found.tsx, error.tsx, PlaceholderView.tsx: min-h-[60vh] → ui-empty-page
- ActionButtons.tsx: min-h-[44px] min-w-[44px] → min-h-11 min-w-11
- u/[username]/page.tsx: h-[72px] w-[72px] → h-18 w-18

CLAUDE.md: replace vague styling section with full four-layer design philosophy —
decision tree, audit command, complete ui-* class catalog, what is/isn't allowed in JSX.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:40:18 +02:00
g-butandClaude Sonnet 4.6 deda86a4ca chore: remove unused listThoughts import from thoughts [slug] page
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:19:20 +02:00
g-butandClaude Sonnet 4.6 202cf7cad3 feat(thoughts): publish "The Model-Agnostic Layer" + make [slug] dynamic
Article covers model-agnostic dispatch vision: fallback chains, local models,
hardware layer, and why Cockpit sits above the model layer not inside any lab's
walled garden. 14 min read, tagged product/strategy/agents/dispatch/hardware.

Removes generateStaticParams + adds force-dynamic so new articles are live
immediately without a rebuild — page reads from the filesystem on each request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 12:16:44 +02:00
g-butandClaude Sonnet 4.6 75bced70ab feat(beacon): write gitBranch into session JSON; show agent+branch chips in Python popup
- _beacon_config.py: add read_project_git_branch() (mirrors server-side parseProjectsConf logic)
- beacon.py: embed gitBranch in session JSON at write time so SSE/web consumers get it without a server-side lookup
- _beacon_popups.py: rewrite ContinuePopup header — green dot, project name, "Ready" badge, then chips row with agent chip + git branch chip; matches web beacon header exactly
- sse/route.ts: add git branch fallback enrichment for sessions written before this change

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 11:58:21 +02:00
g-butandClaude Sonnet 4.6 4c590a983d feat(beacon): add agent chip + git branch chip to popup header
- BeaconSession type: add optional gitBranch field
- beacon/[id]/page.tsx: server component enriches session with git branch
  via parseProjectsConf() + execSync('git rev-parse --abbrev-ref HEAD')
  so branch is available in the initial render with no client fetch
- BeaconClient.tsx: header now shows agent chip ("Claude ready") and
  git branch chip with GitBranch icon, matching the Control panel card

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 11:43:07 +02:00
g-butandClaude Sonnet 4.6 fe4f334ee0 refactor(beacon): use ReadyBanner as SSOT for countdown + prompt buttons
Kill the duplicate countdown / auto-fire / button rendering inside BeaconBody
and replace with the ReadyBanner component that the Control panel already uses.

Changes:
- ready-banner.tsx: widen prompts type to PromptItem (Pick of the display
  fields) so both PromptMeta[] (card) and AgentPrompt[] (beacon) are accepted
  without casting — export PromptItem for external use.
- BeaconClient.tsx: remove countdown useState + two useEffects + manual
  primary/action/more button rendering; add ReadyBanner with onAutoInject
  wired to the same choice-selection logic; add recentPrompts fetch + display;
  update header subtitle to show agent name (was hardcoded "session complete").
- api/beacon/recent/route.ts: new GET ?project= endpoint that returns
  RecentCustomPrompt[] via the same DB query the control panel uses —
  lets the beacon popup show "Reuse recent prompts" identically.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 11:27:24 +02:00
g-butandClaude Sonnet 4.6 8363b89310 fix(inject): always queue when server has no Zellij session
The production standalone server runs outside Zellij (no ZELLIJ_SESSION_NAME),
so calling zellij action directly from the server process silently no-ops.

Two changes:
1. executor.ts: gate direct injection on both RUNTIME_AVAILABLE *and*
   ZELLIJ_SESSION_NAME being present — falls through to queue otherwise.
2. inject/route.ts: run filesystem side-effects (beacon cancel, state files,
   handshake clear) immediately in the route handler; they only need /tmp
   access which the server always has. injectFn is now just the Zellij write.

Result: localhost production server always queues; daemon (which IS inside
Zellij) picks up and injects with correct session context. Dev server
launched from within a Zellij pane still injects directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 10:03:59 +02:00
g-butandClaude Sonnet 4.6 19374873e0 fix(beacon): unify countdown to SSOT — session carries configured value to web
Four issues fixed:
- BeaconSession now carries countdownSeconds (read from settings file in both
  the API route and beacon.py), so the web popup always shows the user-configured
  value instead of a hardcoded fallback
- DEFAULT_BEACON_COUNTDOWN_S changed from 30 → 12 to match Python COUNTDOWN_SECONDS;
  fallback is now consistent across all surfaces when no settings file exists
- BeaconClient uses session.countdownSeconds instead of AUTO_INJECT_S / URL param,
  eliminating the split between readyAt-path (12s) and URL-param-path (30s)
- useAutoContinue default changed false → true so new tabs start with auto-continue
  enabled, matching Python popup behaviour and isAutoContinueEnabledSync

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:32:57 +02:00
g-butandClaude Sonnet 4.6 efd04f73a4 fix(inject): await async injectFn so zellij injection actually fires on localhost
The injectFn closure uses dynamic imports (await import('@/lib/zellij')) but
executor called it without await — the Promise was discarded, imports never
resolved, and execSync never ran. Localhost injection silently returned ok:true
while doing nothing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 09:13:57 +02:00
g-butandClaude Sonnet 4.6 1b502f1b21 feat(settings): add password change for email/password accounts
Email/password users had no in-app way to change their password —
the only option was the forgot-password email flow. Adds:
  - PATCH /api/me/password — verifies current password, rejects OAuth
    accounts (no passwordHash), enforces 8-char minimum on new password
  - updateUserPasswordHash() helper in users queries
  - "Change password" subsection in ProfileSettings, shown only when
    the account has a passwordHash; includes inline validation for
    length and confirm-match before the request is sent

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 08:55:21 +02:00
g-butandClaude Sonnet 4.6 da60f83258 fix(ux): surface errors in AddEventForm, HabitGoalLinks, AddHabitForm, PersonChannelsSection
All six components had try/finally without catch, so network errors
produced no user feedback and unhandled promise rejections. Each
mutation now catches and shows an inline error message or returns
false to its parent form. AddHabitButton and HabitsList.addHabit
now catch to return false instead of throwing into AddHabitForm.
HabitGoalLinks also handles !res.ok for link/unlink so API-level
failures surface instead of silently being ignored.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 07:48:38 +02:00
g-butandClaude Sonnet 4.6 6a0f66e062 fix(auth): use startsWith for invitation route guard in Edge Runtime
The edge runtime's regex engine doesn't reliably evaluate complex
lookahead patterns at compile time, causing /api/invitations/<token>
to return 401 instead of 404, blocking unauthenticated invitation
acceptance. Replace the regex test with pathname.startsWith which
is guaranteed to work in the edge runtime.

Smoke test /api/invitations/<token> now returns 404 (was 401).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 07:35:36 +02:00