Commit Graph
1304 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 830f90341f feat(billing): wire pricing CTA → sign-in → Stripe checkout
- GET /api/checkout/[plan]: auth-protected redirect route that creates a
  Stripe checkout session (or bounces back to sign-in with callbackUrl
  preserved if unauthenticated)
- Landing pricing CTAs now link to /sign-in?callbackUrl=/api/checkout/<plan>
  when Stripe is ready, so the full funnel is connected end-to-end
- BillingSettings reads ?billing= query param on mount and shows a status
  notice (success / canceled / error / not-configured / already-active),
  then strips the param from the URL so it doesn't persist on refresh
- Suspense wrapper added around BillingSettings in settings page

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 14:23:46 +02:00
g-butandClaude Sonnet 4.6 c47a22eb5f feat(billing): Stripe subscription infrastructure — schema, routes, BillingSettings UI
Adds complete ready-to-activate payment infrastructure:
- DB: plan/planStatus/stripeCustomerId/stripeSubscriptionId on users table
- src/lib/stripe.ts: Stripe client + price ID config (returns null until keys added)
- /api/stripe/checkout: creates checkout session for personal/pro/team plans
- /api/stripe/portal: redirects to Stripe billing portal for subscription management
- /api/stripe/webhook: handles subscription lifecycle (activated, updated, canceled)
- BillingSettings component: shows current plan, monthly/annual toggle, upgrade cards
- Settings page: BillingSettings wired in above ProjectsSettings
- Landing: pricing CTAs pass ?plan= param when Stripe is ready

Activate by adding to .env.local:
  STRIPE_SECRET_KEY=sk_live_...
  STRIPE_WEBHOOK_SECRET=whsec_...
  STRIPE_PRICE_PERSONAL_MONTHLY=price_...
  STRIPE_PRICE_PERSONAL_ANNUAL=price_...
  STRIPE_PRICE_PRO_MONTHLY=price_...
  STRIPE_PRICE_PRO_ANNUAL=price_...
  STRIPE_PRICE_TEAM_MONTHLY=price_...
  STRIPE_PRICE_TEAM_ANNUAL=price_...

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 14:08:06 +02:00
g-butandClaude Sonnet 4.6 e2d2d07741 fix(invite): auto sign-in after invite acceptance now works
The local credentials provider signs in only the default (owner) user, so
the post-acceptance signIn("local") call was always authenticating as the
wrong account. Added a user-password credentials provider that looks up
any user by ID and verifies their password hash, then wired the invite
page to use it with the userId returned by the accept API.

Also distinguishes expired vs already-used invite states so the error
message is specific rather than generic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 13:52:52 +02:00
g-butandClaude Sonnet 4.6 3d956e2356 feat(control): agent switching in cloud mode via daemon queue
switch-agent route returned 503 in cloud mode. Now enqueues a
switch_agent pending command instead, which the local daemon claims
within its 5s poll cycle and executes:
  1. injects the quit command for the current agent (e.g. /exit for claude)
  2. waits 1s for exit, then injects the launch command for the new agent

Schema: adds SwitchAgentPayload type and "switch_agent" to the type comment.
Queries: adds enqueueSwitchAgentCommand.
Daemon: adds execute_switch_agent + _agent_quit_cmd + _agent_launch_cmd
  helpers; adds switch_agent case to the main dispatch loop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 13:37:43 +02:00
g-butandClaude Sonnet 4.6 ac941900a2 fix(auth): clarify sign-in page copy — Local password → Password, owner password divider
"Local password" read as localhost-specific jargon. Renamed to "Password".
Divider now says "or owner password" to distinguish the admin bypass from
the GitHub OAuth path for regular users.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 13:24:59 +02:00
g-butandClaude Sonnet 4.6 252eabb80c refactor(goals): extract GoalCard state/handlers into use-goal-card hook
GoalCard was 319 lines (component limit: 300). State declarations and five
async handlers moved to use-goal-card.ts — business logic separated from
rendering. Component is now 239 lines, hook is 111 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 13:18:06 +02:00
g-butandClaude Sonnet 4.6 1b1e6e910e fix(control): remove git-dirty from attention bar; compact idle tile launch label
Attention bar was filled with routine "N uncommitted" noise from git dirty
state, crowding out real health signals (critical, failing tests). Git state
is already visible in per-project header chips and idle tiles.

Idle tile launch button showed "codex · gpt-5.4" which wrapped onto three
lines in the compact grid. Model is already in the title tooltip; showing
only the agent name keeps the chip single-line.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 13:07:26 +02:00
g-butandClaude Sonnet 4.6 e331b586e7 feat(control): live tab state via SSE + daemon sync indicator
tabOpen propagation:
- Add tabOpen to FastProjectState; local path derives it from zellijTabCache,
  cloud path reads it from DB (daemon-pushed).
- SSE change detection now fires when tabOpen changes so projects move
  between active/idle immediately, not after the next 30s poll.
- mergeProjectPatches updates zellijTabs from incoming tabOpen patches
  so the client's tab list stays live without a full page refresh.

Daemon status indicator (cloud mode only):
- daemonLastPushedAt computed from MAX(project_states.updatedAt) —
  no extra query, derived from the already-fetched dbStatesArr.
- ControlPanel header shows "daemon Xs ago" when connected,
  "daemon offline" when >90s stale, "daemon not connected" when never seen.
- Gives cloud users clear feedback when their local daemon is down.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:50:38 +02:00
g-butandClaude Sonnet 4.6 3de153031d fix(control): cloud-mode next-best-step + disable redundant auto-inject
Three improvements for web (Vercel) users:

1. orchestration/run: for claude adapter in cloud mode, render the intent
   prompt and enqueue via pending_commands instead of returning 503.
   The local daemon picks it up and injects. Other adapters still 503
   (they require local workers).

2. runtimeAvailable flag: exposed in ControlData API response and
   threaded down to ProjectCard so cloud mode is detectable client-side.

3. ReadyBanner auto-inject: disabled when runtimeAvailable=false
   (no onAutoInject prop passed). The local stop hook already handles
   auto-continuation the moment Claude finishes — the cloud countdown
   firing 12s later would double-inject on top of running work.
   Manual dispatch buttons still work in cloud mode.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:28:48 +02:00
g-butandClaude Sonnet 4.6 0b1585a9da fix(control): surface launch errors in modal + fix Zellij session discovery
Three-layer fix for silent launch failure on web:
- agent-runtime: discover ZELLIJ_SESSION_NAME via env or full session scan
  so zellij action calls work when running outside a Zellij pane
- api/agent/launch: guard with isRuntimeAvailable() — returns 503 with
  helpful message instead of hanging when launched from cloud/Vercel
- use-control-data: launchProject now checks res.ok and throws so the
  error propagates to LaunchTabModal's error prop instead of silently
  closing the modal

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 12:11:26 +02:00
g-butandClaude Sonnet 4.6 f625c48478 feat(nav): add More drawer to mobile nav — all 14 views now reachable
Previously 9 of 14 views (Habits, Events, Money, History, Prompts, System,
Memory, Thoughts, Settings) were completely inaccessible from mobile — the
bottom bar only showed the 5 mobile:true items with no overflow path.

Add a 6th "More" button that opens a bottom sheet with the 9 overflow items
in a 3×3 grid. Sheet closes on tap-outside, on link navigation, or on the
X button. "More" button highlights as active when the current path is an
overflow item, giving correct active-state feedback.

No config changes — NAV_ITEMS is still the SSOT; OVERFLOW_ITEMS is derived
by filtering mobile:false at runtime.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 11:57:34 +02:00
g-butandClaude Sonnet 4.6 0bf662ac10 fix(transcribe): Groq Whisper cloud fallback + extract AgentSwitcherPopover
Transcribe route: replace daemon-relay remote path with direct Groq Whisper
API call (whisper-large-v3-turbo). Cuts remote transcription from 8-15s to
2-4s and removes the polling/result-TTL complexity entirely. GROQ_API_KEY
must be set in Vercel env vars. Local path (Whisper via Python) unchanged.

Add callGroqTranscribe() to lib/groq.ts alongside the existing callGroqText()
so both text and audio inference share the same API client module.

Extract AgentSwitcherPopover from ProjectStatusChips (306→253 lines) into
its own focused file — removes the circular useRef/useEffect block from the
parent component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 11:48:26 +02:00
g-butandClaude Sonnet 4.6 4c4589d3fd refactor: split 3 over-300-line components into focused files
project-card-helpers.tsx 328→177: extract ReadyBanner to ready-banner.tsx
project-composer.tsx 325→deleted: split into prompt-input.tsx (182) + queue-list.tsx (144)
SubscriptionActions.tsx 314→229: extract inline edit form to SubscriptionEditForm.tsx (96)

Update all import sites. No behaviour changes.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 10:48:21 +02:00
g-butandClaude Sonnet 4.6 dd87493df5 refactor(ux): tighten page title to text-xl sm:text-2xl
Previous pass went text-2xl/text-3xl — still too large for a daily-use
operational tool. Drop one step to text-xl/text-2xl.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 09:19:54 +02:00
g-butandClaude Sonnet 4.6 378e42dde7 refactor(ux): content-first layout — featured first, compact headers, scrollable tags
Thoughts page: featured essay now leads the page above all filters.
Tag strip collapses from 5-row blob to a single horizontally scrollable
row — 70+ tags no longer consume the entire viewport.
Tags removed from grid cards (redundant when filter is visible).
Count merged inline with search bar.

Global: remove "Cockpit" kicker from PageLayout (redundant inside app).
Shrink ui-page-title text-4xl→text-2xl / sm:text-5xl→sm:text-3xl and
ui-page-subtitle text-lg→text-sm across all pages — operational tool
needs functional headers, not magazine-cover sizing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 08:48:33 +02:00
g-butandClaude Sonnet 4.6 e3a779a4b3 feat(runtime-bridge): tabOpen detection + remote transcription relay
Daemon now detects whether each project's Zellij tab is actually open
and pushes tabOpen:boolean with every runtime state heartbeat.
Control panel on Vercel reads this from project_states instead of
calling getZellijTabs() locally — fixes the always-closed tab display
in cloud mode.

Beacon transcribe falls back to pending_commands queue when runtime is
unavailable (Vercel), so voice commands relay to local Whisper daemon.
Command results now carry a text field for transcription payloads.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 08:38:47 +02:00
g-butandClaude Sonnet 4.6 7814c5c6fe fix(daemon): inject_prompt finds zellij session by tab name — was silently failing from systemd
Without ZELLIJ_SESSION_NAME set, `zellij action` outside a session lists
sessions instead of targeting one, so write-chars fired nowhere despite
returning 0. Now `_find_session_for_tab` scans all sessions via
query-tab-names to find the right one, then prefixes every action with
ZELLIJ_SESSION_NAME. Also removes expandedCount from the OPEN TABS
metric card — UI expansion state doesn't belong in a Zellij-backed
tab count.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:51:54 +02:00
g-butandClaude Sonnet 4.6 88fc1988ff refactor(goals): split goal-card-helpers 388→197+198 — extract milestone components
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:38:34 +02:00
g-butandClaude Sonnet 4.6 149f840088 refactor(control): split control-panel-helpers 390→205+192 — extract modals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:32:02 +02:00
g-butandClaude Sonnet 4.6 9204b93dc3 refactor(control): split project-card-sections 413→202+112+109 — extract banners and activity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:24:42 +02:00
g-butandClaude Sonnet 4.6 cd68673252 refactor(control): split project-profile-helpers 420→217+207 lines — extract display sections
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:15:32 +02:00
g-butandClaude Sonnet 4.6 77dcd6e091 refactor(control): extract useProjectCardActions hook — reduce ProjectCard 430→209 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 06:44:59 +02:00
g-butandClaude Sonnet 4.6 ef64140667 refactor(components): split BootstrapModal and GoalCard — eliminate god components
BootstrapModal: 413→158 lines via bootstrap-modal-steps.tsx (4 step components + shared primitives)
GoalCard: 383→318 lines via goal-card-sections.tsx (GoalTitleRow + GoalDescriptionEdit)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 06:23:59 +02:00
g-butandClaude Sonnet 4.6 a16f710313 refactor(control): extract ProjectFleetView + useLaunchModal + useCreateProject — ControlPanel 444→267 lines
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 05:32:55 +02:00
g-butandClaude Sonnet 4.6 75b869e283 feat(today): add Daily Wrap-Up — closes the daily loop with an evening review CTA
The Today action bar now switches between Plan My Day (before 5pm) and Wrap Up Day (from 5pm) using server-side time. The wrap-up prompt asks Ivy to tally commits, surface blockers, check overdue commitments, and name the first task for tomorrow. Also adds the template to the prompt library (personal/global, featured, schedulable at 5pm weekdays).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 05:06:18 +02:00
g-butandClaude Sonnet 4.6 101843300d refactor(control): extract BriefField and ToggleGroup — eliminate 6+2 site DRY violations in BootstrapModal
Six labeled-input blocks and two toggle-button groups shared identical structure. Local BriefField and ToggleGroup components remove the duplication. 462 → 413 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 05:00:55 +02:00
g-butandClaude Sonnet 4.6 839ab396f7 feat(today): add Plan My Day button to action bar — one-click morning planning dispatch to Ivy
The Today page had situational awareness (SummaryBar + Brief Ivy) but no planning CTA. Plan My Day sends a structured prompt asking Ivy to identify the one highest-priority project, three concrete tasks, and one relationship to maintain — the full morning planning loop in one click.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:54:53 +02:00
g-butandClaude Sonnet 4.6 e697a6bc5e refactor(control): extract ControlMetricCard — eliminate 4-site duplication of ui-control-metric-card structure
Four identical label/value/note blocks are replaced by a single typed component in control-panel-helpers.tsx. ControlPanel.tsx -33 lines.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:49:14 +02:00
g-butandClaude Sonnet 4.6 0c2933d077 refactor(hooks): extract useEscapeKey — eliminate 5-site duplication of identical useEffect boilerplate
Five components had verbatim copies of a 9-line useEffect block (keydown guard, INPUT/TEXTAREA skip, add/remove listener). Centralising it in useEscapeKey() makes the invariant a single source of truth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:44:37 +02:00
g-butandClaude Sonnet 4.6 972c4b03ce feat(today): Add Ivy dispatch button to GoalsDueCard and EventsDueCard rows
Matches the per-row pattern already established in StuckGoalsCard — each upcoming deadline now has a direct Ask Ivy shortcut with deadline-contextual prompt.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:33:17 +02:00
g-butandClaude Sonnet 4.6 224839096a fix(goals): wire up Ivy button in empty state — copy said 'ask her' with no mechanism to do so; now renders a labeled IvyDispatchButton pre-loaded with a goal-definition prompt
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:24:00 +02:00
g-butandClaude Sonnet 4.6 6b37ef9fb1 feat(prompts): Escape key resets search, category and scope filters — completes Escape-reset sweep across all five filtered views
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:18:37 +02:00
g-butandClaude Sonnet 4.6 663e70b98e feat(ux): Escape key resets search/filter on EventsGrid and ProjectGrid — completes keyboard reset sweep across all filtered views
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:14:55 +02:00
g-butandClaude Sonnet 4.6 df3007af25 feat(people): Escape key resets search and health filter — global handler skips input focus, search input blurs on Escape
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:09:06 +02:00
g-butandClaude Sonnet 4.6 e5d246176b feat(today): Brief Ivy pill on SummaryBar — one-click daily brief with goals, habits, events, commitments, fleet state; add optional label prop to IvyDispatchButton
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 04:05:13 +02:00
g-butandClaude Sonnet 4.6 1fec5d1ac4 feat(money): Ask Ivy button on SubscriptionActions — dispatch with name, vendor, cost, frequency, next due, notes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:59:36 +02:00
g-butandClaude Sonnet 4.6 4b39b24ffa feat(projects): Ask Ivy button on ProjectCard — dispatch with name, status, maturity, description, health signals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:54:37 +02:00
g-butandClaude Sonnet 4.6 89a51d557e feat(habits): Ask Ivy button on HabitCard — dispatch with habit name, frequency, completion rate, streak, linked goals
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:49:10 +02:00
g-butandClaude Sonnet 4.6 312dc9dc5b feat(goals): Escape key resets sort/filter — global handler skips input focus, search input blurs on Escape
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:46:19 +02:00
g-butandClaude Sonnet 4.6 92dfd6adb3 feat(events): Ask Ivy button on EventCard — dispatch with event name, type, category, deadline context
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:40:42 +02:00
g-butandClaude Sonnet 4.6 5d09d0ec49 feat(people): Ask Ivy button on PersonDetail drawer — richer dispatch with attrs, interaction history, health
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:36:45 +02:00
g-butandClaude Sonnet 4.6 9c7b27927a feat(people): Ask Ivy button on PersonCard — one-click dispatch with name, role, location, last contact
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:32:35 +02:00
g-butandClaude Sonnet 4.6 398c4fd93b feat(today): add Control dispatch to RecentRunsCard next-step — run full agent from agent recommendation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:27:59 +02:00
g-butandClaude Sonnet 4.6 48a2a0f5ec refactor(shared): extract ControlDispatchButton — add agent dispatch to StuckGoalsCard, clean up GoalCard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:23:51 +02:00
g-butandClaude Sonnet 4.6 39c00479b2 feat(goals): Send to Control — goal with linked project dispatches agent via localStorage prefill on /control
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:16:09 +02:00
g-butandClaude Sonnet 4.6 98e8d7fd53 refactor(shared): extract IvyDispatchButton — eliminate 3-site duplication of ivy:open dispatch logic
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:10:07 +02:00
g-butandClaude Sonnet 4.6 415ce80ee7 feat(today): Send to Ivy button on StuckGoalsCard — unblock stalled goals with one click
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:05:06 +02:00
g-butandClaude Sonnet 4.6 78a05add61 feat(today): Send to Ivy button on RecentRunsCard next-step — closes agent-output→agent-input loop
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 03:01:10 +02:00
g-butandClaude Sonnet 4.6 15e9149779 feat(goals): one-click Send to Ivy — goal context opens Ivy pre-filled via custom event
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 02:57:25 +02:00
g-butandClaude Sonnet 4.6 8f3d917c32 feat(goals): add sort controls to GoalsGrid — by due date, stuck first, or most progress
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 02:51:46 +02:00