Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

Issues and pull requests are welcome. Please run `pnpm typecheck` and `pnpm build` before opening a PR.

For web UI changes, follow the [design system and page layout rules](docs/DESIGN.md).

## Database changes

Edit `lib/db/src/schema/*.ts`, then generate a migration:
Expand Down
6 changes: 5 additions & 1 deletion THIRD_PARTY_LICENSES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Every package that ships in the server or the web app bundle, from `pnpm licenses list --prod`. All are
permissive; none is GPL, AGPL, SSPL, BUSL or another license that restricts redistribution.

244 packages: MIT 226, ISC 9, Apache-2.0 4, OFL-1.1 1, (MIT OR EUPL-1.1+) 1, MIT-0 1, BSD-3-Clause 1, Unlicense 1.
248 packages: MIT 229, ISC 9, Apache-2.0 4, OFL-1.1 1, (MIT OR EUPL-1.1+) 1, MIT-0 1, BSD-3-Clause 1, Unlicense 1, 0BSD 1.

| Package | Version | License |
| ------------------------------------------------- | -------------- | ------------------ |
Expand Down Expand Up @@ -77,6 +77,7 @@ permissive; none is GPL, AGPL, SSPL, BUSL or another license that restricts redi
| finalhandler | 2.1.1 | MIT |
| fontkit | 2.0.4 | MIT |
| forwarded | 0.2.0 | MIT |
| framer-motion | 14.14.0 | MIT |
| fresh | 2.0.0 | MIT |
| function-bind | 1.1.2 | MIT |
| get-caller-file | 2.0.5 | ISC |
Expand Down Expand Up @@ -157,6 +158,8 @@ permissive; none is GPL, AGPL, SSPL, BUSL or another license that restricts redi
| micromark-util-types | 2.0.3 | MIT |
| mime-db | 1.54.0 | MIT |
| mime-types | 3.0.2 | MIT |
| motion-dom | 14.14.0 | MIT |
| motion-utils | 14.7.0 | MIT |
| ms | 2.1.3 | MIT |
| negotiator | 1.1.0 | MIT |
| nodemailer | 10.4.0 | MIT-0 |
Expand Down Expand Up @@ -231,6 +234,7 @@ permissive; none is GPL, AGPL, SSPL, BUSL or another license that restricts redi
| toidentifier | 1.0.1 | MIT |
| trim-lines | 3.0.1 | MIT |
| trough | 2.2.0 | MIT |
| tslib | 2.9.1 | 0BSD |
| type-is | 2.1.0 | MIT |
| undici | 7.30.2 | MIT |
| undici-types | 7.24.6 | MIT |
Expand Down
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@tanstack/react-query": "catalog:",
"framer-motion": "^14.14.0",
"lucide-react": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
Expand Down
83 changes: 48 additions & 35 deletions apps/web/src/components/AgentHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useEffect, useRef, useState } from "react";
import { AnimatePresence, m } from "framer-motion";
import { Link, useLocation } from "wouter";
import { useQuery, useQueryClient } from "@tanstack/react-query";
import { Bell, Menu, MessageCircle, MessagesSquare, Phone, Plus } from "lucide-react";
Expand All @@ -9,6 +10,7 @@ import { AgentAvatar } from "./Creature";
import { statusEmoji, usePanel } from "./AgentPanel";
import { NotificationsSheet } from "./NotificationsSheet";
import { cx } from "./ui";
import { reveal } from "./Motion";

export function useNewSideChat() {
const qc = useQueryClient();
Expand Down Expand Up @@ -39,46 +41,57 @@ function ChatsMenu({ title }: { title?: string }) {
onClick={() => setOpen(!open)}
className="flex h-8 shrink-0 items-center gap-2 rounded-full bg-[var(--card)] px-3 text-[13px] hover:bg-[var(--hover)]"
data-testid="open-chats"
aria-expanded={open}
aria-label="Chats"
>
<Menu size={15} /> Chats
</button>
{title && <div className="truncate text-sm text-[var(--muted)]">{title}</div>}
{open && (
<div className="absolute left-0 top-10 w-72 rounded-2xl border border-[var(--line)] bg-[#202020] p-2 shadow-2xl">
<Link
href="/"
onClick={() => setOpen(false)}
className={cx("flex items-center gap-3 rounded-xl px-3 py-2 text-sm hover:bg-[var(--hover)]", loc === "/" && "bg-[var(--hover)]")}
<AnimatePresence>
{open && (
<m.div
key="chats"
{...reveal}
exit={{ opacity: 0, y: 4, pointerEvents: "none" }}
className="glass absolute top-10 left-0 w-72 rounded-card border border-edge p-2 shadow-2xl"
>
<MessageCircle size={16} /> Main chat
</Link>
{side.length > 0 && <div className="px-3 pb-1 pt-3 text-[11px] text-[var(--muted)]">Side chats</div>}
<div className="max-h-64 overflow-y-auto">
{side.map((c) => (
<Link
key={c.id}
href={`/chats/${c.id}`}
onClick={() => setOpen(false)}
className={cx("flex items-center gap-3 rounded-xl px-3 py-2 text-sm hover:bg-[var(--hover)]", loc === `/chats/${c.id}` && "bg-[var(--hover)]")}
>
<MessagesSquare size={15} className="shrink-0" /> <span className="truncate">{c.title}</span>
</Link>
))}
</div>
<div className="mt-2 rounded-xl bg-[var(--card)] p-3 text-center">
<MessagesSquare size={20} className="mx-auto text-[var(--muted)]" />
<div className="mt-1 text-sm font-medium">Start a side chat</div>
<div className="mt-0.5 text-xs text-[var(--muted)]">Keep a bigger project in its own thread. I still remember everything about you.</div>
<button
onClick={() => (setOpen(false), void newSide())}
className="mt-2 inline-flex h-8 items-center gap-1.5 rounded-full bg-[var(--hover)] px-3 text-xs hover:bg-[#363636]"
<Link
href="/"
onClick={() => setOpen(false)}
className={cx("flex items-center gap-3 rounded-xl px-3 py-2 text-sm hover:bg-[var(--hover)]", loc === "/" && "bg-[var(--hover)]")}
>
<Plus size={13} /> New side chat
</button>
</div>
</div>
)}
<MessageCircle size={16} /> Main chat
</Link>
{side.length > 0 && <div className="px-3 pb-1 pt-3 text-[11px] text-[var(--muted)]">Side chats</div>}
<div className="max-h-64 overflow-y-auto">
{side.map((c) => (
<Link
key={c.id}
href={`/chats/${c.id}`}
onClick={() => setOpen(false)}
className={cx(
"flex items-center gap-3 rounded-xl px-3 py-2 text-sm hover:bg-[var(--hover)]",
loc === `/chats/${c.id}` && "bg-[var(--hover)]",
)}
>
<MessagesSquare size={15} className="shrink-0" /> <span className="truncate">{c.title}</span>
</Link>
))}
</div>
<div className="mt-2 rounded-xl bg-[var(--card)] p-3 text-center">
<MessagesSquare size={20} className="mx-auto text-[var(--muted)]" />
<div className="mt-1 text-sm font-medium">Start a side chat</div>
<div className="mt-0.5 text-xs text-[var(--muted)]">Keep a bigger project in its own thread. I still remember everything about you.</div>
<button
onClick={() => (setOpen(false), void newSide())}
className="mt-2 inline-flex h-8 items-center gap-1.5 rounded-full bg-[var(--hover)] px-3 text-xs hover:bg-[#363636]"
>
<Plus size={13} /> New side chat
</button>
</div>
</m.div>
)}
</AnimatePresence>
</div>
);
}
Expand All @@ -92,7 +105,7 @@ export function AgentHeader({ me, title, onCall }: { me: Me; title?: string; onC
const busy = status !== "Idle";
const pill = "flex h-8 items-center gap-1.5 rounded-full bg-[var(--card)] px-3 text-[13px] hover:bg-[var(--hover)]";
return (
<div className="relative flex h-14 shrink-0 items-center gap-2 px-3 md:px-4">
<div className="glass relative z-20 flex h-16 shrink-0 items-center gap-2 border-b border-edge px-4 md:px-6">
<ChatsMenu title={title} />
{!open && (
<button
Expand All @@ -103,7 +116,7 @@ export function AgentHeader({ me, title, onCall }: { me: Me; title?: string; onC
>
<AgentAvatar avatarUrl={me.agent.avatarUrl} size={40} busy={busy} />
<span
className="-mt-1.5 max-w-[220px] truncate rounded-full border border-[var(--line)] bg-[#1f1f1f] px-2 py-px text-[11px]"
className="-mt-1.5 max-w-[min(12rem,35vw)] truncate rounded-full border border-edge bg-panel px-2 py-px text-[11px]"
data-testid="agent-status"
data-busy={busy ? "1" : "0"}
>
Expand Down
51 changes: 25 additions & 26 deletions apps/web/src/components/AgentPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ import { api, del, patch, timeUntil } from "../lib/api";
import { useEvents } from "../lib/events";
import type { Me } from "../lib/types";
import { ApprovalCard } from "./ApprovalCard";
import { AgentAvatar, PRESETS } from "./Creature";
import { AgentAvatar, AvatarPicker } from "./Creature";
import { AnimatePresence, m } from "framer-motion";
import { reveal } from "./Motion";
import { FilesBrowser } from "./FilesBrowser";
import { Button, cx, Empty, Input } from "./ui";

Expand Down Expand Up @@ -61,11 +63,25 @@ function Section({ title, children, defaultOpen = true }: { title: ReactNode; ch
const [open, setOpen] = useState(defaultOpen);
return (
<div className="px-4 pb-2 pt-3">
<button onClick={() => setOpen(!open)} className="flex w-full items-center justify-between py-1 text-[13px] text-[var(--ink)]">
<button aria-expanded={open} onClick={() => setOpen(!open)} className="flex w-full items-center justify-between py-1 text-[13px] text-[var(--ink)]">
<span>{title}</span>
<ChevronDown size={16} className={cx("text-[var(--muted)] transition", !open && "-rotate-90")} />
<m.span initial={false} animate={{ rotate: open ? 0 : -90 }}>
<ChevronDown size={16} className="text-muted" />
</m.span>
</button>
{open && <div className="mt-1">{children}</div>}
<AnimatePresence initial={false}>
{open && (
<m.div
key="details"
initial={{ height: 0, opacity: 0 }}
animate={{ height: "auto", opacity: 1 }}
exit={{ height: 0, opacity: 0 }}
className="overflow-hidden"
>
<div className="pt-1">{children}</div>
</m.div>
)}
</AnimatePresence>
</div>
);
}
Expand Down Expand Up @@ -292,21 +308,7 @@ function IdentityTab({ me, editing, setEditing }: { me: Me; editing: boolean; se
</button>
) : (
<div className="mt-3 space-y-3">
<div className="flex flex-wrap justify-center gap-2">
{PRESETS.map((p) => (
<button
key={p.id}
onClick={() => save({ avatarUrl: `preset:${p.id}` })}
aria-label={p.name}
className={cx(
"rounded-full ring-offset-2 ring-offset-[var(--card)]",
me.agent.avatarUrl === `preset:${p.id}` && "ring-2 ring-[var(--accent)]",
)}
>
<AgentAvatar avatarUrl={`preset:${p.id}`} size={40} />
</button>
))}
</div>
<AvatarPicker value={me.agent.avatarUrl} onChange={(avatarUrl) => save({ avatarUrl })} />
<label className="block text-xs text-[var(--muted)]">
Name
<Input value={name} onChange={(e) => setName(e.target.value)} className="mt-1" data-testid="identity-name-input" />
Expand Down Expand Up @@ -417,10 +419,7 @@ export function AgentPanel({ me, overlay = false }: { me: Me; overlay?: boolean
{ value: "identity", label: "Identity", icon: <UserRound size={16} /> },
];
return (
<aside
className={cx("flex h-full w-[360px] max-w-full shrink-0 flex-col border-l border-[var(--line)] bg-[var(--panel)]", overlay && "shadow-2xl")}
data-testid="agent-panel"
>
<aside className={cx("glass flex h-full w-[min(22.5rem,100vw)] shrink-0 flex-col border-l border-edge", overlay && "shadow-2xl")} data-testid="agent-panel">
<div className="flex justify-end px-3 pt-3">
<button
onClick={() => setOpen(false)}
Expand Down Expand Up @@ -462,19 +461,19 @@ export function AgentPanel({ me, overlay = false }: { me: Me; overlay?: boolean
onClick={() => (setTab(t.value), setTabKey((k) => k + 1))}
className={cx(
"flex flex-1 items-center justify-center rounded-full py-1.5 transition",
tab === t.value ? "bg-[#3a3a3a] text-[var(--ink)]" : "text-[var(--muted)] hover:text-[var(--ink)]",
tab === t.value ? "bg-hover text-highlight" : "text-muted hover:text-ink",
)}
>
{t.icon}
</button>
))}
</div>
</div>
<div className="mt-1 min-h-0 flex-1 overflow-y-auto pb-6">
<m.div key={tab} {...reveal} className="mt-1 min-h-0 flex-1 overflow-y-auto pb-6">
{tab === "activity" && <ActivityTab key={tabKey} />}
{tab === "approvals" && <ApprovalsTab />}
{tab === "identity" && <IdentityTab key={tabKey} me={me} editing={editing} setEditing={setEditing} />}
</div>
</m.div>
</aside>
);
}
Expand Down
Loading
Loading