agentmail 0.2.9 → 0.2.11

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.
Files changed (28) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/drafts/client/Client.d.ts +12 -0
  3. package/dist/cjs/api/resources/drafts/client/Client.js +62 -0
  4. package/dist/cjs/api/resources/drafts/types/CreateDraftRequest.d.ts +2 -0
  5. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.d.ts +13 -0
  6. package/dist/cjs/api/resources/inboxes/resources/drafts/client/Client.js +63 -0
  7. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.d.ts +13 -0
  8. package/dist/cjs/api/resources/pods/resources/drafts/client/Client.js +63 -0
  9. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.d.ts +2 -0
  10. package/dist/cjs/serialization/resources/drafts/types/CreateDraftRequest.js +2 -0
  11. package/dist/cjs/version.d.ts +1 -1
  12. package/dist/cjs/version.js +1 -1
  13. package/dist/esm/BaseClient.mjs +2 -2
  14. package/dist/esm/api/resources/drafts/client/Client.d.mts +12 -0
  15. package/dist/esm/api/resources/drafts/client/Client.mjs +62 -0
  16. package/dist/esm/api/resources/drafts/types/CreateDraftRequest.d.mts +2 -0
  17. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.d.mts +13 -0
  18. package/dist/esm/api/resources/inboxes/resources/drafts/client/Client.mjs +63 -0
  19. package/dist/esm/api/resources/pods/resources/drafts/client/Client.d.mts +13 -0
  20. package/dist/esm/api/resources/pods/resources/drafts/client/Client.mjs +63 -0
  21. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.d.mts +2 -0
  22. package/dist/esm/serialization/resources/drafts/types/CreateDraftRequest.mjs +2 -0
  23. package/dist/esm/version.d.mts +1 -1
  24. package/dist/esm/version.mjs +1 -1
  25. package/dist/llms-full.txt +57 -83
  26. package/dist/llms.txt +1 -1
  27. package/package.json +1 -1
  28. package/reference.md +187 -0
@@ -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.9",
47
- "User-Agent": "agentmail/0.2.9",
46
+ "X-Fern-SDK-Version": "0.2.11",
47
+ "User-Agent": "agentmail/0.2.11",
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);
@@ -32,4 +32,16 @@ export declare class DraftsClient {
32
32
  */
33
33
  get(draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
34
34
  private __get;
35
+ /**
36
+ * @param {AgentMail.DraftId} draft_id
37
+ * @param {AgentMail.AttachmentId} attachment_id
38
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link AgentMail.NotFoundError}
41
+ *
42
+ * @example
43
+ * await client.drafts.getAttachment("draft_id", "attachment_id")
44
+ */
45
+ getAttachment(draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
46
+ private __getAttachment;
35
47
  }
@@ -197,5 +197,67 @@ class DraftsClient {
197
197
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/drafts/{draft_id}");
198
198
  });
199
199
  }
200
+ /**
201
+ * @param {AgentMail.DraftId} draft_id
202
+ * @param {AgentMail.AttachmentId} attachment_id
203
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
204
+ *
205
+ * @throws {@link AgentMail.NotFoundError}
206
+ *
207
+ * @example
208
+ * await client.drafts.getAttachment("draft_id", "attachment_id")
209
+ */
210
+ getAttachment(draft_id, attachment_id, requestOptions) {
211
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(draft_id, attachment_id, requestOptions));
212
+ }
213
+ __getAttachment(draft_id, attachment_id, requestOptions) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
216
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
217
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
218
+ const _response = yield core.fetcher({
219
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
220
+ method: "GET",
221
+ headers: _headers,
222
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
223
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
224
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
225
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
226
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
227
+ logging: this._options.logging,
228
+ });
229
+ if (_response.ok) {
230
+ return {
231
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
232
+ unrecognizedObjectKeys: "passthrough",
233
+ allowUnrecognizedUnionMembers: true,
234
+ allowUnrecognizedEnumValues: true,
235
+ skipValidation: true,
236
+ breadcrumbsPrefix: ["response"],
237
+ }),
238
+ rawResponse: _response.rawResponse,
239
+ };
240
+ }
241
+ if (_response.error.reason === "status-code") {
242
+ switch (_response.error.statusCode) {
243
+ case 404:
244
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
245
+ unrecognizedObjectKeys: "passthrough",
246
+ allowUnrecognizedUnionMembers: true,
247
+ allowUnrecognizedEnumValues: true,
248
+ skipValidation: true,
249
+ breadcrumbsPrefix: ["response"],
250
+ }), _response.rawResponse);
251
+ default:
252
+ throw new errors.AgentMailError({
253
+ statusCode: _response.error.statusCode,
254
+ body: _response.error.body,
255
+ rawResponse: _response.rawResponse,
256
+ });
257
+ }
258
+ }
259
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/drafts/{draft_id}/attachments/{attachment_id}");
260
+ });
261
+ }
200
262
  }
201
263
  exports.DraftsClient = DraftsClient;
@@ -8,6 +8,8 @@ export interface CreateDraftRequest {
8
8
  subject?: AgentMail.DraftSubject;
9
9
  text?: AgentMail.DraftText;
10
10
  html?: AgentMail.DraftHtml;
11
+ /** Attachments to include in draft. */
12
+ attachments?: AgentMail.SendAttachment[];
11
13
  inReplyTo?: AgentMail.DraftInReplyTo;
12
14
  sendAt?: AgentMail.DraftSendAt;
13
15
  clientId?: AgentMail.DraftClientId;
@@ -34,6 +34,19 @@ export declare class DraftsClient {
34
34
  */
35
35
  get(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
36
36
  private __get;
37
+ /**
38
+ * @param {AgentMail.inboxes.InboxId} inbox_id
39
+ * @param {AgentMail.DraftId} draft_id
40
+ * @param {AgentMail.AttachmentId} attachment_id
41
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link AgentMail.NotFoundError}
44
+ *
45
+ * @example
46
+ * await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id")
47
+ */
48
+ getAttachment(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
+ private __getAttachment;
37
50
  /**
38
51
  * @param {AgentMail.inboxes.InboxId} inbox_id
39
52
  * @param {AgentMail.CreateDraftRequest} request
@@ -199,6 +199,69 @@ class DraftsClient {
199
199
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/drafts/{draft_id}");
200
200
  });
201
201
  }
202
+ /**
203
+ * @param {AgentMail.inboxes.InboxId} inbox_id
204
+ * @param {AgentMail.DraftId} draft_id
205
+ * @param {AgentMail.AttachmentId} attachment_id
206
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
207
+ *
208
+ * @throws {@link AgentMail.NotFoundError}
209
+ *
210
+ * @example
211
+ * await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id")
212
+ */
213
+ getAttachment(inbox_id, draft_id, attachment_id, requestOptions) {
214
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(inbox_id, draft_id, attachment_id, requestOptions));
215
+ }
216
+ __getAttachment(inbox_id, draft_id, attachment_id, requestOptions) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
219
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
220
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
221
+ const _response = yield core.fetcher({
222
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
223
+ method: "GET",
224
+ headers: _headers,
225
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
226
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
227
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
228
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
229
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
230
+ logging: this._options.logging,
231
+ });
232
+ if (_response.ok) {
233
+ return {
234
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
235
+ unrecognizedObjectKeys: "passthrough",
236
+ allowUnrecognizedUnionMembers: true,
237
+ allowUnrecognizedEnumValues: true,
238
+ skipValidation: true,
239
+ breadcrumbsPrefix: ["response"],
240
+ }),
241
+ rawResponse: _response.rawResponse,
242
+ };
243
+ }
244
+ if (_response.error.reason === "status-code") {
245
+ switch (_response.error.statusCode) {
246
+ case 404:
247
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
248
+ unrecognizedObjectKeys: "passthrough",
249
+ allowUnrecognizedUnionMembers: true,
250
+ allowUnrecognizedEnumValues: true,
251
+ skipValidation: true,
252
+ breadcrumbsPrefix: ["response"],
253
+ }), _response.rawResponse);
254
+ default:
255
+ throw new errors.AgentMailError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.body,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ }
261
+ }
262
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}");
263
+ });
264
+ }
202
265
  /**
203
266
  * @param {AgentMail.inboxes.InboxId} inbox_id
204
267
  * @param {AgentMail.CreateDraftRequest} request
@@ -34,4 +34,17 @@ export declare class DraftsClient {
34
34
  */
35
35
  get(pod_id: AgentMail.pods.PodId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
36
36
  private __get;
37
+ /**
38
+ * @param {AgentMail.pods.PodId} pod_id
39
+ * @param {AgentMail.DraftId} draft_id
40
+ * @param {AgentMail.AttachmentId} attachment_id
41
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link AgentMail.NotFoundError}
44
+ *
45
+ * @example
46
+ * await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id")
47
+ */
48
+ getAttachment(pod_id: AgentMail.pods.PodId, draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
+ private __getAttachment;
37
50
  }
@@ -199,5 +199,68 @@ class DraftsClient {
199
199
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/drafts/{draft_id}");
200
200
  });
201
201
  }
202
+ /**
203
+ * @param {AgentMail.pods.PodId} pod_id
204
+ * @param {AgentMail.DraftId} draft_id
205
+ * @param {AgentMail.AttachmentId} attachment_id
206
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
207
+ *
208
+ * @throws {@link AgentMail.NotFoundError}
209
+ *
210
+ * @example
211
+ * await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id")
212
+ */
213
+ getAttachment(pod_id, draft_id, attachment_id, requestOptions) {
214
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(pod_id, draft_id, attachment_id, requestOptions));
215
+ }
216
+ __getAttachment(pod_id, draft_id, attachment_id, requestOptions) {
217
+ return __awaiter(this, void 0, void 0, function* () {
218
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
219
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
220
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
221
+ const _response = yield core.fetcher({
222
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
223
+ method: "GET",
224
+ headers: _headers,
225
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
226
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
227
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
228
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
229
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
230
+ logging: this._options.logging,
231
+ });
232
+ if (_response.ok) {
233
+ return {
234
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
235
+ unrecognizedObjectKeys: "passthrough",
236
+ allowUnrecognizedUnionMembers: true,
237
+ allowUnrecognizedEnumValues: true,
238
+ skipValidation: true,
239
+ breadcrumbsPrefix: ["response"],
240
+ }),
241
+ rawResponse: _response.rawResponse,
242
+ };
243
+ }
244
+ if (_response.error.reason === "status-code") {
245
+ switch (_response.error.statusCode) {
246
+ case 404:
247
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
248
+ unrecognizedObjectKeys: "passthrough",
249
+ allowUnrecognizedUnionMembers: true,
250
+ allowUnrecognizedEnumValues: true,
251
+ skipValidation: true,
252
+ breadcrumbsPrefix: ["response"],
253
+ }), _response.rawResponse);
254
+ default:
255
+ throw new errors.AgentMailError({
256
+ statusCode: _response.error.statusCode,
257
+ body: _response.error.body,
258
+ rawResponse: _response.rawResponse,
259
+ });
260
+ }
261
+ }
262
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}");
263
+ });
264
+ }
202
265
  }
203
266
  exports.DraftsClient = DraftsClient;
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../../api/index.js";
2
2
  import * as core from "../../../../core/index.js";
3
3
  import type * as serializers from "../../../index.js";
4
+ import { SendAttachment } from "../../attachments/types/SendAttachment.js";
4
5
  import { DraftBcc } from "./DraftBcc.js";
5
6
  import { DraftCc } from "./DraftCc.js";
6
7
  import { DraftClientId } from "./DraftClientId.js";
@@ -23,6 +24,7 @@ export declare namespace CreateDraftRequest {
23
24
  subject?: DraftSubject.Raw | null;
24
25
  text?: DraftText.Raw | null;
25
26
  html?: DraftHtml.Raw | null;
27
+ attachments?: SendAttachment.Raw[] | null;
26
28
  in_reply_to?: DraftInReplyTo.Raw | null;
27
29
  send_at?: DraftSendAt.Raw | null;
28
30
  client_id?: DraftClientId.Raw | null;
@@ -36,6 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.CreateDraftRequest = void 0;
38
38
  const core = __importStar(require("../../../../core/index.js"));
39
+ const SendAttachment_js_1 = require("../../attachments/types/SendAttachment.js");
39
40
  const DraftBcc_js_1 = require("./DraftBcc.js");
40
41
  const DraftCc_js_1 = require("./DraftCc.js");
41
42
  const DraftClientId_js_1 = require("./DraftClientId.js");
@@ -56,6 +57,7 @@ exports.CreateDraftRequest = core.serialization.object({
56
57
  subject: DraftSubject_js_1.DraftSubject.optional(),
57
58
  text: DraftText_js_1.DraftText.optional(),
58
59
  html: DraftHtml_js_1.DraftHtml.optional(),
60
+ attachments: core.serialization.list(SendAttachment_js_1.SendAttachment).optional(),
59
61
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo_js_1.DraftInReplyTo.optional()),
60
62
  sendAt: core.serialization.property("send_at", DraftSendAt_js_1.DraftSendAt.optional()),
61
63
  clientId: core.serialization.property("client_id", DraftClientId_js_1.DraftClientId.optional()),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.9";
1
+ export declare const SDK_VERSION = "0.2.11";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "0.2.9";
4
+ exports.SDK_VERSION = "0.2.11";
@@ -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.9",
10
- "User-Agent": "agentmail/0.2.9",
9
+ "X-Fern-SDK-Version": "0.2.11",
10
+ "User-Agent": "agentmail/0.2.11",
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);
@@ -32,4 +32,16 @@ export declare class DraftsClient {
32
32
  */
33
33
  get(draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
34
34
  private __get;
35
+ /**
36
+ * @param {AgentMail.DraftId} draft_id
37
+ * @param {AgentMail.AttachmentId} attachment_id
38
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link AgentMail.NotFoundError}
41
+ *
42
+ * @example
43
+ * await client.drafts.getAttachment("draft_id", "attachment_id")
44
+ */
45
+ getAttachment(draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
46
+ private __getAttachment;
35
47
  }
@@ -161,4 +161,66 @@ export class DraftsClient {
161
161
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/drafts/{draft_id}");
162
162
  });
163
163
  }
164
+ /**
165
+ * @param {AgentMail.DraftId} draft_id
166
+ * @param {AgentMail.AttachmentId} attachment_id
167
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
168
+ *
169
+ * @throws {@link AgentMail.NotFoundError}
170
+ *
171
+ * @example
172
+ * await client.drafts.getAttachment("draft_id", "attachment_id")
173
+ */
174
+ getAttachment(draft_id, attachment_id, requestOptions) {
175
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(draft_id, attachment_id, requestOptions));
176
+ }
177
+ __getAttachment(draft_id, attachment_id, requestOptions) {
178
+ return __awaiter(this, void 0, void 0, function* () {
179
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
180
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
181
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
182
+ const _response = yield core.fetcher({
183
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
184
+ method: "GET",
185
+ headers: _headers,
186
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
187
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
188
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
189
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
190
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
191
+ logging: this._options.logging,
192
+ });
193
+ if (_response.ok) {
194
+ return {
195
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
196
+ unrecognizedObjectKeys: "passthrough",
197
+ allowUnrecognizedUnionMembers: true,
198
+ allowUnrecognizedEnumValues: true,
199
+ skipValidation: true,
200
+ breadcrumbsPrefix: ["response"],
201
+ }),
202
+ rawResponse: _response.rawResponse,
203
+ };
204
+ }
205
+ if (_response.error.reason === "status-code") {
206
+ switch (_response.error.statusCode) {
207
+ case 404:
208
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
209
+ unrecognizedObjectKeys: "passthrough",
210
+ allowUnrecognizedUnionMembers: true,
211
+ allowUnrecognizedEnumValues: true,
212
+ skipValidation: true,
213
+ breadcrumbsPrefix: ["response"],
214
+ }), _response.rawResponse);
215
+ default:
216
+ throw new errors.AgentMailError({
217
+ statusCode: _response.error.statusCode,
218
+ body: _response.error.body,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ }
222
+ }
223
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/drafts/{draft_id}/attachments/{attachment_id}");
224
+ });
225
+ }
164
226
  }
@@ -8,6 +8,8 @@ export interface CreateDraftRequest {
8
8
  subject?: AgentMail.DraftSubject;
9
9
  text?: AgentMail.DraftText;
10
10
  html?: AgentMail.DraftHtml;
11
+ /** Attachments to include in draft. */
12
+ attachments?: AgentMail.SendAttachment[];
11
13
  inReplyTo?: AgentMail.DraftInReplyTo;
12
14
  sendAt?: AgentMail.DraftSendAt;
13
15
  clientId?: AgentMail.DraftClientId;
@@ -34,6 +34,19 @@ export declare class DraftsClient {
34
34
  */
35
35
  get(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
36
36
  private __get;
37
+ /**
38
+ * @param {AgentMail.inboxes.InboxId} inbox_id
39
+ * @param {AgentMail.DraftId} draft_id
40
+ * @param {AgentMail.AttachmentId} attachment_id
41
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link AgentMail.NotFoundError}
44
+ *
45
+ * @example
46
+ * await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id")
47
+ */
48
+ getAttachment(inbox_id: AgentMail.inboxes.InboxId, draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
+ private __getAttachment;
37
50
  /**
38
51
  * @param {AgentMail.inboxes.InboxId} inbox_id
39
52
  * @param {AgentMail.CreateDraftRequest} request
@@ -163,6 +163,69 @@ export class DraftsClient {
163
163
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/drafts/{draft_id}");
164
164
  });
165
165
  }
166
+ /**
167
+ * @param {AgentMail.inboxes.InboxId} inbox_id
168
+ * @param {AgentMail.DraftId} draft_id
169
+ * @param {AgentMail.AttachmentId} attachment_id
170
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
171
+ *
172
+ * @throws {@link AgentMail.NotFoundError}
173
+ *
174
+ * @example
175
+ * await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id")
176
+ */
177
+ getAttachment(inbox_id, draft_id, attachment_id, requestOptions) {
178
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(inbox_id, draft_id, attachment_id, requestOptions));
179
+ }
180
+ __getAttachment(inbox_id, draft_id, attachment_id, requestOptions) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
183
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
184
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
185
+ const _response = yield core.fetcher({
186
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/inboxes/${core.url.encodePathParam(serializers.inboxes.InboxId.jsonOrThrow(inbox_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
187
+ method: "GET",
188
+ headers: _headers,
189
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
190
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
191
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
192
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
193
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
194
+ logging: this._options.logging,
195
+ });
196
+ if (_response.ok) {
197
+ return {
198
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
199
+ unrecognizedObjectKeys: "passthrough",
200
+ allowUnrecognizedUnionMembers: true,
201
+ allowUnrecognizedEnumValues: true,
202
+ skipValidation: true,
203
+ breadcrumbsPrefix: ["response"],
204
+ }),
205
+ rawResponse: _response.rawResponse,
206
+ };
207
+ }
208
+ if (_response.error.reason === "status-code") {
209
+ switch (_response.error.statusCode) {
210
+ case 404:
211
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
212
+ unrecognizedObjectKeys: "passthrough",
213
+ allowUnrecognizedUnionMembers: true,
214
+ allowUnrecognizedEnumValues: true,
215
+ skipValidation: true,
216
+ breadcrumbsPrefix: ["response"],
217
+ }), _response.rawResponse);
218
+ default:
219
+ throw new errors.AgentMailError({
220
+ statusCode: _response.error.statusCode,
221
+ body: _response.error.body,
222
+ rawResponse: _response.rawResponse,
223
+ });
224
+ }
225
+ }
226
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/inboxes/{inbox_id}/drafts/{draft_id}/attachments/{attachment_id}");
227
+ });
228
+ }
166
229
  /**
167
230
  * @param {AgentMail.inboxes.InboxId} inbox_id
168
231
  * @param {AgentMail.CreateDraftRequest} request
@@ -34,4 +34,17 @@ export declare class DraftsClient {
34
34
  */
35
35
  get(pod_id: AgentMail.pods.PodId, draft_id: AgentMail.DraftId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.Draft>;
36
36
  private __get;
37
+ /**
38
+ * @param {AgentMail.pods.PodId} pod_id
39
+ * @param {AgentMail.DraftId} draft_id
40
+ * @param {AgentMail.AttachmentId} attachment_id
41
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
42
+ *
43
+ * @throws {@link AgentMail.NotFoundError}
44
+ *
45
+ * @example
46
+ * await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id")
47
+ */
48
+ getAttachment(pod_id: AgentMail.pods.PodId, draft_id: AgentMail.DraftId, attachment_id: AgentMail.AttachmentId, requestOptions?: DraftsClient.RequestOptions): core.HttpResponsePromise<AgentMail.AttachmentResponse>;
49
+ private __getAttachment;
37
50
  }
@@ -163,4 +163,67 @@ export class DraftsClient {
163
163
  return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/drafts/{draft_id}");
164
164
  });
165
165
  }
166
+ /**
167
+ * @param {AgentMail.pods.PodId} pod_id
168
+ * @param {AgentMail.DraftId} draft_id
169
+ * @param {AgentMail.AttachmentId} attachment_id
170
+ * @param {DraftsClient.RequestOptions} requestOptions - Request-specific configuration.
171
+ *
172
+ * @throws {@link AgentMail.NotFoundError}
173
+ *
174
+ * @example
175
+ * await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id")
176
+ */
177
+ getAttachment(pod_id, draft_id, attachment_id, requestOptions) {
178
+ return core.HttpResponsePromise.fromPromise(this.__getAttachment(pod_id, draft_id, attachment_id, requestOptions));
179
+ }
180
+ __getAttachment(pod_id, draft_id, attachment_id, requestOptions) {
181
+ return __awaiter(this, void 0, void 0, function* () {
182
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
183
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
184
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
185
+ const _response = yield core.fetcher({
186
+ url: core.url.join((_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : ((_c = (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.AgentMailEnvironment.Production).http, `/v0/pods/${core.url.encodePathParam(serializers.pods.PodId.jsonOrThrow(pod_id, { omitUndefined: true }))}/drafts/${core.url.encodePathParam(serializers.DraftId.jsonOrThrow(draft_id, { omitUndefined: true }))}/attachments/${core.url.encodePathParam(serializers.AttachmentId.jsonOrThrow(attachment_id, { omitUndefined: true }))}`),
187
+ method: "GET",
188
+ headers: _headers,
189
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
190
+ timeoutMs: ((_f = (_d = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _d !== void 0 ? _d : (_e = this._options) === null || _e === void 0 ? void 0 : _e.timeoutInSeconds) !== null && _f !== void 0 ? _f : 60) * 1000,
191
+ maxRetries: (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.maxRetries,
192
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
193
+ fetchFn: (_j = this._options) === null || _j === void 0 ? void 0 : _j.fetch,
194
+ logging: this._options.logging,
195
+ });
196
+ if (_response.ok) {
197
+ return {
198
+ data: serializers.AttachmentResponse.parseOrThrow(_response.body, {
199
+ unrecognizedObjectKeys: "passthrough",
200
+ allowUnrecognizedUnionMembers: true,
201
+ allowUnrecognizedEnumValues: true,
202
+ skipValidation: true,
203
+ breadcrumbsPrefix: ["response"],
204
+ }),
205
+ rawResponse: _response.rawResponse,
206
+ };
207
+ }
208
+ if (_response.error.reason === "status-code") {
209
+ switch (_response.error.statusCode) {
210
+ case 404:
211
+ throw new AgentMail.NotFoundError(serializers.ErrorResponse.parseOrThrow(_response.error.body, {
212
+ unrecognizedObjectKeys: "passthrough",
213
+ allowUnrecognizedUnionMembers: true,
214
+ allowUnrecognizedEnumValues: true,
215
+ skipValidation: true,
216
+ breadcrumbsPrefix: ["response"],
217
+ }), _response.rawResponse);
218
+ default:
219
+ throw new errors.AgentMailError({
220
+ statusCode: _response.error.statusCode,
221
+ body: _response.error.body,
222
+ rawResponse: _response.rawResponse,
223
+ });
224
+ }
225
+ }
226
+ return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v0/pods/{pod_id}/drafts/{draft_id}/attachments/{attachment_id}");
227
+ });
228
+ }
166
229
  }
@@ -1,6 +1,7 @@
1
1
  import type * as AgentMail from "../../../../api/index.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as serializers from "../../../index.mjs";
4
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
4
5
  import { DraftBcc } from "./DraftBcc.mjs";
5
6
  import { DraftCc } from "./DraftCc.mjs";
6
7
  import { DraftClientId } from "./DraftClientId.mjs";
@@ -23,6 +24,7 @@ export declare namespace CreateDraftRequest {
23
24
  subject?: DraftSubject.Raw | null;
24
25
  text?: DraftText.Raw | null;
25
26
  html?: DraftHtml.Raw | null;
27
+ attachments?: SendAttachment.Raw[] | null;
26
28
  in_reply_to?: DraftInReplyTo.Raw | null;
27
29
  send_at?: DraftSendAt.Raw | null;
28
30
  client_id?: DraftClientId.Raw | null;
@@ -1,5 +1,6 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../core/index.mjs";
3
+ import { SendAttachment } from "../../attachments/types/SendAttachment.mjs";
3
4
  import { DraftBcc } from "./DraftBcc.mjs";
4
5
  import { DraftCc } from "./DraftCc.mjs";
5
6
  import { DraftClientId } from "./DraftClientId.mjs";
@@ -20,6 +21,7 @@ export const CreateDraftRequest = core.serialization.object({
20
21
  subject: DraftSubject.optional(),
21
22
  text: DraftText.optional(),
22
23
  html: DraftHtml.optional(),
24
+ attachments: core.serialization.list(SendAttachment).optional(),
23
25
  inReplyTo: core.serialization.property("in_reply_to", DraftInReplyTo.optional()),
24
26
  sendAt: core.serialization.property("send_at", DraftSendAt.optional()),
25
27
  clientId: core.serialization.property("client_id", DraftClientId.optional()),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.2.9";
1
+ export declare const SDK_VERSION = "0.2.11";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.2.9";
1
+ export const SDK_VERSION = "0.2.11";
@@ -1686,26 +1686,26 @@ The AgentMail MCP server works with any MCP-compatible client, including:
1686
1686
  For detailed setup instructions and available tools, visit [mcp.agentmail.to](https://mcp.agentmail.to).
1687
1687
 
1688
1688
 
1689
- # Moltbot
1689
+ # Openclaw
1690
1690
 
1691
- > AgentMail's Moltbot (Clawdbot) integration
1691
+ > AgentMail's Openclaw integration
1692
1692
 
1693
1693
  ## Getting started
1694
1694
 
1695
- Moltbot (formerly Clawdbot) is an open-source AI personal assistant that runs on your own devices and integrates with messaging platforms like WhatsApp, Telegram, Discord, and Slack. By adding AgentMail to Moltbot, your agent gains the ability to send and receive emails, enabling two-way email conversations alongside your existing chat channels.
1695
+ Openclaw (formerly Moltbot) is an open-source AI personal assistant that runs on your own devices and integrates with messaging platforms like WhatsApp, Telegram, Discord, and Slack. By adding AgentMail to Openclaw, your agent gains the ability to send and receive emails, enabling two-way email conversations alongside your existing chat channels.
1696
1696
 
1697
- There are three ways to integrate AgentMail with Moltbot: using the official AgentMail skill, the AgentMail MCP server, or creating a custom skill.
1697
+ There are two ways to integrate AgentMail with Openclaw: using the official AgentMail skill or creating a custom skill.
1698
1698
 
1699
1699
  ## Option 1: Official AgentMail Skill (Recommended)
1700
1700
 
1701
- The easiest way to add email capabilities to Moltbot is by installing the official AgentMail skill from [skills.sh](https://skills.sh/agentmail-to/agentmail-skills/agentmail). This skill is maintained by the AgentMail team and provides comprehensive email functionality.
1701
+ The easiest way to add email capabilities to Openclaw is by installing the official AgentMail skill from [skills.sh](https://skills.sh/agentmail-to/agentmail-skills/agentmail). This skill is maintained by the AgentMail team and provides comprehensive email functionality.
1702
1702
 
1703
1703
  ### Installation
1704
1704
 
1705
- Install the skill using the Moltbot CLI:
1705
+ Install the skill using the Openclaw CLI:
1706
1706
 
1707
1707
  ```bash
1708
- moltbot skills install agentmail-to/agentmail-skills/agentmail
1708
+ openclaw skills install agentmail-to/agentmail-skills/agentmail
1709
1709
  ```
1710
1710
 
1711
1711
  Or install via ClawdHub:
@@ -1716,7 +1716,7 @@ clawdhub install agentmail
1716
1716
 
1717
1717
  ### Configuration
1718
1718
 
1719
- Add your AgentMail API key to the skill configuration in `~/.clawdbot/moltbot.json`:
1719
+ Add your AgentMail API key to the skill configuration in `~/.openclaw/openclaw.json`:
1720
1720
 
1721
1721
  ```json
1722
1722
  {
@@ -1753,73 +1753,26 @@ The official skill includes:
1753
1753
  Check that the skill is loaded:
1754
1754
 
1755
1755
  ```bash
1756
- moltbot skills list --eligible
1756
+ openclaw skills list --eligible
1757
1757
  ```
1758
1758
 
1759
1759
  You should see `agentmail` in the list of available skills.
1760
1760
 
1761
- ## Option 2: MCP Server
1762
-
1763
- An alternative way to add email capabilities to Moltbot is through the AgentMail MCP server. Moltbot supports MCP (Model Context Protocol) servers, which allows it to connect to external tools like AgentMail.
1764
-
1765
- ### Setup
1766
-
1767
- 1. Get your AgentMail API key from the [AgentMail Console](https://console.agentmail.to).
1768
-
1769
- 2. Add the AgentMail MCP server to your Moltbot configuration. Edit your `~/.clawdbot/moltbot.json` file:
1770
-
1771
- ```json
1772
- {
1773
- "mcp": {
1774
- "servers": {
1775
- "agentmail": {
1776
- "command": "npx",
1777
- "args": ["-y", "@agentmail/mcp-server"],
1778
- "env": {
1779
- "AGENTMAIL_API_KEY": "your-api-key-here"
1780
- }
1781
- }
1782
- }
1783
- }
1784
- }
1785
- ```
1761
+ ## Option 2: Custom Skill
1786
1762
 
1787
- 3. Restart Moltbot to load the new MCP server:
1788
-
1789
- ```bash
1790
- moltbot restart
1791
- ```
1792
-
1793
- 4. Verify the integration by asking Moltbot to list your inboxes:
1794
-
1795
- ```
1796
- List my AgentMail inboxes
1797
- ```
1798
-
1799
- ### Available tools
1800
-
1801
- Once connected, Moltbot can use the following AgentMail tools:
1802
-
1803
- * **Inbox management:** Create, list, and delete inboxes
1804
- * **Message operations:** Send, receive, and reply to emails
1805
- * **Thread management:** Access and manage email threads
1806
- * **Attachments:** Handle email attachments
1807
-
1808
- ## Option 3: Custom Skill
1809
-
1810
- For more control over the integration, you can create a custom AgentMail skill. Skills are directories containing a `SKILL.md` file with instructions for Moltbot.
1763
+ For more control over the integration, you can create a custom AgentMail skill. Skills are directories containing a `SKILL.md` file with instructions for Openclaw.
1811
1764
 
1812
1765
  ### Create the skill directory
1813
1766
 
1814
- Create a new skill in your Moltbot workspace:
1767
+ Create a new skill in your Openclaw workspace:
1815
1768
 
1816
1769
  ```bash
1817
- mkdir -p ~/.clawdbot/skills/agentmail
1770
+ mkdir -p ~/.openclaw/skills/agentmail
1818
1771
  ```
1819
1772
 
1820
1773
  ### Create the skill file
1821
1774
 
1822
- Create `~/.clawdbot/skills/agentmail/SKILL.md` with the following content:
1775
+ Create `~/.openclaw/skills/agentmail/SKILL.md` with the following content:
1823
1776
 
1824
1777
  ````markdown
1825
1778
  ---
@@ -1873,7 +1826,7 @@ curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1873
1826
  -H "Content-Type: application/json" \
1874
1827
  -d '{
1875
1828
  "to": ["recipient@example.com"],
1876
- "subject": "Hello from Moltbot",
1829
+ "subject": "Hello from Openclaw",
1877
1830
  "text": "This email was sent by my AI assistant."
1878
1831
  }' \
1879
1832
  https://api.agentmail.to/v1/inboxes/{inbox_id}/messages
@@ -1898,7 +1851,7 @@ curl -s -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1898
1851
 
1899
1852
  ### Configure the skill
1900
1853
 
1901
- Add your AgentMail API key to the skill configuration in `~/.clawdbot/moltbot.json`:
1854
+ Add your AgentMail API key to the skill configuration in `~/.openclaw/openclaw.json`:
1902
1855
 
1903
1856
  ```json
1904
1857
  {
@@ -1920,14 +1873,14 @@ Add your AgentMail API key to the skill configuration in `~/.clawdbot/moltbot.js
1920
1873
  Check that the skill is loaded:
1921
1874
 
1922
1875
  ```bash
1923
- moltbot skills list --eligible
1876
+ openclaw skills list --eligible
1924
1877
  ```
1925
1878
 
1926
1879
  You should see `agentmail` in the list of available skills.
1927
1880
 
1928
1881
  ## Example use cases
1929
1882
 
1930
- Once AgentMail is integrated with Moltbot, you can ask your agent to:
1883
+ Once AgentMail is integrated with Openclaw, you can ask your agent to:
1931
1884
 
1932
1885
  * "Create a new email inbox for my project"
1933
1886
  * "Check my inbox for new emails"
@@ -1937,9 +1890,9 @@ Once AgentMail is integrated with Moltbot, you can ask your agent to:
1937
1890
 
1938
1891
  ## Real-time email notifications
1939
1892
 
1940
- For proactive email handling, you can combine AgentMail webhooks with Moltbot's webhook support. This allows Moltbot to notify you immediately when new emails arrive.
1893
+ For proactive email handling, you can combine AgentMail webhooks with Openclaw's webhook support. This allows Openclaw to notify you immediately when new emails arrive.
1941
1894
 
1942
- 1. Set up a webhook endpoint in Moltbot (see [Moltbot webhook documentation](https://docs.molt.bot/automation/webhook))
1895
+ 1. Set up a webhook endpoint in Openclaw (see [Openclaw webhook documentation](https://docs.openclaw.ai/automation/webhook))
1943
1896
 
1944
1897
  2. Register the webhook with AgentMail:
1945
1898
 
@@ -1947,21 +1900,20 @@ For proactive email handling, you can combine AgentMail webhooks with Moltbot's
1947
1900
  curl -X POST -H "Authorization: Bearer $AGENTMAIL_API_KEY" \
1948
1901
  -H "Content-Type: application/json" \
1949
1902
  -d '{
1950
- "url": "https://your-moltbot-webhook-url",
1903
+ "url": "https://your-openclaw-webhook-url",
1951
1904
  "events": ["message.received"]
1952
1905
  }' \
1953
1906
  https://api.agentmail.to/v1/webhooks
1954
1907
  ```
1955
1908
 
1956
- Now Moltbot will be notified whenever a new email arrives, allowing it to proactively inform you or take action.
1909
+ Now Openclaw will be notified whenever a new email arrives, allowing it to proactively inform you or take action.
1957
1910
 
1958
1911
  ## Resources
1959
1912
 
1960
1913
  * [Official AgentMail Skill](https://skills.sh/agentmail-to/agentmail-skills/agentmail)
1961
1914
  * [AgentMail API Reference](/api-reference)
1962
- * [AgentMail MCP Server](https://mcp.agentmail.to)
1963
- * [Moltbot Documentation](https://docs.molt.bot)
1964
- * [Moltbot Skills Guide](https://docs.molt.bot/tools/skills)
1915
+ * [Openclaw Documentation](https://docs.openclaw.ai)
1916
+ * [Openclaw Skills Guide](https://docs.openclaw.ai/tools/skills)
1965
1917
 
1966
1918
 
1967
1919
  # Replit
@@ -14172,6 +14124,34 @@ components:
14172
14124
  type: string
14173
14125
  type_drafts:DraftHtml:
14174
14126
  type: string
14127
+ type_attachments:AttachmentFilename:
14128
+ type: string
14129
+ type_attachments:AttachmentContentType:
14130
+ type: string
14131
+ type_attachments:AttachmentContentDisposition:
14132
+ type: string
14133
+ enum:
14134
+ - value: inline
14135
+ - value: attachment
14136
+ type_attachments:AttachmentContentId:
14137
+ type: string
14138
+ type_attachments:SendAttachment:
14139
+ type: object
14140
+ properties:
14141
+ filename:
14142
+ $ref: '#/components/schemas/type_attachments:AttachmentFilename'
14143
+ content_type:
14144
+ $ref: '#/components/schemas/type_attachments:AttachmentContentType'
14145
+ content_disposition:
14146
+ $ref: '#/components/schemas/type_attachments:AttachmentContentDisposition'
14147
+ content_id:
14148
+ $ref: '#/components/schemas/type_attachments:AttachmentContentId'
14149
+ content:
14150
+ type: string
14151
+ description: Base64 encoded content of attachment.
14152
+ url:
14153
+ type: string
14154
+ description: URL to the attachment.
14175
14155
  type_drafts:DraftInReplyTo:
14176
14156
  type: string
14177
14157
  type_drafts:DraftSendAt:
@@ -14198,6 +14178,11 @@ components:
14198
14178
  $ref: '#/components/schemas/type_drafts:DraftText'
14199
14179
  html:
14200
14180
  $ref: '#/components/schemas/type_drafts:DraftHtml'
14181
+ attachments:
14182
+ type: array
14183
+ items:
14184
+ $ref: '#/components/schemas/type_attachments:SendAttachment'
14185
+ description: Attachments to include in draft.
14201
14186
  in_reply_to:
14202
14187
  $ref: '#/components/schemas/type_drafts:DraftInReplyTo'
14203
14188
  send_at:
@@ -14212,19 +14197,8 @@ components:
14212
14197
  type: string
14213
14198
  type_attachments:AttachmentId:
14214
14199
  type: string
14215
- type_attachments:AttachmentFilename:
14216
- type: string
14217
14200
  type_attachments:AttachmentSize:
14218
14201
  type: integer
14219
- type_attachments:AttachmentContentType:
14220
- type: string
14221
- type_attachments:AttachmentContentDisposition:
14222
- type: string
14223
- enum:
14224
- - value: inline
14225
- - value: attachment
14226
- type_attachments:AttachmentContentId:
14227
- type: string
14228
14202
  type_attachments:Attachment:
14229
14203
  type: object
14230
14204
  properties:
package/dist/llms.txt CHANGED
@@ -14,7 +14,7 @@
14
14
  - [Pods](https://docs.agentmail.to/documentation/core-concepts/pods.mdx): Learn how to use pods for multi-tenant email management
15
15
  - [Skills](https://docs.agentmail.to/integrations/skills.mdx): AgentMail's official skill for Moltbot, Claude Code, Cursor, and other AI assistants
16
16
  - [MCP](https://docs.agentmail.to/integrations/mcp.mdx): AgentMail's Model Context Protocol (MCP) integration
17
- - [Moltbot](https://docs.agentmail.to/integrations/moltbot.mdx): AgentMail's Moltbot (Clawdbot) integration
17
+ - [Openclaw](https://docs.agentmail.to/integrations/openclaw.mdx): AgentMail's Openclaw integration
18
18
  - [Replit](https://docs.agentmail.to/integrations/replit.mdx): AgentMail's Replit integration
19
19
  - [Guide: Sending & Receiving Email](https://docs.agentmail.to/sending-receiving-email.mdx): A step-by-step guide to the practical workflow of sending initial emails and handling replies to have a full conversation.
20
20
  - [IMAP & SMTP](https://docs.agentmail.to/imap-smtp.mdx): Configure IMAP and SMTP to access your AgentMail inboxes using email clients or programmatic access.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentmail",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
package/reference.md CHANGED
@@ -1252,6 +1252,63 @@ await client.drafts.get("draft_id");
1252
1252
  </dl>
1253
1253
 
1254
1254
 
1255
+ </dd>
1256
+ </dl>
1257
+ </details>
1258
+
1259
+ <details><summary><code>client.drafts.<a href="/src/api/resources/drafts/client/Client.ts">getAttachment</a>(draft_id, attachment_id) -> AgentMail.AttachmentResponse</code></summary>
1260
+ <dl>
1261
+ <dd>
1262
+
1263
+ #### 🔌 Usage
1264
+
1265
+ <dl>
1266
+ <dd>
1267
+
1268
+ <dl>
1269
+ <dd>
1270
+
1271
+ ```typescript
1272
+ await client.drafts.getAttachment("draft_id", "attachment_id");
1273
+
1274
+ ```
1275
+ </dd>
1276
+ </dl>
1277
+ </dd>
1278
+ </dl>
1279
+
1280
+ #### ⚙️ Parameters
1281
+
1282
+ <dl>
1283
+ <dd>
1284
+
1285
+ <dl>
1286
+ <dd>
1287
+
1288
+ **draft_id:** `AgentMail.DraftId`
1289
+
1290
+ </dd>
1291
+ </dl>
1292
+
1293
+ <dl>
1294
+ <dd>
1295
+
1296
+ **attachment_id:** `AgentMail.AttachmentId`
1297
+
1298
+ </dd>
1299
+ </dl>
1300
+
1301
+ <dl>
1302
+ <dd>
1303
+
1304
+ **requestOptions:** `DraftsClient.RequestOptions`
1305
+
1306
+ </dd>
1307
+ </dl>
1308
+ </dd>
1309
+ </dl>
1310
+
1311
+
1255
1312
  </dd>
1256
1313
  </dl>
1257
1314
  </details>
@@ -1367,6 +1424,71 @@ await client.inboxes.drafts.get("inbox_id", "draft_id");
1367
1424
  </dl>
1368
1425
 
1369
1426
 
1427
+ </dd>
1428
+ </dl>
1429
+ </details>
1430
+
1431
+ <details><summary><code>client.inboxes.drafts.<a href="/src/api/resources/inboxes/resources/drafts/client/Client.ts">getAttachment</a>(inbox_id, draft_id, attachment_id) -> AgentMail.AttachmentResponse</code></summary>
1432
+ <dl>
1433
+ <dd>
1434
+
1435
+ #### 🔌 Usage
1436
+
1437
+ <dl>
1438
+ <dd>
1439
+
1440
+ <dl>
1441
+ <dd>
1442
+
1443
+ ```typescript
1444
+ await client.inboxes.drafts.getAttachment("inbox_id", "draft_id", "attachment_id");
1445
+
1446
+ ```
1447
+ </dd>
1448
+ </dl>
1449
+ </dd>
1450
+ </dl>
1451
+
1452
+ #### ⚙️ Parameters
1453
+
1454
+ <dl>
1455
+ <dd>
1456
+
1457
+ <dl>
1458
+ <dd>
1459
+
1460
+ **inbox_id:** `AgentMail.InboxId`
1461
+
1462
+ </dd>
1463
+ </dl>
1464
+
1465
+ <dl>
1466
+ <dd>
1467
+
1468
+ **draft_id:** `AgentMail.DraftId`
1469
+
1470
+ </dd>
1471
+ </dl>
1472
+
1473
+ <dl>
1474
+ <dd>
1475
+
1476
+ **attachment_id:** `AgentMail.AttachmentId`
1477
+
1478
+ </dd>
1479
+ </dl>
1480
+
1481
+ <dl>
1482
+ <dd>
1483
+
1484
+ **requestOptions:** `DraftsClient.RequestOptions`
1485
+
1486
+ </dd>
1487
+ </dl>
1488
+ </dd>
1489
+ </dl>
1490
+
1491
+
1370
1492
  </dd>
1371
1493
  </dl>
1372
1494
  </details>
@@ -2862,6 +2984,71 @@ await client.pods.drafts.get("pod_id", "draft_id");
2862
2984
  </dl>
2863
2985
 
2864
2986
 
2987
+ </dd>
2988
+ </dl>
2989
+ </details>
2990
+
2991
+ <details><summary><code>client.pods.drafts.<a href="/src/api/resources/pods/resources/drafts/client/Client.ts">getAttachment</a>(pod_id, draft_id, attachment_id) -> AgentMail.AttachmentResponse</code></summary>
2992
+ <dl>
2993
+ <dd>
2994
+
2995
+ #### 🔌 Usage
2996
+
2997
+ <dl>
2998
+ <dd>
2999
+
3000
+ <dl>
3001
+ <dd>
3002
+
3003
+ ```typescript
3004
+ await client.pods.drafts.getAttachment("pod_id", "draft_id", "attachment_id");
3005
+
3006
+ ```
3007
+ </dd>
3008
+ </dl>
3009
+ </dd>
3010
+ </dl>
3011
+
3012
+ #### ⚙️ Parameters
3013
+
3014
+ <dl>
3015
+ <dd>
3016
+
3017
+ <dl>
3018
+ <dd>
3019
+
3020
+ **pod_id:** `AgentMail.PodId`
3021
+
3022
+ </dd>
3023
+ </dl>
3024
+
3025
+ <dl>
3026
+ <dd>
3027
+
3028
+ **draft_id:** `AgentMail.DraftId`
3029
+
3030
+ </dd>
3031
+ </dl>
3032
+
3033
+ <dl>
3034
+ <dd>
3035
+
3036
+ **attachment_id:** `AgentMail.AttachmentId`
3037
+
3038
+ </dd>
3039
+ </dl>
3040
+
3041
+ <dl>
3042
+ <dd>
3043
+
3044
+ **requestOptions:** `DraftsClient.RequestOptions`
3045
+
3046
+ </dd>
3047
+ </dl>
3048
+ </dd>
3049
+ </dl>
3050
+
3051
+
2865
3052
  </dd>
2866
3053
  </dl>
2867
3054
  </details>