Skip to main content

Module browser_profiles_store

Module browser_profiles_store 

Source
Expand description

Named browser profiles: the list of them, in shared_dir (~/.agentmux/shared/browser-profiles.json), like the bookmarks (docs/specs/SPEC_BROWSER_PANE_PROFILES_MENU_2026_10_09.md §3, §6). A profile’s cookie jar is a disk-backed CEF profile the host keeps at <cef-cache>/profile-<id>; this file only names and colours them. “Personal” (the shared jar every tab had before profiles) isn’t listed: it always exists and can’t be deleted.

Structs§

BrowserProfile

Constants§

MAX_NAME_CHARS
MAX_PROFILES

Functions§

add
A new profile added to profiles: a fresh id, a checked name, and the given colour or the shared palette’s hue farthest from the ones in use (palette::farthest_free_slot), so a deleted profile’s colour is reused and nothing repeats until all 12 hues are taken. Black and White are never given: they are only ever someone’s own choice.
agent_profile_id
The id of the own profile of the agent owner (its uid, which a rename keeps): agent-, a readable part of it, and a hash of all of it, so two owners never share an id however alike their names, in the characters a profile id has.
ensure_agent_profile
Agent owner’s own profile in profiles, made if it has none, its name kept to the agent’s current name (so a rename shows and the data stays). Whether the list changed is the second part.
is_profile_id
Is id a well-formed profile id?
profiles_file_path
read_profiles
The list. A missing or empty file is “no profiles yet”; a present but unparseable one is an error, not an empty list that would look like the profiles vanished.
remove
Remove profile id. Its tabs and its jar are the caller’s to close.
update
Rename or recolour profile id.
write_profiles
Replace the list, through a temp file and a rename, so a crash never leaves a half-written file.