Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(society): the creator lists only connected seats - subscriptions first, login, model, effort
rubenluetke10-beep9a9a7bb9b029
diff --git a/docs/agent-society/agent-definition.md b/docs/agent-society/agent-definition.mdindex 5e1a64ab06..812adc1d0b 100644--- a/docs/agent-society/agent-definition.md+++ b/docs/agent-society/agent-definition.md@@ -68,6 +68,14 @@ card; nothing hidden drives behavior.runner it resolves to on this box (`subscription: true|false`) and the accounts stored forits CLI; models, efforts and permission ladders come from`GET /api/agent-chat/catalog?surface=society`.+- **The creator lists only connected seats** (maintainer, 2026-09-02, after Grok Bot's "New+ Bot" sheet): the catalog joined with the Agents tab's credential truth (the same+ `joinProviderOptions` join the chat's composer uses), grouped subscription → API key → local,+ with a login picker only when a CLI has more than one signed-in account, the model and the+ effort. A provider that is not connected is not shown; one sentence says where to connect it.+ Name, title, description, "Runs on" and a visible **Focus** chip row are the whole sheet —+ ceiling, tool-access mode and budget sit under "More". Everything else the agent is told in+ its own chat afterwards (`components/society/create/CreateAgentDialog.tsx`, `brainPicker.ts`).- Reference check (2026-09-02): Hermes Agent switches with `hermes model` / `/model provider:name`and offers Codex/ChatGPT device-code OAuth, xAI SuperGrok OAuth and Claude OAuth (Max only);OpenClaw selects `agents.entries.*.model` as `provider/model`, reuses `claude -p` for thediff --git a/jarvis/ui/web/frontend/src/components/society/create/CreateAgentDialog.tsx b/jarvis/ui/web/frontend/src/components/society/create/CreateAgentDialog.tsxindex a0b87fc2d5..af1c5207b7 100644--- a/jarvis/ui/web/frontend/src/components/society/create/CreateAgentDialog.tsx+++ b/jarvis/ui/web/frontend/src/components/society/create/CreateAgentDialog.tsx@@ -1,8 +1,19 @@/**- * Create an agent: three fields and an Advanced disclosure on the left, the+ * Create an agent: the left column is what a person actually decides, the* character on the right — live, turnable, from above and below — with the* look editor under it (MASTERPLAN §4.2, agent-definition §6: no wizard).*+ * Left, top to bottom (maintainer, 2026-09-02, modelled on Grok Bot's "New+ * Bot" sheet): name, title, description; "Runs on" — ONLY the seats that are+ * connected on this machine, subscriptions first (a CLI on a plan bills the+ * plan, not per token), then saved API keys, then local models, with the+ * login to use when a CLI has more than one, the model and the effort; a+ * visible "Focus" chip row (what the agent reaches for first — everything+ * Jarvis has connected stays available); and a "More" disclosure for the+ * permission ceiling, the tool-access mode and the daily budget. A provider+ * that is not connected is not listed: one sentence says where to connect it.+ * Everything else the agent is told in its own chat afterwards.+ ** Everything a person changes is visible in the preview the same frame: a* preset, a colour, the build, the height. What is not built yet is shown* disabled with the reason (the small/large builds), never hidden.@@ -16,14 +27,33 @@ import * as Dialog from "@radix-ui/react-dialog";import { useQuery } from "@tanstack/react-query";import { ChevronDown, Shuffle, Upload, X } from "lucide-react";+import { effortLabel } from "@/components/agentchat/AgentComposer";+import { AgentMark } from "@/components/agentic/AgentMark";+import { ProviderLogo } from "@/components/providers/ProviderLogo";import { Button } from "@/components/ui/button";-import { Combobox } from "@/components/ui/combobox";+import { Combobox, type ComboboxGroup } from "@/components/ui/combobox";import { ScrollArea } from "@/components/ui/scroll-area";import { useT } from "@/i18n";-import { fetchAgentChatCatalog, type AgentChatProvider } from "@/lib/agentChatApi";+import {+ fetchAgentChatCatalog,+ fetchAgentConnections,+ type AgentConnectionRow,+} from "@/lib/agentChatApi";+import { fetchSocietyProviders, type SocietyProviderRow } from "@/lib/societyApi";import { cn } from "@/lib/utils";+import { joinProviderOptions } from "@/store/agentChat";import { CapabilityChip } from "../CapabilityChip";+import {+ accountChoice,+ accountHint,+ brainSeats,+ defaultSeat,+ effortsFor,+ modelsFor,+ type BrainKind,+ type BrainSeat,+} from "./brainPicker";import {useCreateAgent,useSocietyCapabilities,@@ -64,11 +94,12 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialoconst [style, setStyle] = useState<string>("modern");const [providerId, setProviderId] = useState("");const [model, setModel] = useState("");+ const [effort, setEffort] = useState("");+ const [accountId, setAccountId] = useState("");const [ceiling, setCeiling] = useState<PermissionCeiling>("monitor");const [grantMode, setGrantMode] = useState<GrantMode>("all");const [budget, setBudget] = useState("2");const [focus, setFocus] = useState<string[]>([]);- const [grants, setGrants] = useState<string[]>([]);const [toolQuery, setToolQuery] = useState("");const fileInput = useRef<HTMLInputElement>(null);const [importing, setImporting] = useState(false);@@ -79,23 +110,61 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialoconst [submitting, setSubmitting] = useState(false);const [error, setError] = useState<string | null>(null);- // The same catalog the typed chat offers — API families, CLI seats, local- // models — filtered by the society surface on the backend.+ // The seats: the same catalog the typed chat offers — API families, CLI+ // seats, local models, filtered by the society surface on the backend —+ // joined with the Agents tab's credential truth exactly as the chat's+ // composer joins it, plus the subscription logins stored per CLI.const catalog = useQuery({queryKey: ["agent-chat", "catalog", "society"],queryFn: () => fetchAgentChatCatalog("society"),enabled: open,staleTime: 60_000,});- const providers: AgentChatProvider[] = catalog.data?.providers ?? [];- const provider = providers.find((p) => p.id === providerId) ?? providers[0] ?? null;+ const connections = useQuery({+ queryKey: ["agent-chat", "connections"],+ queryFn: () => fetchAgentConnections().catch(() => [] as AgentConnectionRow[]),+ enabled: open,+ staleTime: 60_000,+ });+ const societyProviders = useQuery({+ queryKey: ["society", "providers"],+ queryFn: () => fetchSocietyProviders().catch(() => [] as SocietyProviderRow[]),+ enabled: open,+ staleTime: 60_000,+ });+ const seatsLoading = catalog.isLoading || connections.isLoading || societyProviders.isLoading;+ const seats = useMemo<BrainSeat[]>(() => {+ const providers = catalog.data?.providers ?? [];+ if (!providers.length) return [];+ return brainSeats(+ joinProviderOptions(providers, connections.data ?? []),+ societyProviders.data ?? [],+ );+ }, [catalog.data, connections.data, societyProviders.data]);+ const seat = seats.find((s) => s.provider.id === providerId) ?? null;+ const accounts = accountChoice(seat);+ const efforts = effortsFor(seat, model);++ const pickSeat = (next: BrainSeat | null) => {+ setProviderId(next?.provider.id ?? "");+ setModel(next ? next.provider.default_model || modelsFor(next)[0]?.id || "" : "");+ setEffort(next?.provider.default_effort ?? "");+ setAccountId("");+ };+ // A fresh dialog starts on the brain marked active, else the first seat —+ // never on a row that is not connected, because none is listed.useEffect(() => {- if (!providerId && provider) {- setProviderId(provider.id);- setModel(provider.default_model || provider.curated_models[0]?.id || "");- }- }, [provider, providerId]);+ if (!providerId && seats.length) pickSeat(defaultSeat(seats));+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [seats, providerId]);++ // A model change can leave the picked effort off that model's ladder.+ useEffect(() => {+ if (efforts.length && !efforts.includes(effort)) setEffort(seat?.provider.default_effort ?? efforts[0]);+ if (!efforts.length && effort) setEffort("");+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, [efforts.join("|")]);useEffect(() => {if (!open) return;@@ -103,8 +172,12 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialosetTitle("");setDescription("");setRecipe(defaultRecipe("ranger"));+ setProviderId("");+ setModel("");+ setEffort("");+ setAccountId("");+ setGrantMode("all");setFocus([]);- setGrants([]);setToolQuery("");setImportProblems(null);setImportedName(null);@@ -171,11 +244,14 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialodescription,figure: recipe,palette: { primary: palette.primary, secondary: palette.secondary, accent: palette.accent },- provider: provider?.id ?? "",- providerLabel: provider?.label ?? t("society.create.provider_unknown"),+ provider: seat?.provider.id ?? "",+ providerLabel: seat?.provider.label ?? t("society.create.provider_unknown"),model,+ effort,+ accountId,grantMode,- toolGrants: grants,+ // "Only the highlighted tools": the focus list IS the allow-list.+ toolGrants: grantMode === "allowlist" ? focus : [],focus,permissionCeiling: ceiling,dailyBudgetUsd: Math.max(0, Number.parseFloat(budget) || 0),@@ -267,6 +343,141 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialo<p className="mt-1 text-[11px] text-muted-foreground">{t("society.create.description_hint")}</p></div>+ {/* ---- Runs on: only what is connected on this machine ---- */}+ <div data-testid="society-create-brain">+ <span className={labelClass}>{t("society.create.brain")}</span>+ {seatsLoading && seats.length === 0 ? (+ <p className="text-xs text-muted-foreground">{t("society.create.catalog_loading")}</p>+ ) : seats.length === 0 ? (+ <p+ data-testid="society-create-nothing-connected"+ className="rounded-md border border-dashed border-border px-3 py-2 text-xs leading-relaxed text-muted-foreground"+ >+ {t("society.create.nothing_connected")}+ </p>+ ) : (+ <div className="flex flex-col gap-2">+ <Combobox+ value={seat?.provider.id ?? ""}+ groups={seatGroups(seats, t)}+ onChange={(id) => pickSeat(seats.find((s) => s.provider.id === id) ?? null)}+ ariaLabel={t("society.create.brain")}+ />+ {accounts.length > 0 ? (+ <div>+ <span className={labelClass}>{t("society.create.account")}</span>+ <Combobox+ value={accountId}+ groups={[+ {+ id: "accounts",+ options: [+ { value: "", label: t("society.create.account_active") },+ ...accounts.map((a) => ({+ value: a.id,+ label: a.label,+ hint: accountHint(a),+ })),+ ],+ },+ ]}+ onChange={setAccountId}+ ariaLabel={t("society.create.account")}+ />+ </div>+ ) : null}+ <div className="grid grid-cols-[minmax(0,1fr)_auto] gap-2">+ <div className="min-w-0">+ <label htmlFor="society-create-model" className={labelClass}>+ {t("society.create.model")}+ </label>+ {modelsFor(seat).length > 0 ? (+ <Combobox+ id="society-create-model"+ value={model}+ groups={[+ {+ id: "models",+ options: modelsFor(seat).map((m) => ({+ value: m.id,+ label: m.label,+ hint: m.note,+ })),+ },+ ]}+ onChange={setModel}+ ariaLabel={t("society.create.model")}+ />+ ) : (+ <input+ id="society-create-model"+ className={cn(fieldClass, "font-mono")}+ value={model}+ onChange={(e) => setModel(e.target.value)}+ placeholder={t("society.create.model_placeholder")}+ autoComplete="off"+ />+ )}+ </div>+ {efforts.length > 0 ? (+ <div>+ <span className={labelClass}>{t("society.create.effort")}</span>+ <Combobox+ value={effort}+ groups={[+ {+ id: "efforts",+ options: efforts.map((lvl) => ({ value: lvl, label: effortLabel(lvl, t) })),+ },+ ]}+ onChange={setEffort}+ ariaLabel={t("society.create.effort")}+ />+ </div>+ ) : null}+ </div>+ </div>+ )}+ <p className="mt-1 text-[11px] text-muted-foreground">{t("society.create.brain_hint")}</p>+ </div>++ {/* ---- Focus: what the agent reaches for first ---- */}+ <div data-testid="society-create-focus">+ <span className={labelClass}>{t("society.create.focus_title")}</span>+ <p className="mb-2 text-[11px] text-muted-foreground">+ {grantMode === "allowlist" ? t("society.create.allowlist_hint") : t("society.create.focus_hint")}+ </p>+ <input+ type="search"+ value={toolQuery}+ onChange={(e) => setToolQuery(e.target.value)}+ placeholder={t("society.create.tools_search")}+ aria-label={t("society.create.tools_search")}+ className={cn(fieldClass, "mb-2")}+ />+ {capabilities.isLoading ? (+ <p className="text-xs text-muted-foreground">{t("society.create.tools_loading")}</p>+ ) : capabilities.isError || (capabilities.data ?? []).length === 0 ? (+ <p className="text-xs text-muted-foreground">{t("society.create.tools_unavailable")}</p>+ ) : (+ <div className="flex max-h-40 flex-wrap gap-1.5 overflow-y-auto">+ {filterCapabilities(capabilities.data ?? [], toolQuery).map((cap) => {+ const on = focus.includes(cap.id);+ return (+ <CapabilityChip+ key={cap.id}+ id={cap.id}+ capability={cap}+ selected={on}+ disconnectedHint={t("society.card.not_connected")}+ onClick={() => setFocus(on ? focus.filter((x) => x !== cap.id) : [...focus, cap.id])}+ />+ );+ })}+ </div>+ )}+ </div>+<Collapsible.Root open={advanced} onOpenChange={setAdvanced}><Collapsible.Trigger asChild><button@@ -281,62 +492,6 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialo</button></Collapsible.Trigger><Collapsible.Content className="flex flex-col gap-4 pt-4">- <div>- <span className={labelClass}>{t("society.create.provider")}</span>- {providers.length > 0 ? (- <Combobox- value={provider?.id ?? ""}- groups={[- {- id: "providers",- options: providers.map((p) => ({ value: p.id, label: p.label })),- },- ]}- onChange={(id) => {- setProviderId(id);- const next = providers.find((p) => p.id === id);- setModel(next?.default_model || next?.curated_models[0]?.id || "");- }}- ariaLabel={t("society.create.provider")}- />- ) : (- <p className="text-xs text-muted-foreground">- {catalog.isLoading ? t("society.create.catalog_loading") : t("society.create.provider_unknown")}- </p>- )}- </div>- <div>- <label htmlFor="society-create-model" className={labelClass}>- {t("society.create.model")}- </label>- {provider && provider.curated_models.length > 0 ? (- <Combobox- id="society-create-model"- value={model}- groups={[- {- id: "models",- options: provider.curated_models.map((m) => ({- value: m.id,- label: m.label,- hint: m.note,- })),- },- ]}- onChange={setModel}- ariaLabel={t("society.create.model")}- />- ) : (- <input- id="society-create-model"- className={cn(fieldClass, "font-mono")}- value={model}- onChange={(e) => setModel(e.target.value)}- placeholder={t("society.create.model_placeholder")}- autoComplete="off"- />- )}- </div><div><span className={labelClass}>{t("society.create.ceiling")}</span><Segmented@@ -352,43 +507,7 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialooptions={GRANTS.map((g) => ({ value: g, label: t(`society.grant.${g}`) }))}onChange={(v) => setGrantMode(v as GrantMode)}/>- </div>- <div>- <span className={labelClass}>{t("society.create.tools_title")}</span>- <p className="mb-2 text-[11px] text-muted-foreground">- {grantMode === "allowlist" ? t("society.create.allowlist_hint") : t("society.create.focus_hint")}- </p>- <input- type="search"- value={toolQuery}- onChange={(e) => setToolQuery(e.target.value)}- placeholder={t("society.create.tools_search")}- aria-label={t("society.create.tools_search")}- className={cn(fieldClass, "mb-2")}- />- {capabilities.isLoading ? (- <p className="text-xs text-muted-foreground">{t("society.create.tools_loading")}</p>- ) : capabilities.isError || (capabilities.data ?? []).length === 0 ? (- <p className="text-xs text-muted-foreground">{t("society.create.tools_unavailable")}</p>- ) : (- <div className="flex max-h-48 flex-wrap gap-1.5 overflow-y-auto">- {filterCapabilities(capabilities.data ?? [], toolQuery).map((cap) => {- const list = grantMode === "allowlist" ? grants : focus;- const setList = grantMode === "allowlist" ? setGrants : setFocus;- const on = list.includes(cap.id);- return (- <CapabilityChip- key={cap.id}- id={cap.id}- capability={cap}- selected={on}- disconnectedHint={t("society.card.not_connected")}- onClick={() => setList(on ? list.filter((x) => x !== cap.id) : [...list, cap.id])}- />- );- })}- </div>- )}+ <p className="mt-1 text-[11px] text-muted-foreground">{t("society.create.grant_mode_hint")}</p></div><div><label htmlFor="society-create-budget" className={labelClass}>@@ -610,6 +729,46 @@ export function CreateAgentDialog({ open, onClose, onCreated }: CreateAgentDialo);}+const KIND_KEYS: Record<BrainKind, string> = {+ subscription: "society.create.kind_subscription",+ api: "society.create.kind_api",+ local: "society.create.kind_local",+};++/**+ * The "Runs on" list: one group per kind, subscriptions first. A row wears+ * its real mark (the IDE's for a CLI seat, the provider family's for an API+ * row) and says what it bills — the one signed-in login's e-mail on a+ * subscription, else the kind.+ */+function seatGroups(seats: BrainSeat[], t: (key: string) => string): ComboboxGroup[] {+ const groups: ComboboxGroup[] = [];+ for (const kind of ["subscription", "api", "local"] as const) {+ const rows = seats.filter((s) => s.kind === kind);+ if (!rows.length) continue;+ groups.push({+ id: kind,+ label: t(KIND_KEYS[kind]),+ options: rows.map((s) => {+ const p = s.provider;+ const only = s.accounts.length === 1 ? accountHint(s.accounts[0]) : "";+ return {+ value: p.id,+ label: p.label,+ hint: only || t(KIND_KEYS[kind]),+ searchText: `${p.family} ${p.runner} ${s.accounts.map((a) => a.email ?? "").join(" ")}`,+ icon: p.agentMark ? (+ <AgentMark agent={p.agentMark} label={p.label} logoUrl={p.logoUrl} variant="plain" size="sm" />+ ) : (+ <ProviderLogo providerId={p.id} label={p.label} size="sm" />+ ),+ };+ }),+ });+ }+ return groups;+}+/** Connected first, then by label; a query narrows by label, id and one-liner. */function filterCapabilities(rows: Capability[], query: string): Capability[] {const q = query.trim().toLowerCase();diff --git a/jarvis/ui/web/frontend/src/components/society/create/brainPicker.test.ts b/jarvis/ui/web/frontend/src/components/society/create/brainPicker.test.tsnew file mode 100644index 0000000000..3b4db9f2d1--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/create/brainPicker.test.ts@@ -0,0 +1,126 @@+import { describe, expect, it } from "vitest";++import type { SocietyAccount, SocietyProviderRow } from "@/lib/societyApi";+import type { ProviderOption } from "@/store/agentChat";++import { accountChoice, brainSeats, defaultSeat, effortsFor } from "./brainPicker";++function option(over: Partial<ProviderOption>): ProviderOption {+ return {+ id: "openai",+ label: "OpenAI",+ family: "openai",+ runner: "brain",+ models_source: "live",+ curated_models: [],+ default_model: "",+ keyless: false,+ native_resume: false,+ effort_levels: [],+ default_effort: "",+ permission_modes: [],+ default_permission_mode: "",+ cli_installed: null,+ connected: true,+ active: false,+ ...over,+ };+}++function account(id: string, connected = true, email: string | null = null): SocietyAccount {+ return { id, label: id, connected, mode: "subscription", message: "", email, tier: null, warning: null };+}++function societyRow(over: Partial<SocietyProviderRow>): SocietyProviderRow {+ return {+ id: "openai",+ label: "OpenAI",+ family: "openai",+ runner: "brain",+ subscription: false,+ keyless: false,+ platform: null,+ accounts: [],+ ...over,+ };+}++describe("brainSeats", () => {+ it("lists only connected rows, subscriptions first, then keys, then local", () => {+ const seats = brainSeats(+ [+ option({ id: "ollama", label: "Ollama", runner: "api", keyless: true }),+ option({ id: "gemini", label: "Google Gemini", connected: false }),+ option({ id: "openai", label: "OpenAI" }),+ option({ id: "claude-api", label: "Anthropic Claude", runner: "claude-cli", cli_installed: true }),+ ],+ [+ societyRow({ id: "claude-api", runner: "claude-cli", subscription: true, platform: "claude" }),+ societyRow({ id: "ollama", runner: "brain", keyless: true }),+ ],+ );+ expect(seats.map((s) => `${s.kind}:${s.provider.id}`)).toEqual([+ "subscription:claude-api",+ "api:openai",+ "local:ollama",+ ]);+ });++ it("decides the kind from the runner when the society route is missing", () => {+ const seats = brainSeats(+ [option({ id: "openai-codex", label: "Codex", runner: "codex-cli", cli_installed: true })],+ [],+ );+ expect(seats[0].kind).toBe("subscription");+ });++ it("keeps only signed-in logins and offers a choice only when there are two", () => {+ const rows = [+ societyRow({+ id: "claude-api",+ subscription: true,+ platform: "claude",+ accounts: [account("a", true, "[email protected]"), account("b", false), account("c", true)],+ }),+ ];+ const [seat] = brainSeats([option({ id: "claude-api", runner: "claude-cli", cli_installed: true })], rows);+ expect(seat.accounts.map((a) => a.id)).toEqual(["a", "c"]);+ expect(accountChoice(seat).length).toBe(2);+ const [single] = brainSeats(+ [option({ id: "claude-api", runner: "claude-cli", cli_installed: true })],+ [{ ...rows[0], accounts: [account("a")] }],+ );+ expect(accountChoice(single)).toEqual([]);+ });++ it("starts on the active brain, else the first seat", () => {+ const seats = brainSeats(+ [option({ id: "openai" }), option({ id: "grok", label: "xAI Grok", active: true })],+ [],+ );+ expect(defaultSeat(seats)?.provider.id).toBe("grok");+ expect(defaultSeat(brainSeats([option({ id: "openai" })], []))?.provider.id).toBe("openai");+ expect(defaultSeat([])).toBeNull();+ });++ it("narrows the effort ladder to the picked model's own", () => {+ const [seat] = brainSeats(+ [+ option({+ id: "agy",+ runner: "agy-cli",+ cli_installed: true,+ effort_levels: ["low", "medium", "high"],+ curated_models: [+ { id: "pro", label: "Pro", efforts: ["low", "high"] },+ { id: "flash", label: "Flash" },+ ],+ }),+ ],+ [],+ );+ expect(effortsFor(seat, "pro")).toEqual(["low", "high"]);+ expect(effortsFor(seat, "flash")).toEqual(["low", "medium", "high"]);+ expect(effortsFor(null, "pro")).toEqual([]);+ });+});diff --git a/jarvis/ui/web/frontend/src/components/society/create/brainPicker.ts b/jarvis/ui/web/frontend/src/components/society/create/brainPicker.tsnew file mode 100644index 0000000000..8d3c0c7354--- /dev/null+++ b/jarvis/ui/web/frontend/src/components/society/create/brainPicker.ts@@ -0,0 +1,85 @@+/**+ * What the creator's "Runs on" picker lists: the seats an agent can sit on+ * RIGHT NOW on this machine, and nothing else (maintainer, 2026-09-02: a+ * provider that is not connected is not shown, one sentence says where to+ * connect it).+ *+ * A seat is one catalog row joined with the Agents tab's credential truth+ * (`joinProviderOptions`, the same join the chat's composer uses) plus, for a+ * vendor CLI on a plan, the subscription logins stored for it+ * (GET /api/society/providers). Three kinds, listed in this order:+ *+ * subscription — a vendor CLI signed in on a plan (Claude Max, ChatGPT,+ * SuperGrok, Google): billed to the plan, not per token;+ * api — a provider's own endpoint behind a saved key;+ * local — a model on this machine (Ollama, a local server).+ *+ * Pure: no fetch, no store, so it is unit-tested with plain rows.+ */+import { isApiRunner, type CuratedModel } from "@/lib/agentChatApi";+import type { SocietyAccount, SocietyProviderRow } from "@/lib/societyApi";+import type { ProviderOption } from "@/store/agentChat";++export type BrainKind = "subscription" | "api" | "local";++export interface BrainSeat {+ provider: ProviderOption;+ kind: BrainKind;+ /** Signed-in logins of that CLI; empty on an API or local seat. */+ accounts: SocietyAccount[];+}++const KIND_ORDER: Record<BrainKind, number> = { subscription: 0, api: 1, local: 2 };++function kindOf(option: ProviderOption, row: SocietyProviderRow | undefined): BrainKind {+ if (row ? row.subscription : !isApiRunner(option.runner)) return "subscription";+ return option.keyless ? "local" : "api";+}++/** The connected seats, subscriptions first, each kind sorted by label. */+export function brainSeats(+ options: ProviderOption[],+ society: SocietyProviderRow[],+): BrainSeat[] {+ const byId = new Map(society.map((r) => [r.id, r]));+ return options+ .filter((o) => o.connected)+ .map((provider) => {+ const row = byId.get(provider.id);+ const kind = kindOf(provider, row);+ const accounts = kind === "subscription" ? (row?.accounts ?? []).filter((a) => a.connected) : [];+ return { provider, kind, accounts };+ })+ .sort(+ (a, b) =>+ KIND_ORDER[a.kind] - KIND_ORDER[b.kind] || a.provider.label.localeCompare(b.provider.label),+ );+}++/** The seat a fresh agent starts on: the brain marked active, else the first listed. */+export function defaultSeat(seats: BrainSeat[]): BrainSeat | null {+ return seats.find((s) => s.provider.active) ?? seats[0] ?? null;+}++/** The models this seat offers; empty means "type one" (a live list not yet fetched). */+export function modelsFor(seat: BrainSeat | null): CuratedModel[] {+ return seat?.provider.curated_models ?? [];+}++/** The seat's effort ladder, narrowed to the picked model's own when it has one. */+export function effortsFor(seat: BrainSeat | null, modelId: string): string[] {+ if (!seat) return [];+ const model = seat.provider.curated_models.find((m) => m.id === modelId);+ if (model && Array.isArray(model.efforts)) return model.efforts;+ return seat.provider.effort_levels ?? [];+}++/** One signed-in login: the picker is shown only when there is a choice. */+export function accountChoice(seat: BrainSeat | null): SocietyAccount[] {+ return seat && seat.accounts.length > 1 ? seat.accounts : [];+}++/** The line under an account's label: its e-mail, else the plan, else nothing. */+export function accountHint(account: SocietyAccount): string {+ return account.email || account.tier || "";+}diff --git a/jarvis/ui/web/frontend/src/components/society/data.ts b/jarvis/ui/web/frontend/src/components/society/data.tsindex 0e8ee99d76..7f4d507974 100644--- a/jarvis/ui/web/frontend/src/components/society/data.ts+++ b/jarvis/ui/web/frontend/src/components/society/data.ts@@ -116,6 +116,10 @@ export interface NewAgentInput {provider: string;providerLabel: string;model: string;+ /** "" = the provider's default effort. */+ effort: string;+ /** The stored subscription login of a CLI seat; "" = that platform's active account. */+ accountId: string;grantMode: GrantMode;toolGrants: string[];focus: string[];@@ -310,6 +314,8 @@ export function useCreateAgent() {tier: "specialist",provider: input.provider || undefined,model: input.model || undefined,+ effort: input.effort || undefined,+ account_id: input.accountId || undefined,avatar: input.figure,grant_mode: input.grantMode,grants: input.grantMode === "allowlist" ? input.toolGrants : undefined,@@ -346,7 +352,7 @@ export function useCreateAgent() {provider: input.provider,providerLabel: input.providerLabel,model: input.model,- effort: "",+ effort: input.effort,figure: input.figure,palette: input.palette,grantMode: input.grantMode,diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 6a2c7d84e4..bcf341e0c1 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -5262,13 +5262,24 @@"subtitle": "Name, Aufgabe und Regelwerk — die Figur rechts ist, wie das Team ihn sehen wird.","name": "Name","name_placeholder": "Späher",- "title_field": "Titel",- "title_placeholder": "Recherche-Späher",+ "title_field": "Bezeichnung",+ "title_placeholder": "Forschung, Marketing, Verwaltung","title_fallback": "Spezialist","description": "Beschreibung",- "description_placeholder": "Was dieser Agent verantwortet, wie er arbeitet und wo er zuerst fragen muss.",- "description_hint": "Ständige Anweisungen — das eigene Regelwerk des Agenten. Einzelaufgaben gehören in den Chat.",- "advanced": "Erweitert",+ "description_placeholder": "Wofür dieser Agent da ist.",+ "description_hint": "Ständige Anweisungen — das eigene Regelwerk des Agenten. Alles Weitere sagst du ihm in seinem Chat.",+ "brain": "Läuft auf",+ "brain_hint": "Es wird nur gelistet, was auf diesem Rechner verbunden ist. Weitere Subscriptions oder API-Keys verbindest du auf dem Agenten-Board hinter diesem Dialog.",+ "nothing_connected": "Noch nichts verbunden. Verbinde eine Subscription oder einen API-Key auf dem Agenten-Board hinter diesem Dialog — bis dahin läuft der Agent auf dem Standardgehirn von Jarvis.",+ "kind_subscription": "Subscription",+ "kind_api": "API-Key",+ "kind_local": "Lokal",+ "account": "Login",+ "account_active": "Das aktive Login",+ "effort": "Stufe",+ "focus_title": "Schwerpunkt",+ "grant_mode_hint": "Alles, was Jarvis verbunden hat — Skills, Plugins, MCP-Server, Gedächtnis — bleibt verfügbar; der Schwerpunkt sagt nur, was zuerst kommt.",+ "advanced": "Mehr","provider": "Anbieter","provider_unknown": "Kein Anbieterkatalog erreichbar — der Agent behält das Standardgehirn von Jarvis.","catalog_loading": "Anbieterkatalog wird geladen…",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex fb9c0b5397..5074d47f0f 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -5268,7 +5268,18 @@"description": "Descripción","description_placeholder": "Qué posee este agente, cómo trabaja y dónde debe preguntar primero.","description_hint": "Instrucciones permanentes — el reglamento propio del agente. Las tareas puntuales van al chat.",- "advanced": "Avanzado",+ "brain": "Funciona con",+ "brain_hint": "Solo se lista lo que está conectado en este equipo. Conecta más suscripciones o claves API en el tablero de Agentes detrás de este diálogo.",+ "nothing_connected": "Aún no hay nada conectado. Conecta una suscripción o una clave API en el tablero de Agentes detrás de este diálogo — hasta entonces el agente usa el cerebro predeterminado de Jarvis.",+ "kind_subscription": "Suscripción",+ "kind_api": "Clave API",+ "kind_local": "Local",+ "account": "Inicio de sesión",+ "account_active": "El inicio de sesión activo",+ "effort": "Esfuerzo",+ "focus_title": "Enfoque",+ "grant_mode_hint": "Todo lo que Jarvis tiene conectado — skills, plugins, servidores MCP, memoria — sigue disponible; el enfoque solo dice qué va primero.",+ "advanced": "Más","provider": "Proveedor","provider_unknown": "No hay catálogo de proveedores — el agente conserva el cerebro predeterminado de Jarvis.","catalog_loading": "Cargando el catálogo de proveedores…",diff --git a/jarvis/ui/web/frontend/src/lib/societyApi.ts b/jarvis/ui/web/frontend/src/lib/societyApi.tsindex 3fa1d665b5..cb6f76ec0f 100644--- a/jarvis/ui/web/frontend/src/lib/societyApi.ts+++ b/jarvis/ui/web/frontend/src/lib/societyApi.ts@@ -75,6 +75,43 @@ export interface ApprovalRules {always_allow: string[];}+/**+ * One stored subscription login of a vendor CLI, display-safe+ * (jarvis/agent_accounts.py AccountSnapshot — never a token).+ */+export interface SocietyAccount {+ id: string;+ label: string;+ connected: boolean;+ /** "subscription" | "api_key" | "expired" | "unknown" */+ mode: string;+ message: string;+ email: string | null;+ tier: string | null;+ warning: string | null;+}++/** One row of GET /api/society/providers: which runner answers on this box and its seats. */+export interface SocietyProviderRow {+ id: string;+ label: string;+ family: string;+ runner: string;+ /** The runner is a vendor CLI on a plan, not an API behind a key. */+ subscription: boolean;+ keyless: boolean;+ /** The agent-accounts platform of that CLI; null on an API row. */+ platform: string | null;+ accounts: SocietyAccount[];+}++export async function fetchSocietyProviders(): Promise<SocietyProviderRow[]> {+ const res = await fetch("/api/society/providers");+ if (!res.ok) throw new Error(`society providers ${res.status}`);+ const body = (await res.json()) as { providers?: SocietyProviderRow[] };+ return Array.isArray(body.providers) ? body.providers : [];+}+/** One roster row as GET /api/society/agents returns it (agent-definition §2). */export interface SocietyAgentRow {agent_id: string;diff --git a/jarvis/ui/web/frontend/src/store/agentChat.ts b/jarvis/ui/web/frontend/src/store/agentChat.tsindex c6603e7cb2..6c5a6a1293 100644--- a/jarvis/ui/web/frontend/src/store/agentChat.ts+++ b/jarvis/ui/web/frontend/src/store/agentChat.ts@@ -196,6 +196,46 @@ function connectionFor(return rows.find((r) => r.jarvis === provider.id);}+/**+ * The catalog joined with the Agents tab's credential truth — one row per+ * provider with `connected` decided here and nowhere else. Pure, so a surface+ * without a chat store (the society's creator) joins the same way and the+ * two pickers can never disagree about what is usable.+ */+export function joinProviderOptions(+ providers: AgentChatProvider[],+ connections: AgentConnectionRow[],+): ProviderOption[] {+ return providers.map((p) => {+ const row = connectionFor(p, connections);+ // An API seat needs an API KEY, not just any credential. The Agents+ // tab counts a subscription login as connected — right for a row a+ // CLI runs — but the brain runner calls the provider's endpoint,+ // where a Claude Code login buys nothing. `key_set` stands in when+ // an older backend does not report the finer field.+ // A coding CLI the Agents tab has no card for — OpenCode, Kimi,+ // GLM Coding Plan, the DeepSeek harness — keeps its own login where+ // this app has no verified reader; installed is all it can know,+ // and the live sweep says the rest.+ const credentialed = p.keyless+ ? true+ : isApiRunner(p.runner)+ ? Boolean(row?.api_key_set ?? row?.key_set)+ : row+ ? Boolean(row.key_set)+ : true;+ const installed = p.cli_installed === null ? true : p.cli_installed;+ return {+ ...p,+ connected: credentialed && installed,+ active: Boolean(row?.is_active_brain),+ // The IDE's mark for the CLI behind a CLI row; an API row keeps+ // its provider-family logo.+ agentMark: p.agent || undefined,+ };+ });+}+/** A session patch the composer's draft must mirror. */function draftFromSession(session: AgentChatSession, prev: ComposerDraft): ComposerDraft {const plan = session.permission_mode === "plan";@@ -444,34 +484,7 @@ export function createAgentChatStore(surface: AgentChatSurface) {providerOptions: () => {const { catalog, connections } = get();if (!catalog) return [];- return catalog.providers.map((p) => {- const row = connectionFor(p, connections);- // An API seat needs an API KEY, not just any credential. The Agents- // tab counts a subscription login as connected — right for a row a- // CLI runs — but the brain runner calls the provider's endpoint,- // where a Claude Code login buys nothing. `key_set` stands in when- // an older backend does not report the finer field.- // A coding CLI the Agents tab has no card for — OpenCode, Kimi,- // GLM Coding Plan, the DeepSeek harness — keeps its own login where- // this app has no verified reader; installed is all it can know,- // and the live sweep says the rest.- const credentialed = p.keyless- ? true- : isApiRunner(p.runner)- ? Boolean(row?.api_key_set ?? row?.key_set)- : row- ? Boolean(row.key_set)- : true;- const installed = p.cli_installed === null ? true : p.cli_installed;- return {- ...p,- connected: credentialed && installed,- active: Boolean(row?.is_active_brain),- // The IDE's mark for the CLI behind a CLI row; an API row keeps- // its provider-family logo.- agentMark: p.agent || undefined,- };- });+ return joinProviderOptions(catalog.providers, connections);},providerById: (id) => get().providerOptions().find((p) => p.id === id) ?? null,