Adds the mail-intake wiki to the hub alongside lib and mcp and picks up the regenerated flat lib reference and standardized MCP modules.
99 lines
8.3 KiB
JSON
99 lines
8.3 KiB
JSON
{
|
|
"module": "mail_intake.adapters.gmail",
|
|
"content": {
|
|
"path": "mail_intake.adapters.gmail",
|
|
"docstring": "# Summary\n\nGmail adapter implementation for Mail Intake.\n\nThis module provides a **Gmail-specific implementation** of the\n`MailIntakeAdapter` contract.\n\nIt is the only place in the codebase where:\n\n- `googleapiclient` is imported.\n- Gmail REST API semantics are known.\n- Low-level `.execute()` calls are made.\n\nAll Gmail-specific behavior must be strictly contained within this module.",
|
|
"objects": {
|
|
"MailIntakeAdapter": {
|
|
"name": "MailIntakeAdapter",
|
|
"kind": "class",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAdapter",
|
|
"signature": null,
|
|
"docstring": "Base adapter interface for mail providers.\n\nNotes:\n **Guarantees:**\n\n - Discover messages matching a query.\n - Retrieve full message payloads.\n - Retrieve full thread payloads.\n\n **Lifecycle:**\n\n - Adapters are intentionally read-only and must not mutate provider state.",
|
|
"members": {
|
|
"iter_message_refs": {
|
|
"name": "iter_message_refs",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.iter_message_refs",
|
|
"signature": "iter_message_refs(query: str)",
|
|
"docstring": "Iterate over lightweight message references matching a query.\n\nArgs:\n query (str):\n Provider-specific query string used to filter messages.\n\nReturns:\n Iterator[dict[str, str]]:\n An iterator over lightweight message reference dictionaries.\n\nYields:\n dict[str, str]:\n Dictionaries containing message and thread identifiers.\n\nNotes:\n **Guarantees:**\n\n - Implementations must yield dictionaries containing at least\n `message_id` and `thread_id`.\n\nExample:\n Typical yield:\n\n ```python\n {\n \"message_id\": \"...\",\n \"thread_id\": \"...\"\n }\n ```"
|
|
},
|
|
"fetch_message": {
|
|
"name": "fetch_message",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_message",
|
|
"signature": "fetch_message(message_id: str)",
|
|
"docstring": "Fetch a full raw message by message identifier.\n\nArgs:\n message_id (str):\n Provider-specific message identifier.\n\nReturns:\n dict[str, Any]:\n Provider-native message payload (e.g., Gmail message JSON structure)."
|
|
},
|
|
"fetch_thread": {
|
|
"name": "fetch_thread",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAdapter.fetch_thread",
|
|
"signature": "fetch_thread(thread_id: str)",
|
|
"docstring": "Fetch a full raw thread by thread identifier.\n\nArgs:\n thread_id (str):\n Provider-specific thread identifier.\n\nReturns:\n dict[str, Any]:\n Provider-native thread payload."
|
|
}
|
|
}
|
|
},
|
|
"MailIntakeAuthProvider": {
|
|
"name": "MailIntakeAuthProvider",
|
|
"kind": "class",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider",
|
|
"signature": null,
|
|
"docstring": "Abstract base class for authentication providers.\n\nThis interface enforces a strict contract between authentication\nproviders and mail adapters by requiring providers to explicitly\ndeclare the type of credentials they return.\n\nNotes:\n **Responsibilities:**\n\n - Acquire credentials from an external provider.\n - Refresh or revalidate credentials as needed.\n - Handle authentication-specific failure modes.\n - Coordinate with credential persistence layers where applicable.\n\n **Constraints:**\n\n - Mail adapters must treat returned credentials as opaque and\n provider-specific.\n - Mail adapters rely only on the declared credential type expected\n by the adapter.",
|
|
"members": {
|
|
"get_credentials": {
|
|
"name": "get_credentials",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAuthProvider.get_credentials",
|
|
"signature": "get_credentials()",
|
|
"docstring": "Retrieve valid, provider-specific credentials.\n\nReturns:\n T:\n Credentials of type `T` suitable for immediate use by the\n corresponding mail adapter.\n\nRaises:\n Exception:\n An authentication-specific exception indicating that\n credentials could not be obtained or validated.\n\nNotes:\n **Guarantees:**\n\n - This method is synchronous by design.\n - Represents the sole entry point through which adapters obtain\n authentication material.\n - Implementations must either return credentials of the declared\n type `T` that are valid at the time of return or raise an exception."
|
|
}
|
|
}
|
|
},
|
|
"MailIntakeAdapterError": {
|
|
"name": "MailIntakeAdapterError",
|
|
"kind": "class",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeAdapterError",
|
|
"signature": null,
|
|
"docstring": "Errors raised by mail provider adapters.\n\nNotes:\n **Lifecycle:**\n\n - Raised when a provider adapter encounters API errors, transport\n failures, or invalid provider responses."
|
|
},
|
|
"MailIntakeGmailAdapter": {
|
|
"name": "MailIntakeGmailAdapter",
|
|
"kind": "class",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter",
|
|
"signature": "MailIntakeGmailAdapter(auth_provider: MailIntakeAuthProvider[Any], user_id: str = 'me')",
|
|
"docstring": "Gmail read-only adapter.\n\nThis adapter implements the `MailIntakeAdapter` interface using the\nGmail REST API. It translates the generic mail intake contract into\nGmail-specific API calls.\n\nNotes:\n **Responsibilities:**\n\n - This class is the ONLY place where `googleapiclient` is imported.\n - Gmail REST semantics are known.\n - `.execute()` is called.\n\n **Constraints:**\n\n - Must remain thin and imperative.\n - Must not perform parsing or interpretation.\n - Must not expose Gmail-specific types beyond this class.",
|
|
"members": {
|
|
"service": {
|
|
"name": "service",
|
|
"kind": "attribute",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.service",
|
|
"signature": null,
|
|
"docstring": "Lazily initialize and return the Gmail API service client.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail service cannot be initialized."
|
|
},
|
|
"iter_message_refs": {
|
|
"name": "iter_message_refs",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.iter_message_refs",
|
|
"signature": "iter_message_refs(query: str) -> Iterator[dict[str, str]]",
|
|
"docstring": "Iterate over message references matching the query.\n\nArgs:\n query (str):\n Gmail search query string.\n\nYields:\n dict[str, str]:\n Dictionaries containing ``message_id`` and ``thread_id``.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
|
},
|
|
"fetch_message": {
|
|
"name": "fetch_message",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_message",
|
|
"signature": "fetch_message(message_id: str) -> dict[str, Any]",
|
|
"docstring": "Fetch a full Gmail message by message ID.\n\nArgs:\n message_id (str):\n Gmail message identifier.\n\nReturns:\n dict[str, Any]:\n Provider-native Gmail message payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
|
},
|
|
"fetch_thread": {
|
|
"name": "fetch_thread",
|
|
"kind": "function",
|
|
"path": "mail_intake.adapters.gmail.MailIntakeGmailAdapter.fetch_thread",
|
|
"signature": "fetch_thread(thread_id: str) -> dict[str, Any]",
|
|
"docstring": "Fetch a full Gmail thread by thread ID.\n\nArgs:\n thread_id (str):\n Gmail thread identifier.\n\nReturns:\n dict[str, Any]:\n Provider-native Gmail thread payload.\n\nRaises:\n MailIntakeAdapterError:\n If the Gmail API returns an error."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |