← Về thư mục
openai4s/storage/snapshots.py
- revert_recovery_setting_key · function · L95-L101 — def revert_recovery_setting_key(root_frame_id: str) -> str
- TreeEntry · class · L104-L108 — class TreeEntry(TypedDict)
- WorkspaceTree · class · L111-L115 — class WorkspaceTree(TypedDict)
- _canonical_json · function · L118-L124 — def _canonical_json(value: Any) -> bytes
- _read_regular_no_follow · function · L127-L157 — def _read_regular_no_follow(path: Path, expected: os.stat_result) -> bytes
- _digest · function · L160-L161 — def _digest(data: bytes) -> str
- _safe_relative · function · L164-L176 — def _safe_relative(value: str) -> str
- _is_secret · function · L179-L191 — def _is_secret(relative: str) -> bool
- WorkspaceCAS · class · L194-L790 — class WorkspaceCAS
- init · method · L197-L206 — def init(self, root: str | Path, *, max_file_bytes: int = 64 << 20) -> None
- locked · method · L209-L219 — def locked(self)
- capture · method · L221-L228 — def capture( self, workspace: str | Path, *, exclude: Iterable[str] = (), ) -> WorkspaceTree
- _capture_locked · method · L230-L303 — def _capture_locked( self, workspace: str | Path, *, exclude: Iterable[str] = (), ) -> WorkspaceTree
- release_trees · method · L305-L382 — def release_trees( self, tree_ids: Iterable[str], *, retained_tree_ids: Iterable[str] = (), retained_tree_ids_provider: Callable[[], Iterable[str]] | None = None, ) -> dict[str, int]
- put_blob · method · L384-L386 — def put_blob(self, data: bytes) -> str
- _put_blob_locked · method · L388-L396 — def _put_blob_locked(self, data: bytes) -> str
- get_blob · method · L398-L400 — def get_blob(self, blob_id: str) -> bytes
- _get_blob_locked · method · L402-L410 — def _get_blob_locked(self, blob_id: str) -> bytes
- put_tree · method · L412-L419 — def put_tree( self, entries: Iterable[Mapping[str, Any]], *, skipped: Iterable[Mapping[str, Any]] = (), ) -> WorkspaceTree
- _put_tree_locked · method · L421-L462 — def _put_tree_locked( self, entries: Iterable[Mapping[str, Any]], *, skipped: Iterable[Mapping[str, Any]] = (), ) -> WorkspaceTree
- get_tree · method · L464-L466 — def get_tree(self, tree_id: str) -> WorkspaceTree
- verify_tree · method · L468-L480 — def verify_tree(self, tree_id: str) -> bool
- _get_tree_locked · method · L482-L497 — def _get_tree_locked(self, tree_id: str) -> WorkspaceTree
- preview_restore · method · L499-L511 — def preview_restore( self, target_tree_id: str, workspace: str | Path, *, baseline_tree_id: str | None = None, ) -> dict[str, Any]
- _preview_restore_locked · method · L513-L578 — def _preview_restore_locked( self, target_tree_id: str, workspace: str | Path, *, baseline_tree_id: str | None = None, ) -> dict[str, Any]
- restore · method · L580-L592 — def restore( self, target_tree_id: str, workspace: str | Path, *, baseline_tree_id: str | None = None, ) -> dict[str, Any]
- _restore_locked · method · L594-L632 — def _restore_locked( self, target_tree_id: str, workspace: str | Path, *, baseline_tree_id: str | None = None, ) -> dict[str, Any]
- materialize · method · L634-L653 — def materialize( self, tree_id: str, destination: str | Path, *, paths: Iterable[str] | None = None, file_mode: int | None = None, ) -> dict[str, Any]
- _materialize_locked · method · L655-L691 — def _materialize_locked( self, tree_id: str, destination: str | Path, *, paths: Iterable[str] | None = None, file_mode: int | None = None, ) -> dict[str, Any]
- diff_trees · method · L693-L721 — def diff_trees(self, before_tree_id: str, after_tree_id: str) -> dict[str, Any]
- _blob_path · method · L723-L726 — def _blob_path(self, blob_id: str) -> Path
- _tree_path · method · L728-L731 — def _tree_path(self, tree_id: str) -> Path
- _manifest_blob_ids · method · L734-L749 — def _manifest_blob_ids(raw: Any) -> set[str] | None
- _entry_map · method · L752-L753 — def _entry_map(tree: WorkspaceTree) -> dict[str, TreeEntry]
- _same_entry · method · L756-L759 — def _same_entry(left: TreeEntry | None, right: TreeEntry | None) -> bool
- _conflict · method · L762-L773 — def _conflict( path: str, baseline: TreeEntry | None, actual: TreeEntry | None, target: TreeEntry | None, ) -> dict[str, Any]
- _atomic_write · method · L776-L790 — def _atomic_write(path: Path, data: bytes, *, mode: int) -> None
- SessionSnapshotRepository · class · L793-L1322 — class SessionSnapshotRepository
- init · method · L796-L813 — def init( self, connection: sqlite3.Connection, lock: Any, *, clock_ms: Callable[[], int], checkpoint_state: Any | None = None, revert_commit_hook: Callable[..., None] | None = None, ) -> None
- set_revert_commit_hook · method · L815-L819 — def set_revert_commit_hook(self, hook: Callable[..., None] | None) -> None
- _migrate_cursor_checkpoints · method · L821-L853 — def _migrate_cursor_checkpoints(self) -> None
- ensure_branch · method · L855-L878 — def ensure_branch( self, *, root_frame_id: str, branch_id: str | None = None, name: str | None = None, ) -> dict[str, Any]
- create_checkpoint · method · L880-L1032 — def create_checkpoint( self, *, root_frame_id: str, branch_id: str | None = None, reason: str, workspace_tree_id: str | None, action_cursor: int | None = None, message_cursor: int | None = None, cell_cursor: int | None = None, auto_event_cursor: int | None = 0, artifact_versions: Any = None, environment_pins: Any = None, generation_refs: Any = None, capability_state: Any = None, permission_state: Any = None, recovery_recipe: Any = None, metadata: Any = None, source_kind: str | None = None, source_id: str | None = None, internal: bool = False, parent_checkpoint_id: str | None = None, checkpoint_id: str | None = None, expected_head: str | None = None, ) -> dict[str, Any]
- fork_branch · method · L1034-L1073 — def fork_branch( self, *, root_frame_id: str, from_checkpoint_id: str, branch_id: str | None = None, name: str | None = None, ) -> dict[str, Any]
- get_checkpoint · method · L1075-L1081 — def get_checkpoint(self, checkpoint_id: str) -> dict[str, Any] | None
- get_checkpoint_for_source · method · L1083-L1101 — def get_checkpoint_for_source( self, root_frame_id: str, *, source_kind: str, source_id: str, ) -> dict[str, Any] | None
- checkpoint_source_map · method · L1103-L1119 — def checkpoint_source_map( self, root_frame_id: str, *, source_kind: str, ) -> dict[str, str]
- list_checkpoints · method · L1121-L1138 — def list_checkpoints( self, root_frame_id: str, *, branch_id: str | None = None, limit: int = 100, ) -> list[dict[str, Any]]
- retained_tree_ids · method · L1140-L1148 — def retained_tree_ids(self) -> tuple[str, ...]
- get_branch · method · L1150-L1155 — def get_branch(self, branch_id: str) -> dict[str, Any] | None
- list_branches · method · L1157-L1164 — def list_branches(self, root_frame_id: str) -> list[dict[str, Any]]
- record_operation · method · L1166-L1227 — def record_operation( self, *, root_frame_id: str, branch_id: str, kind: str, status: str, preview: Any, source_checkpoint_id: str | None = None, target_checkpoint_id: str | None = None, error: str | None = None, finished: bool = False, operation_id: str | None = None, ) -> dict[str, Any]
- get_operation · method · L1229-L1235 — def get_operation(self, operation_id: str) -> dict[str, Any] | None
- list_operations · method · L1237-L1265 — def list_operations( self, root_frame_id: str, *, branch_id: str | None = None, kind: str | None = None, status: str | None = None, limit: int = 100, ) -> list[dict[str, Any]]
- _text · method · L1268-L1271 — def _text(name: str, value: str) -> str
- _cursor · method · L1274-L1279 — def _cursor(value: int | None) -> int | None
- _sha256 · method · L1282-L1289 — def _sha256(name: str, value: str) -> str
- _json · method · L1292-L1293 — def _json(value: Any) -> str
- _load · method · L1296-L1300 — def _load(value: str | None, default: Any) -> Any
- _decode_checkpoint · method · L1303-L1316 — def _decode_checkpoint(cls, row: sqlite3.Row) -> dict[str, Any]
- _decode_operation · method · L1319-L1322 — def _decode_operation(cls, row: sqlite3.Row) -> dict[str, Any]