← Về thư mục
openai4s/permissions.py
- _scope · function · L35-L36 — def _scope(value: str | None) -> str
- _daemon_config · function · L39-L44 — def _daemon_config()
- _recomputed_action_digest · function · L47-L62 — def _recomputed_action_digest(request) -> str | None
- _guardian_hard_deny · function · L65-L108 — def _guardian_hard_deny( store, *, root_frame_id: str | None, project_id: str, tool: str, target: str, ) -> bool
- _guardian_denial_history · function · L111-L122 — def _guardian_denial_history(store, root_frame_id: str | None) -> list[bool]
- guardian_denial_history · function · L125-L133 — def guardian_denial_history(store, root_frame_id: str | None) -> list[bool]
- _active_auto_mode_run_for_permission · function · L136-L175 — def _active_auto_mode_run_for_permission( store, root_frame_id: str | None, request: dict ) -> dict | None
- _start_guardian_assessment · function · L178-L218 — def _start_guardian_assessment( store, *, root_frame_id: str | None, request: dict, ) -> dict | None
- _complete_guardian_assessment · function · L221-L252 — def _complete_guardian_assessment( store, assessment: dict | None, *, decision: tuple[bool, str], dangerous: bool, structural: bool, ) -> str | None
- _stage7_auto_review_requested · function · L255-L298 — def _stage7_auto_review_requested( config: Any = None, approvals_reviewer: str | None = None ) -> bool
- _unattended_file_policy_reason · function · L301-L323 — def _unattended_file_policy_reason( *, enabled: bool, tool: str, target: str, canonical_arguments: Any, resolved_file_path: str | None, resolved_file_is_credential: bool, ) -> str | None
- _file_policy_review_kind · function · L326-L335 — def _file_policy_review_kind(reason: str) -> str
- _safe_resolved_review_path · function · L338-L349 — def _safe_resolved_review_path(value: str | None) -> str | None
- _restart_resolution_marker · function · L352-L433 — def _restart_resolution_marker(store, request: dict, *, allow: bool) -> bool
- suggest_patterns · function · L436-L474 — def suggest_patterns(method: str, target: str) -> list[str]
- _Pending · class · L477-L509 — class _Pending
- init · method · L492-L509 — def init( self, payload: dict, store=None, *, expected_action_digest: str | None = None, )
- PermissionBroker · class · L512-L1716 — class PermissionBroker
- init · method · L523-L537 — def init(self) -> None: #: How the broker learns which approvals reviewer a conversation #: actually selected. This is a PORT, not an import: the durable #: selection is Web-session state owned by
openai4s/server/, while #: the broker is core infrastructure the CLI shares. Reaching into the #: server package from here would invert the dependency, and #: tests/test_config.py asserts that boundary. The server registers #: its adapter at startup; the CLI, which has no such state, leaves it #: unset and the operator's environment decides -- the only thing there #: is to decide from in a one-shot run.
- register_channel · method · L540-L558 — def register_channel( self, root_frame_id: str, emit: Callable[[dict], Any], cancel_event: threading.Event | None = None, watching: Callable[[], bool] | None = None, guardian_terminal: Callable[[str], Any] | None = None, store=None, ) -> None: #
watching is UI metadata only. Approval correctness never depends on # a subscriber being present: unwatched requests remain durably pending.
- _notify_guardian_terminal · method · L561-L568 — def _notify_guardian_terminal(channel: dict | None, message: str) -> None
- unregister_channel · method · L570-L572 — def unregister_channel(self, root_frame_id: str) -> None
- pending_events · method · L574-L599 — def pending_events(self, root_frame_id: str, *, store=None) -> list[dict]
- is_pending · method · L601-L606 — def is_pending(self, root_frame_id: str) -> bool
- set_approvals_reviewer_resolver · method · L608-L619 — def set_approvals_reviewer_resolver( self, resolver: Callable[[Any, str, str], str] | None ) -> None
- _approvals_reviewer · method · L621-L640 — def _approvals_reviewer( self, store, root_frame_id: str | None, project_id: str ) -> str
- _permission_scope · method · L643-L666 — def _permission_scope( store, frame_id: str | None, project_id: str | None ) -> tuple[str | None, str | None]
- approvals_reviewer_for · method · L668-L685 — def approvals_reviewer_for( self, *, store, frame_id: str | None, project_id: str | None = None, ) -> str
- guardian_adjudicates · method · L687-L709 — def guardian_adjudicates( self, *, store, frame_id: str | None, guardian_config: Any = None, project_id: str | None = None, ) -> bool
- approval_reachable · method · L711-L799 — def approval_reachable( self, *, store, frame_id: str | None, method: str, dangerous: bool = False, side_effect_class: str | None = None, guardian_config: Any = None, project_id: str | None = None, ) -> bool
- _resolve_guardian_decision · method · L801-L872 — def _resolve_guardian_decision( self, store, *, decision_id: str, root: str | None, chan: dict | None, created_request: dict, decision: tuple[bool, str], audit_id: str | None = None, structural: bool = False, circuit_open: bool = False, ) -> dict
- gate · method · L875-L1403 — def gate( self, *, store, frame_id: str | None, method: str, target: str = "", view: tuple | None = None, project_id: str | None = None, action_group_id: str | None = None, action_id: str | None = None, tool_call_id: str | None = None, side_effect_class: str | None = None, resource_keys: list[str] | tuple[str, ...] | None = None, dangerous: bool = False, canonical_arguments: Any = None, resolved_file_path: str | None = None, resolved_file_is_credential: bool = False, guardian_config: Any = None, approvals_reviewer: str | None = None, timeout: float | None = None, ) -> dict: # Resolve the conversation identity + project from the dispatcher's frame # (works for root, background and delegated child dispatchers alike).
- resolve · method · L1406-L1423 — def resolve( self, decision_id: str | None, *, allow: bool, scope: str = "once", pattern: str | None = None, message: str | None = None, ) -> bool
- resolve_result · method · L1425-L1705 — def resolve_result( self, decision_id: str | None, *, allow: bool, scope: str = "once", pattern: str | None = None, message: str | None = None, store=None, root_frame_id: str | None = None, ) -> dict
- cancel_root · method · L1707-L1716 — def cancel_root(self, root_frame_id: str) -> None
- broker · function · L1723-L1729 — def broker() -> PermissionBroker