agentmail 0.2.14 → 0.2.16
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.
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/websockets/client/Client.d.ts +2 -2
- package/dist/cjs/api/resources/websockets/client/Client.js +2 -2
- package/dist/cjs/environments.d.ts +5 -1
- package/dist/cjs/environments.js +4 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/websockets/client/Client.d.mts +2 -2
- package/dist/esm/api/resources/websockets/client/Client.mjs +2 -2
- package/dist/esm/environments.d.mts +5 -1
- package/dist/esm/environments.mjs +4 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/dist/llms-full.txt +54 -1
- package/dist/llms.txt +1 -0
- package/package.json +1 -1
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "agentmail",
|
|
46
|
-
"X-Fern-SDK-Version": "0.2.
|
|
47
|
-
"User-Agent": "agentmail/0.2.
|
|
46
|
+
"X-Fern-SDK-Version": "0.2.16",
|
|
47
|
+
"User-Agent": "agentmail/0.2.16",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -4,7 +4,7 @@ import { WebsocketsSocket } from "./Socket.js";
|
|
|
4
4
|
export declare namespace WebsocketsClient {
|
|
5
5
|
type Options = BaseClientOptions;
|
|
6
6
|
interface ConnectArgs {
|
|
7
|
-
apiKey
|
|
7
|
+
apiKey?: string;
|
|
8
8
|
/** Additional query parameters to send with the websocket connect request. */
|
|
9
9
|
queryParams?: Record<string, unknown>;
|
|
10
10
|
/** Arbitrary headers to send with the websocket connect request. */
|
|
@@ -18,5 +18,5 @@ export declare namespace WebsocketsClient {
|
|
|
18
18
|
export declare class WebsocketsClient {
|
|
19
19
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebsocketsClient.Options>;
|
|
20
20
|
constructor(options?: WebsocketsClient.Options);
|
|
21
|
-
connect(args
|
|
21
|
+
connect(args?: WebsocketsClient.ConnectArgs): Promise<WebsocketsSocket>;
|
|
22
22
|
}
|
|
@@ -53,8 +53,8 @@ class WebsocketsClient {
|
|
|
53
53
|
constructor(options = {}) {
|
|
54
54
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
55
55
|
}
|
|
56
|
-
connect(
|
|
57
|
-
return __awaiter(this,
|
|
56
|
+
connect() {
|
|
57
|
+
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
58
58
|
var _a, _b;
|
|
59
59
|
const { apiKey, queryParams, headers, debug, reconnectAttempts } = args;
|
|
60
60
|
const _queryParams = {
|
|
@@ -11,5 +11,9 @@ export declare const AgentMailEnvironment: {
|
|
|
11
11
|
readonly http: "https://x402.api.agentmail.to";
|
|
12
12
|
readonly websockets: "wss://x402.ws.agentmail.to";
|
|
13
13
|
};
|
|
14
|
+
readonly EuProd: {
|
|
15
|
+
readonly http: "https://api.agentmail.eu";
|
|
16
|
+
readonly websockets: "wss://ws.agentmail.eu";
|
|
17
|
+
};
|
|
14
18
|
};
|
|
15
|
-
export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402;
|
|
19
|
+
export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402 | typeof AgentMailEnvironment.EuProd;
|
package/dist/cjs/environments.js
CHANGED
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.2.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.16";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "agentmail",
|
|
9
|
-
"X-Fern-SDK-Version": "0.2.
|
|
10
|
-
"User-Agent": "agentmail/0.2.
|
|
9
|
+
"X-Fern-SDK-Version": "0.2.16",
|
|
10
|
+
"User-Agent": "agentmail/0.2.16",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
@@ -4,7 +4,7 @@ import { WebsocketsSocket } from "./Socket.mjs";
|
|
|
4
4
|
export declare namespace WebsocketsClient {
|
|
5
5
|
type Options = BaseClientOptions;
|
|
6
6
|
interface ConnectArgs {
|
|
7
|
-
apiKey
|
|
7
|
+
apiKey?: string;
|
|
8
8
|
/** Additional query parameters to send with the websocket connect request. */
|
|
9
9
|
queryParams?: Record<string, unknown>;
|
|
10
10
|
/** Arbitrary headers to send with the websocket connect request. */
|
|
@@ -18,5 +18,5 @@ export declare namespace WebsocketsClient {
|
|
|
18
18
|
export declare class WebsocketsClient {
|
|
19
19
|
protected readonly _options: NormalizedClientOptionsWithAuth<WebsocketsClient.Options>;
|
|
20
20
|
constructor(options?: WebsocketsClient.Options);
|
|
21
|
-
connect(args
|
|
21
|
+
connect(args?: WebsocketsClient.ConnectArgs): Promise<WebsocketsSocket>;
|
|
22
22
|
}
|
|
@@ -17,8 +17,8 @@ export class WebsocketsClient {
|
|
|
17
17
|
constructor(options = {}) {
|
|
18
18
|
this._options = normalizeClientOptionsWithAuth(options);
|
|
19
19
|
}
|
|
20
|
-
connect(
|
|
21
|
-
return __awaiter(this,
|
|
20
|
+
connect() {
|
|
21
|
+
return __awaiter(this, arguments, void 0, function* (args = {}) {
|
|
22
22
|
var _a, _b;
|
|
23
23
|
const { apiKey, queryParams, headers, debug, reconnectAttempts } = args;
|
|
24
24
|
const _queryParams = {
|
|
@@ -11,5 +11,9 @@ export declare const AgentMailEnvironment: {
|
|
|
11
11
|
readonly http: "https://x402.api.agentmail.to";
|
|
12
12
|
readonly websockets: "wss://x402.ws.agentmail.to";
|
|
13
13
|
};
|
|
14
|
+
readonly EuProd: {
|
|
15
|
+
readonly http: "https://api.agentmail.eu";
|
|
16
|
+
readonly websockets: "wss://ws.agentmail.eu";
|
|
17
|
+
};
|
|
14
18
|
};
|
|
15
|
-
export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402;
|
|
19
|
+
export type AgentMailEnvironment = typeof AgentMailEnvironment.Prod | typeof AgentMailEnvironment.ProdX402 | typeof AgentMailEnvironment.EuProd;
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.2.
|
|
1
|
+
export declare const SDK_VERSION = "0.2.16";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.2.
|
|
1
|
+
export const SDK_VERSION = "0.2.16";
|
package/dist/llms-full.txt
CHANGED
|
@@ -4593,6 +4593,59 @@ main();
|
|
|
4593
4593
|
***
|
|
4594
4594
|
|
|
4595
4595
|
|
|
4596
|
+
***
|
|
4597
|
+
|
|
4598
|
+
title: WebSockets Quickstart
|
|
4599
|
+
subtitle: Get started with real-time email event streaming
|
|
4600
|
+
slug: websockets/quickstart
|
|
4601
|
+
---------------------------
|
|
4602
|
+
|
|
4603
|
+
```typescript title="TypeScript"
|
|
4604
|
+
import { AgentMailClient } from "agentmail";
|
|
4605
|
+
|
|
4606
|
+
const client = new AgentMailClient();
|
|
4607
|
+
|
|
4608
|
+
async function main() {
|
|
4609
|
+
const socket = await client.websockets.connect({
|
|
4610
|
+
apiKey: process.env.AGENTMAIL_API_KEY,
|
|
4611
|
+
});
|
|
4612
|
+
|
|
4613
|
+
socket.on("message", async (event) => {
|
|
4614
|
+
if (event.type === "subscribed") {
|
|
4615
|
+
console.log("Subscribed to", event.inboxIds);
|
|
4616
|
+
} else if (event.eventType === "message.received") {
|
|
4617
|
+
console.log(`Received message from: ${event.message.from}`);
|
|
4618
|
+
}
|
|
4619
|
+
});
|
|
4620
|
+
|
|
4621
|
+
await socket.waitForOpen();
|
|
4622
|
+
|
|
4623
|
+
socket.sendSubscribe({
|
|
4624
|
+
type: "subscribe",
|
|
4625
|
+
inboxIds: ["my-agent@agentmail.to"],
|
|
4626
|
+
});
|
|
4627
|
+
}
|
|
4628
|
+
|
|
4629
|
+
main();
|
|
4630
|
+
```
|
|
4631
|
+
|
|
4632
|
+
```python title="Python"
|
|
4633
|
+
from agentmail import AgentMail, MessageReceivedEvent, Subscribe, Subscribed
|
|
4634
|
+
|
|
4635
|
+
client = AgentMail()
|
|
4636
|
+
|
|
4637
|
+
with client.websockets.connect() as socket:
|
|
4638
|
+
socket.send_subscribe(Subscribe(inbox_ids=["my-agent@agentmail.to"]))
|
|
4639
|
+
|
|
4640
|
+
for event in socket:
|
|
4641
|
+
if isinstance(event, Subscribed):
|
|
4642
|
+
print(f"Subscribed to {event.inbox_ids}")
|
|
4643
|
+
elif isinstance(event, MessageReceivedEvent):
|
|
4644
|
+
msg = event.message
|
|
4645
|
+
print(f"Received message from: {msg.from_}")
|
|
4646
|
+
```
|
|
4647
|
+
|
|
4648
|
+
|
|
4596
4649
|
***
|
|
4597
4650
|
|
|
4598
4651
|
title: Email Deliverability
|
|
@@ -21826,7 +21879,7 @@ channels:
|
|
|
21826
21879
|
query:
|
|
21827
21880
|
type: object
|
|
21828
21881
|
properties:
|
|
21829
|
-
|
|
21882
|
+
api_key:
|
|
21830
21883
|
type: string
|
|
21831
21884
|
publish:
|
|
21832
21885
|
operationId: websockets-publish
|
package/dist/llms.txt
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
- [Webhook Setup Guide](https://docs.agentmail.to/webhook-setup.mdx): A comprehensive guide to setting up webhooks with ngrok and AgentMail, including account creation, inbox setup, and code examples.
|
|
27
27
|
- [Verifying Webhooks](https://docs.agentmail.to/webhook-verification.mdx): Learn how to verify webhook signatures to secure your webhook endpoints and prevent spoofed requests.
|
|
28
28
|
- [WebSockets](https://docs.agentmail.to/websockets.mdx): Learn how to use WebSockets for instant email notifications without webhooks or polling.
|
|
29
|
+
- [WebSockets Quickstart](https://docs.agentmail.to/websockets/quickstart.mdx): Get started with real-time email event streaming
|
|
29
30
|
- [Email Deliverability](https://docs.agentmail.to/email-deliverability.mdx): Learn the strategies and best practices for maximizing your email deliverability with AgentMail.
|
|
30
31
|
- [Idempotent Requests](https://docs.agentmail.to/idempotency.mdx): A guide to using the client_id parameter in AgentMail to prevent duplicate resources and safely retry API requests.
|
|
31
32
|
- [Example: Event-Driven Agent](https://docs.agentmail.to/webhook-agent.mdx): A step-by-step guide to building a sophisticated agent that performs proactive outreach and uses webhooks for inbound message processing.
|