← Về thư mục
openai4s/host/files.py
- _normalize_policy_segment · function · L116-L126 — def _normalize_policy_segment(value: str) -> str
- _path_segments · function · L129-L136 — def _path_segments(path: str) -> tuple[str, ...]
- _has_secret_directory · function · L139-L148 — def _has_secret_directory(segments: tuple[str, ...]) -> bool
- is_secret_path · function · L151-L166 — def is_secret_path(path: str) -> bool
- is_credential_path · function · L169-L179 — def is_credential_path(path: str) -> bool
- _UnsafeAliasInspection · class · L182-L183 — class _UnsafeAliasInspection(ValueError)
- _traverses_secret_symlink_path · function · L186-L269 — def _traverses_secret_symlink_path(workspace: Path, path: Path) -> bool
- _SecretAliasSnapshot · class · L272-L789 — class _SecretAliasSnapshot
- init · method · L290-L305 — def init( self, workspace: Path, *, include_unattended_basenames: bool = False ) -> None
- _check_time · method · L307-L309 — def _check_time(self) -> None
- _consume_entry · method · L311-L315 — def _consume_entry(self) -> None
- _signature · method · L317-L342 — def _signature( self, directory: Path, *, missing_ok: bool = False ) -> tuple[int, int, int, int, int] | None
- _resolve_candidate · method · L344-L351 — def _resolve_candidate(self, candidate: Path) -> Path
- _resolve_subtree_candidate · method · L353-L366 — def _resolve_subtree_candidate(self, candidate: Path) -> Path
- _resolve_inside_candidate · method · L368-L376 — def _resolve_inside_candidate(self, candidate: Path, *, kind: str) -> Path
- _identity · method · L378-L392 — def _identity(self, candidate: Path, *, missing_ok: bool) -> tuple[int, int] | None
- _policy_relative · method · L395-L410 — def _policy_relative(path: Path, parent: Path) -> tuple[str, ...] | None
- _target_ancestor_identities · method · L412-L429 — def _target_ancestor_identities( self, target: Path ) -> tuple[tuple[Path, tuple[int, int]], ...]
- _secret_root_length · method · L432-L443 — def _secret_root_length(parts: tuple[str, ...]) -> int | None
- _is_secret_basename · method · L445-L453 — def _is_secret_basename(self, name: str) -> bool
- _entry_is_dir · method · L455-L461 — def _entry_is_dir(self, entry: os.DirEntry[str], *, follow: bool) -> bool
- _entry_is_symlink · method · L463-L469 — def _entry_is_symlink(self, entry: os.DirEntry[str]) -> bool
- _matching_children · method · L471-L495 — def _matching_children(self, directory: Path, wanted: str) -> list[Path]
- _scan_workspace · method · L497-L573 — def _scan_workspace( self, ) -> tuple[set[Path], set[Path], dict[Path, str], set[Path]]
- _collect_secret_descendants · method · L575-L638 — def _collect_secret_descendants( self, roots: set[Path] ) -> tuple[set[Path], set[Path], set[tuple[int, int]], set[tuple[int, int]]]
- _prepare · method · L640-L708 — def _prepare(self) -> None
- contains · method · L710-L762 — def contains(self, target: Path) -> bool
- _metadata_identity · method · L765-L766 — def _metadata_identity(metadata: os.stat_result) -> tuple[int, int]
- contains_exact_identity · method · L768-L777 — def contains_exact_identity(self, metadata: os.stat_result) -> bool
- contains_root_identity · method · L779-L783 — def contains_root_identity(self, metadata: os.stat_result) -> bool
- matches_workspace_identity · method · L785-L789 — def matches_workspace_identity(self, metadata: os.stat_result) -> bool
- UnsafeWorkspaceCandidate · class · L792-L793 — class UnsafeWorkspaceCandidate(ValueError)
- _secure_open_flags · function · L796-L813 — def _secure_open_flags(*, directory: bool = False) -> int
- _require_dir_fd_support · function · L816-L824 — def _require_dir_fd_support() -> None
- _identity · function · L827-L828 — def _identity(metadata: os.stat_result) -> tuple[int, int]
- VerifiedWorkspaceFile · class · L831-L853 — class VerifiedWorkspaceFile
- init · method · L834-L844 — def init( self, descriptor: int, *, relative: str, metadata: os.stat_result, ) -> None
- enter · method · L846-L847 — def enter(self) -> "VerifiedWorkspaceFile"
- exit · method · L849-L850 — def exit(self, *_args: Any) -> None
- close · method · L852-L853 — def close(self) -> None
- SecureWorkspaceDirectory · class · L856-L916 — class SecureWorkspaceDirectory
- init · method · L859-L870 — def init( self, descriptor: int, *, relative: str, aliases: _SecretAliasSnapshot, predicate: Callable[[str], bool], ) -> None
- enter · method · L872-L873 — def enter(self) -> "SecureWorkspaceDirectory"
- exit · method · L875-L876 — def exit(self, *_args: Any) -> None
- close · method · L878-L881 — def close(self) -> None
- inspect_entry · method · L883-L916 — def inspect_entry(self, name: str) -> os.stat_result
- SecureWorkspaceParent · class · L919-L1030 — class SecureWorkspaceParent(SecureWorkspaceDirectory)
- init · method · L922-L939 — def init( self, descriptor: int, *, relative: str, leaf: str, aliases: _SecretAliasSnapshot, predicate: Callable[[str], bool], ) -> None
- enter · method · L941-L942 — def enter(self) -> "SecureWorkspaceParent"
- open_verified_read · method · L944-L988 — def open_verified_read(self) -> VerifiedWorkspaceFile
- create_staged · method · L990-L1006 — def create_staged(self, *, suffix: str) -> tuple[int, str]
- target_metadata · method · L1008-L1014 — def target_metadata(self) -> os.stat_result | None
- publish · method · L1016-L1024 — def publish(self, staged_name: str) -> None
- discard · method · L1026-L1030 — def discard(self, staged_name: str) -> None
- _is_terminated · function · L1070-L1078 — def _is_terminated(piece: str) -> bool
- BoundedTextReader · class · L1081-L1177 — class BoundedTextReader
- init · method · L1093-L1120 — def init( self, source: Any, *, max_bytes: int = MAX_READ_BYTES, chunk_bytes: int = READ_CHUNK_BYTES, max_line_chars: int = MAX_LINE_CHARS, ) -> None
- lines · method · L1122-L1177 — def lines(self) -> Iterator[str]
- BoundedSelection · class · L1180-L1246 — class BoundedSelection
- init · method · L1190-L1196 — def init(self, limit: int) -> None
- offer · method · L1198-L1208 — def offer(self, key: str, value: Any = None) -> None
- retained · method · L1211-L1212 — def retained(self) -> int
- dropped · method · L1215-L1216 — def dropped(self) -> int
- values · method · L1218-L1220 — def values(self) -> list[Any]
- items · method · L1222-L1224 — def items(self) -> list[tuple[str, Any]]
- counters · method · L1226-L1246 — def counters(self, *, scan_truncated: bool = False) -> dict[str, Any]
- WorkspaceFileService · class · L1249-L1662 — class WorkspaceFileService
- init · method · L1256-L1267 — def init( self, *, data_dir: Path, frame_id: Callable[[], str | None], workspace: Callable[[], str | Path | None] | None = None, ) -> None
- workspace · method · L1269-L1299 — def workspace(self) -> Path
- relative · method · L1301-L1306 — def relative(self, path: Path) -> str | None
- _candidate_parts · method · L1308-L1331 — def _candidate_parts(self, relative: str | Path) -> tuple[str, ...]
- _validated_parts · method · L1333-L1372 — def _validated_parts( self, relative: str | Path, *, aliases: _SecretAliasSnapshot, predicate: Callable[[str], bool], allow_root: bool, ) -> tuple[str, ...]
- _open_directory_descriptor · method · L1374-L1451 — def _open_directory_descriptor( self, parts: tuple[str, ...], *, aliases: _SecretAliasSnapshot, create: bool, ) -> int
- _secure_parent · method · L1453-L1476 — def _secure_parent( self, relative: str | Path, *, aliases: _SecretAliasSnapshot, predicate: Callable[[str], bool], create_parents: bool, ) -> SecureWorkspaceParent
- secure_parent · method · L1478-L1489 — def secure_parent( self, relative: str | Path, *, create_parents: bool = False ) -> SecureWorkspaceParent
- verified_read_opener · method · L1491-L1508 — def verified_read_opener( self, ) -> Callable[[str | Path], VerifiedWorkspaceFile]
- open_file · function · L1499-L1506 — def open_file(relative: str | Path) -> VerifiedWorkspaceFile
- open_verified_read · method · L1510-L1513 — def open_verified_read(self, relative: str | Path) -> VerifiedWorkspaceFile
- open_verified_directory · method · L1515-L1534 — def open_verified_directory(self, relative: str | Path) -> SecureWorkspaceDirectory
- _resolved_path_checker · method · L1536-L1583 — def _resolved_path_checker( self, *, include_unattended_basenames: bool ) -> Callable[[Path], bool]
- is_secret · function · L1556-L1581 — def is_secret(candidate: Path) -> bool
- resolved_secret_checker · method · L1585-L1588 — def resolved_secret_checker(self) -> Callable[[Path], bool]
- resolved_credential_checker · method · L1590-L1593 — def resolved_credential_checker(self) -> Callable[[Path], bool]
- resolve · method · L1595-L1630 — def resolve(self, relative: str, *, must_exist: bool = False) -> Path
- is_secret_path · method · L1633-L1635 — def is_secret_path(path: str) -> bool
- _execute_compat · method · L1637-L1644 — def _execute_compat(self, host_method: str, spec: dict) -> dict
- read_file · method · L1646-L1647 — def read_file(self, spec: dict) -> dict
- write_file · method · L1649-L1650 — def write_file(self, spec: dict) -> dict
- edit_file · method · L1652-L1653 — def edit_file(self, spec: dict) -> dict
- glob · method · L1655-L1656 — def glob(self, spec: dict) -> dict
- grep · method · L1658-L1659 — def grep(self, spec: dict) -> dict
- list_dir · method · L1661-L1662 — def list_dir(self, spec: dict) -> dict