Approval-mode state shared by the Textual client and agent server.
Store namespace for per-thread approval-mode control records.
Version of the unrestricted-mode warning that must be acknowledged.
[warnings].suppress key that mutes the recurring "YOLO is active" toast.
Suppression is cosmetic: YOLO still requires an explicit acknowledgement to
enter (a modal in the TUI, a console prompt for --yolo), still honors the
startup.yolo_switcher setting, and still shows a persistent YOLO
status-bar indicator the whole time it is active. Because the acknowledgement
is once per policy version, that indicator is the only remaining in-session
signal for a returning user who has muted the toast.
Version of the first-run Auto mode education notice.
Bump this string whenever the notice copy changes materially enough that already-shown installs should see it again.
Return a validated mode, failing closed to manual.
Return the next Shift+Tab approval mode for the active session.
The cycle is Manual → Auto → YOLO → Manual when both Auto and the YOLO
switcher entry are available. Auto is omitted when auto_eligible is false
(for example a remote sandbox). YOLO is omitted when orgs/users disable
startup.yolo_switcher. Launching with --yolo still leaves unrestricted
mode when the switcher entry is disabled; Shift+Tab only exits YOLO then.
Return the store key for a thread's live approval mode.
Return the stored approval-mode payload.
Read a live approval mode from the server-side LangGraph Store.
Asynchronously read a live approval mode from a LangGraph Store.
The graph server supplies an async batched Store whose synchronous methods
reject calls from the event-loop thread. Prefer aget() for that runtime,
while retaining a synchronous fallback for lightweight local test stores.
Persist approval mode through an agent's remote store client.
Return the installation-local acknowledgement file path.
Return whether the current unrestricted-mode warning was accepted.
Persist the current unrestricted-mode warning acknowledgement.
Merges into any existing approval state so first-run Auto notice fields are preserved. Concurrent saves are serialized with a cross-process lock.
Return whether the current Auto first-enable notice was already shown.
The notice self-versions on auto_notice_version and deliberately does not
gate on the top-level version (unlike has_yolo_acknowledgement), so the
two records can evolve independently within one approval.json.
Persist that the Auto first-enable notice was shown.
Merges into any existing approval state so YOLO acknowledgement fields are
preserved. Concurrent saves are serialized with a cross-process lock.
Callers should fail open when this returns False.