@agentdomain/agentkit-plugin 0.2.1 → 0.4.0
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/LICENSE +202 -21
- package/README.md +2 -2
- package/dist/index.d.ts +13 -10
- package/dist/index.js +156 -85
- package/package.json +7 -4
package/LICENSE
CHANGED
|
@@ -1,21 +1,202 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -10,10 +10,10 @@ The provider exposes actions for:
|
|
|
10
10
|
|
|
11
11
|
- Agent identity registration and quote
|
|
12
12
|
- Registry search
|
|
13
|
-
- Email send/list, primary address
|
|
13
|
+
- Email send/list/batch, monthly usage, signed inbound webhooks, primary address updates, and Starter/Pro/Enterprise aliases
|
|
14
14
|
- DNS list/create/update/delete
|
|
15
15
|
- SSL reconfiguration
|
|
16
16
|
- RenewalVault status, funding, auto-renew, and withdrawal
|
|
17
|
-
- Per-agent Pro and Enterprise Premium Plans
|
|
17
|
+
- Per-agent Starter, Pro, and Enterprise Premium Plans
|
|
18
18
|
|
|
19
19
|
Default API base: `https://agentdomain.app/api/v1`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { z } from
|
|
1
|
+
import { z } from "zod";
|
|
2
2
|
declare const QuoteSchema: z.ZodObject<{
|
|
3
3
|
preferredName: z.ZodString;
|
|
4
4
|
tld: z.ZodDefault<z.ZodEnum<["xyz", "com", "ai", "org", "io", "net", "co", "app"]>>;
|
|
@@ -9,7 +9,7 @@ declare const QuoteSchema: z.ZodObject<{
|
|
|
9
9
|
emailEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
10
10
|
emailUsername: z.ZodOptional<z.ZodString>;
|
|
11
11
|
years: z.ZodDefault<z.ZodNumber>;
|
|
12
|
-
premiumPlan: z.ZodDefault<z.ZodEnum<["included", "pro", "enterprise"]>>;
|
|
12
|
+
premiumPlan: z.ZodDefault<z.ZodEnum<["included", "starter", "pro", "enterprise"]>>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
14
|
preferredName: string;
|
|
15
15
|
tld: "xyz" | "com" | "ai" | "org" | "io" | "net" | "co" | "app";
|
|
@@ -17,7 +17,7 @@ declare const QuoteSchema: z.ZodObject<{
|
|
|
17
17
|
registerEns: boolean;
|
|
18
18
|
emailEnabled: boolean;
|
|
19
19
|
years: number;
|
|
20
|
-
premiumPlan: "included" | "pro" | "enterprise";
|
|
20
|
+
premiumPlan: "included" | "starter" | "pro" | "enterprise";
|
|
21
21
|
basenameLabel?: string | undefined;
|
|
22
22
|
ensLabel?: string | undefined;
|
|
23
23
|
emailUsername?: string | undefined;
|
|
@@ -31,7 +31,7 @@ declare const QuoteSchema: z.ZodObject<{
|
|
|
31
31
|
emailEnabled?: boolean | undefined;
|
|
32
32
|
emailUsername?: string | undefined;
|
|
33
33
|
years?: number | undefined;
|
|
34
|
-
premiumPlan?: "included" | "pro" | "enterprise" | undefined;
|
|
34
|
+
premiumPlan?: "included" | "starter" | "pro" | "enterprise" | undefined;
|
|
35
35
|
}>;
|
|
36
36
|
declare const SearchSchema: z.ZodObject<{
|
|
37
37
|
q: z.ZodOptional<z.ZodString>;
|
|
@@ -49,7 +49,7 @@ declare const SearchSchema: z.ZodObject<{
|
|
|
49
49
|
capability?: string | undefined;
|
|
50
50
|
limit?: number | undefined;
|
|
51
51
|
}>;
|
|
52
|
-
declare const
|
|
52
|
+
declare const EmailUsageSchema: z.ZodObject<{
|
|
53
53
|
agentId: z.ZodString;
|
|
54
54
|
}, "strip", z.ZodTypeAny, {
|
|
55
55
|
agentId: string;
|
|
@@ -67,7 +67,7 @@ export interface AgentDomainActionProviderOptions {
|
|
|
67
67
|
apiKey?: string;
|
|
68
68
|
baseRpcUrl?: string;
|
|
69
69
|
renewalVaultAddress?: string;
|
|
70
|
-
network?:
|
|
70
|
+
network?: "base" | "base-sepolia";
|
|
71
71
|
}
|
|
72
72
|
export declare class AgentDomainActionProvider {
|
|
73
73
|
readonly name = "agentdomain";
|
|
@@ -91,7 +91,7 @@ export declare class AgentDomainActionProvider {
|
|
|
91
91
|
emailEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
92
92
|
emailUsername: z.ZodOptional<z.ZodString>;
|
|
93
93
|
years: z.ZodDefault<z.ZodNumber>;
|
|
94
|
-
premiumPlan: z.ZodDefault<z.ZodEnum<["included", "pro", "enterprise"]>>;
|
|
94
|
+
premiumPlan: z.ZodDefault<z.ZodEnum<["included", "starter", "pro", "enterprise"]>>;
|
|
95
95
|
}, "strip", z.ZodTypeAny, {
|
|
96
96
|
preferredName: string;
|
|
97
97
|
tld: "xyz" | "com" | "ai" | "org" | "io" | "net" | "co" | "app";
|
|
@@ -99,7 +99,7 @@ export declare class AgentDomainActionProvider {
|
|
|
99
99
|
registerEns: boolean;
|
|
100
100
|
emailEnabled: boolean;
|
|
101
101
|
years: number;
|
|
102
|
-
premiumPlan: "included" | "pro" | "enterprise";
|
|
102
|
+
premiumPlan: "included" | "starter" | "pro" | "enterprise";
|
|
103
103
|
basenameLabel?: string | undefined;
|
|
104
104
|
ensLabel?: string | undefined;
|
|
105
105
|
emailUsername?: string | undefined;
|
|
@@ -113,7 +113,7 @@ export declare class AgentDomainActionProvider {
|
|
|
113
113
|
emailEnabled?: boolean | undefined;
|
|
114
114
|
emailUsername?: string | undefined;
|
|
115
115
|
years?: number | undefined;
|
|
116
|
-
premiumPlan?: "included" | "pro" | "enterprise" | undefined;
|
|
116
|
+
premiumPlan?: "included" | "starter" | "pro" | "enterprise" | undefined;
|
|
117
117
|
}>;
|
|
118
118
|
invoke: (walletProvider: WalletProvider, args: z.infer<typeof QuoteSchema>) => Promise<string>;
|
|
119
119
|
} | {
|
|
@@ -146,7 +146,7 @@ export declare class AgentDomainActionProvider {
|
|
|
146
146
|
}, {
|
|
147
147
|
agentId: string;
|
|
148
148
|
}>;
|
|
149
|
-
invoke: (walletProvider: WalletProvider, args: z.infer<typeof
|
|
149
|
+
invoke: (walletProvider: WalletProvider, args: z.infer<typeof EmailUsageSchema>) => Promise<string>;
|
|
150
150
|
})[];
|
|
151
151
|
private register;
|
|
152
152
|
private renewalStatus;
|
|
@@ -165,6 +165,9 @@ export declare class AgentDomainActionProvider {
|
|
|
165
165
|
private search;
|
|
166
166
|
private sendEmail;
|
|
167
167
|
private listEmail;
|
|
168
|
+
private sendEmailBatch;
|
|
169
|
+
private emailUsage;
|
|
170
|
+
private configureEmailWebhook;
|
|
168
171
|
private updatePrimaryEmail;
|
|
169
172
|
private createEmailAlias;
|
|
170
173
|
private deleteEmailAlias;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { z } from
|
|
2
|
-
import { AgentDomain } from
|
|
3
|
-
import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from
|
|
4
|
-
import { createPublicClient, createWalletClient, http, encodeFunctionData, } from
|
|
5
|
-
import { base, baseSepolia } from
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { AgentDomain } from "@agentdomain/sdk";
|
|
3
|
+
import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from "@agentdomain/shared/constants";
|
|
4
|
+
import { createPublicClient, createWalletClient, http, encodeFunctionData, } from "viem";
|
|
5
|
+
import { base, baseSepolia } from "viem/chains";
|
|
6
6
|
const RegisterSchema = z.object({
|
|
7
7
|
preferredName: z.string().min(3).max(63),
|
|
8
|
-
tld: z.enum(SUPPORTED_TLDS).default(
|
|
8
|
+
tld: z.enum(SUPPORTED_TLDS).default("xyz"),
|
|
9
9
|
registerBasename: z.boolean().default(true),
|
|
10
10
|
basenameLabel: z.string().min(3).max(63).optional(),
|
|
11
11
|
registerEns: z.boolean().default(false),
|
|
@@ -24,11 +24,11 @@ const RegisterSchema = z.object({
|
|
|
24
24
|
dnsTarget: z.string().url().optional(),
|
|
25
25
|
years: z.number().int().min(1).max(10).default(1),
|
|
26
26
|
autoRenew: z.boolean().default(false),
|
|
27
|
-
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default(
|
|
27
|
+
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
|
|
28
28
|
});
|
|
29
29
|
const QuoteSchema = z.object({
|
|
30
30
|
preferredName: z.string(),
|
|
31
|
-
tld: z.enum(SUPPORTED_TLDS).default(
|
|
31
|
+
tld: z.enum(SUPPORTED_TLDS).default("xyz"),
|
|
32
32
|
registerBasename: z.boolean().default(true),
|
|
33
33
|
basenameLabel: z.string().min(3).max(63).optional(),
|
|
34
34
|
registerEns: z.boolean().default(false),
|
|
@@ -41,7 +41,7 @@ const QuoteSchema = z.object({
|
|
|
41
41
|
.regex(/^[a-z0-9](?:[a-z0-9._+-]{0,62}[a-z0-9])?$/)
|
|
42
42
|
.optional(),
|
|
43
43
|
years: z.number().int().min(1).max(10).default(1),
|
|
44
|
-
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default(
|
|
44
|
+
premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
|
|
45
45
|
});
|
|
46
46
|
const SearchSchema = z.object({
|
|
47
47
|
q: z.string().optional(),
|
|
@@ -60,12 +60,26 @@ const ListEmailSchema = z.object({
|
|
|
60
60
|
agentId: z.string(),
|
|
61
61
|
limit: z.number().int().min(1).max(100).default(20),
|
|
62
62
|
});
|
|
63
|
+
const BatchEmailSchema = z.object({
|
|
64
|
+
agentId: z.string(),
|
|
65
|
+
messages: z.array(SendEmailSchema.omit({ agentId: true })).max(100),
|
|
66
|
+
idempotencyKey: z.string().max(256).optional(),
|
|
67
|
+
});
|
|
68
|
+
const EmailUsageSchema = z.object({ agentId: z.string() });
|
|
69
|
+
const EmailWebhookSchema = z.object({
|
|
70
|
+
agentId: z.string(),
|
|
71
|
+
url: z.string().url(),
|
|
72
|
+
payloadMode: z.enum(["metadata", "inline_text"]).default("metadata"),
|
|
73
|
+
enabled: z.boolean().default(true),
|
|
74
|
+
});
|
|
63
75
|
const RenewalStatusSchema = z.object({
|
|
64
76
|
agentId: z.string().min(1),
|
|
65
77
|
});
|
|
66
78
|
const FundRenewalSchema = z.object({
|
|
67
79
|
agentId: z.string().min(1),
|
|
68
|
-
amountUsdc: z
|
|
80
|
+
amountUsdc: z
|
|
81
|
+
.string()
|
|
82
|
+
.regex(/^\d+(\.\d{1,6})?$/, "Use a USDC amount with up to 6 decimals"),
|
|
69
83
|
enableAutoRenew: z.boolean().default(false),
|
|
70
84
|
});
|
|
71
85
|
const EnableAutoRenewSchema = z.object({
|
|
@@ -74,7 +88,16 @@ const EnableAutoRenewSchema = z.object({
|
|
|
74
88
|
const SslReconfigureSchema = z.object({
|
|
75
89
|
agentId: z.string().min(1),
|
|
76
90
|
});
|
|
77
|
-
const DnsRecordTypeSchema = z.enum([
|
|
91
|
+
const DnsRecordTypeSchema = z.enum([
|
|
92
|
+
"A",
|
|
93
|
+
"AAAA",
|
|
94
|
+
"ALIAS",
|
|
95
|
+
"CNAME",
|
|
96
|
+
"MX",
|
|
97
|
+
"TXT",
|
|
98
|
+
"NS",
|
|
99
|
+
"SRV",
|
|
100
|
+
]);
|
|
78
101
|
const ListDnsSchema = z.object({
|
|
79
102
|
agentId: z.string().min(1),
|
|
80
103
|
});
|
|
@@ -96,14 +119,17 @@ const DeleteDnsSchema = z.object({
|
|
|
96
119
|
});
|
|
97
120
|
const WithdrawRenewalSchema = z.object({
|
|
98
121
|
agentId: z.string().min(1),
|
|
99
|
-
amountUsdc: z
|
|
122
|
+
amountUsdc: z
|
|
123
|
+
.string()
|
|
124
|
+
.regex(/^\d+(\.\d{1,6})?$/, "Use a USDC amount with up to 6 decimals"),
|
|
100
125
|
});
|
|
101
126
|
const ServicePlanStatusSchema = z.object({
|
|
102
127
|
agentId: z.string().min(1),
|
|
103
128
|
});
|
|
104
129
|
const PurchaseServicePlanSchema = z.object({
|
|
105
130
|
agentId: z.string().min(1),
|
|
106
|
-
plan: z.enum([
|
|
131
|
+
plan: z.enum(["starter", "pro", "enterprise"]),
|
|
132
|
+
planSku: z.custom().optional(),
|
|
107
133
|
});
|
|
108
134
|
const SetRegistryVisibilitySchema = z.object({
|
|
109
135
|
agentId: z.string().min(1),
|
|
@@ -123,7 +149,7 @@ const DeleteEmailAliasSchema = z.object({
|
|
|
123
149
|
emailAddress: z.string().email(),
|
|
124
150
|
});
|
|
125
151
|
export class AgentDomainActionProvider {
|
|
126
|
-
name =
|
|
152
|
+
name = "agentdomain";
|
|
127
153
|
apiUrl;
|
|
128
154
|
apiKey;
|
|
129
155
|
baseRpcUrl;
|
|
@@ -132,14 +158,17 @@ export class AgentDomainActionProvider {
|
|
|
132
158
|
constructor(opts = {}) {
|
|
133
159
|
this.apiUrl = opts.apiUrl ?? AGENTDOMAIN_API_BASE_URL;
|
|
134
160
|
this.apiKey = opts.apiKey;
|
|
135
|
-
this.baseRpcUrl = opts.baseRpcUrl ??
|
|
161
|
+
this.baseRpcUrl = opts.baseRpcUrl ?? "https://mainnet.base.org";
|
|
136
162
|
this.renewalVaultAddress = opts.renewalVaultAddress;
|
|
137
|
-
this.network = opts.network ??
|
|
163
|
+
this.network = opts.network ?? "base";
|
|
138
164
|
}
|
|
139
165
|
createAgentDomain(walletProvider) {
|
|
140
166
|
const wallet = walletProvider.getAddress();
|
|
141
|
-
const chain = this.network ===
|
|
142
|
-
const publicClient = createPublicClient({
|
|
167
|
+
const chain = this.network === "base-sepolia" ? baseSepolia : base;
|
|
168
|
+
const publicClient = createPublicClient({
|
|
169
|
+
chain,
|
|
170
|
+
transport: http(this.baseRpcUrl),
|
|
171
|
+
});
|
|
143
172
|
const walletClient = createWalletClient({
|
|
144
173
|
chain,
|
|
145
174
|
transport: http(this.baseRpcUrl),
|
|
@@ -164,122 +193,140 @@ export class AgentDomainActionProvider {
|
|
|
164
193
|
getActions() {
|
|
165
194
|
return [
|
|
166
195
|
{
|
|
167
|
-
name:
|
|
168
|
-
description:
|
|
196
|
+
name: "register_agent_identity",
|
|
197
|
+
description: "Register a complete agent identity bundle on AgentDomain. Domain, DNS, included email setup, SSL certification, AgentID NFT orchestration, and platform fee are included by default. Basename and ENS are optional paid add-ons. Pays in USDC on Base.",
|
|
169
198
|
schema: RegisterSchema,
|
|
170
199
|
invoke: this.register.bind(this),
|
|
171
200
|
},
|
|
172
201
|
{
|
|
173
|
-
name:
|
|
174
|
-
description:
|
|
202
|
+
name: "quote_agent_registration",
|
|
203
|
+
description: "Price an agent identity registration before committing. Quote includes the annual platform fee with email setup, SSL certification, and AgentID NFT orchestration; Basename and ENS only charge when enabled.",
|
|
175
204
|
schema: QuoteSchema,
|
|
176
205
|
invoke: this.quote.bind(this),
|
|
177
206
|
},
|
|
178
207
|
{
|
|
179
|
-
name:
|
|
180
|
-
description:
|
|
208
|
+
name: "search_agents",
|
|
209
|
+
description: "Search the public AgentDomain registry.",
|
|
181
210
|
schema: SearchSchema,
|
|
182
211
|
invoke: this.search.bind(this),
|
|
183
212
|
},
|
|
184
213
|
{
|
|
185
|
-
name:
|
|
186
|
-
description:
|
|
214
|
+
name: "send_agent_email",
|
|
215
|
+
description: "Send text-only email from an agent primary email or active alias via AWS SES.",
|
|
187
216
|
schema: SendEmailSchema,
|
|
188
217
|
invoke: this.sendEmail.bind(this),
|
|
189
218
|
},
|
|
190
219
|
{
|
|
191
|
-
name:
|
|
192
|
-
description:
|
|
220
|
+
name: "list_agent_email",
|
|
221
|
+
description: "Query text-only agent email and extracted verification codes.",
|
|
193
222
|
schema: ListEmailSchema,
|
|
194
223
|
invoke: this.listEmail.bind(this),
|
|
195
224
|
},
|
|
196
225
|
{
|
|
197
|
-
name:
|
|
198
|
-
description:
|
|
226
|
+
name: "send_agent_email_batch",
|
|
227
|
+
description: "Queue up to 100 emails in one API request.",
|
|
228
|
+
schema: BatchEmailSchema,
|
|
229
|
+
invoke: this.sendEmailBatch.bind(this),
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "get_agent_email_usage",
|
|
233
|
+
description: "Get combined monthly sent and received email usage.",
|
|
234
|
+
schema: EmailUsageSchema,
|
|
235
|
+
invoke: this.emailUsage.bind(this),
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
name: "configure_email_webhook",
|
|
239
|
+
description: "Configure signed inbound email events for this agent.",
|
|
240
|
+
schema: EmailWebhookSchema,
|
|
241
|
+
invoke: this.configureEmailWebhook.bind(this),
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
name: "get_renewal_status",
|
|
245
|
+
description: "Get exact next renewal amount, shortfall, vault balance, expiry date, and auto-renew state for an AgentDomain identity.",
|
|
199
246
|
schema: RenewalStatusSchema,
|
|
200
247
|
invoke: this.renewalStatus.bind(this),
|
|
201
248
|
},
|
|
202
249
|
{
|
|
203
|
-
name:
|
|
204
|
-
description:
|
|
250
|
+
name: "fund_renewal_vault",
|
|
251
|
+
description: "Deposit USDC from the connected wallet into one AgentID renewal vault. Anyone can fund; only the AgentID owner can withdraw or enable auto-renew. Call get_renewal_status first and usually deposit the returned shortfall.",
|
|
205
252
|
schema: FundRenewalSchema,
|
|
206
253
|
invoke: this.fundRenewal.bind(this),
|
|
207
254
|
},
|
|
208
255
|
{
|
|
209
|
-
name:
|
|
210
|
-
description:
|
|
256
|
+
name: "enable_auto_renew",
|
|
257
|
+
description: "Enable RenewalVault auto-renew. Requires the wallet provider to be the AgentID NFT owner and support sendTransaction.",
|
|
211
258
|
schema: EnableAutoRenewSchema,
|
|
212
259
|
invoke: this.enableAutoRenew.bind(this),
|
|
213
260
|
},
|
|
214
261
|
{
|
|
215
|
-
name:
|
|
216
|
-
description:
|
|
262
|
+
name: "reconfigure_ssl",
|
|
263
|
+
description: "Rebuild the Cloudflare SaaS SSL hostname and sync the required Spaceship DNS validation records for an existing agent.",
|
|
217
264
|
schema: SslReconfigureSchema,
|
|
218
265
|
invoke: this.reconfigureSsl.bind(this),
|
|
219
266
|
},
|
|
220
267
|
{
|
|
221
|
-
name:
|
|
222
|
-
description:
|
|
268
|
+
name: "list_dns_records",
|
|
269
|
+
description: "List DNS records for an AgentDomain identity.",
|
|
223
270
|
schema: ListDnsSchema,
|
|
224
271
|
invoke: this.listDns.bind(this),
|
|
225
272
|
},
|
|
226
273
|
{
|
|
227
|
-
name:
|
|
228
|
-
description:
|
|
274
|
+
name: "create_dns_record",
|
|
275
|
+
description: "Create a user-managed DNS record and sync it to the domain provider.",
|
|
229
276
|
schema: CreateDnsSchema,
|
|
230
277
|
invoke: this.createDns.bind(this),
|
|
231
278
|
},
|
|
232
279
|
{
|
|
233
|
-
name:
|
|
234
|
-
description:
|
|
280
|
+
name: "update_dns_record",
|
|
281
|
+
description: "Update a user-managed DNS record and sync it to the domain provider.",
|
|
235
282
|
schema: UpdateDnsSchema,
|
|
236
283
|
invoke: this.updateDns.bind(this),
|
|
237
284
|
},
|
|
238
285
|
{
|
|
239
|
-
name:
|
|
240
|
-
description:
|
|
286
|
+
name: "delete_dns_record",
|
|
287
|
+
description: "Delete a user-managed DNS record and sync the domain provider state.",
|
|
241
288
|
schema: DeleteDnsSchema,
|
|
242
289
|
invoke: this.deleteDns.bind(this),
|
|
243
290
|
},
|
|
244
291
|
{
|
|
245
|
-
name:
|
|
246
|
-
description:
|
|
292
|
+
name: "withdraw_renewal_vault",
|
|
293
|
+
description: "Withdraw unused USDC from an AgentID renewal vault. Requires the AgentID NFT owner wallet.",
|
|
247
294
|
schema: WithdrawRenewalSchema,
|
|
248
295
|
invoke: this.withdrawRenewal.bind(this),
|
|
249
296
|
},
|
|
250
297
|
{
|
|
251
|
-
name:
|
|
252
|
-
description:
|
|
298
|
+
name: "get_service_plan",
|
|
299
|
+
description: "Get the current per-agent Premium Plan, limits, and billing state.",
|
|
253
300
|
schema: ServicePlanStatusSchema,
|
|
254
301
|
invoke: this.getServicePlan.bind(this),
|
|
255
302
|
},
|
|
256
303
|
{
|
|
257
|
-
name:
|
|
258
|
-
description:
|
|
304
|
+
name: "purchase_service_plan",
|
|
305
|
+
description: "Upgrade one agent to an AgentDomain Starter, Pro, or Enterprise Premium Plan using x402 USDC payment.",
|
|
259
306
|
schema: PurchaseServicePlanSchema,
|
|
260
307
|
invoke: this.purchaseServicePlan.bind(this),
|
|
261
308
|
},
|
|
262
309
|
{
|
|
263
|
-
name:
|
|
264
|
-
description:
|
|
310
|
+
name: "set_registry_visibility",
|
|
311
|
+
description: "Hide or show one agent in the public AgentDomain registry. Hiding requires an active paid Premium Plan.",
|
|
265
312
|
schema: SetRegistryVisibilitySchema,
|
|
266
313
|
invoke: this.setRegistryVisibility.bind(this),
|
|
267
314
|
},
|
|
268
315
|
{
|
|
269
|
-
name:
|
|
270
|
-
description:
|
|
316
|
+
name: "update_primary_email",
|
|
317
|
+
description: "Change one agent primary email username. The old primary address stops receiving new mail.",
|
|
271
318
|
schema: UpdatePrimaryEmailSchema,
|
|
272
319
|
invoke: this.updatePrimaryEmail.bind(this),
|
|
273
320
|
},
|
|
274
321
|
{
|
|
275
|
-
name:
|
|
276
|
-
description:
|
|
322
|
+
name: "create_email_alias",
|
|
323
|
+
description: "Create an extra receive-and-send alias for one agent. Requires available paid-plan alias capacity.",
|
|
277
324
|
schema: CreateEmailAliasSchema,
|
|
278
325
|
invoke: this.createEmailAlias.bind(this),
|
|
279
326
|
},
|
|
280
327
|
{
|
|
281
|
-
name:
|
|
282
|
-
description:
|
|
328
|
+
name: "delete_email_alias",
|
|
329
|
+
description: "Delete one active email alias from an agent.",
|
|
283
330
|
schema: DeleteEmailAliasSchema,
|
|
284
331
|
invoke: this.deleteEmailAlias.bind(this),
|
|
285
332
|
},
|
|
@@ -287,23 +334,27 @@ export class AgentDomainActionProvider {
|
|
|
287
334
|
}
|
|
288
335
|
async register(walletProvider, args) {
|
|
289
336
|
const { ad, wallet } = this.createAgentDomain(walletProvider);
|
|
290
|
-
const result = await ad.register({
|
|
291
|
-
|
|
337
|
+
const result = await ad.register({
|
|
338
|
+
...args,
|
|
339
|
+
emailEnabled: true,
|
|
340
|
+
wallet,
|
|
341
|
+
});
|
|
342
|
+
let autoRenewMsg = "";
|
|
292
343
|
if (args.autoRenew && this.renewalVaultAddress) {
|
|
293
344
|
try {
|
|
294
345
|
if (walletProvider.sendTransaction) {
|
|
295
346
|
const data = encodeFunctionData({
|
|
296
347
|
abi: [
|
|
297
348
|
{
|
|
298
|
-
type:
|
|
299
|
-
name:
|
|
349
|
+
type: "function",
|
|
350
|
+
name: "setAutoRenew",
|
|
300
351
|
inputs: [
|
|
301
|
-
{ name:
|
|
302
|
-
{ name:
|
|
352
|
+
{ name: "tokenId", type: "uint256" },
|
|
353
|
+
{ name: "enabled", type: "bool" },
|
|
303
354
|
],
|
|
304
355
|
},
|
|
305
356
|
],
|
|
306
|
-
functionName:
|
|
357
|
+
functionName: "setAutoRenew",
|
|
307
358
|
args: [BigInt(result.nftTokenId), true],
|
|
308
359
|
});
|
|
309
360
|
const txHash = await walletProvider.sendTransaction({
|
|
@@ -314,7 +365,7 @@ export class AgentDomainActionProvider {
|
|
|
314
365
|
}
|
|
315
366
|
else {
|
|
316
367
|
autoRenewMsg =
|
|
317
|
-
|
|
368
|
+
" (Cannot enable auto-renew because walletProvider lacks sendTransaction).";
|
|
318
369
|
}
|
|
319
370
|
}
|
|
320
371
|
catch (e) {
|
|
@@ -326,7 +377,7 @@ export class AgentDomainActionProvider {
|
|
|
326
377
|
async renewalStatus(walletProvider, args) {
|
|
327
378
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
328
379
|
const status = await ad.getRenewalStatus(args.agentId);
|
|
329
|
-
return `Renewal status for ${status.domain}: next renewal $${status.nextRenewalAmountUsdc}, vault balance $${status.vaultBalanceUsdc}, shortfall $${status.shortfallUsdc}, expires ${status.expiresAt ??
|
|
380
|
+
return `Renewal status for ${status.domain}: next renewal $${status.nextRenewalAmountUsdc}, vault balance $${status.vaultBalanceUsdc}, shortfall $${status.shortfallUsdc}, expires ${status.expiresAt ?? "unknown"}, renewable from ${status.renewableFrom ?? "unknown"}, auto-renew ${status.autoRenewEnabled ? "enabled" : "off"}.`;
|
|
330
381
|
}
|
|
331
382
|
async fundRenewal(walletProvider, args) {
|
|
332
383
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
@@ -339,30 +390,31 @@ export class AgentDomainActionProvider {
|
|
|
339
390
|
}
|
|
340
391
|
async enableAutoRenew(walletProvider, args) {
|
|
341
392
|
if (!this.renewalVaultAddress) {
|
|
342
|
-
throw new Error(
|
|
393
|
+
throw new Error("renewalVaultAddress is required to enable auto-renew.");
|
|
343
394
|
}
|
|
344
395
|
if (!walletProvider.sendTransaction) {
|
|
345
|
-
throw new Error(
|
|
396
|
+
throw new Error("walletProvider.sendTransaction is required to enable auto-renew.");
|
|
346
397
|
}
|
|
347
398
|
const { ad, wallet } = this.createAgentDomain(walletProvider);
|
|
348
399
|
const status = await ad.getRenewalStatus(args.agentId);
|
|
349
400
|
if (!status.tokenId)
|
|
350
|
-
throw new Error(
|
|
351
|
-
if (status.ownerAddress &&
|
|
401
|
+
throw new Error("AgentID NFT is not minted yet.");
|
|
402
|
+
if (status.ownerAddress &&
|
|
403
|
+
status.ownerAddress.toLowerCase() !== wallet.toLowerCase()) {
|
|
352
404
|
throw new Error(`Only the AgentID NFT owner (${status.ownerAddress}) can enable auto-renew.`);
|
|
353
405
|
}
|
|
354
406
|
const data = encodeFunctionData({
|
|
355
407
|
abi: [
|
|
356
408
|
{
|
|
357
|
-
type:
|
|
358
|
-
name:
|
|
409
|
+
type: "function",
|
|
410
|
+
name: "setAutoRenew",
|
|
359
411
|
inputs: [
|
|
360
|
-
{ name:
|
|
361
|
-
{ name:
|
|
412
|
+
{ name: "tokenId", type: "uint256" },
|
|
413
|
+
{ name: "enabled", type: "bool" },
|
|
362
414
|
],
|
|
363
415
|
},
|
|
364
416
|
],
|
|
365
|
-
functionName:
|
|
417
|
+
functionName: "setAutoRenew",
|
|
366
418
|
args: [BigInt(status.tokenId), true],
|
|
367
419
|
});
|
|
368
420
|
const txHash = await walletProvider.sendTransaction({
|
|
@@ -400,7 +452,7 @@ export class AgentDomainActionProvider {
|
|
|
400
452
|
}
|
|
401
453
|
async withdrawRenewal(walletProvider, args) {
|
|
402
454
|
if (!walletProvider.sendTransaction) {
|
|
403
|
-
throw new Error(
|
|
455
|
+
throw new Error("walletProvider.sendTransaction is required to withdraw vault funds.");
|
|
404
456
|
}
|
|
405
457
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
406
458
|
const tx = await ad.withdrawFromVault(args.agentId, args.amountUsdc);
|
|
@@ -415,24 +467,28 @@ export class AgentDomainActionProvider {
|
|
|
415
467
|
async getServicePlan(walletProvider, args) {
|
|
416
468
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
417
469
|
const result = await ad.getServicePlan(args.agentId);
|
|
418
|
-
return `Premium Plan for ${result.domain}: ${result.entitlement.plan} (${result.entitlement.status}),
|
|
470
|
+
return `Premium Plan for ${result.domain}: ${result.entitlement.plan} (${result.entitlement.status}), ${result.entitlement.limits.monthlyEmails} combined emails/month, ${result.entitlement.limits.apiKeys} API key(s), ${result.entitlement.limits.dnsRecords} DNS records, registry hidden ${result.registryVisibility.hidden}.`;
|
|
419
471
|
}
|
|
420
472
|
async purchaseServicePlan(walletProvider, args) {
|
|
421
473
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
422
474
|
const result = await ad.purchaseServicePlan(args);
|
|
423
|
-
return `Purchased ${result.entitlement.plan} Premium Plan for ${result.domain}. Current period ends ${result.entitlement.currentPeriodEnd ??
|
|
475
|
+
return `Purchased ${result.entitlement.plan} Premium Plan for ${result.domain}. Current period ends ${result.entitlement.currentPeriodEnd ?? "unknown"}.`;
|
|
424
476
|
}
|
|
425
477
|
async setRegistryVisibility(walletProvider, args) {
|
|
426
478
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
427
479
|
const result = await ad.setRegistryVisibility(args.agentId, args.registryHidden);
|
|
428
|
-
return `${result.domain} is now ${result.registryVisibility.hidden ?
|
|
480
|
+
return `${result.domain} is now ${result.registryVisibility.hidden ? "hidden from" : "visible in"} the public registry.`;
|
|
429
481
|
}
|
|
430
482
|
async quote(walletProvider, args) {
|
|
431
483
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
432
484
|
const q = await ad.quote(args);
|
|
433
|
-
const basenamePart = Number(q.basenameCostUsdc) > 0
|
|
434
|
-
|
|
435
|
-
|
|
485
|
+
const basenamePart = Number(q.basenameCostUsdc) > 0
|
|
486
|
+
? ` + Basename $${q.basenameCostUsdc}`
|
|
487
|
+
: "";
|
|
488
|
+
const ensPart = Number(q.ensCostUsdc) > 0 ? ` + ENS $${q.ensCostUsdc}` : "";
|
|
489
|
+
const planPart = Number(q.premiumPlanFeeUsdc ?? 0) > 0
|
|
490
|
+
? ` + ${q.premiumPlanLabel} $${q.premiumPlanFeeUsdc}`
|
|
491
|
+
: "";
|
|
436
492
|
return `Total: $${q.totalUsdc} USDC (domain $${q.domainCostUsdc} + platform $${q.platformFeeUsdc ?? q.serviceFeeUsdc}, email and SSL included${basenamePart}${ensPart}${planPart})`;
|
|
437
493
|
}
|
|
438
494
|
async search(walletProvider, args) {
|
|
@@ -440,7 +496,7 @@ export class AgentDomainActionProvider {
|
|
|
440
496
|
const result = await ad.search(args);
|
|
441
497
|
return `Found ${result.total} agents. First ${result.items.length}: ${result.items
|
|
442
498
|
.map((a) => a.domain)
|
|
443
|
-
.join(
|
|
499
|
+
.join(", ")}`;
|
|
444
500
|
}
|
|
445
501
|
async sendEmail(walletProvider, args) {
|
|
446
502
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
@@ -450,13 +506,28 @@ export class AgentDomainActionProvider {
|
|
|
450
506
|
subject: args.subject,
|
|
451
507
|
text: args.text,
|
|
452
508
|
});
|
|
453
|
-
return `Email
|
|
509
|
+
return `Email queued: ${result.id}`;
|
|
454
510
|
}
|
|
455
511
|
async listEmail(walletProvider, args) {
|
|
456
512
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
457
513
|
const result = await ad.listEmail(args.agentId, { limit: args.limit });
|
|
458
514
|
return JSON.stringify(result, null, 2);
|
|
459
515
|
}
|
|
516
|
+
async sendEmailBatch(walletProvider, args) {
|
|
517
|
+
const { ad } = this.createAgentDomain(walletProvider);
|
|
518
|
+
return JSON.stringify(await ad.sendEmailBatch(args.agentId, {
|
|
519
|
+
messages: args.messages,
|
|
520
|
+
idempotencyKey: args.idempotencyKey,
|
|
521
|
+
}), null, 2);
|
|
522
|
+
}
|
|
523
|
+
async emailUsage(walletProvider, args) {
|
|
524
|
+
const { ad } = this.createAgentDomain(walletProvider);
|
|
525
|
+
return JSON.stringify(await ad.getEmailUsage(args.agentId), null, 2);
|
|
526
|
+
}
|
|
527
|
+
async configureEmailWebhook(walletProvider, args) {
|
|
528
|
+
const { ad } = this.createAgentDomain(walletProvider);
|
|
529
|
+
return JSON.stringify(await ad.setEmailWebhook(args.agentId, args), null, 2);
|
|
530
|
+
}
|
|
460
531
|
async updatePrimaryEmail(walletProvider, args) {
|
|
461
532
|
const { ad } = this.createAgentDomain(walletProvider);
|
|
462
533
|
const result = await ad.updatePrimaryEmail(args.agentId, args.username);
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentdomain/agentkit-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Coinbase AgentKit action provider for AgentDomain",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": "https://github.com/0xmdrakib/AgentDomain.git",
|
|
7
|
+
"homepage": "https://agentdomain.app/docs",
|
|
8
|
+
"bugs": "https://github.com/0xmdrakib/AgentDomain/issues",
|
|
6
9
|
"type": "module",
|
|
7
10
|
"main": "./dist/index.js",
|
|
8
11
|
"types": "./dist/index.d.ts",
|
|
@@ -23,8 +26,8 @@
|
|
|
23
26
|
"dependencies": {
|
|
24
27
|
"viem": "^2.55.2",
|
|
25
28
|
"zod": "^3.24.1",
|
|
26
|
-
"@agentdomain/sdk": "^0.
|
|
27
|
-
"@agentdomain/shared": "^0.
|
|
29
|
+
"@agentdomain/sdk": "^0.4.0",
|
|
30
|
+
"@agentdomain/shared": "^0.4.0"
|
|
28
31
|
},
|
|
29
32
|
"peerDependencies": {
|
|
30
33
|
"@coinbase/agentkit": "^0.1.0"
|