Skip to main content

Module queens

Module queens 

Source
Expand description

Queen sessions: the sessions LeanCTX | Cloud Desktop started as a Queen, registered by the app over the 0600 local socket (an app-only call).

A bus role is self-declared, so it never grants anything. A session may set a task’s priority and labels through ctx_tasks only when the launching app’s session id of its MCP server (LEAN_CTX_SESSION_ID) is registered here. The app removes the id when the session ends.

Stored 0600 in the Instance’s data dir; at most MAX_QUEENS ids.

Structs§

QueenSession
One registered Queen session.

Constants§

MAX_QUEENS
NOT_A_QUEEN
The refusal for a session that may read but not set priority.
QUEENS_FILE

Functions§

data_dir
The Instance’s data dir, where the registrations live.
is_queen_in
Whether session_id is a registered Queen session in dir.
list_in
The registered sessions in dir, sorted by id.
register_in
Register session_id (again: it keeps its since, the name is updated).
remove_in
Remove session_id (no error when it is not registered).
this_session_is_queen
Whether this process runs for a registered Queen session: the launching app’s session id (LEAN_CTX_SESSION_ID) of this process is registered.
validate_session_id
8-128 of [A-Za-z0-9._:-].