Your team of AI agents, on your Mac, Windows or Linux. Agents that talk in channels, write code, review each other and use your tools, on the Claude Code, Codex, OpenCode or Pi you already have. Anything that touches the real world waits for your yes.
TypeScript agent-teamagentic-aiai-agentsai-assistantclaude-codecodexcursorelectrongrokgrok-bot-alternativelinuxlocal-firstmacosmcpmulti-agentopenclaw-alternativeopencodewindows
Working pulse on channels; a reply that lands while you're away marks unread (#21)
Gian Moraes0ecaee4e5336
diff --git a/src/core/engines/fake.ts b/src/core/engines/fake.tsindex 20edf25..dd7a76e 100644--- a/src/core/engines/fake.ts+++ b/src/core/engines/fake.ts@@ -77,6 +77,11 @@ export function fakeEngine(id: Engine['id'], opts: { delayMs?: number; reply?: (const texto = /lembr[ae] que (.+)/i.exec(last)![1]!.trim()await callTool(turn.mcpUrl, 'lembrar', { texto, sobre: 'usuario' })reply = 'Anotado.'+ } else if (turn.mcpUrl && /pergunte em (\d+) ?s/i.test(last)) {+ // "pergunte em 3 s": asks after a delay, so a test can leave the thread while it's still working.+ await new Promise((r) => setTimeout(r, Number(/pergunte em (\d+) ?s/i.exec(last)![1]) * 1000))+ await callTool(turn.mcpUrl, 'ask_user', { question: 'Pra quando você precisa disso?' })+ reply = 'Te mandei uma pergunta.'} else if (/pergunt/i.test(last) && turn.mcpUrl) {await callTool(turn.mcpUrl, 'ask_user', { question: 'Pra quando você precisa disso?' })reply = 'Te mandei uma pergunta.'diff --git a/src/renderer/src/components/Sidebar.tsx b/src/renderer/src/components/Sidebar.tsxindex 0d2ae81..a88c348 100644--- a/src/renderer/src/components/Sidebar.tsx+++ b/src/renderer/src/components/Sidebar.tsx@@ -163,7 +163,7 @@ export function Sidebar(): ReactNode {if (!agent) return nullreturn (<div key={c.id} onContextMenu={(e) => open(e, dmMenu(c.id, agent.id, agent.name))}>- <DmItem id={c.id} name={agent.name} color={agent.color} />+ <DmItem id={c.id} name={agent.name} color={agent.color} unread={c.unread} /></div>)})}@@ -208,23 +208,26 @@ export function Sidebar(): ReactNode {function ChannelItem({ id, name, unread }: { id: string; name: string; unread?: number }): ReactNode {const active = useStore((s) => s.view?.kind === 'conversation' && s.view.id === id)+ const working = useStore((s) => s.messages.some((m) => m.conversationId === id && m.run?.status === 'working'))return (<button className={`nav-item ${active ? 'is-active' : ''} ${unread ? 'is-unread' : ''}`} onClick={() => navigate({ kind: 'conversation', id })}><Icon name="hash" /><span className="nav-item__label">{name}</span>+ {working && <span className="pulse" title={L('Trabalhando', 'Working')} />}{unread ? <span className="badge badge--soft">{unread}</span> : null}</button>)}-function DmItem({ id, name, color }: { id: string; name: string; color: Parameters<typeof AgentAvatar>[0]['agent']['color'] }): ReactNode {+function DmItem({ id, name, color, unread }: { id: string; name: string; color: Parameters<typeof AgentAvatar>[0]['agent']['color']; unread?: number }): ReactNode {const active = useStore((s) => s.view?.kind === 'conversation' && s.view.id === id)const working = useStore((s) => s.messages.some((m) => m.conversationId === id && m.run?.status === 'working'))return (- <button className={`nav-item ${active ? 'is-active' : ''}`} onClick={() => navigate({ kind: 'conversation', id })}>+ <button className={`nav-item ${active ? 'is-active' : ''} ${unread ? 'is-unread' : ''}`} onClick={() => navigate({ kind: 'conversation', id })}><AgentAvatar agent={{ name, color }} size={18} busy={working} /><span className="nav-item__label">{name}</span>{working && <span className="pulse" title={L('Trabalhando', 'Working')} />}+ {unread ? <span className="badge badge--soft">{unread}</span> : null}</button>)}@@ -232,14 +235,15 @@ function DmItem({ id, name, color }: { id: string; name: string; color: Parametefunction AgentItem({ id }: { id: string }): ReactNode {const agent = useStore((s) => agentById(s, id))const active = useStore((s) => s.view?.kind === 'agent' && s.view.id === id)- const working = useStore((s) => s.messages.some((m) => m.author.kind === 'agent' && m.author.id === id && m.run?.status === 'working'))+ // The agent list is configuration: working shows on the thread (DM, channel),+ // never here — an agent busy in a channel would glow next to an idle DM.if (!agent) return nullconst pct = agent.limit > 0 ? agent.used / agent.limit : 1return (<button className={`nav-item ${active ? 'is-active' : ''}`} onClick={() => navigate({ kind: 'agent', id })}>- <AgentAvatar agent={agent} size={18} busy={working} />+ <AgentAvatar agent={agent} size={18} /><span className="nav-item__label">{agent.name}</span>- {working ? <span className="pulse" title={L('Trabalhando', 'Working')} /> : <span className="nav-item__meta">{agent.role}</span>}+ <span className="nav-item__meta">{agent.role}</span>{agent.computer && agent.computerKind === 'mac' && (<span className="nav-item__mac" title={L('Roda no seu computador', 'Runs on your computer')}><Icon name="laptop" size={13} />diff --git a/src/renderer/src/store.ts b/src/renderer/src/store.tsindex 5730686..9ad9964 100644--- a/src/renderer/src/store.ts+++ b/src/renderer/src/store.ts@@ -186,8 +186,18 @@ function apply(e: CoreEvent): void {case 'message': {const known = s.messages.some((m) => m.id === e.message.id)const viewing = s.view?.kind === 'conversation' && s.view.id === e.message.conversationId+ const fromAgent = e.message.author.kind === 'agent' || e.message.author.kind === 'routine'+ // A reply that lands while you're elsewhere is new content too: the end of+ // the run, or it stopping for your turn (a question, an approval — the+ // states the core notifies). Counted once: if the badge already counts+ // this conversation, the run's start is already in it.+ const finished =+ known && fromAgent && !viewing && e.message.run !== undefined+ && ['done', 'failed', 'limit_reached', 'waiting_input', 'waiting_approval'].includes(e.message.run.status)+ && s.messages.find((m) => m.id === e.message.id)?.run?.status !== e.message.run.status+ && (s.conversations.find((c) => c.id === e.message.conversationId)?.unread ?? 0) === 0const conversations =- !known && !viewing && (e.message.author.kind === 'agent' || e.message.author.kind === 'routine')+ fromAgent && !viewing && (!known || finished)? s.conversations.map((c) => (c.id === e.message.conversationId ? { ...c, unread: (c.unread ?? 0) + 1 } : c)): s.conversationsreturn { ...s, conversations, messages: upsert(s.messages, e.message) }