feat(assistant): self-configuring assistant mode (#244)

* test(backend): replace better-sqlite3 test mock with node:sqlite

Reimplement the bun:sqlite test mock on top of node:sqlite with an
explicit BEGIN/COMMIT/ROLLBACK transaction wrapper.

* feat(assistant): self-configuring assistant mode

Add a self-editable assistant workspace and the APIs that support it:
- POST /assistant/reload disposes and re-bootstraps the assistant
  instance (directory-scoped, rate-limited) so agent.md edits apply.
- Internal settings API accepts non-secret TTS/STT patches via
  dedicated partial schemas.
- Strip the generated agent persona from opencode.json on repair so
  user-customized agents are preserved across config recovery.
- Cache the last assistant session id to avoid redundant session
  listing on launch.

* style(repo): align worktree and workspace tabs with primary/orange theme
This commit is contained in:
Chris Scott authored and GitHub committed 2026-05-31 11:38:02 -04:00
1 parent eedbbfb94e
commit dbd6866682
22 files changed
+733 -156

No files matched your search

@@ -181,7 +181,7 @@ export function WorkspaceManager({
const isActive = !!workspace.fullPath && workspace.fullPath === activeWorkspaceDirectory
const label = workspaceLabel(workspace)
const rowClassName = isActive
? 'border-purple-500/50 bg-purple-500/10 text-foreground'
? 'border-primary/50 bg-primary/10 text-foreground'
: 'border-border bg-muted/30 hover:bg-muted/50'
if (!manageMode) {
return (
@@ -197,9 +197,9 @@ export function WorkspaceManager({
className={`flex min-h-11 items-center gap-2 rounded-md border px-3 py-2 text-sm text-left ${rowClassName}`}
aria-pressed={isActive}
>
<GitBranch className="h-3.5 w-3.5 text-purple-400 flex-shrink-0" />
<span className="truncate">{label}</span>
{isActive && <span className="text-xs text-purple-400">Selected</span>}
<GitBranch className="h-3.5 w-3.5 text-primary flex-shrink-0" />
<span className={isActive ? 'truncate text-orange-600 dark:text-orange-400' : 'truncate'}>{label}</span>
{isActive && <span className="text-xs text-orange-600 dark:text-orange-400">Selected</span>}
{workspace.fullPath && (
<span className="ml-auto hidden truncate text-xs text-muted-foreground md:block md:max-w-[45%]">
{workspace.fullPath}
@@ -219,7 +219,7 @@ export function WorkspaceManager({
onCheckedChange={(checked) => toggle(workspaceId, checked === true)}
aria-label={`Select workspace ${label}`}
/>
<GitBranch className="h-3.5 w-3.5 text-purple-400 flex-shrink-0" />
<GitBranch className="h-3.5 w-3.5 text-primary flex-shrink-0" />
<span className="truncate">{label}</span>
{workspace.fullPath && (
<span className="ml-auto hidden truncate text-xs text-muted-foreground md:block md:max-w-[45%]">
+12 -9
View File
@@ -24,30 +24,33 @@ export function WorktreeTabs({
}: WorktreeTabsProps) {
const hasWorkspaces = workspaces.length > 0
const workspaceLabel = value === 'workspaces' && activeWorkspaceLabel ? activeWorkspaceLabel : 'Workspaces'
const tabClassName =
'group min-w-0 flex-1 gap-1.5 px-2 sm:flex-none sm:px-3 data-[state=active]:border data-[state=active]:border-primary/50 data-[state=active]:bg-primary/10 data-[state=inactive]:hover:bg-accent data-[state=inactive]:hover:text-foreground'
const activeLabelClassName = 'group-data-[state=active]:text-orange-600 dark:group-data-[state=active]:text-orange-400'
return (
<div className="px-4 pt-2 flex-shrink-0">
<Tabs value={value} onValueChange={(next) => onValueChange(next as WorktreeTabValue)} className="min-w-0">
<TabsList className="w-full justify-start overflow-hidden">
<TabsTrigger value="repo" className="min-w-0 flex-1 gap-1.5 px-2 sm:flex-none sm:px-3">
<TabsList className="w-full justify-start gap-1 overflow-hidden">
<TabsTrigger value="repo" className={tabClassName}>
<GitBranch className="h-3 w-3 shrink-0" />
<span className="min-w-0 truncate">{baseLabel}</span>
<span className={`min-w-0 truncate ${activeLabelClassName}`}>{baseLabel}</span>
</TabsTrigger>
{hasWorkspaces ? (
<>
<TabsTrigger value="workspaces" className="min-w-0 flex-1 gap-1.5 px-2 sm:flex-none sm:px-3" onClick={onWorkspaceMenu}>
<Layers className="h-3 w-3 shrink-0 text-purple-400" />
<span className="min-w-0 truncate">{workspaceLabel}</span>
<span className="shrink-0 text-xs text-muted-foreground">({workspaces.length})</span>
<TabsTrigger value="workspaces" className={tabClassName} onClick={onWorkspaceMenu}>
<Layers className="h-3 w-3 shrink-0 text-primary" />
<span className={`min-w-0 truncate ${activeLabelClassName}`}>{workspaceLabel}</span>
<span className={`shrink-0 text-xs text-muted-foreground ${activeLabelClassName}`}>({workspaces.length})</span>
</TabsTrigger>
</>
) : (
<button
type="button"
onClick={onCreateWorkspace}
className="inline-flex h-8 min-w-0 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-sm font-medium text-muted-foreground hover:bg-background hover:text-foreground sm:flex-none sm:px-3"
className="inline-flex h-8 min-w-0 flex-1 items-center justify-center gap-1.5 rounded-md px-2 text-sm font-medium text-muted-foreground hover:bg-accent hover:text-foreground sm:flex-none sm:px-3"
>
<Layers className="h-3 w-3 shrink-0 text-purple-400" />
<Layers className="h-3 w-3 shrink-0 text-primary" />
<span className="min-w-0 truncate">Workspace</span>
<Plus className="h-3.5 w-3.5 shrink-0" />
</button>