← Về thư mục
openai4s/server/session_package.py
- _imported_plan_status · function · L146-L166 — def _imported_plan_status(raw: Any) -> str
- package_annotation · function · L169-L185 — def package_annotation(row: Mapping[str, Any]) -> dict[str, Any]
- restore_annotation · function · L188-L196 — def restore_annotation(row: Mapping[str, Any]) -> dict[str, Any]
- SessionPackageError · class · L199-L200 — class SessionPackageError(ValueError)
- _canonical_json · function · L203-L209 — def _canonical_json(value: Any) -> bytes
- _remap_delivery_urls · function · L212-L223 — def _remap_delivery_urls(content: str, replacements: Mapping[str, str]) -> str
- _rows · function · L226-L239 — def _rows(value: Any, key: str) -> list[Any]
- _environment_lines · function · L242-L290 — def _environment_lines(snapshots: list[Any]) -> list[str]
- _reproduce_notes · function · L293-L391 — def _reproduce_notes( *, root_frame_id: str, project_name: str, environment: Any, artifacts: Any, lineage_edges: Any, ) -> bytes
- _sha256 · function · L394-L395 — def _sha256(data: bytes) -> str
- _fsync_directory · function · L398-L406 — def _fsync_directory(path: Path) -> None
- _mkdir_durable · function · L409-L420 — def _mkdir_durable(path: Path, *, exist_ok: bool) -> None
- _write_durable_snapshot · function · L423-L475 — def _write_durable_snapshot( destination: Path, payload: bytes, *, expected_sha256: str, ) -> None
- _safe_text · function · L478-L485 — def _safe_text(value: Any) -> str
- _downgrade_imported_review_metadata · function · L488-L526 — def _downgrade_imported_review_metadata( metadata: dict[str, Any] | None, ) -> dict[str, Any] | None
- _sanitize · function · L529-L547 — def _sanitize(value: Any, *, depth: int = 0) -> Any
- _assert_secret_free · function · L550-L571 — def _assert_secret_free(value: Any, *, path: str = "payload", depth: int = 0) -> None
- _portable_auto_mode_projection · function · L574-L582 — def _portable_auto_mode_projection(value: Any, **scope: Any) -> dict[str, Any]
- _export_auto_mode_for_publication · function · L585-L606 — def _export_auto_mode_for_publication( store: Any, root_frame_id: str, **scope: Any, ) -> Any
- _safe_relative · function · L609-L615 — def _safe_relative(value: str) -> str
- _is_secret_path · function · L618-L626 — def _is_secret_path(value: str) -> bool
- _safe_artifact_filename · function · L629-L643 — def _safe_artifact_filename(value: Any) -> str
- _secret_text_bytes · function · L646-L652 — def _secret_text_bytes(data: bytes) -> bool: # Entries are already bounded to MAX_ENTRY_BYTES. Decode lossily so binary, # NUL-containing, non-UTF-8, and large files cannot bypass ASCII credential # signatures; random scientific bytes remain exportable unless they contain # an actual high-confidence secret marker.
- session_import_quarantine_key · function · L655-L656 — def session_import_quarantine_key(root_frame_id: str) -> str
- _import_permission_decision · function · L659-L662 — def _import_permission_decision(value: Any) -> str
- _zip_bytes · function · L665-L680 — def _zip_bytes(files: Mapping[str, bytes]) -> bytes
- SessionPackageService · class · L683-L4388 — class SessionPackageService
- init · method · L686-L699 — def init( self, store: Any, *, data_dir: str | Path, workspace: Callable[[str, str], str | Path], cas: WorkspaceCAS, ) -> None
- _known_secret_bytes · method · L701-L749 — def _known_secret_bytes(self) -> tuple[bytes, ...]
- collect · function · L706-L714 — def collect(value: Any, *, secret_key: bool = False) -> None
- _contains_secret_bytes · method · L751-L754 — def _contains_secret_bytes(self, data: bytes) -> bool
- _scan_untrusted_text · method · L756-L778 — def _scan_untrusted_text(self, text: Any) -> str
- _bounded_records · method · L781-L787 — def _bounded_records(name: str, records: list[Any]) -> list[Any]
- export · method · L790-L1164 — def export(self, root_frame_id: str) -> dict[str, Any]
- _export_messages · method · L1166-L1194 — def _export_messages(self, root_frame_id: str) -> list[dict[str, Any]]
- _export_cells · method · L1196-L1213 — def _export_cells(self, root_frame_id: str) -> list[dict[str, Any]]
- _export_generations · method · L1215-L1306 — def _export_generations( self, root_frame_id: str, *, branch_ids: set[str], cells: list[dict[str, Any]], attempts: list[dict[str, Any]], environment_snapshots: list[dict[str, Any]], recovery: list[dict[str, Any]], ) -> list[dict[str, Any]]
- session_owned · function · L1247-L1255 — def session_owned(row: Mapping[str, Any]) -> bool
- add · function · L1257-L1270 — def add(row: Any) -> None
- _safe_group · method · L1309-L1349 — def _safe_group(group: Mapping[str, Any]) -> dict[str, Any]
- _export_workspace · method · L1351-L1412 — def _export_workspace( self, root_frame_id: str, *, active_branch: str, checkpoints: list[dict[str, Any]], ) -> tuple[dict[str, bytes], dict[str, Any]]
- _export_artifacts · method · L1414-L1541 — def _export_artifacts( self, root_frame_id: str ) -> tuple[dict[str, bytes], dict[str, Any], list[dict[str, Any]]]
- _export_lineage · method · L1543-L1565 — def _export_lineage(self, artifacts: Mapping[str, Any]) -> list[dict[str, Any]]
- _export_completion_deliveries · method · L1567-L1718 — def _export_completion_deliveries( self, root_frame_id: str, *, messages: list[dict[str, Any]], artifacts: Mapping[str, Any], ) -> list[dict[str, Any]]
- import_bytes · method · L1721-L1743 — def import_bytes(self, data: bytes) -> dict[str, Any]
- _import_bytes · method · L1745-L2120 — def _import_bytes(self, data: bytes) -> dict[str, Any]
- _read_untrusted · method · L2122-L2227 — def _read_untrusted(self, data: bytes) -> tuple[dict[str, bytes], dict[str, Any]]
- _load_json · method · L2230-L2237 — def _load_json(data: bytes, name: str) -> dict[str, Any]
- _validate_documents · method · L2239-L3071 — def _validate_documents( self, documents: Mapping[str, dict[str, Any]], files: Mapping[str, bytes] ) -> None
- records · function · L2242-L2255 — def records( document_name: str, key: str, limit_name: str, ) -> list[Mapping[str, Any]]
- identities · function · L2257-L2270 — def identities( values: list[Mapping[str, Any]], field: str, label: str ) -> tuple[set[str], dict[str, Mapping[str, Any]]]
- reference · function · L2272-L2276 — def reference(value: Any, allowed: set[str], label: str) -> None
- required_reference · function · L2278-L2281 — def required_reference(value: Any, allowed: set[str], label: str) -> None
- _import_messages · method · L3073-L3124 — def _import_messages( self, new_root: str, messages: list[Any], *, source_root: str, branch_map: Mapping[str, str], delivery_message_ids: set[str], ) -> tuple[dict[str, str], dict[str, str]]
- _import_ledger · method · L3126-L3231 — def _import_ledger( self, new_root: str, branch_map: Mapping[str, str], ledger: Mapping[str, Any], ) -> tuple[dict[str, str], dict[str, str], dict[str, str]]
- _remap_compaction_result · method · L3233-L3262 — def _remap_compaction_result( self, result: Mapping[str, Any], group_map: Mapping[str, str] ) -> dict[str, Any]
- _annotate_assistant_message · method · L3264-L3271 — def _annotate_assistant_message(self, message: Any) -> Any
- _import_cells · method · L3273-L3353 — def _import_cells( self, new_root: str, new_project: str, cells: list[Any], *, generation_map: Mapping[str, str], ) -> tuple[dict[str, str], dict[int, int]]
- _import_attempts · method · L3355-L3405 — def _import_attempts( self, attempts: list[Any], *, group_map: Mapping[str, str], cell_map: Mapping[str, str], revision_map: Mapping[int, int], generation_map: Mapping[str, str], ) -> None
- _import_environment_snapshots · method · L3407-L3430 — def _import_environment_snapshots( self, snapshots: list[Any], *, generation_map: Mapping[str, str], ) -> dict[str, str]
- _import_artifacts · method · L3432-L3518 — def _import_artifacts( self, new_root: str, new_project: str, manifest: Mapping[str, Any], files: Mapping[str, bytes], *, import_root: Path, active_workspace: Path, cell_map: Mapping[str, str], env_map: Mapping[str, str], ) -> tuple[dict[str, str], dict[str, str], list[tuple[str, bytes]]]
- _import_completion_deliveries · method · L3520-L3609 — def _import_completion_deliveries( self, new_root: str, new_project: str, deliveries: list[Any], *, source_root: str, branch_map: Mapping[str, str], message_map: Mapping[str, str], imported_message_content: Mapping[str, str], version_map: Mapping[str, str], ) -> None
- _import_lineage · method · L3611-L3630 — def _import_lineage( self, lineage: Mapping[str, Any], *, version_map: Mapping[str, str], cell_map: Mapping[str, str], new_root: str, ) -> None
- _import_generations · method · L3632-L3691 — def _import_generations( self, new_root: str, branch_map: Mapping[str, str], generations: list[Any], ) -> dict[str, str]
- _import_workspace · method · L3693-L3714 — def _import_workspace( self, snapshots: Mapping[str, Any], files: Mapping[str, bytes] ) -> dict[str, str]
- _import_snapshots · method · L3716-L3829 — def _import_snapshots( self, new_root: str, *, source_root: str, source_project: str, new_project: str, snapshots: Mapping[str, Any], branch_map: Mapping[str, str], tree_map: Mapping[str, str], artifact_map: Mapping[str, str], version_map: Mapping[str, str], generation_map: Mapping[str, str], cell_map: Mapping[str, str], message_map: Mapping[str, str], revision_map: Mapping[int, int], ) -> dict[str, str]
- _create_checkpoint_chain · method · L3831-L3950 — def _create_checkpoint_chain( self, new_root: str, source_branch: str, checkpoints: list[dict[str, Any]], **maps: Any, ) -> None
- _import_policies · method · L3952-L3992 — def _import_policies( self, new_root: str, new_project: str, permissions: Mapping[str, Any], capabilities: Mapping[str, Any], ) -> None
- _import_plans_review_memory · method · L3994-L4114 — def _import_plans_review_memory( self, new_root: str, new_project: str, *, plans: Mapping[str, Any], review: Mapping[str, Any], memories: Mapping[str, Any], artifact_map: Mapping[str, str], ) -> None
- _import_operations_and_recovery · method · L4116-L4163 — def _import_operations_and_recovery( self, new_root: str, *, snapshots: Mapping[str, Any], branch_map: Mapping[str, str], checkpoint_map: Mapping[str, str], generation_map: Mapping[str, str], ) -> None
- _safe_import_permissions · method · L4166-L4185 — def _safe_import_permissions( state: Any, source_project: str, new_project: str, source_root: str, new_root: str, ) -> dict[str, Any]
- _safe_import_capabilities · method · L4188-L4214 — def _safe_import_capabilities( state: Any, source_project: str, new_project: str, source_root: str, new_root: str, ) -> dict[str, Any]
- _safe_import_checkpoint_metadata · method · L4217-L4264 — def _safe_import_checkpoint_metadata( cls, state: Any, *, checkpoint_map: Mapping[str, str], revision_map: Mapping[int, int], ) -> dict[str, Any]
- _safe_integer_cursor · method · L4267-L4275 — def _safe_integer_cursor(value: Any) -> int | None
- _map_cursor · method · L4278-L4283 — def _map_cursor(value: Any, revision_map: Mapping[int, int]) -> int | None
- _remap_nested · method · L4286-L4296 — def _remap_nested(cls, value: Any, mapping: Mapping[str, str]) -> Any
- _source_branch_head · method · L4299-L4307 — def _source_branch_head( source_branch: str, branches: list[dict[str, Any]], checkpoint_map: Mapping[str, str], ) -> str | None
- _workspace_blob_ids · method · L4309-L4323 — def _workspace_blob_ids( self, workspace: Mapping[str, Any], files: Mapping[str, bytes] ) -> set[str]
- _materialize_live_artifacts · method · L4326-L4341 — def _materialize_live_artifacts( workspace: Path, artifacts: list[tuple[str, bytes]] ) -> None
- _release_import_cas · method · L4343-L4363 — def _release_import_cas(self, tree_ids: set[str], blob_ids: set[str]) -> None
- _remove_private_import_root · method · L4366-L4369 — def _remove_private_import_root(path: Path) -> None
- _remove_private_workspace · method · L4372-L4375 — def _remove_private_workspace(path: Path) -> None
- _remove_private_tree · method · L4378-L4388 — def _remove_private_tree(path: Path) -> None