The 7-line streak loop appeared twice — once using HABIT_HISTORY_DAYS
as the bound (listHabitsForToday) and once using a dynamic days param
(getHabitHeatmapData). Extracted to a private computeStreak(dates, maxDays)
function eliminating the duplication.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The repeating inline-edit input pattern (bg-surface-raised border rounded
outline-none transition-colors with focus:border-border-strong) appeared
14 times across 9 components with no shared class. Adds ui-input-inline
to globals.css as the single source of truth for click-to-edit inputs on
raised surfaces. Callers supply their own padding, text-size, width, and
border-strength overrides as needed.
Files updated: HabitCard, CommitmentItem, GoalCard, goal-card-helpers,
HabitRow, LogConversationButton, ProjectInlineEditors, ProjectPromptsTab,
project-overview-helpers.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Eliminates the duplicate type Agent = "codex" | "claude" that violated
the single-source-of-truth principle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
CreateEventInput, PatchEventInput, MilestoneSchema, SubscriptionRow,
PatchSubscriptionInput, LatestLifecycleEvents, PatchProjectInput,
PatchCommitmentInput — all referenced only within their own query file,
never imported by route handlers or components.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
WhisperModel (beacon), CHANNEL_ATTR_PREFIX + ChannelConfig (channels),
PromptScope (prompt-library), SubscriptionMeta (subscriptions) — all
had zero external callers and are only referenced within their own file.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agent-registry: remove sanitizeAgentOption, getDefaultAgentId,
getAgentRegistryEntry, getDefaultAgentConfig, sanitizeAgentConfig,
listSwitchableAgentRegistry — all had zero external callers.
agent-config: make CLAUDE_HOME, PROJECTS_CONF, CLAUDE_PROJECTS_CONF,
CLAUDE_PROMPTS_FILE, PromptConfig, readPromptConfig private — only
used within the file.
agent-preferences: make AGENT_PREFERENCES_FILE private.
agent-catalog: make AgentCatalogEntry private.
constants: make OPENCLAW_DIR, WORKSPACE_DIR private.
utils: make UUID_RE private.
session-content: make ParsedSession private.
crons: make CronFileData private.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ProjectTab, SwitchTabResult, getConfiguredProjectTabs, getOpenZellijTabs,
restartTab, and restartOpenProjectTabs had zero external callers. The
internal helpers (getOpenZellijTabs, restartTab) are kept as private
functions since launchAgentInTab still depends on them.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The export was unused — both control routes import from control-fast-state.ts
which has the correct basename-only matching. The agent-runtime version used
a full cmdline scan that produced false positives on bash shell-snapshot scripts
and was superseded when control-fast-state.ts was introduced.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
isOrchestrationReady was not included in isActive, so projects where an
orchestration run just finished were buried in the collapsed idle grid
instead of appearing in the active section where the user can see the
result. The sort rank was already correct (rank 2, same as isReady) but
the active/idle split was wrong.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed three duplicates in agent-preferences.ts:
- local `type Agent` (same as registry export)
- local `sanitizeAgentId` (identical implementation)
- local `syncClaudeSettings` (same logic as registry's syncAgentSettings)
Now calls syncAgentSettings("claude", ...) directly instead of re-deriving the
~/.claude/settings.json path inline.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both maps cover the same health labels (good/excellent/needs-attention/degraded/critical)
so an agent writing "degraded" no longer silently falls through to neutral tag style
in DevLogList and the public profile page.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removed local duplicate of the agent-prompts.json path. agent-config.ts is
already the SSOT and also supports AGENT_PROMPTS_FILE env-var override which
the local copy silently ignored.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both beacon-settings and beacon/transcribe routes defined the same
~/.config/agent-dashboard-settings.json path. Extracted to BEACON_SETTINGS_PATH
in config/beacon.ts (already the SSOT for beacon config after WHISPER_MODELS).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaced ad hoc pattern matching (startsWith "green"/"red", includes "fail")
with the existing SSOT from lib/constants/control. Fixes degraded health showing
as muted text-secondary instead of warning color in project detail view.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Within same display-state rank, surface projects with degraded or critical
health before those with only git activity, so attention-needed projects
float to the top of the idle grid.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agent/route.ts redefined AGENT_IDS locally instead of importing from
lib/agent-registry.ts where it lives. One source of truth for agent IDs.
AlertSeverity derived type had zero external usages — removed.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Avoids recreating Record objects on every render. Renamed to
HEALTH_BADGE_STYLE and HEALTH_BADGE_ICON for UPPER_SNAKE_CASE consistency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Labels belonged alongside SORT_MODE in lib/constants/statuses.ts.
PeopleGrid now imports from there instead of defining them locally.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds collapsible "Library prompts" section to IntentButtonPanel showing
featured project-scoped prompts as polished mini-cards (2-col grid with
name, description, category badge). Clicking injects directly when the
agent is ready (bannerActive) or populates the input for review when idle.
Adds FEATURED_PROJECT_PROMPTS and substituteProjectName() to
config/prompt-library.ts as the SSOT for control-panel prompt injection.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
HEALTH_STYLE was defined inside DevLogList.tsx (a UI component) and
imported as a module-level constant by the public profile page. Constants
must not live in component files — moved to config/ui.ts as HEALTH_TAG_STYLE
with both consumers updated to import from the canonical location.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
When the user toggles health filters (e.g. after landing on /people?health=stale
via SummaryBar), the URL now stays in sync via replaceState so the current
filter is always bookmarkable and shareable without triggering a server re-render.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getFleetSummary now also reads sessionHealth from DB and counts projects
whose health is degraded or critical. A new amber pill appears in SummaryBar
when any exist, linking to /control — so the user sees unhealthy agents
from Today without opening the Control panel.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The habits page was read-only; users had no way to rename habits, change
their cadence, deactivate them, or remove them despite the API supporting
all four. Introduces HabitCard (client component) with click-to-edit title,
frequency chip selector, on/off active toggle, and a delete button.
Also extends PatchHabitBody and updateHabit to accept the active field.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add id="actions" to ActionQueueCard wrapper and id="commitments" around
CommitmentsCard so the SummaryBar pills can link directly to the relevant
card on the Today page, matching the existing #alerts anchor pattern.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
staleContacts in getTodaySummary was using HEALTH_ACTIVE_DAYS (14d)
as threshold, but "stale" is defined as > HEALTH_FADING_DAYS (30d).
This made the SummaryBar warn about fading contacts (14-30d) under
the "needs attention" label, which conflates two different health states.
Now the count only surfaces contacts silent for 30+ days, matching
the semantic meaning of "stale" in lib/constants/people. The SummaryBar
link goes to /people?health=stale instead of fading+stale.
Also removes stale comment in people.ts that referenced the wrong path.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cutoff4h and cutoff10m in getFleetSummary were magic numbers duplicating
intent already expressed in lib/constants/control. The 10-minute waiting
window is identical to READY_WINDOW_S (the UI banner window) — keeping
them separate means they can silently drift. Now both point to the same
constant so a change to READY_WINDOW_S automatically keeps the Today bar
pill in sync with the control panel banner.
The 4-hour running stale window is extracted as PROMPT_RUNNING_WINDOW_S
so it has a name, a comment explaining the invariant, and a single place
to adjust if the threshold ever changes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Three changes for a coherent auto-continue experience:
1. Beacon popup: the Pause/Play button now reflects the *effective* paused
state — shows Play whenever isComposing (typing, focused, or recording),
not just when autoContinueEnabled is false. This makes typing/speaking
visually equivalent to pressing Pause, as intended. The button stays
visible and enabled during recording (was opacity-30 disabled) so the
user can always see and control the state. Status bar text updated:
"Focused — paused" when textarea is focused but empty, "Recording —
paused" when mic is active.
2. ReadyBanner (control panel): added a Pause/Play button next to the
countdown timer — the button was previously only in the IntentButtonPanel
below the banner, requiring the user to look away from where the countdown
was displayed. Now it's inline with the timer for immediate access.
3. Threaded onToggleAutoContinue through ProjectBanners → ReadyBanner so
both isReady and isOrchReady banners get the toggle.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The control panel already paused its countdown on input focus (customFocused).
The beacon popup only paused on non-empty text — so clicking the textarea
before typing didn't pause the countdown, leaving a window where a fast
typist could still get auto-fired before their first character registered.
Now inputFocused is included in isComposing, matching the control panel's
behaviour and closing the remaining race.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The fire effect only guarded against mic states (listening/processing)
but not text input — so typing in the custom box didn't stop the
countdown from firing. Replacing the individual mic checks with
isComposing (which already covers both mic and textarea) means the
auto-inject is suppressed whenever the user is mid-sentence, regardless
of input method.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GoalCard hardcoded bg-status-positive/60 regardless of actual progress.
Now uses getProgressTone with the same thresholds as GoalsDueCard and
ProjectGoalsTab — amber below 50%, accent below 80%, green at 80%+.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
"Needs input" metric was only counting isReady (Claude session) but missed
isOrchestrationReady (orchestration run finished). Both states require builder
attention, so both should be reflected in the dashboard metric.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Projects with degraded or critical session health now show as "N degraded"
inline in the "Projects in control" metric note, so the builder can see
health issues at a glance without expanding each card.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces --radius-modal (2rem) and --radius-pill (1.75rem) tokens in
globals.css — both expressed relative to --radius so they scale with
the base. Eliminates the last two rounded-[*] arbitrary values.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Idle tiles already show branch + health. Adding today's commit count gives
the builder a quick glance at which idle projects shipped work today.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The inventory note ("Source: Projects database · N directory-backed...") was
developer diagnostics with no judgment value. Replaced with a fleet-level
signal: total commits shipped today across all projects, shown only when > 0.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ReadyBanner is the high-frequency state (agent finishes a cycle, 12s countdown
before auto-inject). Showing the last 5 commits there lets the builder verify
real progress before the next dispatch, same collapsible pattern as ClosedBanner.
Adds git prop to ReadyBanner; both ReadyBanner calls in ProjectBanners pass it.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surfaces the last 5 git commits (already fetched but unused) in a
collapsible row inside the ClosedBanner — shown at session-close time
when the builder is reviewing what was done before deciding next action.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves RelationshipHealth type, HEALTH_ACTIVE_DAYS/FADING_DAYS, deriveRelationshipHealth,
HEALTH_DOT_COLOR, and HEALTH_LABEL out of lib/utils (a pure-utility module) into a
dedicated lib/constants/people.ts. lib/utils re-exports for backward compat.
Updates all 8 callers to import from the canonical location.
Also adds missing title tooltip attributes to line-clamped running-banner text
in project-card-helpers and project-card-sections.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a collapsible Notes section to ProjectProfile — a free-form textarea
that debounce-saves on change and persists on blur. Schema: new nullable
`notes TEXT` column on user_projects; PATCH route + query updated.
Dot indicator on the collapsed header when notes are non-empty.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds a Focus button (lucide Focus icon) to every ProjectCard header and
ProjectTile footer. Clicking it sets focusedTab state in ControlPanel,
hiding all other projects and showing a slim accent banner "X — focus mode
· Exit focus". Idle tiles in focus mode expand automatically. Helps the
builder review a specific agent's output without visual noise from other
projects.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Show "N running" (accent) and "N waiting" (green) pills in the Today
page summary bar, linking to /control. Uses a fast DB-only query on
project_states (currentPromptStartedAt within 4h = running; readyAt
within 10m = waiting) — no process scanning, safe for server components.
Bridges the personal productivity view with agent fleet awareness.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>