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
Add a Tuca model picker (#23)
Andrey Diasb4a889fa9517
diff --git a/src/renderer/src/components/Onboarding.tsx b/src/renderer/src/components/Onboarding.tsxindex 98df960..fe62afa 100644--- a/src/renderer/src/components/Onboarding.tsx+++ b/src/renderer/src/components/Onboarding.tsx@@ -6,7 +6,7 @@// the person lands in a channel watching it work. Then "Primeiros passos" in the sidebar// walks through the rest, checking itself off as each feature gets used.import { L, lang } from '../../../shared/lang'-import { createContext, useCallback, useContext, useEffect, useState, type ReactNode } from 'react'+import { createContext, useCallback, useContext, useEffect, useRef, useState, type ReactNode } from 'react'import {ENGINES,MODELS,@@ -210,8 +210,10 @@ export function Onboarding({ build = false, from }: { build?: boolean; from?: Vi}const close = (): void => (build ? leave() : updateSettings({ onboarding: { done: true } }))+ // On the builder screen the Tuca starts on his own model; in the introduction he waits+ // for the person to pick one (MeetTuca).useEffect(() => {- if (step !== 'agent' || tucaConv.id || tucaConv.error) return+ if (!build || step !== 'agent' || tucaConv.id || tucaConv.error) returnensureTuca(agent.modelId, true).then((r) => setTucaConv({ id: r.conversationId })).catch((e: unknown) => setTucaConv({ error: e instanceof Error ? e.message : String(e) }))@@ -686,14 +688,56 @@ function You({ name, context, setContext, onBack, onNext }: { name: string; cont// ---------- 4. the agent ----------// The first agent, made with the Tuca: he asks, proposes a card, "Usar esse agente" fills it in.+// His model is the person's choice: in the introduction nothing is picked for them, and+// he only starts once they pick; on the builder screen it's the one picked before.+// Changing it starts a new session with him on that model.function MeetTuca({ conv: session, onUse, onManual, onBack }: { conv: { id?: string; error?: string }; onUse: (d: AgentDraft, messageId: string) => void; onManual: () => void; onBack?: () => void }): ReactNode {const build = useContext(BuildMode)- const conv = session.id- const error = session.error ?? ''+ const [conv, setConv] = useState(session.id)const tuca = useStore((s) => s.agents.find((a) => a.kind === 'tuca'))+ const [model, setModel] = useState(build ? (tuca?.modelId ?? '') : '')+ const [applying, setApplying] = useState(false)+ const [modelError, setModelError] = useState('')+ const typed = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)+ useEffect(() => setConv(session.id), [session.id])+ useEffect(() => {+ if (build && !model && tuca?.modelId) setModel(tuca.modelId)+ }, [build, model, tuca?.modelId])+ useEffect(() => () => clearTimeout(typed.current), [])+ const error = session.error ?? ''const messages = useStore((s) => (conv ? s.messages.filter((m) => m.conversationId === conv) : []))const latest = [...messages].reverse().find((m) => m.run?.agentDraft && !m.run.agentDraft.state)?.run?.agentDraft+ async function start(value: string): Promise<void> {+ if (conv && value === tuca?.modelId) return+ setApplying(true)+ setModelError('')+ try {+ // He's made with the chosen model; once he exists, it's saved on him and a new session starts.+ if (tuca) {+ const channels = getState().conversations.filter((c) => c.kind === 'channel' && c.members.includes(tuca.id)).map((c) => c.id)+ await saveAgent({ ...tuca, modelId: value }, channels)+ }+ setConv((await ensureTuca(value, true)).conversationId)+ } catch (e) {+ setModelError(e instanceof Error ? e.message : String(e))+ } finally {+ setApplying(false)+ }+ }++ // A model from the list starts him right away; a name being typed waits for a pause.+ // A harness alone (no model yet) waits for the model.+ function pick(value: string): void {+ setModel(value)+ setModelError('')+ clearTimeout(typed.current)+ const m = modelInfo(value)+ if (!m?.id) return+ if (MODELS.some((x) => x.id === value)) return void start(value)+ typed.current = setTimeout(() => void start(value), 900)+ }+return (<div className="onb__split"><section className="onb__main">@@ -704,6 +748,18 @@ function MeetTuca({ conv: session, onUse, onManual, onBack }: { conv: { id?: str? L('Ele faz duas ou três perguntas e propõe um agente. Nada é criado sem você.', 'It asks two or three questions and proposes an agent. Nothing is created without you.'): L('O Tuca monta os agentes do seu time. Ele faz duas ou três perguntas e propõe um; nada é criado sem você. Depois ele fica na barra lateral pra montar os próximos.', 'Tuca builds your team’s agents. It asks two or three questions and proposes one; nothing is created without you. Then it stays in the sidebar to build the next ones.')}</p>+ <div className="onb__field onb__field--tuca-model">+ <span>{L('Modelo do Tuca', 'Tuca’s model')}</span>+ <ModelPicker value={model} onChange={pick} />+ <span className="hint">+ {applying+ ? L('Chamando o Tuca com esse modelo…', 'Calling Tuca with this model…')+ : conv+ ? L('Trocar o modelo começa uma conversa nova com ele.', 'Changing the model starts a new conversation with him.')+ : L('Escolha com qual modelo o Tuca conversa com você e monta os agentes.', 'Pick the model Tuca uses to talk with you and build the agents.')}+ </span>+ {modelError && <p className="hint hint--warn">{modelError}</p>}+ </div><div className="onb-tuca">{conv && tuca ? (<UseDraft.Provider value={onUse}>@@ -711,7 +767,7 @@ function MeetTuca({ conv: session, onUse, onManual, onBack }: { conv: { id?: str<Composer conversationId={conv} members={[tuca]} placeholder={L('Ex.: quero alguém pra triar os tickets de suporte toda manhã', 'E.g. I want someone to triage the support tickets every morning')} /></UseDraft.Provider>) : (- <p className="muted onb-tuca__wait">{error || L('Chamando o Tuca…', 'Calling Tuca…')}</p>+ <p className="muted onb-tuca__wait">{error || (applying || build ? L('Chamando o Tuca…', 'Calling Tuca…') : L('Escolha o modelo do Tuca acima pra começar.', 'Pick Tuca’s model above to start.'))}</p>)}</div><div className="onb__nav">diff --git a/src/renderer/src/styles.css b/src/renderer/src/styles.cssindex cb54395..bbd63ac 100644--- a/src/renderer/src/styles.css+++ b/src/renderer/src/styles.css@@ -2795,6 +2795,9 @@ table.csv th {top: 12px;padding-top: 36px;}+.onb__field--tuca-model {+ margin-bottom: 14px;+}/* the language, first thing on the first step */.lang-picker {align-self: flex-start;