Skip to content

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.

feat(society): Jarvis' card shows the shared brain and edits the agent-instructions file in place

rubenluetke10-beep71400ff1903d
diff --git a/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx b/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
index 626db668b9..2eb8574bea 100644
--- a/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/card/AgentSpecSheet.tsx
@@ -18,6 +18,7 @@ import { useT } from "@/i18n";
import { CapabilityChip } from "../CapabilityChip";
import { useSetAgentPaused, useSocietyCapabilities, type Capability, type SocietyAgent } from "../data";
+import { LeadBrain, LeadInstructions } from "./LeadSections";
function formatDate(ms: number | null, fallback: string): string {
if (ms === null) return fallback;
@@ -65,12 +66,15 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
<ScrollArea className="min-h-0 flex-1">
<div className="flex flex-col gap-5 p-5">
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
{t("society.card.brain")}
</h3>
+ {agent.tier === "lead" ? (
+ <LeadBrain />
+ ) : (
<div className="flex flex-wrap items-center gap-2">
{agent.provider ? (
- <span className="inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-[12px] text-foreground">
+ <span className="inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-xs text-foreground">
<ProviderLogo providerId={agent.provider} label={agent.providerLabel || agent.provider} size="sm" />
{agent.providerLabel || agent.provider}
</span>
@@ -78,28 +82,35 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
<Badge variant="outline">{t("society.card.default_brain")}</Badge>
)}
{agent.model ? (
- <Badge variant="secondary" className="font-mono text-[11px]">
+ <Badge variant="secondary" className="font-mono text-xs">
{agent.model}
</Badge>
) : null}
{agent.effort ? <Badge variant="outline">{agent.effort}</Badge> : null}
<Badge variant="outline">{t(`society.tier.${agent.tier}`)}</Badge>
</div>
+ )}
</section>
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
- {t("society.card.description")}
- </h3>
- {agent.description ? (
- <p className="whitespace-pre-line text-[13px] leading-relaxed text-foreground">{agent.description}</p>
+ {agent.tier === "lead" ? (
+ <LeadInstructions />
) : (
- <p className="text-xs text-muted-foreground">{t("society.card.no_description")}</p>
+ <>
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
+ {t("society.card.description")}
+ </h3>
+ {agent.description ? (
+ <p className="whitespace-pre-line text-sm leading-relaxed text-foreground">{agent.description}</p>
+ ) : (
+ <p className="text-xs text-muted-foreground">{t("society.card.no_description")}</p>
+ )}
+ </>
)}
</section>
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
{t("society.card.focus")}
</h3>
{agent.focus.length === 0 ? (
@@ -114,7 +125,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
</section>
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
{t("society.card.tools")}
</h3>
<p className="mb-2 text-xs text-muted-foreground">
@@ -129,7 +140,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
) : null}
{agent.denies.length > 0 ? (
<div className="mt-2">
- <p className="mb-1 text-[11px] text-muted-foreground">{t("society.card.denied")}</p>
+ <p className="mb-1 text-xs text-muted-foreground">{t("society.card.denied")}</p>
<div className="flex flex-wrap gap-1.5">
{agent.denies.map((id) => (
<CapabilityChip key={id} id={id} capability={byId.get(id)} className="line-through opacity-60" />
@@ -148,7 +159,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
{agent.approvalRules.requireApproval.length > 0 || agent.approvalRules.alwaysAllow.length > 0 ? (
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
{t("society.card.approval_rules")}
</h3>
{agent.approvalRules.requireApproval.length > 0 ? (
@@ -161,7 +172,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
) : null}
<section>
- <h3 className="mb-2 text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ <h3 className="mb-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground">
{t("society.card.routines")}
</h3>
{agent.routines.length === 0 ? (
@@ -171,7 +182,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
{agent.routines.map((routine) => {
const due = relativeUntil(routine.nextFire, t);
return (
- <li key={routine.id} className="flex items-baseline justify-between gap-3 text-[13px]">
+ <li key={routine.id} className="flex items-baseline justify-between gap-3 text-sm">
<span className="truncate text-foreground">{routine.label}</span>
<span className="shrink-0 text-xs text-muted-foreground">
{routine.schedule}
@@ -212,7 +223,7 @@ export function AgentSpecSheet({ agent }: { agent: SocietyAgent }) {
function RuleRow({ label, ids, byId }: { label: string; ids: string[]; byId: Map<string, Capability> }) {
return (
<div className="mb-2">
- <p className="mb-1 text-[11px] text-muted-foreground">{label}</p>
+ <p className="mb-1 text-xs text-muted-foreground">{label}</p>
<div className="flex flex-wrap gap-1.5">
{ids.map((id) => (
<CapabilityChip key={id} id={id} capability={byId.get(id.split(":").slice(0, 2).join(":"))} />
@@ -225,8 +236,8 @@ function RuleRow({ label, ids, byId }: { label: string; ids: string[]; byId: Map
function Fact({ label, value }: { label: string; value: string }) {
return (
<div className="min-w-0">
- <div className="text-[11px] text-muted-foreground">{label}</div>
- <div className="truncate text-[13px] font-medium text-foreground">{value}</div>
+ <div className="text-xs text-muted-foreground">{label}</div>
+ <div className="truncate text-sm font-medium text-foreground">{value}</div>
</div>
);
}
diff --git a/jarvis/ui/web/frontend/src/components/society/card/LeadSections.tsx b/jarvis/ui/web/frontend/src/components/society/card/LeadSections.tsx
new file mode 100644
index 0000000000..4a5c8e6f48
--- /dev/null
+++ b/jarvis/ui/web/frontend/src/components/society/card/LeadSections.tsx
@@ -0,0 +1,157 @@
+/**
+ * The two spec-sheet sections that are different for Jarvis, because Jarvis
+ * is the harness itself (maintainer, 2026-09-02):
+ *
+ * - Brain: the provider/model the front page's chat and the voice stage use
+ * right now (the shared "jarvis" store's draft), not a per-row field.
+ * - Standing instructions: the person's agent-instructions file (the same
+ * one the Agent Instructions section edits), editable in place and
+ * applied on the next turn — no restart.
+ */
+import { useEffect, useState } from "react";
+import { Pencil } from "lucide-react";
+
+import { ProviderLogo } from "@/components/providers/ProviderLogo";
+import { Badge } from "@/components/ui/badge";
+import { Button } from "@/components/ui/button";
+import { useT } from "@/i18n";
+import { useAgentChatStore } from "@/store/agentChat";
+
+interface InstructionsPayload {
+ content: string;
+ exists: boolean;
+ filename: string;
+ template: string;
+}
+
+export function LeadBrain() {
+ const t = useT();
+ const draft = useAgentChatStore((s) => s.draft);
+ const providerById = useAgentChatStore((s) => s.providerById);
+ const loadCatalog = useAgentChatStore((s) => s.loadCatalog);
+ const catalog = useAgentChatStore((s) => s.catalog);
+ useEffect(() => {
+ if (!catalog) void loadCatalog();
+ }, [catalog, loadCatalog]);
+ const provider = providerById(draft.provider);
+ return (
+ <div className="flex flex-col gap-1.5">
+ <div className="flex flex-wrap items-center gap-2">
+ {provider ? (
+ <span className="inline-flex items-center gap-1.5 rounded-full border border-border px-2 py-0.5 text-[12px] text-foreground">
+ <ProviderLogo providerId={provider.id} label={provider.label} size="sm" />
+ {provider.label}
+ </span>
+ ) : (
+ <Badge variant="outline">{t("society.card.default_brain")}</Badge>
+ )}
+ <Badge variant="secondary" className="font-mono text-[11px]">
+ {draft.model || t("society.chat.model_provider_default")}
+ </Badge>
+ {draft.effort ? <Badge variant="outline">{draft.effort}</Badge> : null}
+ <Badge variant="outline">{t("society.tier.lead")}</Badge>
+ </div>
+ <p className="text-[11px] text-muted-foreground">{t("society.card.brain_shared_hint")}</p>
+ </div>
+ );
+}
+
+export function LeadInstructions() {
+ const t = useT();
+ const [payload, setPayload] = useState<InstructionsPayload | null>(null);
+ const [editing, setEditing] = useState(false);
+ const [draft, setDraft] = useState("");
+ const [saving, setSaving] = useState(false);
+ const [error, setError] = useState<string | null>(null);
+
+ useEffect(() => {
+ let live = true;
+ void fetch("/api/settings/agent-instructions")
+ .then((r) => (r.ok ? (r.json() as Promise<InstructionsPayload>) : null))
+ .then((data) => {
+ if (live && data) setPayload(data);
+ })
+ .catch(() => {
+ /* the section below says the file could not be read */
+ });
+ return () => {
+ live = false;
+ };
+ }, []);
+
+ const save = async () => {
+ setSaving(true);
+ setError(null);
+ try {
+ const res = await fetch("/api/settings/agent-instructions", {
+ method: "PUT",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ content: draft }),
+ });
+ if (!res.ok) {
+ const detail = (await res.json().catch(() => null)) as { detail?: unknown } | null;
+ throw new Error(typeof detail?.detail === "string" ? detail.detail : `save ${res.status}`);
+ }
+ setPayload((await res.json()) as InstructionsPayload);
+ setEditing(false);
+ } catch (err) {
+ setError(err instanceof Error ? err.message : String(err));
+ } finally {
+ setSaving(false);
+ }
+ };
+
+ const content = payload?.content ?? "";
+ return (
+ <div>
+ <div className="mb-2 flex items-center justify-between gap-2">
+ <h3 className="text-[11px] font-semibold uppercase tracking-wide text-muted-foreground">
+ {payload?.filename
+ ? t("society.card.instructions_file").replace("{0}", payload.filename)
+ : t("society.card.description")}
+ </h3>
+ {!editing ? (
+ <button
+ type="button"
+ onClick={() => {
+ setDraft(content || payload?.template || "");
+ setEditing(true);
+ }}
+ className="flex items-center gap-1 rounded-md px-1.5 py-0.5 text-[11px] text-muted-foreground hover:bg-secondary hover:text-foreground"
+ >
+ <Pencil className="h-3 w-3" aria-hidden />
+ {t("society.card.edit")}
+ </button>
+ ) : null}
+ </div>
+ {editing ? (
+ <div className="flex flex-col gap-2">
+ <textarea
+ value={draft}
+ onChange={(e) => setDraft(e.target.value)}
+ rows={10}
+ className="w-full resize-y rounded-md border border-border bg-background px-3 py-2 font-mono text-[12px] leading-relaxed text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-border-strong"
+ />
+ {error ? (
+ <p role="alert" className="text-[11px] text-destructive">
+ {error}
+ </p>
+ ) : null}
+ <div className="flex items-center justify-end gap-2">
+ <Button size="sm" variant="ghost" onClick={() => setEditing(false)} disabled={saving}>
+ {t("society.create.cancel")}
+ </Button>
+ <Button size="sm" onClick={() => void save()} disabled={saving || !draft.trim()}>
+ {saving ? t("society.card.saving") : t("society.card.save")}
+ </Button>
+ </div>
+ </div>
+ ) : content ? (
+ <p className="whitespace-pre-line text-[13px] leading-relaxed text-foreground">{content}</p>
+ ) : (
+ <p className="text-xs text-muted-foreground">{t("society.card.instructions_empty")}</p>
+ )}
+ <p className="mt-1 text-[11px] text-muted-foreground">{t("society.card.instructions_hint")}</p>
+ </div>
+ );
+}
diff --git a/jarvis/ui/web/frontend/src/components/society/figures/AgentFigureViewer.tsx b/jarvis/ui/web/frontend/src/components/society/figures/AgentFigureViewer.tsx
index 1766e53167..51f2239dd3 100644
--- a/jarvis/ui/web/frontend/src/components/society/figures/AgentFigureViewer.tsx
+++ b/jarvis/ui/web/frontend/src/components/society/figures/AgentFigureViewer.tsx
@@ -137,7 +137,7 @@ export function AgentFigureViewer({ recipe, clip = "idle", quiet = false, classN
dpr={1}
frameloop={frameloop}
gl={{ antialias: false, alpha: true, powerPreference: "low-power" }}
- camera={{ fov: 26, near: 0.1, far: 40, position: [0, heightM * 0.55, heightM * 2.4] }}
+ camera={{ fov: 26, near: 0.1, far: 40, position: [0, heightM * 0.55, heightM * 2.5] }}
onCreated={({ gl }) => {
gl.setClearColor(0x000000, 0);
}}
@@ -162,7 +162,7 @@ export function AgentFigureViewer({ recipe, clip = "idle", quiet = false, classN
) : (
<PaletteTile palette={palette} label={t("society.figure.no_figure")} />
)}
- <p className="pointer-events-none absolute inset-x-0 bottom-2 text-center text-[11px] text-[#5b5245]/80">
+ <p className="pointer-events-none absolute inset-x-0 bottom-2 text-center text-xs text-[#5b5245]/80">
{reduced ? t("society.figure.reduced_motion") : t("society.figure.drag_hint")}
</p>
</div>
@@ -235,7 +235,7 @@ function FigureScene({ recipe, look, palette, heightM, clip, quiet, paused, orbi
// 2.4 heights of distance: larger than the 2.6 it opened with (maintainer:
// "about a fifth"), with the crown and the hem still inside the frame.
const mid = heightM * 0.5;
- const distance = (heightM * 2.4) / o.zoom;
+ const distance = (heightM * 2.5) / o.zoom;
camera.position.set(0, mid + Math.sin(o.pitch) * distance, Math.cos(o.pitch) * distance);
camera.lookAt(0, mid, 0);
camera.updateProjectionMatrix();
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.json
index 11b413a467..52cad7c9b9 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json
@@ -5201,6 +5201,13 @@
"idle": "Unterwegs"
},
"card": {
+ "brain_shared_hint": "Dasselbe Gehirn, das Chat und Sprache gerade nutzen; ändern kannst du es an der Modell-Pille im Chat.",
+ "instructions_file": "Ständige Anweisungen ({0})",
+ "instructions_empty": "Noch keine ständigen Anweisungen — die Vorlage ist einen Klick entfernt.",
+ "instructions_hint": "Wird vor jeder Antwort gelesen, getippt wie gesprochen. Gilt ab der nächsten Antwort, kein Neustart.",
+ "edit": "Bearbeiten",
+ "save": "Speichern",
+ "saving": "Speichert…",
"default_brain": "Standardgehirn von Jarvis",
"no_description": "Noch keine ständigen Anweisungen.",
"focus": "Greift zuerst zu",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.json
index ed6edb81e0..eea924e205 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json
@@ -5201,6 +5201,13 @@
"idle": "Wandering"
},
"card": {
+ "brain_shared_hint": "The same brain the chat and the voice stage use right now; change it in the chat's model pill.",
+ "instructions_file": "Standing instructions ({0})",
+ "instructions_empty": "No standing instructions yet — the template is a click away.",
+ "instructions_hint": "Read before every turn, typed or spoken. Saved on the next turn, no restart.",
+ "edit": "Edit",
+ "save": "Save",
+ "saving": "Saving…",
"default_brain": "Jarvis' default brain",
"no_description": "No standing instructions yet.",
"focus": "Reaches for first",
diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.json
index 5a3705baf1..1d8f4e3b3a 100644
--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json
+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json
@@ -5201,6 +5201,13 @@
"idle": "Paseando"
},
"card": {
+ "brain_shared_hint": "El mismo cerebro que usan ahora el chat y la voz; cámbialo en la píldora de modelo del chat.",
+ "instructions_file": "Instrucciones permanentes ({0})",
+ "instructions_empty": "Aún no hay instrucciones permanentes; la plantilla está a un clic.",
+ "instructions_hint": "Se lee antes de cada respuesta, escrita o hablada. Vale desde la siguiente respuesta, sin reiniciar.",
+ "edit": "Editar",
+ "save": "Guardar",
+ "saving": "Guardando…",
"default_brain": "Cerebro predeterminado de Jarvis",
"no_description": "Aún no hay instrucciones permanentes.",
"focus": "Usa primero",