← Về thư mục
openai4s/server/session_domain.py
- CursorCheckpointUnavailable · class · L38-L39 — class CursorCheckpointUnavailable(RuntimeError)
- SessionDomainStore · class · L42-L143 — class SessionDomainStore(Protocol): # Snapshot repository facade.
- ensure_session_branch · method · L44-L44 — def ensure_session_branch(self, **fields: Any) -> dict
- create_session_checkpoint · method · L46-L46 — def create_session_checkpoint(self, **fields: Any) -> dict
- fork_session_branch · method · L48-L48 — def fork_session_branch(self, **fields: Any) -> dict
- get_session_checkpoint · method · L50-L50 — def get_session_checkpoint(self, checkpoint_id: str) -> dict | None
- get_session_checkpoint_for_source · method · L52-L54 — def get_session_checkpoint_for_source( self, root_frame_id: str, *, source_kind: str, source_id: str ) -> dict | None
- list_session_checkpoints · method · L56-L58 — def list_session_checkpoints( self, root_frame_id: str, **filters: Any ) -> list[dict]
- get_session_branch · method · L60-L60 — def get_session_branch(self, branch_id: str) -> dict | None
- list_session_branches · method · L62-L62 — def list_session_branches(self, root_frame_id: str) -> list[dict]
- ensure_active_session_branch · method · L64-L64 — def ensure_active_session_branch(self, root_frame_id: str) -> str
- active_session_branch · method · L66-L66 — def active_session_branch(self, root_frame_id: str) -> str
- activate_session_branch_checkpoint · method · L68-L68 — def activate_session_branch_checkpoint(self, **fields: Any) -> dict
- record_snapshot_operation · method · L70-L70 — def record_snapshot_operation(self, **fields: Any) -> dict
- get_snapshot_operation · method · L72-L72 — def get_snapshot_operation(self, operation_id: str) -> dict | None
- list_snapshot_operations · method · L74-L76 — def list_snapshot_operations( self, root_frame_id: str, **filters: Any ) -> list[dict]
- append_recovery_event · method · L78-L78 — def append_recovery_event(self, **fields: Any) -> dict
- list_recovery_events · method · L80-L80 — def list_recovery_events(self, **filters: Any) -> list[dict]
- get_frame · method · L83-L83 — def get_frame(self, frame_id: str) -> dict | None
- message_count · method · L85-L85 — def message_count(self, root_frame_id: str) -> int
- cell_count · method · L87-L87 — def cell_count(self, root_frame_id: str) -> int
- list_cells · method · L89-L91 — def list_cells( self, root_frame_id: str, *, branch_id: str | None = None ) -> list[dict]
- list_action_groups · method · L93-L93 — def list_action_groups(self, root_frame_id: str, **filters: Any) -> list[dict]
- auto_mode_event_cursor · method · L95-L97 — def auto_mode_event_cursor( self, root_frame_id: str, branch_id: str | None = None ) -> int | None
- list_execution_attempts · method · L99-L99 — def list_execution_attempts(self, **filters: Any) -> list[dict]
- append_action_group · method · L101-L101 — def append_action_group(self, **fields: Any) -> dict
- append_action_event · method · L103-L103 — def append_action_event(self, **fields: Any) -> dict
- append_action_group_with_events · method · L105-L105 — def append_action_group_with_events(self, **fields: Any) -> dict
- get_action_group · method · L107-L109 — def get_action_group( self, group_id: str, *, include_events: bool = True ) -> dict | None
- list_artifacts · method · L111-L111 — def list_artifacts(self, filters: dict | None = None) -> list[dict]
- get_artifact · method · L113-L113 — def get_artifact(self, artifact_id: str) -> dict | None
- version_meta · method · L115-L115 — def version_meta(self, version_id: str) -> dict | None
- list_kernel_generations · method · L117-L119 — def list_kernel_generations( self, root_frame_id: str, **filters: Any ) -> list[dict]
- latest_kernel_generation · method · L121-L123 — def latest_kernel_generation( self, root_frame_id: str, language: str, *, branch_id: str | None = None ) -> dict | None
- list_permission_rules_for_frame · method · L125-L125 — def list_permission_rules_for_frame(self, **filters: Any) -> dict
- list_explicit_capability_states · method · L127-L129 — def list_explicit_capability_states( self, args: Any, *kwargs: Any ) -> list[dict]
- list_plans · method · L131-L131 — def list_plans(self, frame_id: str, *, limit: int = 50) -> list[dict]
- list_memories · method · L133-L135 — def list_memories( self, project_id: str | None = None, block: str | None = None ) -> list[dict]
- get_setting · method · L137-L137 — def get_setting(self, key: str, default: str | None = None) -> str | None
- set_setting · method · L139-L139 — def set_setting(self, key: str, value: str) -> None
- delete_setting · method · L141-L141 — def delete_setting(self, key: str) -> None
- delete_setting_if_value · method · L143-L143 — def delete_setting_if_value(self, key: str, expected_value: str) -> bool
- _SnapshotFacade · class · L146-L183 — class _SnapshotFacade
- init · method · L149-L150 — def init(self, store: SessionDomainStore) -> None
- create_checkpoint · method · L152-L153 — def create_checkpoint(self, **fields: Any) -> dict
- fork_branch · method · L155-L156 — def fork_branch(self, **fields: Any) -> dict
- get_checkpoint · method · L158-L159 — def get_checkpoint(self, checkpoint_id: str) -> dict | None
- get_checkpoint_for_source · method · L161-L168 — def get_checkpoint_for_source( self, root_frame_id: str, *, source_kind: str, source_id: str ) -> dict | None
- list_checkpoints · method · L170-L171 — def list_checkpoints(self, root_frame_id: str, **filters: Any) -> list[dict]
- get_branch · method · L173-L174 — def get_branch(self, branch_id: str) -> dict | None
- list_branches · method · L176-L177 — def list_branches(self, root_frame_id: str) -> list[dict]
- record_operation · method · L179-L180 — def record_operation(self, **fields: Any) -> dict
- get_operation · method · L182-L183 — def get_operation(self, operation_id: str) -> dict | None
- SessionDomainService · class · L186-L1108 — class SessionDomainService
- init · method · L189-L233 — def init( self, store: SessionDomainStore, *, data_dir: str | Path, workspace: WorkspaceResolver, event_sink: DomainEventSink | None = None, renderer_registry: RendererRegistry | None = None, before_revert_unlock: BeforeRevertUnlock | None = None, ) -> None
- checkpoints · method · L236-L252 — def checkpoints( self, root_frame_id: str, *, branch_id: str | None = None, limit: int = 100, ) -> dict[str, Any]
- create_checkpoint · method · L254-L269 — def create_checkpoint( self, root_frame_id: str, *, branch_id: str | None = None, reason: str = "manual", expected_head: str | None = None, metadata: Mapping[str, Any] | None = None, ) -> dict
- capture_cursor_checkpoint · method · L271-L323 — def capture_cursor_checkpoint( self, root_frame_id: str, *, source_kind: str, source_id: str, branch_id: str | None = None, ) -> dict | None
- branches · method · L325-L418 — def branches(self, root_frame_id: str) -> dict[str, Any]: # Pure projection: do not create the root branch from a GET. The first # checkpoint call owns that mutation; until then the UI must still be # able to offer "Create checkpoint".
- mutation_reason · function · L359-L360 — def mutation_reason(unavailable: str | None = None) -> str | None
- fork_branch · method · L420-L470 — def fork_branch( self, root_frame_id: str, *, from_checkpoint_id: str | None = None, from_cell_id: str | None = None, from_message_id: str | None = None, branch_id: str | None = None, name: str | None = None, ) -> dict
- prepare_activation · method · L472-L529 — def prepare_activation( self, root_frame_id: str, *, branch_id: str, ) -> dict[str, Any]
- publish_activation · method · L531-L554 — def publish_activation( self, root_frame_id: str, *, branch_id: str, checkpoint_id: str, expected_current_branch_id: str, ) -> dict[str, Any]
- revert_preview · method · L556-L567 — def revert_preview( self, root_frame_id: str, *, target_checkpoint_id: str, branch_id: str | None = None, ) -> dict[str, Any]
- revert_apply · method · L569-L584 — def revert_apply( self, root_frame_id: str, *, target_checkpoint_id: str, branch_id: str | None = None, ) -> dict[str, Any]
- revert_undo · method · L586-L601 — def revert_undo( self, root_frame_id: str, *, revert_checkpoint_id: str, branch_id: str | None = None, ) -> dict[str, Any]
- _publish_revert_projection · method · L603-L641 — def _publish_revert_projection( self, root_frame_id: str, branch_id: str, result: dict[str, Any], ) -> dict[str, Any]
- revert_operations · method · L643-L655 — def revert_operations( self, root_frame_id: str, *, branch_id: str | None = None, limit: int = 100, ) -> list[dict]
- reconcile_revert · method · L657-L679 — def reconcile_revert(self, root_frame_id: str) -> dict[str, Any]
- recovery_status · method · L682-L693 — def recovery_status(self, root_frame_id: str, **filters: Any) -> dict[str, Any]
- recovery_actions · method · L695-L713 — def recovery_actions(self, root_frame_id: str, **filters: Any) -> dict[str, Any]
- action_timeline · method · L715-L718 — def action_timeline(self, root_frame_id: str, **filters: Any) -> dict[str, Any]
- notebook_export · method · L720-L727 — def notebook_export( self, root_frame_id: str, *, language: str | None = None ) -> dict[str, Any]
- execution_sources · method · L729-L735 — def execution_sources(self, root_frame_id: str) -> dict[str, Any]
- execution_sources_export · method · L737-L743 — def execution_sources_export(self, root_frame_id: str) -> dict[str, Any]
- session_export · method · L745-L748 — def session_export(self, root_frame_id: str) -> dict[str, Any]
- session_import · method · L750-L753 — def session_import(self, data: bytes) -> dict[str, Any]
- artifact_renderer · method · L755-L784 — def artifact_renderer( self, artifact_id: str, *, version_id: str | None = None, root_frame_id: str | None = None, ) -> dict[str, Any]
- renderer_catalog · method · L786-L787 — def renderer_catalog(self) -> list[dict[str, Any]]
- _checkpoint_state · method · L790-L940 — def _checkpoint_state(self, root_frame_id: str, branch_id: str) -> dict[str, Any]
- _branch_cells · method · L942-L956 — def _branch_cells(self, root_frame_id: str, branch_id: str) -> list[dict]
- _workspace_tree_exists · method · L958-L963 — def _workspace_tree_exists(self, tree_id: str) -> bool
- _capability_state · method · L965-L979 — def _capability_state(self, project_id: str, root_frame_id: str) -> dict[str, Any]
- _record_cursor_checkpoint_warning · method · L981-L1006 — def _record_cursor_checkpoint_warning( self, root_frame_id: str, *, branch_id: str, source_kind: str, source_id: str, error: Exception, ) -> None: # Exception messages may contain filesystem paths or provider material. # Persist only the exception class; the important audit fact is that no # source mapping was created and therefore no fork is advertised.
- _record_domain_event · method · L1008-L1010 — def _record_domain_event(self, event: dict[str, Any]) -> None
- _persist_domain_event · method · L1012-L1100 — def _persist_domain_event(self, event: Mapping[str, Any]) -> dict[str, Any]
- _broadcast_domain_event · method · L1102-L1108 — def _broadcast_domain_event(self, public: Mapping[str, Any]) -> None
- _event_kind · function · L1111-L1118 — def _event_kind(event_type: str) -> str