AdanotchDocs
Guides

Companions

Draw your own pet to take Lokum's place, add it, and show it in your extensions.

The character beside the notch is Lokum, but you can draw your own companion and put it there instead. A companion is a folder with no code in it.

The folder

pamuk/
├── pet.json
├── idle.svg      # required
├── sleep.svg     # optional
└── dance.svg

pet.json:

{ "id": "pamuk", "name": "Pamuk" }

The id may only use a-z, 0-9 and - (40 characters at most). lokum and active are reserved. Adding a pet with an id that is already installed replaces it.

Poses

Draw one file per pose. idle.svg is required; a pose you don't draw shows idle. File names are case sensitive (nightShift.svg). Lokum picks the pose from what happens on the Mac, and a companion that stands in for Lokum follows the same rules. The first row that applies wins:

FileShown when
surpriseda file is dragged to the notch
lovedthe companion was petted
alertan agent waits for your approval, or a warning came in
recordingthe screen is recorded, or the camera or the microphone is in use
dizzya command run with adanotch run failed
celebratinga command run with adanotch run finished well
posinga screenshot was just taken
sadthe battery is below 20 %
meltingthe Mac runs hot
dancemusic or a video plays, even during a focus session
sleepa focus session, and the night while nobody works
searchingthere is no internet
zenDo Not Disturb is on
exhaustedan AI provider's limit is used up
nightShiftyou are still working between 01:00 and 06:00
yawning45 minutes without a key press or mouse move
idlenothing else applies

Lokum also reacts to single moments for a few seconds, on a banner or beside the notch. These poses are not in the order above; draw the ones you want, the rest show idle:

FileShown when
happysomething went well: text was recognised, a timer finished
pluggedInthe charger was just plugged in
chargingthe Mac is charging
fullBatterythe battery is at 100 %
unpluggedthe charger was pulled out
thinkingan agent is planning
readingan agent is gathering context
codingan agent is editing files
approvalan agent is asking for permission
teammore than one agent is working
taskDonean agent finished its task
stuckan agent hit a failure
hellothe lid was opened
goodbyethe Mac is going to sleep
eatinga file was dropped on the shelf
prouda pull request was merged
rushinga meeting is about to start
carryinga big download is running
stuffedthe disk is almost full
cleaningthe trash was emptied
typinga long stretch of typing
stretchinga Pomodoro just ended
drinkingthe water reminder
birthdayit is your birthday
bayrama holiday
anniversarya year together

Drawing rules

A companion never runs code; only a small subset of SVG is drawn.

  • Elements: g, path, circle, ellipse, rect, text. Anything else is ignored.
  • The character sits in a 0…40 × 0…32 box. The visible area is -10 -14 60 52, so an antenna or a star can reach outside the box.
  • Colours: #rrggbb, or Lokum's names (ink, cheek, mouth, white, pink, yellow, red, orange, green, blue, cyan).
  • For movement, give a g one of these classes: p-breathe, p-bob, p-droop, p-jump, p-blink, p-tw, p-z, p-h, p-n, p-t, p-led, p-spin (turns around), p-fall (tumbles down and fades).
  • Each file is at most 64 KB and 600 elements. A whole <svg> file works too.
<svg xmlns="http://www.w3.org/2000/svg">
  <g class="p-breathe">
    <path d="M5.5 31 C2.2 31 2 26 2.6 20 C3.6 10 10 5.2 20 5.2 C30 5.2 36.4 10 37.4 20 C38 26 37.8 31 34.5 31 Z" fill="#a99bf0"/>
    <ellipse cx="14" cy="18" rx="2.1" ry="2.7" fill="ink"/>
    <ellipse cx="26" cy="18" rx="2.1" ry="2.7" fill="ink"/>
  </g>
</svg>

Add it

In Settings › Lokum › Companions › Add companion…, choose the folder. Adanotch checks the files, copies them into its own library (~/Library/Application Support/Adanotch/Pets/) and switches to the pet at once. If something is wrong, it says what. While a pet is active Lokum's outfits are hidden; choose "Lokum" to get them back.

Show it in extensions

Your extension can show the companion in its card or beside the notch. It can't change the drawing, only pick the pose. You draw it with ui.pet(id, pose, { size }). The id is an installed pet's id, "lokum" for Lokum herself, or "active" for whichever the user chose (a pet or Lokum), so your extension shows what they picked.

const { ui } = AdanotchKit;

return {
  compact: { leading: ui.pet("active", running ? "dance" : "idle") },
  expanded: ui.stack(
    [ui.pet("active", "happy", { size: 56 }), ui.text("Ready!")],
    { axis: "h", spacing: 12, align: "center" },
  ),
};

A companion that belongs to your extension

If your extension should have its own companion, ship the pet folder with it and give its id to ui.pet:

ui.pet("pamuk", "dance")
  • The user installs the folder once with Add companion…; say so in your extension's README. Installing activates it, and the user can switch back to Lokum or another pet later; ui.pet("pamuk", …) draws the one you asked for even when it isn't the active one.
  • If the id doesn't name an installed pet (not added yet, or removed), the active pet or Lokum is drawn. Your extension gets no error.
  • Pets don't go inside the .adanotchext package; they are shared as a separate folder.

See the UI reference.

On this page