@agentmbox/plugin-agentmbox 1.0.1 → 1.0.2
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/package.json +1 -1
- package/bun.lock +0 -659
- package/src/actions/getEmails.ts +0 -153
- package/src/actions/sendEmail.ts +0 -132
- package/src/index.ts +0 -95
- package/src/providers/emailProvider.ts +0 -82
- package/src/services/AgentMBoxOnboardingService.ts +0 -447
- package/src/services/AgentMBoxService.ts +0 -216
- package/src/types/index.ts +0 -167
- package/tsconfig.json +0 -20
package/src/types/index.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* AgentMBox Plugin Types
|
|
3
|
-
* TypeScript interfaces for AgentMBox email integration
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export interface AgentMBoxConfig {
|
|
7
|
-
/** API key for AgentMBox (starts with ai_) */
|
|
8
|
-
apiKey: string;
|
|
9
|
-
/** Mailbox address (e.g., my-agent@agentmbox.com) */
|
|
10
|
-
mailbox?: string;
|
|
11
|
-
/** Base URL for AgentMBox API (default: https://agentmbox.com/api/v1) */
|
|
12
|
-
baseUrl?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface EmailAddress {
|
|
16
|
-
name?: string;
|
|
17
|
-
email: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface Email {
|
|
21
|
-
id: string;
|
|
22
|
-
from: EmailAddress[];
|
|
23
|
-
to: EmailAddress[];
|
|
24
|
-
cc?: EmailAddress[] | null;
|
|
25
|
-
subject: string;
|
|
26
|
-
receivedAt: string;
|
|
27
|
-
textBody?: string;
|
|
28
|
-
htmlBody?: string;
|
|
29
|
-
preview?: string;
|
|
30
|
-
hasAttachment: boolean;
|
|
31
|
-
isRead: boolean;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface EmailListResponse {
|
|
35
|
-
mailbox: string;
|
|
36
|
-
emails: Email[];
|
|
37
|
-
limit: number;
|
|
38
|
-
offset: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface EmailDetailResponse {
|
|
42
|
-
email: Email;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export interface SendEmailRequest {
|
|
46
|
-
/** Sender address (must be a mailbox you own) */
|
|
47
|
-
from: string;
|
|
48
|
-
/** Recipient(s) - single email or array */
|
|
49
|
-
to: string | string[];
|
|
50
|
-
/** Email subject line */
|
|
51
|
-
subject: string;
|
|
52
|
-
/** Plain text body */
|
|
53
|
-
text?: string;
|
|
54
|
-
/** HTML body */
|
|
55
|
-
html?: string;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface SendEmailResponse {
|
|
59
|
-
success: boolean;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface Mailbox {
|
|
63
|
-
id: string;
|
|
64
|
-
address: string;
|
|
65
|
-
localPart: string;
|
|
66
|
-
domainName: string;
|
|
67
|
-
displayName?: string | null;
|
|
68
|
-
password?: string; // Only shown at creation
|
|
69
|
-
createdAt: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export interface MailboxListResponse {
|
|
73
|
-
mailboxes: Mailbox[];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export interface CreateMailboxRequest {
|
|
77
|
-
localPart: string;
|
|
78
|
-
domainId?: string;
|
|
79
|
-
displayName?: string;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export interface CreateMailboxResponse {
|
|
83
|
-
mailbox: Mailbox;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export interface PaymentStatus {
|
|
87
|
-
paid: boolean;
|
|
88
|
-
paidUntil: string | null;
|
|
89
|
-
solanaAddress: string;
|
|
90
|
-
usdcPerPeriod: number;
|
|
91
|
-
periodDays: number;
|
|
92
|
-
creditedUsdc: number;
|
|
93
|
-
payments: unknown[];
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export interface PaymentCheckResponse {
|
|
97
|
-
paid: boolean;
|
|
98
|
-
paidUntil: string;
|
|
99
|
-
newCredits: number;
|
|
100
|
-
balanceUsdc: number;
|
|
101
|
-
creditedUsdc: number;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
export interface Domain {
|
|
105
|
-
id: string;
|
|
106
|
-
domain: string;
|
|
107
|
-
verified: boolean;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export interface DomainDNSRecords {
|
|
111
|
-
verification: { type: string; name: string; value: string };
|
|
112
|
-
mx: { type: string; name: string; value: string; priority: number };
|
|
113
|
-
spf: { type: string; name: string; value: string };
|
|
114
|
-
dkim: { type: string; name: string; value: string };
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export interface DomainResponse {
|
|
118
|
-
domain: Domain;
|
|
119
|
-
dnsRecords: DomainDNSRecords;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export interface DomainVerifyResponse {
|
|
123
|
-
verified: boolean;
|
|
124
|
-
txtVerified: boolean;
|
|
125
|
-
mxVerified: boolean;
|
|
126
|
-
spfVerified: boolean;
|
|
127
|
-
dkimVerified: boolean;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export interface DomainListResponse {
|
|
131
|
-
domains: (Domain & { dnsRecords?: DomainDNSRecords })[];
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
export interface ApiKey {
|
|
135
|
-
id: string;
|
|
136
|
-
name: string;
|
|
137
|
-
key: string;
|
|
138
|
-
keyPrefix: string;
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
export interface ApiKeyResponse {
|
|
142
|
-
id: string;
|
|
143
|
-
name: string;
|
|
144
|
-
key: string;
|
|
145
|
-
keyPrefix: string;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface ApiKeyListResponse {
|
|
149
|
-
keys: ApiKey[];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
export interface AgentMBoxError {
|
|
153
|
-
error: string;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export type AgentMBoxErrorCode = 400 | 401 | 402 | 403 | 404 | 409 | 502;
|
|
157
|
-
|
|
158
|
-
export function isAgentMBoxError(
|
|
159
|
-
response: unknown,
|
|
160
|
-
): response is AgentMBoxError {
|
|
161
|
-
return (
|
|
162
|
-
typeof response === "object" &&
|
|
163
|
-
response !== null &&
|
|
164
|
-
"error" in response &&
|
|
165
|
-
typeof (response as AgentMBoxError).error === "string"
|
|
166
|
-
);
|
|
167
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2022",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"lib": ["ES2022"],
|
|
7
|
-
"rootDir": "./src",
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"forceConsistentCasingInFileNames": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"declarationMap": true,
|
|
15
|
-
"sourceMap": true,
|
|
16
|
-
"types": ["node"]
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/**/*"],
|
|
19
|
-
"exclude": ["node_modules", "dist"]
|
|
20
|
-
}
|