mailsai 0.2.2__tar.gz → 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mailsai
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in.
5
5
  Author-email: "Mails.ai" <support@mails.ai>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://mails.ai
8
8
  Project-URL: Documentation, https://mails.ai/docs
9
- Project-URL: Source, https://github.com/RolloutsAI/mailsai
10
- Project-URL: Issues, https://github.com/RolloutsAI/mailsai/issues
9
+ Project-URL: Source, https://github.com/mailsai/mailsai
10
+ Project-URL: Issues, https://github.com/mailsai/mailsai/issues
11
11
  Keywords: email,ai,agent,mcp,mails.ai,agent-identity,sender-reputation,agent-email,prompt-injection,transactional-email
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Intended Audience :: Developers
@@ -157,7 +157,7 @@ except MailsError as e:
157
157
  ## Documentation
158
158
 
159
159
  - Full docs: [mails.ai/docs](https://mails.ai/docs)
160
- - Source: [github.com/RolloutsAI/mailsai](https://github.com/RolloutsAI/mailsai/tree/main/packages/sdk-py)
160
+ - Source: [github.com/mailsai/mailsai](https://github.com/mailsai/mailsai/tree/main/packages/sdk-py)
161
161
 
162
162
  ## License
163
163
 
@@ -129,7 +129,7 @@ except MailsError as e:
129
129
  ## Documentation
130
130
 
131
131
  - Full docs: [mails.ai/docs](https://mails.ai/docs)
132
- - Source: [github.com/RolloutsAI/mailsai](https://github.com/RolloutsAI/mailsai/tree/main/packages/sdk-py)
132
+ - Source: [github.com/mailsai/mailsai](https://github.com/mailsai/mailsai/tree/main/packages/sdk-py)
133
133
 
134
134
  ## License
135
135
 
@@ -98,6 +98,22 @@ def _require_httpx() -> Any:
98
98
  return httpx
99
99
 
100
100
 
101
+ def _fold_body(kwargs: Dict[str, Any]) -> None:
102
+ """Fold the ergonomic aliases into the canonical fields, in place.
103
+
104
+ `body` is an SDK-level convenience the TypeScript client has always had
105
+ (`body_text: input.body_text ?? input.body`), and `text`/`html` are the Resend-shaped
106
+ aliases the API accepts. This client had NEITHER on Client.send() — only on the
107
+ Agent.send() helper — so the exact snippet in our own README, `send(**{"from": …,
108
+ "body": …})`, reached the server with an unknown `body` field and came back
109
+ "At least one of html (or body_html) and text (or body_text) is required".
110
+ Explicit canonical fields always win.
111
+ """
112
+ text = kwargs.pop("body", None)
113
+ if kwargs.get("body_text") is None and kwargs.get("text") is None and text is not None:
114
+ kwargs["body_text"] = text
115
+
116
+
101
117
  class Client:
102
118
  """Low-level Mails.ai REST client."""
103
119
 
@@ -238,6 +254,7 @@ class Client:
238
254
  idempotency_key = kwargs.pop("idempotency_key", None)
239
255
  if agent is not None:
240
256
  kwargs["agent"] = agent
257
+ _fold_body(kwargs)
241
258
  body = {k: v for k, v in kwargs.items() if v is not None}
242
259
  headers = {"Idempotency-Key": idempotency_key} if idempotency_key else None
243
260
  return self._request("POST", "/api/v1/messages", body, headers)
@@ -252,10 +269,12 @@ class Client:
252
269
  return self._request("GET", "/api/v1/me")
253
270
 
254
271
  def reply(self, message_id: str, **kwargs: Any) -> Dict[str, Any]:
272
+ _fold_body(kwargs)
255
273
  body = {k: v for k, v in kwargs.items() if v is not None}
256
274
  return self._request("POST", f"/api/v1/messages/{message_id}/reply", body)
257
275
 
258
276
  def forward(self, message_id: str, **kwargs: Any) -> Dict[str, Any]:
277
+ _fold_body(kwargs)
259
278
  body = {k: v for k, v in kwargs.items() if v is not None}
260
279
  return self._request("POST", f"/api/v1/messages/{message_id}/forward", body)
261
280
 
@@ -1,13 +1,13 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mailsai
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in.
5
5
  Author-email: "Mails.ai" <support@mails.ai>
6
6
  License: MIT
7
7
  Project-URL: Homepage, https://mails.ai
8
8
  Project-URL: Documentation, https://mails.ai/docs
9
- Project-URL: Source, https://github.com/RolloutsAI/mailsai
10
- Project-URL: Issues, https://github.com/RolloutsAI/mailsai/issues
9
+ Project-URL: Source, https://github.com/mailsai/mailsai
10
+ Project-URL: Issues, https://github.com/mailsai/mailsai/issues
11
11
  Keywords: email,ai,agent,mcp,mails.ai,agent-identity,sender-reputation,agent-email,prompt-injection,transactional-email
12
12
  Classifier: Development Status :: 4 - Beta
13
13
  Classifier: Intended Audience :: Developers
@@ -157,7 +157,7 @@ except MailsError as e:
157
157
  ## Documentation
158
158
 
159
159
  - Full docs: [mails.ai/docs](https://mails.ai/docs)
160
- - Source: [github.com/RolloutsAI/mailsai](https://github.com/RolloutsAI/mailsai/tree/main/packages/sdk-py)
160
+ - Source: [github.com/mailsai/mailsai](https://github.com/mailsai/mailsai/tree/main/packages/sdk-py)
161
161
 
162
162
  ## License
163
163
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "mailsai"
7
- version = "0.2.2"
7
+ version = "0.2.4"
8
8
  description = "Email API for AI agents — Python SDK. Per-agent email addresses on your domain, per-agent reputation, and prompt-injection scanning on every inbound. Send, receive structured inbound replies, and identify agents via REST. Intent + entity extraction is opt-in."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -29,8 +29,8 @@ dependencies = ["httpx>=0.24.0"]
29
29
  [project.urls]
30
30
  Homepage = "https://mails.ai"
31
31
  Documentation = "https://mails.ai/docs"
32
- Source = "https://github.com/RolloutsAI/mailsai"
33
- Issues = "https://github.com/RolloutsAI/mailsai/issues"
32
+ Source = "https://github.com/mailsai/mailsai"
33
+ Issues = "https://github.com/mailsai/mailsai/issues"
34
34
 
35
35
  [tool.setuptools]
36
36
  packages = ["mailsai"]
File without changes
File without changes