Commit Graph
1304 Commits
Author SHA1 Message Date
g-butandClaude Sonnet 4.6 ece4a4de12 refactor(api): migrate remaining routes to readJsonBody helper
Eliminates hand-rolled req.json().catch() + safeParse patterns in
me, user-projects POST, and user-projects PATCH routes. Also adds
readIdParam to user-projects DELETE for consistent UUID validation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:58:26 +02:00
g-butandClaude Sonnet 4.6 0580f57093 refactor: complete form.tsx → globals.css migration for all remaining constants
Add ui-btn-chip, ui-btn-icon, ui-btn-save, ui-btn-add, ui-btn-submit to globals.css.
Remove SECONDARY_BUTTON_CLASS, ICON_BUTTON_CLASS, INLINE_SAVE_CLASS, ADD_BUTTON_CLASS,
PRIMARY_BUTTON_CLASS, DANGER_BUTTON_CLASS string constants from form.tsx.
All 36 usages across 13 files now reference ui-* classes directly — no import needed.
form.tsx now contains only FIELD_INPUT_CLASS alias and the Field component.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:49:33 +02:00
g-butandClaude Sonnet 4.6 94107a3006 refactor: promote input variants to ui-* classes, eliminate DeleteCommitmentButton
- Add ui-input-compact and ui-input-tight to globals.css (visual SSOT)
- Remove FIELD_INPUT_CLASS_COMPACT / FIELD_INPUT_CLASS_TIGHT string constants from form.tsx
- Inline ui-input-compact/tight directly in all 17 components (no import needed)
- Delete DeleteCommitmentButton.tsx (52-line reimplementation of DeleteButton);
  CommitmentItem now uses DeleteButton directly

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:44:46 +02:00
g-butandClaude Sonnet 4.6 e9f5d8d24b refactor: eliminate all raw fetch() calls — route everything through lib/api/fetch helpers
Replaces the remaining 10 raw fetch() calls across 6 files with getJson/postJson/patchJson.
No more repeated { method, headers, body: JSON.stringify } boilerplate outside the SSOT helper.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:34:49 +02:00
g-butandClaude Sonnet 4.6 596d2dc7bc feat(people): one-tap "reached out" quick-log on PersonCard
Adds a single-click "→ Reached out" button to each person card so reviewing
stale contacts requires no extra steps — tap once, health updates immediately.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:28:33 +02:00
g-butandClaude Sonnet 4.6 12a5aa5885 fix(people): full grid state sync for create and delete from PersonDetail
Three related state-sync gaps closed:

1. Deleting a person from the detail drawer no longer leaves a ghost card
   in the grid — onDeleted callback removes from local state immediately
   (router.refresh() was unreliable since PeopleGrid uses useState).

2. Creating a person now shows the new card — NewPersonButton moved inside
   PeopleGrid and passed an onCreated callback that calls search() with
   the current query/sort/filter state.

3. useRouter import removed from PersonDetail (no longer needed).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:23:33 +02:00
g-butandClaude Sonnet 4.6 f0bed51924 fix(people): sync grid health state when interaction logged from detail drawer
PersonDetail (drawer) had no callback back to PeopleGrid, so logging an
interaction from the drawer left the card's health dot and last-seen
timestamp stale until a page reload. Adds onInteractionLogged prop to
PersonDetail, extracts shared handleLogged into PeopleGrid so both the
inline PersonCard log and the drawer route through the same update logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:16:31 +02:00
g-butandClaude Sonnet 4.6 04e963a070 refactor(fetch): replace raw fetch boilerplate with postJson/patchJson/deleteJson helpers
Eliminates repeated { method, headers, body: JSON.stringify(...) } patterns
across 6 components, and migrates NewProjectModal to the shared <Modal>
component instead of rolling its own fixed inset-0 z-50 backdrop.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 06:08:17 +02:00
g-butandClaude Sonnet 4.6 d8fcb14a99 feat(people): remove logged contact from filtered view when health improves
When a health filter is active (fading/stale/unknown) and you log an
interaction that moves the contact to 'active', the card now disappears
immediately from the list and the total count decrements. Previously the
contact stayed in the list with an updated dot, leaving noise in the
stale-contact review workflow.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:59:48 +02:00
g-butandClaude Sonnet 4.6 016eced27f feat(events): autocomplete type field from existing event types
The type input in AddEventForm now shows a datalist of types already in
the list, preventing accidental "conference" vs "Conference" splits that
would fragment the filter chips. New types still accepted freely.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:56:46 +02:00
g-butandClaude Sonnet 4.6 5c41c4648b feat(goals): inline sub-goal creation directly on GoalCard
Previously adding a sub-goal required the global New Goal modal + parent
dropdown. Now each active goal card has an inline '+ Add sub-goal' button
that expands an input field in the children section — Enter to save,
Escape to cancel. Refreshes server state on success.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:54:22 +02:00
g-butandClaude Sonnet 4.6 0f08004f3a feat(projects): create goals directly from project Goals tab
Previously you could only link existing goals to a project — now you can
create a new goal (with title + optional target date) inline, pre-linked
to the project in a single API call. Adds entityId to CreateGoalBody/POST
route, and replaces the single 'Link existing' button with a mode-based
panel (idle → create | link → idle).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:51:13 +02:00
g-butandClaude Sonnet 4.6 75c7d4e734 fix(tokens): eliminate last text-white and opacity-white violations
- HabitRow checkmark: text-white → text-text-inverted (on colored bg)
- ProjectDetailTabBar active tab: text-white → text-text-primary
- Goals empty state: text-white/30 → text-text-muted
- channels.ts email/other: text-white/40|/30 → text-text-tertiary|muted

All bare text-white, bg-white, border-white and white/opacity classes
are now eliminated from app components.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:43:18 +02:00
g-butandClaude Sonnet 4.6 a10b64e84d fix(tokens): eliminate last hardcoded oklch values in setup and landing pages
- setup/page.tsx error text: oklch literal → text-status-negative
- page.tsx green dot: oklch literal → bg-status-positive class

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:37:46 +02:00
g-butandClaude Sonnet 4.6 a3f09eea4e fix(tokens): remove hardcoded oklch status-negative value from auth pages
Error messages in sign-in and invite pages used style={{ color: "oklch(...)" }}
which was literally the --status-negative token value. Replace with className.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:36:05 +02:00
g-butandClaude Sonnet 4.6 5f894e2b76 fix(tokens): replace text-destructive with text-status-negative for SSOT
Error messages and destructive hover states in ProjectsSettings, ProfileSettings,
and onboarding were using the shadcn 'destructive' token instead of our SSOT
semantic token text-status-negative.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:33:04 +02:00
g-butandClaude Sonnet 4.6 e289f0362f fix(tokens): eliminate last hardcoded Tailwind colors, add border-interactive token
- Add --border-interactive token (light: 0.30, dark: 55% white) for
  interactive-element hover borders — replaces hover:border-white/60 on
  goal checkboxes
- HEALTH_DOT_COLOR: bg-green/yellow/red-400 → bg-status-positive/warning/negative
- ProjectGrid issues border: border-yellow-500/20 → border-status-warning/20
- PromptLibraryClient star: text-yellow-400/80 → text-status-warning/80

Zero hardcoded Tailwind color classes remain outside intentional brand/config files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:29:57 +02:00
g-butandClaude Sonnet 4.6 43dc962d28 refactor: split ProjectOverviewTab and AskIvyModal below 300-line limit
- Move ClaudeSession into project-overview-helpers (ProjectOverviewTab: 322 → 258)
- Extract useSpeechRecognition into src/hooks/use-speech-recognition.ts
- Extract useElapsedTimer + QUICK_PROMPTS into ask-ivy-helpers.ts
  (AskIvyModal: 317 → 226)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:25:08 +02:00
g-butandClaude Sonnet 4.6 096fd6e3c8 refactor(control): extract useControlData hook from ControlPanel
Moves all data fetching, SSE subscription, and API callbacks into
src/hooks/use-control-data.ts. ControlPanel drops from 488 → 278 lines,
staying under the 300-line god-component limit.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:21:04 +02:00
g-butandClaude Sonnet 4.6 3d54cf27e4 refactor(control): split ProjectCard god component 523→252 lines
Extracted ProjectCardHeader, SessionSummary, ProjectBanners, and
IntentButtonPanel into project-card-sections.tsx (388 lines). Header
self-manages syncing/syncResult; IntentButtonPanel self-manages
showMore/clearingContext. ProjectCard now contains only state, effects,
computed values, and a clean JSX skeleton.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:15:10 +02:00
g-butandClaude Sonnet 4.6 4cb631e856 fix(tokens): replace remaining bg-white/* indicator dots with bg-status-neutral
3 inactive state dots (never-run, low-progress) → bg-status-neutral.
2 intentional exceptions remain: hover:border-white/60 on goal checkboxes
(interactive 60% hover highlight has no defined token equivalent).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:07:06 +02:00
g-butandClaude Sonnet 4.6 3b3b8ce391 fix(tokens): replace bg-white/* and border-white/* with semantic tokens
74 bg-white/* opacity backgrounds → bg-surface-base/raised/overlay;
84 border-white/* opacity borders → border-border-subtle/default/strong.
5 intentional exceptions remain: hover:border-white/60 (checkbox highlight,
beyond token range) and bg-white/20-25 (inactive indicator dots, need a
dedicated status-inactive token to handle cleanly).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 05:05:18 +02:00
g-butandClaude Sonnet 4.6 5487caf649 fix(tokens): replace 241 text-white/* opacity violations with semantic tokens
All text-white/X inline opacity classes replaced with the correct
semantic token: /80-85→text-text-primary, /50-75→text-text-secondary,
/35-40→text-text-tertiary, /10-30→text-text-muted. Eliminates hardcoded
color pattern across 44 component files per SSOT rule.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:58:35 +02:00
g-butandClaude Sonnet 4.6 7211266f76 refactor(control): split ControlPanel god component 723→488 lines
Extracted ActivityLogPanel, BrainConfigPanel, FleetStatusBar, and
NewProjectModal into control-panel-helpers.tsx (362 lines). ControlPanel
now contains only state, effects, and callbacks — no large JSX blocks.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:53:17 +02:00
g-butandClaude Sonnet 4.6 7ab1d77556 fix(lint): remove unused secondsAgo and MaturityBar imports from ProjectCard
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:43:52 +02:00
g-butandClaude Sonnet 4.6 71cdcd0698 refactor(control): extract ProjectCard helper components to separate file
ProjectCard.tsx was 809 lines (god component per CLAUDE.md >300 rule).
The 8 self-contained presentational helpers — SessionBadge, MaturityBar,
ClosedBanner, ClosingBanner, RunningBanner, ReadyBanner,
LatestOrchestrationPanel, ProfilePanel — are moved to
project-card-helpers.tsx (298 lines). ProjectCard.tsx is now 524 lines
containing only the main interactive component logic.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:42:47 +02:00
g-butandClaude Sonnet 4.6 2ce5bd0999 fix(lint): remove unused ORCHESTRATION_INTENTS import from control-intents
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:31:07 +02:00
g-butandClaude Sonnet 4.6 b1618ca851 refactor(ssot): APP_LOCALE constant, delete dead thoughts config, trim dead export
- Add APP_LOCALE to lib/constants.ts (env: COCKPIT_LOCALE, default: de-CH)
- Replace 3 hardcoded locale strings ("de-CH"/"en-CH") with APP_LOCALE in
  CalendarCard, PersonInteractionsSection, and Greeting
- Delete config/thoughts.ts (95 lines, never imported — app uses
  lib/thoughts-content.ts which reads from content/thoughts/ markdown files)
- Remove unused getIntentLabel export from config/control-intents.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:30:05 +02:00
g-butandClaude Sonnet 4.6 ed0d54c619 fix(build): merge middleware into proxy.ts, delete duplicate middleware.ts
Next.js 16 renamed middleware.ts to proxy.ts. Having both files caused a
build error. Merged the complete auth logic (public paths, invite bypass,
API pass-through, onboarding redirect) into proxy.ts and deleted the
redundant middleware.ts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:22:09 +02:00
g-butandClaude Sonnet 4.6 d3c64e1a03 fix(multi-user): greeting name, project-states isolation, session type
- Greeting now shows the logged-in user's name (via getCurrentUserName())
  instead of the hardcoded DEFAULT_USER_NAME constant
- getAllProjectStates() replaced with getProjectStatesByUserId(userId) so
  the control panel only surfaces project states owned by the current user
  (or legacy rows with null userId for backward compat)
- auth.ts Session type uses explicit fields instead of Omit<DefaultSession>
  which was collapsing to {} under TypeScript's union distribution
- session.ts: add getCurrentUserName() helper

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:17:50 +02:00
g-butandClaude Sonnet 4.6 5be833f95b fix(best-practices): userId in inject upsert + readCurrentPrompt type guard
- /api/inject: pass userId to upsertProjectState so project-state rows are
  scoped to the authenticated user (matches the rest of the multi-user migration)
- control-fast-state: validate JSON shape in readCurrentPrompt() before casting
  to CurrentPrompt — malformed /tmp files no longer silently produce undefined fields

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:11:22 +02:00
g-butandClaude Sonnet 4.6 d5dd002949 fix(multi-user): complete DEFAULT_USER_ID migration across all query files
Every DB query now scopes data to the authenticated user via userId param
sourced from getCurrentUserId(). Invited team members no longer see the
owner's data. Affected: people, projects, memory, utils, orchestration-runs,
prompt-history, events, habits, money, alerts, actions, today.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 04:02:58 +02:00
g-butandClaude Sonnet 4.6 24a7bdc26a fix(ux+multi-user): nav copy SSOT + multi-tenancy read path + mission
Navigation:
- Add description field to NavItem type (navigation.ts is now SSOT)
- Write real per-item descriptions for all 12 nav items
  - Control: "Dispatch agents across projects" (was "Brain switching")
  - 9 generic items: specific descriptions (was "Tracked view" x9)
- Sidebar reads item.description instead of hardcoded ternary
- Control page subtitle: "Dispatch AI agents across your projects — pick an intent and fire"
  (was "Switch brains, models, and terminal sessions")

Multi-user read path fix:
- today.ts: all 5 functions now accept userId param (was DEFAULT_USER_ID)
- goals.ts: getGoals/getGoalStats now accept userId param
- goals/page.tsx, prompts/page.tsx: call getCurrentUserId()
- CommitmentsCard, GoalsDueCard, SubscriptionsCard, SummaryBar: call getCurrentUserId()
- actions.ts fulfillCommitment: call getCurrentUserId() in server action

CLAUDE.md:
- Add Mission section (2-sentence product definition)
- Add control/ to Architecture component list
- Add /control, /thoughts, /settings to Views table
- Update /control description to match actual fleet command feature

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 03:32:14 +02:00
g-butandClaude Sonnet 4.6 cc3b763d6d feat(cockpit): multi-dev invites, launch button, git sync guard, context clear
- Invitation system: token-based /invite/[token] registration page, TeamSettings
  component in /settings, DB schema + queries, full API (create/list/accept)
- Create & Launch: "New project" modal in ControlPanel, ensureTabExists() in
  agent-runtime so zellij tab is created if not open, Play button on idle tiles
- Git sync guard: behindRemote field in GitState (git rev-list HEAD..@{u}),
  "↓ N behind" warning badge + git pull button + /api/project/sync route
- Clear context: /api/project/clear-context sends /clear to Claude without
  writing prompt state; "Clear context" button in ProjectCard More section,
  only shown when currentAdapter === "claude"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-04 02:36:04 +02:00
g-butandClaude Sonnet 4.6 70d1d6def4 feat(packaging): self-hosted distribution foundation
First-run flow:
- /setup page + /api/setup: creates first user with hashed password
  (Node crypto scrypt, no new deps). POST rejects if users already exist.
- Landing page redirects to /setup when DB has no users
- middleware.ts: protects app routes, passes public pages through

Auth:
- passwordHash column added to users schema (drizzle-kit push applied)
- src/lib/password.ts: hashPassword/verifyPassword via Node scrypt
- auth.ts Credentials: env var takes priority, falls back to DB hash
  so packaged installs work without LOCAL_AUTH_PASSWORD

Multi-tenancy groundwork:
- Replaced DEFAULT_USER_ID with getCurrentUserId() across all 12 API
  route files (people, subscriptions, events, goals, projects, commitments)

Docker:
- Dockerfile: multi-stage Node 22 alpine, standalone output
- docker-compose.yml: postgres + migrate + app services
- .dockerignore, .env.example with documented required vars
- next.config.ts: output: standalone
- package.json: added migrate script (drizzle-kit push)
- tsconfig.json: scope to src/ only, exclude .next generated files

Install: clone → cp .env.example .env.local → docker-compose up
First visit → /setup → create account → sign in → done.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 13:46:07 +02:00
g-butandClaude Sonnet 4.6 3d315235a6 redesign(landing+signin): dramatic visual uplift + local auth
- Landing: 52–108px clamp headline, multi-layer glows, grid fade mask,
  3-col feature cards, stronger grid (0.055 opacity vs 0.035 before)
- Sign-in: matching dark bg, 36–48px headline, polished glass card,
  labeled inputs, focus border transitions
- globals.css: base font 15px→16px, headings font-weight 600→700,
  ui-page-title 3xl→4xl/5xl, ui-page-subtitle text-base→text-lg
- auth.ts: Credentials provider (local) for LOCAL_AUTH_PASSWORD,
  JWT strategy (required alongside DB adapter), jwt()+session() callbacks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 12:07:30 +02:00
g-butandClaude Sonnet 4.6 e0e9c7f538 redesign(landing): x.ai-inspired dark hero page
- Deep near-black background (#080808) with subtle 72px grid overlay
- Radial center glow adds depth without color
- 80px bold headline at lg, tight -3% tracking
- Reduced text/CTA to essentials — no feature card grid
- Proof line at bottom: "Built on Claude · Runs on your machine"
- Rounded-full CTAs: white primary, ghost outline secondary

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 10:58:19 +02:00
g-butandClaude Sonnet 4.6 5eb0c82451 feat(control): fleet grid view — idle projects collapse to compact tiles
Active projects (agent running, recent ready/closed/closing signal, or current
prompt) show as full ProjectCards. Idle projects compress to a 3-column tile
grid with name, health, git branch, and session.next preview.

- ProjectTile.tsx: new compact tile with spinner for running, health dot,
  branch, and session.next truncated to one line
- ControlPanel: isActiveProject() helper (5-min window), expandedTabs state
  to promote tiles back to full cards on click, collapsible idle section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 09:52:39 +02:00
g-butandClaude Sonnet 4.6 04ac6fd9a9 refactor: design tokens, route group, orchestration SSOT cleanup
Design system:
- globals.css: add status color tokens (status-positive/warning/negative)
- constants/control.ts: replace hardcoded color classes with semantic tokens
- Components: replace hardcoded colors (emerald-400, amber-400, red-400) with
  status-positive/warning/negative tokens throughout

Route structure:
- Move all app pages into (app)/ route group alongside shared layout
- Remove flat src/app/ page files (moved to src/app/(app)/)

Orchestration SSOT:
- contract.ts: convert AdapterId and OrchestrationTaskIntentId from string union
  types to const arrays so z.enum() can use them as runtime values
- run/route.ts: remove hardcoded intent/adapter enum lists; import from contract
- run/route.ts: use getCurrentUserId() instead of DEFAULT_USER_ID

Misc:
- control/route.ts: remove unused fs import
- Sessions API: minor cleanup

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:28:33 +02:00
g-butandClaude Sonnet 4.6 d9c1a875d8 feat(control): SSE real-time stream, activity log, UI polish, schema indexes
Control panel:
- Add SSE endpoint (/api/control/stream) pushing agent state diffs every 2s
- Extract shared fast-state reader to lib/control-fast-state.ts (DRY)
- ControlPanel: reduce polling from 10s to 30s; SSE handles fast path (2s latency)
- ControlPanel: add collapsible 24h activity log (was fetched but never rendered)
- ProjectCard: fix RunningBanner elapsed time bug ("154s" → "2m 34s")
- ProjectCard: add warning color to elapsed timer after 15 min (possible stall)
- ProjectCard: fix ClosingBanner elapsed time bug ("3ms running" → "3m running")
- ProjectCard: remove duplicate Pause icon from auto-continue toggle button
- ProjectCard: show session.tests and session.todos in status tab summary

Navigation:
- Move /control to mobile nav (remove /money from mobile); control is flagship view

DB schema:
- project_states: add user_id FK column + index (was only table missing user isolation)
- prompt_history: add idx_prompt_history_user_id index
- habits.habit_completions: add idx_habit_completions_user_id index
- goals: add composite idx_goals_user_status index on (userId, status)
- getRecentActivity query added to prompt-history queries

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 05:20:04 +02:00
g-butandClaude Sonnet 4.6 e84b6d4f0a feat: GitHub OAuth, design system rebuild, reliability fixes (M1-M7)
Auth & multi-user:
- GitHub OAuth via next-auth DrizzleAdapter; signIn callback absorbs first
  login into is_default=true user so all pre-auth data stays accessible
- getCurrentUserId() helper; onboarding + profile pages
- normalizeUsername() extracted to lib/username.ts (DRY fix)

Design system:
- All public pages (landing, sign-in, onboarding, settings) rebuilt to use
  ui-* classes and semantic tokens only — zero raw Tailwind color violations
- ui-input, ui-btn-*, ui-panel, bg-surface-*, text-text-* throughout

Reliability (M1–M7):
- M1: Stale claude-stop-active lock cleanup on stop hook entry
- M2: /api/inject validates tab exists in Zellij before writing /tmp
- M3: Prompt SSOT unified — claude-prompts.json single array format
- M4: DBUS UID hardcode removed (already in dotfiles)
- M5: auth.ts signIn callback + AdapterAccountType cast
- M6: project_states DB table — persists ready/closing/closed/session/prompt
  across reboots; stop.sh PATCHes on stop/close; control falls back to DB
  when /tmp is empty (24h window); inject writes currentPrompt to DB
- M7: scheduleOpenClawWorker now async; waits for spawn event (2s timeout);
  marks run as error in DB if worker fails to start

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-02 18:20:46 +02:00
g-but d62a442fba feat(control): add pause/play button for per-tab auto work 2026-05-01 13:46:15 +02:00
g-but 72a6393895 ux(control): rename auto-continue toggle to pause/resume wording 2026-05-01 13:31:45 +02:00
g-but 33b92a3be0 feat(control): persist auto-continue toggle per tab 2026-05-01 13:18:32 +02:00
g-but 4863989c9d feat(control): pause/disable auto-continue while typing 2026-05-01 13:17:02 +02:00
g-butandClaude Sonnet 4.6 a33027c651 feat(control): full project profile with dimension prompts + prompt history
- Add ProjectProfile tab to every project card: 7 dimensions (Engineering,
  Product, UX, Marketing, Content, Business, Deploy), each with 3 crafted
  prompts that interpolate project context (name, path, mission, stack, url)
- Per-project agent selector: override global brain per card; chosen agent
  used for all dimension prompt dispatches and auto-launches agent in tab
  if not running (via /api/agent/launch → restartTab)
- Add intent:"custom" to orchestration contract so dimension prompts dispatch
  as full free-form text, not a fixed intent enum
- Add prompt_history table (append-only log of every dispatch: adapter,
  intent, custom_prompt, dispatched_at) — foundation for reuse and learning
- Log every /api/orchestration/run dispatch to prompt_history regardless of adapter
- Return recentCustomPrompts per project in /api/control response (batch query)
- Show reusable chips below custom input: click to prefill, ×N for repeat use
- Show usage count on dimension prompt buttons in Profile tab
- Add /api/agent/launch route: wraps restartTab + launchAgentInTab
- Extract launchAgentInTab to agent-runtime.ts (shared, no duplication)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 13:10:39 +02:00
g-but 43bb66b17c fix(orchestration): enforce exact session handoff line format 2026-05-01 12:43:36 +02:00
g-butandClaude Sonnet 4.6 eed9a4147a fix(control): sort dirs before cache key comparison
Unsorted join caused cache misses whenever project list order changed
between polls (same set, different order = treated as different dirs).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:19:08 +02:00
g-butandClaude Sonnet 4.6 e2bfddc4c9 refactor(zellij): extract injectIntoTab to shared lib
Was duplicated verbatim in inject/route.ts and orchestration/run/route.ts —
any fix to the shell-escape logic needed double application. Now SSOT.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:18:02 +02:00
g-butandClaude Sonnet 4.6 10c42815a1 fix(orchestration): auto-cleanup stale running runs on control panel poll
Runs stuck in "running" beyond 60 min now auto-transition to error state
on every /api/control poll (every ~10s), preventing phantom active states.
Cleanup runs in parallel with the latestRuns query so it adds no latency.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 12:08:33 +02:00