MingaGhostCursors.Tracker (minga_ghost_cursors v0.1.0)

Copy Markdown View Source

Tracks agent edit positions and manages ghost cursor overlays.

Subscribes to :buffer_changed events, filters for agent-sourced edits, and registers overlays via Minga.Extension.Overlay. Monitors agent session PIDs so overlays are cleaned up when sessions end.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

last_edit()

@type last_edit() :: {overlay_key(), position()} | nil

overlay_key()

@type overlay_key() :: {buffer :: pid(), session :: pid()}

position()

@type position() :: {line :: non_neg_integer(), col :: non_neg_integer()}

state()

@type state() :: %{
  monitored: %{optional(pid()) => reference()},
  labels: %{optional(pid()) => String.t()},
  last_updated: last_edit(),
  host: host()
}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

last_updated(server \\ __MODULE__)

@spec last_updated(GenServer.server()) :: last_edit()

start_link(opts \\ [])

@spec start_link(keyword()) :: GenServer.on_start()