Skip to content

A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.

Remember Mochi's outfit in the preferences

Claude396cf291303f
diff --git a/windows/src-tauri/src/settings.rs b/windows/src-tauri/src/settings.rs
index 17f63e1c..a95abfd7 100644
--- a/windows/src-tauri/src/settings.rs
+++ b/windows/src-tauri/src/settings.rs
@@ -23,6 +23,10 @@ pub struct Settings {
pub hooks_installed: bool,
/// Claude model used by the chat. Changeable in the settings window.
pub model: String,
+ /// Mochi's outfit, picked in the wardrobe: "auto" (dresses for the
+ /// season), "none" or an outfit id — the Mac's raw values. The island reads
+ /// anything it doesn't know as "auto", so the value is stored as it comes.
+ pub mochi_outfit: String,
}
fn default_model() -> String {
@@ -46,6 +50,7 @@ impl Default for Settings {
autostart: false,
hooks_installed: false,
model: default_model(),
+ mochi_outfit: "auto".into(),
}
}
}
@@ -306,7 +311,8 @@ mod tests {
"screen": "cursor",
"autostart": true,
"hooksInstalled": true,
- "model": "some-model"
+ "model": "some-model",
+ "mochiOutfit": "witchHat"
}"#;
fn custom() -> Value {
@@ -396,6 +402,22 @@ mod tests {
assert_eq!(loaded, expected);
}
+ #[test]
+ fn a_file_from_before_the_wardrobe_dresses_mochi_for_the_seasons() {
+ let loaded = parse(&custom_with("mochiOutfit", None)).unwrap();
+ assert_eq!(loaded.mochi_outfit, "auto");
+ assert_eq!(loaded.model, "some-model");
+ assert!(!loaded.sound_enabled);
+ }
+
+ #[test]
+ fn an_outfit_this_build_does_not_know_is_kept_as_written() {
+ // A newer build may add outfits: the island shows "auto" for it, but
+ // the choice must survive a save made by this one.
+ let loaded = parse(&custom_with("mochiOutfit", Some(json!("topHat")))).unwrap();
+ assert_eq!(loaded.mochi_outfit, "topHat");
+ }
+
#[test]
fn a_missing_field_takes_its_default_and_the_rest_are_kept() {
for key in custom().as_object().unwrap().keys() {
@@ -632,6 +654,7 @@ mod tests {
"autostart",
"hooksInstalled",
"model",
+ "mochiOutfit",
]
);
let _ = std::fs::remove_dir_all(&dir);
diff --git a/windows/src/core/state.ts b/windows/src/core/state.ts
index 01236b80..16acf8c4 100644
--- a/windows/src/core/state.ts
+++ b/windows/src/core/state.ts
@@ -2,6 +2,7 @@
import type { BotEmoteName, BotStateName, IslandMode, IslandViewName } from "./layout";
import type { EyeShape } from "../mochi/engine";
+import { DEFAULT_OUTFIT, type Outfit } from "../mochi/wardrobe";
export type AgentSource = "claudeCode" | "n8n" | "agent";
export type PillBadge = "approval" | "finished" | "error";
@@ -92,6 +93,11 @@ export interface Settings {
hooksInstalled: boolean;
/** Claude model used by the chat. */
model: string;
+ /**
+ * Mochi's outfit: "auto" (dresses for the season), "none" or an outfit id.
+ * Same raw values as the Mac's "mochiOutfit"; read it through parseOutfit.
+ */
+ mochiOutfit: string;
}
export const DEFAULT_SETTINGS: Settings = {
@@ -106,6 +112,7 @@ export const DEFAULT_SETTINGS: Settings = {
autostart: false,
hooksInstalled: false,
model: "claude-opus-5",
+ mochiOutfit: DEFAULT_OUTFIT,
};
type Listener = () => void;
@@ -140,6 +147,9 @@ class AppState {
integrations: Record<string, IntegrationInfo> = {};
+ /** Outfit shown on Mochi while the pointer rests on a wardrobe button. */
+ wardrobePreview: Outfit | null = null;
+
lastActivity = performance.now();
settings: Settings = { ...DEFAULT_SETTINGS };
diff --git a/windows/tests/wardrobe.test.mjs b/windows/tests/wardrobe.test.mjs
new file mode 100644
index 00000000..f6310d94
--- /dev/null
+++ b/windows/tests/wardrobe.test.mjs
@@ -0,0 +1,131 @@
+// Mochi's wardrobe: season → outfit, stored preference → outfit (src/mochi/wardrobe.ts).
+// Mirrors tests/MochiWardrobeTests.swift so both platforms dress Mochi alike.
+
+import { test } from "node:test";
+import assert from "node:assert/strict";
+import {
+ OUTFIT_SELECTIONS, OUTFIT_LABELS, SeasonCache, easterDate, parseOutfit, resolveOutfit,
+ seasonalOutfit, wardrobeHeader,
+} from "../src/mochi/wardrobe.ts";
+import { DEFAULT_SETTINGS } from "../src/core/state.ts";
+
+/** A local calendar day, at noon so no time zone can push it into the next one. */
+const day = (y, m, d) => new Date(y, m - 1, d, 12);
+const season = (y, m, d) => seasonalOutfit(day(y, m, d));
+
+test("witch hat from October 1 to November 1", () => {
+ assert.equal(season(2026, 9, 30), "none");
+ assert.equal(season(2026, 10, 1), "witchHat");
+ assert.equal(season(2026, 10, 31), "witchHat");
+ assert.equal(season(2026, 11, 1), "witchHat");
+ assert.equal(season(2026, 11, 2), "none");
+});
+
+test("Santa hat from December 1 to 26", () => {
+ assert.equal(season(2026, 11, 30), "none");
+ assert.equal(season(2026, 12, 1), "santaHat");
+ assert.equal(season(2026, 12, 26), "santaHat");
+ assert.equal(season(2026, 12, 27), "none");
+});
+
+test("party hat from December 31 to January 2", () => {
+ assert.equal(season(2026, 12, 30), "none");
+ assert.equal(season(2026, 12, 31), "partyHat");
+ assert.equal(season(2027, 1, 1), "partyHat");
+ assert.equal(season(2027, 1, 2), "partyHat");
+ assert.equal(season(2027, 1, 3), "none");
+});
+
+test("nothing around Valentine's day (the hearts headband is gone)", () => {
+ for (const d of [12, 13, 15, 16]) assert.equal(season(2026, 2, d), "none");
+});
+
+test("Easter falls where the calendar says", () => {
+ assert.deepEqual(easterDate(2026), [4, 5]);
+ assert.deepEqual(easterDate(2027), [3, 28]);
+ assert.deepEqual(easterDate(2028), [4, 16]);
+ assert.deepEqual(easterDate(2019), [4, 21]);
+});
+
+test("bunny ears from two days before Easter to the day after", () => {
+ // Easter 2026 = April 5
+ assert.equal(season(2026, 4, 2), "none");
+ for (const d of [3, 4, 5, 6]) assert.equal(season(2026, 4, d), "bunnyEars", `April ${d}`);
+ assert.equal(season(2026, 4, 7), "none");
+ // Easter 2027 = March 28
+ assert.equal(season(2027, 3, 26), "bunnyEars");
+ assert.equal(season(2027, 3, 29), "bunnyEars");
+ assert.equal(season(2027, 3, 30), "none");
+ // Easter 2028 = April 16
+ assert.equal(season(2028, 4, 14), "bunnyEars");
+ assert.equal(season(2028, 4, 17), "bunnyEars");
+ assert.equal(season(2028, 4, 18), "none");
+});
+
+test("a daylight-saving change just before Easter doesn't shift the count", () => {
+ // Europe moves its clocks on March 29 2026, a week before Easter: midnight
+ // and late-evening dates must count the same days as noon.
+ assert.equal(seasonalOutfit(new Date(2026, 3, 3, 0, 0)), "bunnyEars");
+ assert.equal(seasonalOutfit(new Date(2026, 3, 6, 23, 59)), "bunnyEars");
+ assert.equal(seasonalOutfit(new Date(2026, 3, 7, 0, 0)), "none");
+});
+
+test("sunglasses from June 21 to August 31", () => {
+ assert.equal(season(2026, 6, 20), "none");
+ assert.equal(season(2026, 6, 21), "sunglasses");
+ assert.equal(season(2026, 8, 31), "sunglasses");
+ assert.equal(season(2026, 9, 1), "none");
+});
+
+test("auto dresses for the season, any other choice is worn as is", () => {
+ const d = day(2026, 10, 15);
+ assert.equal(resolveOutfit("auto", d), "witchHat");
+ assert.equal(resolveOutfit("none", d), "none");
+ assert.equal(resolveOutfit("beanie", d), "beanie");
+});
+
+test("the stored values are the Mac's, in the wardrobe's order", () => {
+ assert.deepEqual([...OUTFIT_SELECTIONS], [
+ "auto", "none", "partyHat", "beanie", "crown", "sunglasses", "roundGlasses",
+ "bow", "scarf", "witchHat", "pumpkin", "santaHat", "bunnyEars",
+ ]);
+ for (const sel of OUTFIT_SELECTIONS) assert.ok(OUTFIT_LABELS[sel], `${sel} has a label`);
+});
+
+test("a stored preference is read back as it was saved", () => {
+ for (const sel of OUTFIT_SELECTIONS) assert.equal(parseOutfit(sel), sel);
+});
+
+test("removed, unknown or missing preferences mean auto", () => {
+ for (const raw of ["topHat", "cap", "heartsHeadband", "strawHat", "totallyUnknown", "", "Beanie"]) {
+ assert.equal(parseOutfit(raw), "auto", JSON.stringify(raw));
+ }
+ for (const raw of [undefined, null, 42, true, {}, ["beanie"]]) {
+ assert.equal(parseOutfit(raw), "auto", String(raw));
+ }
+});
+
+test("preferences from before the wardrobe start on auto", () => {
+ assert.equal(DEFAULT_SETTINGS.mochiOutfit, "auto");
+ // What main.ts does with a settings.json that has no mochiOutfit key.
+ const old = { soundEnabled: false, model: "x" };
+ const merged = { ...DEFAULT_SETTINGS, ...old };
+ assert.equal(parseOutfit(merged.mochiOutfit), "auto");
+});
+
+test("the wardrobe header names the hovered outfit, else the current choice", () => {
+ const d = day(2026, 10, 15);
+ assert.equal(wardrobeHeader(null, "auto", d), "Auto · Witch hat");
+ assert.equal(wardrobeHeader(null, "crown", d), "Crown");
+ assert.equal(wardrobeHeader("auto", "crown", d), "Auto · follows the seasons (now: Witch hat)");
+ assert.equal(wardrobeHeader("scarf", "auto", d), "Scarf");
+ assert.equal(wardrobeHeader(null, "auto", day(2026, 5, 1)), "Auto · None");
+});
+
+test("the per-frame season lookup follows the calendar day", () => {
+ const cache = new SeasonCache();
+ assert.equal(cache.get("auto", day(2026, 9, 30)), "none");
+ assert.equal(cache.get("auto", new Date(2026, 9, 1, 0, 0, 1)), "witchHat");
+ assert.equal(cache.get("bow", day(2026, 10, 1)), "bow");
+ assert.equal(cache.get("auto", day(2026, 12, 2)), "santaHat");
+});