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): Cocoa, a chocolate Labrador puppy companion in the Jarvis Verse

rubenluetke10-beepdf013c2392f9
diff --git a/docs/agent-society/office-map.md b/docs/agent-society/office-map.md
index b5dfa2c332..1a31e6bb21 100644
--- a/docs/agent-society/office-map.md
+++ b/docs/agent-society/office-map.md
@@ -173,11 +173,12 @@ the floor plan differ.
- **Jarvis is the person's pet** (2026-10-02): Jarvis appears as the pet
chosen in Settings → My Pets (`docs/pets.md`), in 3D, not always as Gigi.
`companion/petCompanions.ts` maps a pet to its companion:
- Gigi keeps its hover model; the six other built-ins have authored Blender
+ Gigi keeps its hover model; the seven other built-ins have authored Blender
models (`scripts/art/build_pet_companions.py`, study
`art/studies/jarvis-pet-companions`, one GLB per pet under
`assets/society/companions/pets/`) and a gait of their own: Ember the
- dragon flies with beating wings, Miso the cat trots, Bolt the battery
+ dragon flies with beating wings, Miso the cat trots, Cocoa the puppy trots
+ with flopping ears and a wagging tail, Bolt the battery
waddles, Brew the teapot hops with a rattling lid, Mochi bounces and Shelly
the snail crawls. Pets that fly hover at head height with Gigi's halo and
sparkles; pets on the floor (`gigiFlight.ts` `ground` mode) walk right
diff --git a/jarvis/ui/web/frontend/src/assets/society/companions/pets/cocoa.glb b/jarvis/ui/web/frontend/src/assets/society/companions/pets/cocoa.glb
new file mode 100644
index 0000000000..a3483f5bf3
Binary files /dev/null and b/jarvis/ui/web/frontend/src/assets/society/companions/pets/cocoa.glb differ
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.test.ts b/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.test.ts
index db44e5963b..72ce74aaed 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.test.ts
@@ -20,6 +20,7 @@ describe("companionFor", () => {
expect(companionFor(pet({ id: "ember", builtin: true })).gait).toBe("fly");
expect(companionFor(pet({ id: "miso", builtin: true })).gait).toBe("walk");
expect(companionFor(pet({ id: "shelly", builtin: true })).gait).toBe("crawl");
+ expect(companionFor(pet({ id: "cocoa", builtin: true })).gait).toBe("walk");
for (const id of Object.keys(BUILTIN_COMPANIONS)) {
expect(companionFor(pet({ id, builtin: true })).kind).toBe("model");
expect(petModelUrl(id)).toBeTruthy();
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.ts b/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.ts
index c4d85034c5..35cc78e5e4 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.ts
+++ b/jarvis/ui/web/frontend/src/components/society/companion/petCompanions.ts
@@ -43,6 +43,7 @@ export const BUILTIN_COMPANIONS: Readonly<Record<string, BuiltinSpec>> = {
brew: { kind: "model", gait: "hop", heightM: 0.34, modelHeightM: 0.341, strideM: 0.5 },
mochi: { kind: "model", gait: "bounce", heightM: 0.28, modelHeightM: 0.25, strideM: 0.45 },
shelly: { kind: "model", gait: "crawl", heightM: 0.36, modelHeightM: 0.4, strideM: 0.28 },
+ cocoa: { kind: "model", gait: "walk", heightM: 0.4, modelHeightM: 0.483, strideM: 0.3 },
};
/** A drawn pet floats at this height (its voxel figure), metres. */
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/petRig.test.ts b/jarvis/ui/web/frontend/src/components/society/companion/petRig.test.ts
index 3e89858ff1..b8f6757650 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/petRig.test.ts
+++ b/jarvis/ui/web/frontend/src/components/society/companion/petRig.test.ts
@@ -68,6 +68,60 @@ describe("pet rig", () => {
}
});
+ it("trots the puppy on diagonal pairs and lifts each paw only on its way forward", () => {
+ const cocoa = spec("cocoa");
+ const state = createRigState();
+ let lifted = 0;
+ for (let i = 0; i < 90; i++) {
+ stepRig(state, cocoa, { dt: DT, speed: 1, mood: "idle", reduced: false });
+ const pose = rigPose(cocoa, state, "idle");
+ expect(pose.get("cocoa_Leg_FL")!.rx).toBeCloseTo(pose.get("cocoa_Leg_BR")!.rx);
+ expect(pose.get("cocoa_Leg_FL")!.rx).toBeCloseTo(-pose.get("cocoa_Leg_FR")!.rx);
+ // Forward swing is a falling rx (the paw moves to +z).
+ if (pose.get("cocoa_Leg_FL")!.dy > 0.001) { lifted++; expect(Math.cos(state.phase)).toBeLessThan(0); }
+ }
+ expect(lifted).toBeGreaterThan(0);
+ });
+
+ it("wags the puppy's tail all the time, faster while talking and slow asleep", () => {
+ const cocoa = spec("cocoa");
+ const wagRate = (mood: PetMood) => {
+ const state = createRigState();
+ let crossings = 0, last = 0, peak = 0;
+ for (let i = 0; i < 240; i++) {
+ stepRig(state, cocoa, { dt: DT, speed: 0, mood, reduced: false });
+ const ry = rigPose(cocoa, state, mood).get("cocoa_Tail")!.ry;
+ if (i > 0 && Math.sign(ry) !== Math.sign(last)) crossings++;
+ last = ry; peak = Math.max(peak, Math.abs(ry));
+ }
+ return { crossings, peak };
+ };
+ const idle = wagRate("idle"), talk = wagRate("talk"), sleep = wagRate("sleep");
+ expect(idle.peak).toBeGreaterThan(0.3);
+ expect(talk.crossings).toBeGreaterThan(idle.crossings);
+ expect(sleep.crossings).toBeLessThan(idle.crossings);
+ expect(sleep.peak).toBeLessThan(idle.peak);
+ });
+
+ it("lets the puppy pant and flap its ears while talking, and lie down asleep", () => {
+ const cocoa = spec("cocoa");
+ const state = createRigState();
+ let jaw = 0, ear = 0;
+ for (let i = 0; i < 120; i++) {
+ stepRig(state, cocoa, { dt: DT, speed: 0, mood: "talk", reduced: false });
+ const pose = rigPose(cocoa, state, "talk");
+ jaw = Math.max(jaw, pose.get("cocoa_Jaw")!.rx);
+ ear = Math.max(ear, pose.get("cocoa_Ear_R")!.rz);
+ }
+ expect(jaw).toBeGreaterThan(0.2);
+ expect(ear).toBeGreaterThan(0.15);
+ const asleep = createRigState();
+ for (let i = 0; i < 60; i++) stepRig(asleep, cocoa, { dt: DT, speed: 0, mood: "sleep", reduced: false });
+ const pose = rigPose(cocoa, asleep, "sleep");
+ expect(pose.get("cocoa_Body")!.dy).toBeLessThan(-0.05);
+ expect(pose.get("cocoa_Head")!.dy).toBeLessThan(-0.05);
+ });
+
it("fills the battery's charge bars one by one while working", () => {
const bolt = spec("bolt");
const state = createRigState();
diff --git a/jarvis/ui/web/frontend/src/components/society/companion/petRig.ts b/jarvis/ui/web/frontend/src/components/society/companion/petRig.ts
index e1432a9505..b08c3b3b43 100644
--- a/jarvis/ui/web/frontend/src/components/society/companion/petRig.ts
+++ b/jarvis/ui/web/frontend/src/components/society/companion/petRig.ts
@@ -217,6 +217,62 @@ export function rigPose(pet: CompanionPet, state: RigState, mood: PetMood, out:
eyes(out, "shelly", state.blink);
break;
}
+ case "cocoa": {
+ // A puppy trot: diagonal pairs swing together and each paw lifts on its way forward.
+ const swing = 0.62 * s;
+ const lift = 0.02 * s;
+ const fold = sleep * (1 - s);
+ const tap = 0.012 * talk * (1 - s);
+ for (const [leg, sign, front] of [["FL", 1, 1], ["BR", 1, 0], ["FR", -1, 1], ["BL", -1, 0]] as const) {
+ const motion = part(out, `cocoa_Leg_${leg}`);
+ motion.rx = sign * swing * Math.sin(p) + (front ? -1.25 : 1.2) * fold;
+ motion.dy = lift * Math.max(0, -sign * Math.cos(p)) - 0.1 * fold
+ + front * tap * Math.max(0, sign * Math.sin(t * TAU * 1.6));
+ }
+ // The tail never stops: a quick wag, faster when walking or talking, lazy asleep.
+ const excite = Math.max(s, talk);
+ const wag = (Math.sin(t * TAU * 2.8) * (1 - excite) + Math.sin(t * TAU * 4.6) * excite) * (1 - sleep)
+ + Math.sin(t * TAU * 0.45) * sleep;
+ const bounce = 0.012 * s * Math.abs(Math.cos(p));
+ const body = part(out, "cocoa_Body");
+ body.dy = bounce - 0.075 * fold;
+ body.rz = 0.035 * s * Math.sin(p);
+ body.rx = 0.07 * work;
+ body.ry = (0.035 + 0.04 * talk) * wag * (1 - sleep);
+ const breath = sleep ? 0.035 * Math.sin(t * 1.3) : 0.018 * Math.sin(t * 2.2) * (1 - s);
+ body.sy = 1 + breath;
+ const tail = part(out, "cocoa_Tail");
+ tail.ry = (0.5 + 0.15 * excite - 0.38 * sleep) * wag;
+ tail.rx = 0.2 * s + 0.2 * talk + 0.25 * work - 0.55 * sleep;
+ tail.dy = body.dy;
+ // Idle curiosity: every few seconds the head tilts to one side and holds.
+ const cycle = t % 7;
+ const curious = cycle < 2.4 ? Math.min(1, 1.8 * Math.sin((cycle / 2.4) * Math.PI)) : 0;
+ const idle = (1 - s) * (1 - sleep) * (1 - work) * (1 - talk);
+ const tilt = 0.32 * curious * idle * (Math.floor(t / 7) % 2 ? 1 : -1);
+ const head = part(out, "cocoa_Head");
+ head.rx = 0.06 * s * Math.sin(2 * p) + work * (0.38 + 0.035 * Math.sin(t * TAU * 4))
+ + 0.22 * sleep + 0.08 * talk * Math.sin(t * TAU * 1.6);
+ head.ry = 0.28 * Math.sin(t * 0.45) * idle * (1 - curious) + 0.28 * work * Math.sin(t * 1.2);
+ head.rz = tilt + 0.14 * talk * Math.sin(t * 2.4);
+ head.dy = 0.8 * bounce - 0.095 * fold - 0.03 * work + 0.1 * breath * sleep;
+ // Panting: the jaw drops while trotting and talking, and the tongue lolls out.
+ const pant = talk * (0.18 + 0.14 * Math.sin(t * TAU * 3.4));
+ part(out, "cocoa_Jaw").rx = 0.1 * s * (1 - talk) + pant;
+ const tongue = part(out, "cocoa_Tongue");
+ tongue.sy = 1 + 0.3 * s + 1.5 * pant - 0.4 * sleep;
+ tongue.sz = 1 + 0.6 * pant;
+ // Floppy ears bounce a beat after every footfall, flap when talking and hang with gravity.
+ const flop = 0.13 * s * (1 + Math.sin(2 * p - 1.2));
+ for (const [side, outward, offset] of [["L", -1, 0], ["R", 1, 0.9]] as const) {
+ const ear = part(out, `cocoa_Ear_${side}`);
+ const flap = 0.28 * talk * (0.5 + 0.5 * Math.sin(t * TAU * 2.2 + offset));
+ ear.rz = outward * (flop + flap + 0.08 * fold) - 0.7 * head.rz;
+ ear.rx = 0.12 * s * Math.sin(2 * p - 0.6) - 0.15 * curious * idle - 0.6 * head.rx;
+ }
+ eyes(out, "cocoa", state.blink);
+ break;
+ }
default:
break;
}
diff --git a/scripts/art/build_pet_companions.py b/scripts/art/build_pet_companions.py
index b94de30942..998b990c62 100644
--- a/scripts/art/build_pet_companions.py
+++ b/scripts/art/build_pet_companions.py
@@ -229,6 +229,23 @@ def dot_eye(prefix, side, pivot_at, parent, radii, iris, pupil=None, glint="#f7f
return eye
+def floppy_ear(name, sign, length, width, thickness, splay, curl, mat, parent):
+ """A soft ear flap hanging from its pivot, widest near the top, its tip curling out."""
+ bpy.ops.mesh.primitive_uv_sphere_add(segments=18, ring_count=12, location=(0, 0, 0))
+ obj = bpy.context.object
+ for vertex in obj.data.vertices:
+ x, y, z = vertex.co
+ down = (1 - z) / 2 # 0 at the root .. 1 at the tip
+ taper = 1 - 0.45 * down**1.5
+ vertex.co = (
+ sign * (thickness * (x * sign + 0.6) * taper + splay * down + curl * down**2.4),
+ y * width * taper - 0.25 * width * down**2,
+ -length * down,
+ )
+ obj.data.update()
+ return finish(obj, name, mat, parent)
+
+
def smile(name, centre, width, depth, mat, parent, lift=0.0):
cx, cy, cz = centre
points = [
@@ -631,6 +648,165 @@ def build_bolt(root):
smile("bolt_Mouth", (0, -0.078, 0.214), 0.018, 0.009, ink, body)
+def build_cocoa(root):
+ """A chocolate Labrador puppy: chunky body, big head, floppy ears, oversized paws."""
+ fur = material("cocoa.Fur", "#6e3b22")
+ light = material("cocoa.FurLight", "#9c5a36")
+ dark = material("cocoa.FurDark", "#4a2414")
+ nose = material("cocoa.Nose", "#2a1610", 0.22)
+ tongue = material("cocoa.Tongue", "#ff7a8a", 0.4)
+ ink = material("cocoa.Ink", "#2a1610", 0.5)
+
+ body = empty("cocoa_Body", (0, 0, 0.195), root)
+ ellipsoid("cocoa_Torso", (0, 0, 0), (0.13, 0.13, 0.118), fur, body)
+ ellipsoid("cocoa_Belly", (0, -0.01, -0.048), (0.095, 0.1, 0.07), light, body, 18, 9)
+ ellipsoid("cocoa_Chest", (0, -0.1, 0.035), (0.1, 0.08, 0.1), fur, body, 18, 9)
+ ellipsoid("cocoa_Bib", (0, -0.145, 0.02), (0.062, 0.04, 0.072), light, body, 16, 8)
+
+ head = empty("cocoa_Head", (0, -0.15, 0.355), root)
+ ellipsoid("cocoa_Skull", (0, 0, 0), (0.145, 0.13, 0.128), fur, head, 26, 13)
+ for side, sign in (("L", -1), ("R", 1)):
+ ellipsoid(
+ f"cocoa_Jowl_{side}",
+ (sign * 0.068, -0.075, -0.05),
+ (0.062, 0.06, 0.056),
+ fur,
+ head,
+ 18,
+ 9,
+ )
+ ellipsoid("cocoa_Muzzle", (0, -0.122, -0.045), (0.072, 0.062, 0.05), light, head)
+ for side, sign in (("L", -1), ("R", 1)):
+ ellipsoid(
+ f"cocoa_Lip_{side}",
+ (sign * 0.028, -0.16, -0.064),
+ (0.034, 0.026, 0.026),
+ light,
+ head,
+ 16,
+ 8,
+ )
+ smile(
+ f"cocoa_Mouth_{side}",
+ (sign * 0.015, -0.183, -0.064),
+ 0.016,
+ 0.009,
+ ink,
+ head,
+ )
+ ellipsoid("cocoa_Nose", (0, -0.178, -0.018), (0.031, 0.019, 0.022), nose, head, 18, 9)
+ ellipsoid(
+ "cocoa_NoseShine",
+ (-0.009, -0.195, -0.008),
+ (0.009, 0.004, 0.006),
+ material("Pet.Glint", "#f7f7fb", 0.2, 0.4),
+ head,
+ 10,
+ 5,
+ )
+ tube("cocoa_Philtrum", [(0, -0.186, -0.036), (0, -0.185, -0.062)], 0.003, ink, head)
+
+ # The lower jaw and tongue hinge so the puppy can pant; the mouth shows when it opens.
+ ellipsoid(
+ "cocoa_MouthInside",
+ (0, -0.135, -0.08),
+ (0.036, 0.034, 0.016),
+ material("cocoa.Mouth", "#5a1f24", 0.6),
+ head,
+ 14,
+ 7,
+ )
+ jaw = empty("cocoa_Jaw", (0, -0.1, -0.082), head)
+ ellipsoid("cocoa_Chin", (0, -0.04, -0.012), (0.046, 0.042, 0.022), light, jaw, 16, 8)
+ lick = empty("cocoa_Tongue", (0, -0.06, -0.01), jaw)
+ ellipsoid("cocoa_TongueTip", (0, -0.012, -0.02), (0.022, 0.011, 0.028), tongue, lick, 16, 8)
+
+ for side, sign in (("L", -1), ("R", 1)):
+ eye = dot_eye(
+ "cocoa",
+ side,
+ (sign * 0.062, -0.104, 0.03),
+ head,
+ (0.032, 0.014, 0.036),
+ "#7a8a9a",
+ "#1a1210",
+ )
+ ellipsoid(
+ f"cocoa_Socket_{side}",
+ (sign * 0.062, -0.097, 0.03),
+ (0.036, 0.013, 0.04),
+ dark,
+ head,
+ 18,
+ 9,
+ )
+ ellipsoid(
+ f"cocoa_Brow_{side}",
+ (sign * 0.064, -0.096, 0.078),
+ (0.036, 0.016, 0.011),
+ fur,
+ head,
+ 16,
+ 8,
+ )
+ ellipsoid(
+ f"cocoa_Glint2_{side}",
+ (-0.01, -0.0135, -0.013),
+ (0.007, 0.004, 0.007),
+ material("Pet.Glint", "#f7f7fb", 0.2, 0.4),
+ eye,
+ 10,
+ 5,
+ )
+ ellipsoid(
+ f"cocoa_Cheek_{side}",
+ (sign * 0.1, -0.1, -0.03),
+ (0.022, 0.01, 0.013),
+ material("Pet.Blush", BLUSH, 0.7),
+ head,
+ 12,
+ 6,
+ )
+ # Floppy ears hang beside the head, their tips curling out.
+ ear = empty(f"cocoa_Ear_{side}", (sign * 0.142, -0.01, 0.05), head)
+ floppy_ear(f"cocoa_EarFlap_{side}", sign, 0.19, 0.07, 0.02, 0.03, 0.04, dark, ear)
+
+ for name, x, y, back in (
+ ("FL", -0.072, -0.08, False),
+ ("FR", 0.072, -0.08, False),
+ ("BL", -0.078, 0.085, True),
+ ("BR", 0.078, 0.085, True),
+ ):
+ leg = empty(f"cocoa_Leg_{name}", (x, y, 0.155), root)
+ if back:
+ ellipsoid(
+ f"cocoa_Haunch_{name}", (0, 0.008, -0.022), (0.052, 0.062, 0.062), fur, leg, 16, 8
+ )
+ ellipsoid(f"cocoa_LegFur_{name}", (0, 0, -0.06), (0.042, 0.044, 0.074), fur, leg, 16, 8)
+ ellipsoid(f"cocoa_Paw_{name}", (0, -0.018, -0.124), (0.05, 0.06, 0.031), light, leg, 18, 9)
+ for i, dx in enumerate((-0.022, 0.0, 0.022)):
+ ellipsoid(
+ f"cocoa_Toe_{name}_{i}",
+ (dx, -0.068, -0.124),
+ (0.015, 0.014, 0.017),
+ light,
+ leg,
+ 8,
+ 4,
+ )
+
+ # A thick otter tail, carried high and happy.
+ tail = empty("cocoa_Tail", (0, 0.12, 0.235), root)
+ tube(
+ "cocoa_TailFur",
+ smooth_points([(0, 0, 0), (0, 0.055, 0.022), (0, 0.1, 0.06), (0, 0.128, 0.11)]),
+ 0.032,
+ fur,
+ tail,
+ taper=0.35,
+ )
+
+
PETS = {
"miso": build_miso,
"ember": build_ember,
@@ -638,6 +814,7 @@ PETS = {
"mochi": build_mochi,
"brew": build_brew,
"bolt": build_bolt,
+ "cocoa": build_cocoa,
}