Expand description
ai-permission-mode — the ACP permission menu (PU-B).
A momentary popup surface over a dynamic option list (design §5.3). The
buffer is a BufferData::Help popup (so the popup renderer draws it) whose
MAJOR mode is this one: the KIND names the surface, this mode names the
behaviour. on_activate reads the oldest Pending permission from the
ConversationStore and owner-writes the projection; <CR> on an option
line resolves it (the file-tree / oil entry_at_line model), Esc/q
defer. Resolution routes through
ConversationStore::resolve_permission
by the agent’s option_id (PU-B.2a).
v1 uses <CR>-by-cursor as the selector. The 1–9 digit accelerators the
design also calls for need a count-override seam (bare digits are parsed as
vim counts, Action::PushDigit, before any mode chord lookup), which no mode
has today — deferred to a follow-up.
Structs§
- AiPermission
Guard - PU-B.3: clears the coordinator’s
menu_openflag when the menu closes (dismiss tears the buffer down → removes the active mode → drops this guard), so the auto-open tick callback opens the next queued request. - AiPermission
Mode ai-permission-mode: the major mode of the*ai-permission*popup buffer.- Permission
Menu Coordinator - PU-B.3: cross-cutting auto-open state shared by the mode (which sets it) and the install-time auto-open tick callback (which reads it). Registered as a service so both reach the same instance.
Constants§
- PERMISSION_
BUFFER_ NAME - The synthetic buffer name the popup menu is projected into.
:ai-permissionand the (PU-B.3) auto-opener both name it inEffect::OpenPopup.
Functions§
- auto_
open_ tick - PU-B.3: the auto-open decision, run every editor tick by the install-time
tick callback (
run_tick_pendingfires on the actor’sasync_landedwake — no keystroke, so a permission arriving while the user is idle opens the menu on its own). Opens the oldest non-deferred pending request when no menu is showing, and setsmenu_openoptimistically so it emits ONCE rather than every tick untilon_activatelands. Returns the effects to apply. - register_
ai_ permission_ actions - Register the
ai-permissionaction commands so the mode’s keymapcmdnames resolve at boot (theregister_ai_conversation_actionspattern). The specs are pure shells returningEffect::None; the real bodies live inAiPermissionMode::action_handlers, consulted before the CommandSpec.
Type Aliases§
- Permission
Menu Coordinator Handle - Service handle for
ServiceRegistrylookup (theArc<T>alias convention,feedback_servicesregistry_arc_typeid).