photon_platform.clerk.focus¶
Named Human-AI focus bridge persisted atomically in ~/.local/state/clerk/focus.json.
Attributes¶
Classes¶
One pinned Human-AI focus slot inside |
Functions¶
|
Return the canonical Clerk focus JSON path. |
|
Pin a directory/file and optional selection into a named Clerk focus slot. |
|
Read a named focus slot from |
|
Return all currently populated focus slots keyed by slot name. |
|
Clear a single named slot, or all slots when |
Module Contents¶
- photon_platform.clerk.focus.DEFAULT_SLOT = 'default'¶
- photon_platform.clerk.focus.default_focus_path(config: photon_platform.clerk.config.ClerkConfig | None = None) pathlib.Path¶
Return the canonical Clerk focus JSON path.
- class photon_platform.clerk.focus.FocusSlot¶
One pinned Human-AI focus slot inside
focus.json.
- photon_platform.clerk.focus.set_focus(path: pathlib.Path | str | None = None, *, selected_paths: collections.abc.Sequence[pathlib.Path | str] = (), note: str | None = None, slot: str = DEFAULT_SLOT, source: str = 'cli', focus_file: pathlib.Path | None = None, include_context: bool = True) FocusSlot¶
Pin a directory/file and optional selection into a named Clerk focus slot.
- Parameters:
path – Primary focused directory or file path. Defaults to the first selected path when omitted.
selected_paths – Optional ordered list of marked files/items.
note – Optional human or agent handoff note.
slot – Named focus slot (defaults to
"default").source – Origin surface (
"cli","svxiv","ui","mcp").focus_file – Optional override destination path.
include_context – Attach resolved
determine_context()metadata when true.
- Returns:
The persisted
FocusSlot.
- photon_platform.clerk.focus.get_focus(slot: str = DEFAULT_SLOT, *, focus_file: pathlib.Path | None = None) FocusSlot | None¶
Read a named focus slot from
focus.json.- Parameters:
slot – Focus slot name (defaults to
"default").focus_file – Optional override focus file path.
- Returns:
FocusSlotif populated, orNone.
- photon_platform.clerk.focus.list_focus_slots(*, focus_file: pathlib.Path | None = None) dict[str, FocusSlot]¶
Return all currently populated focus slots keyed by slot name.
- photon_platform.clerk.focus.clear_focus(slot: str | None = DEFAULT_SLOT, *, focus_file: pathlib.Path | None = None) bool¶
Clear a single named slot, or all slots when
slotisNone.- Parameters:
slot – Slot name to remove, or
Noneto clear all slots.focus_file – Optional override focus file path.
- Returns:
Trueif anything was removed,Falseotherwise.