@agentdomain/agentkit-plugin 0.6.0 → 0.8.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/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ AgentDomain public developer tools and verified Base contracts
2
+ Copyright 2026 Md. Rakib
3
+
4
+ AgentDomain and related names and logos are trademarks or service marks of
5
+ their respective owner. This license does not grant trademark rights.
package/README.md CHANGED
@@ -1,21 +1,57 @@
1
1
  # @agentdomain/agentkit-plugin
2
2
 
3
- Coinbase AgentKit action provider for AgentDomain.
3
+ Coinbase AgentKit action provider for AgentDomain identity infrastructure.
4
+
5
+ ## Install
4
6
 
5
7
  ```bash
6
- npm install @agentdomain/agentkit-plugin
8
+ npm install @agentdomain/agentkit-plugin @coinbase/agentkit
9
+ ```
10
+
11
+ ## Create the provider
12
+
13
+ ```ts
14
+ import { AgentDomainActionProvider } from '@agentdomain/agentkit-plugin';
15
+
16
+ const agentdomain = new AgentDomainActionProvider({
17
+ builderCode: process.env.AGENTDOMAIN_BUILDER_CODE,
18
+ renewalVaultAddress: process.env.RENEWAL_VAULT_ADDRESS,
19
+ });
20
+
21
+ const actions = agentdomain.getActions();
7
22
  ```
8
23
 
24
+ The AgentKit runtime supplies its wallet provider when invoking an action. The
25
+ default API is `https://api.agentdomain.app/api/v1`; set `apiUrl` only when a
26
+ different documented AgentDomain environment is intentionally used.
27
+
28
+ ## Actions
29
+
9
30
  The provider exposes actions for:
10
31
 
11
32
  - Agent identity registration and quote
12
33
  - Registry search
13
34
  - Email send/list/batch, monthly usage, signed inbound webhooks, primary address updates, and Starter/Pro/Enterprise aliases
14
- - Typed DNS list/create/update/delete for all 13 Spaceship-supported types, plus capabilities, batch preview/apply, and BIND import/export
35
+ - Typed DNS list/create/update/delete for all 13 supported types, plus capabilities, batch preview/apply, and BIND import/export
15
36
  - SSL reconfiguration
16
37
  - RenewalVault status, funding, auto-renew, and withdrawal
17
38
  - Per-agent Starter, Pro, and Enterprise Premium Plans
18
39
 
19
- Default API base: `https://agentdomain.app/api/v1`.
40
+ ## Credentials and transaction safety
41
+
42
+ `builderCode` is required only for direct Base writes such as auto-renew and
43
+ vault withdrawal. Missing or invalid attribution stops those actions before
44
+ `walletProvider.sendTransaction`; reads, signatures, and x402 v2 paid requests
45
+ keep their existing behavior.
46
+
47
+ Use a dedicated wallet with only the authority and funds required by the agent.
48
+ If `apiKey` is used for scoped operations, inject it through a trusted secret
49
+ store and never ship it in source or browser configuration. Preview DNS batches
50
+ before applying them and use registration quotes before authorizing payment.
51
+
52
+ ## Links
20
53
 
21
- Request the base URL directly to retrieve AgentDomain's machine-readable API discovery metadata.
54
+ - [AgentKit guide](https://docs.agentdomain.app/frameworks/agentkit)
55
+ - [API discovery](https://api.agentdomain.app/api/v1)
56
+ - [Source](https://github.com/0xmdrakib/AgentDomain/tree/main/packages/agentkit-plugin)
57
+ - [Security policy](https://github.com/0xmdrakib/AgentDomain/security/policy)
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { z } from "zod";
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"]>>;
@@ -35,17 +35,17 @@ declare const QuoteSchema: z.ZodObject<{
35
35
  }>;
36
36
  declare const SearchSchema: z.ZodObject<{
37
37
  q: z.ZodOptional<z.ZodString>;
38
- framework: z.ZodOptional<z.ZodEnum<["agentkit", "eliza", "crewai", "langchain", "openai", "anthropic"]>>;
38
+ framework: z.ZodOptional<z.ZodEnum<["agentkit", "eliza", "openai", "anthropic"]>>;
39
39
  capability: z.ZodOptional<z.ZodString>;
40
40
  limit: z.ZodDefault<z.ZodNumber>;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  limit: number;
43
43
  q?: string | undefined;
44
- framework?: "agentkit" | "eliza" | "crewai" | "langchain" | "openai" | "anthropic" | undefined;
44
+ framework?: "agentkit" | "eliza" | "openai" | "anthropic" | undefined;
45
45
  capability?: string | undefined;
46
46
  }, {
47
47
  q?: string | undefined;
48
- framework?: "agentkit" | "eliza" | "crewai" | "langchain" | "openai" | "anthropic" | undefined;
48
+ framework?: "agentkit" | "eliza" | "openai" | "anthropic" | undefined;
49
49
  capability?: string | undefined;
50
50
  limit?: number | undefined;
51
51
  }>;
@@ -108,7 +108,9 @@ export interface AgentDomainActionProviderOptions {
108
108
  apiKey?: string;
109
109
  baseRpcUrl?: string;
110
110
  renewalVaultAddress?: string;
111
- network?: "base" | "base-sepolia";
111
+ network?: 'base' | 'base-sepolia';
112
+ /** Public ERC-8021 app code required for direct Base transaction actions. */
113
+ builderCode?: string;
112
114
  }
113
115
  export declare class AgentDomainActionProvider {
114
116
  readonly name = "agentdomain";
@@ -117,6 +119,7 @@ export declare class AgentDomainActionProvider {
117
119
  private readonly baseRpcUrl;
118
120
  private readonly renewalVaultAddress?;
119
121
  private readonly network;
122
+ private readonly builderCode?;
120
123
  constructor(opts?: AgentDomainActionProviderOptions);
121
124
  private createAgentDomain;
122
125
  getActions(): ({
@@ -162,17 +165,17 @@ export declare class AgentDomainActionProvider {
162
165
  description: string;
163
166
  schema: z.ZodObject<{
164
167
  q: z.ZodOptional<z.ZodString>;
165
- framework: z.ZodOptional<z.ZodEnum<["agentkit", "eliza", "crewai", "langchain", "openai", "anthropic"]>>;
168
+ framework: z.ZodOptional<z.ZodEnum<["agentkit", "eliza", "openai", "anthropic"]>>;
166
169
  capability: z.ZodOptional<z.ZodString>;
167
170
  limit: z.ZodDefault<z.ZodNumber>;
168
171
  }, "strip", z.ZodTypeAny, {
169
172
  limit: number;
170
173
  q?: string | undefined;
171
- framework?: "agentkit" | "eliza" | "crewai" | "langchain" | "openai" | "anthropic" | undefined;
174
+ framework?: "agentkit" | "eliza" | "openai" | "anthropic" | undefined;
172
175
  capability?: string | undefined;
173
176
  }, {
174
177
  q?: string | undefined;
175
- framework?: "agentkit" | "eliza" | "crewai" | "langchain" | "openai" | "anthropic" | undefined;
178
+ framework?: "agentkit" | "eliza" | "openai" | "anthropic" | undefined;
176
179
  capability?: string | undefined;
177
180
  limit?: number | undefined;
178
181
  }>;
@@ -238,6 +241,7 @@ export declare class AgentDomainActionProvider {
238
241
  private renewalStatus;
239
242
  private fundRenewal;
240
243
  private enableAutoRenew;
244
+ private requireBuilderCode;
241
245
  private reconfigureSsl;
242
246
  private listDns;
243
247
  private getDnsCapabilities;
package/dist/index.js CHANGED
@@ -1,12 +1,12 @@
1
- import { z } from "zod";
2
- import { AgentDomain } from "@agentdomain/sdk";
3
- import { DNS_RECORD_TYPES, dnsRecordSchema, } from "@agentdomain/shared";
4
- import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from "@agentdomain/shared/constants";
5
- import { createPublicClient, createWalletClient, http, encodeFunctionData, } from "viem";
6
- import { base, baseSepolia } from "viem/chains";
1
+ import { z } from 'zod';
2
+ import { AgentDomain, encodeSetAutoRenewCalldata } from '@agentdomain/sdk';
3
+ import { DNS_RECORD_TYPES, dnsRecordSchema } from '@agentdomain/shared';
4
+ import { AGENTDOMAIN_API_BASE_URL, SERVICE_PLAN_KEYS, SUPPORTED_FRAMEWORKS, SUPPORTED_TLDS, } from '@agentdomain/shared/constants';
5
+ import { createPublicClient, createWalletClient, http } from 'viem';
6
+ import { base, baseSepolia } from 'viem/chains';
7
7
  const RegisterSchema = z.object({
8
8
  preferredName: z.string().min(3).max(63),
9
- tld: z.enum(SUPPORTED_TLDS).default("xyz"),
9
+ tld: z.enum(SUPPORTED_TLDS).default('xyz'),
10
10
  registerBasename: z.boolean().default(true),
11
11
  basenameLabel: z.string().min(3).max(63).optional(),
12
12
  registerEns: z.boolean().default(false),
@@ -25,11 +25,11 @@ const RegisterSchema = z.object({
25
25
  dnsTarget: z.string().url().optional(),
26
26
  years: z.number().int().min(1).max(10).default(1),
27
27
  autoRenew: z.boolean().default(false),
28
- premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
28
+ premiumPlan: z.enum(SERVICE_PLAN_KEYS).default('included'),
29
29
  });
30
30
  const QuoteSchema = z.object({
31
31
  preferredName: z.string(),
32
- tld: z.enum(SUPPORTED_TLDS).default("xyz"),
32
+ tld: z.enum(SUPPORTED_TLDS).default('xyz'),
33
33
  registerBasename: z.boolean().default(true),
34
34
  basenameLabel: z.string().min(3).max(63).optional(),
35
35
  registerEns: z.boolean().default(false),
@@ -42,7 +42,7 @@ const QuoteSchema = z.object({
42
42
  .regex(/^[a-z0-9](?:[a-z0-9._+-]{0,62}[a-z0-9])?$/)
43
43
  .optional(),
44
44
  years: z.number().int().min(1).max(10).default(1),
45
- premiumPlan: z.enum(SERVICE_PLAN_KEYS).default("included"),
45
+ premiumPlan: z.enum(SERVICE_PLAN_KEYS).default('included'),
46
46
  });
47
47
  const SearchSchema = z.object({
48
48
  q: z.string().optional(),
@@ -74,7 +74,7 @@ const EmailUsageSchema = z.object({ agentId: z.string() });
74
74
  const EmailWebhookSchema = z.object({
75
75
  agentId: z.string(),
76
76
  url: z.string().url(),
77
- payloadMode: z.enum(["metadata", "inline_text"]).default("metadata"),
77
+ payloadMode: z.enum(['metadata', 'inline_text']).default('metadata'),
78
78
  enabled: z.boolean().default(true),
79
79
  });
80
80
  const RenewalStatusSchema = z.object({
@@ -82,9 +82,7 @@ const RenewalStatusSchema = z.object({
82
82
  });
83
83
  const FundRenewalSchema = z.object({
84
84
  agentId: z.string().min(1),
85
- amountUsdc: z
86
- .string()
87
- .regex(/^\d+(\.\d{1,6})?$/, "Use a USDC amount with up to 6 decimals"),
85
+ amountUsdc: z.string().regex(/^\d+(\.\d{1,6})?$/, 'Use a USDC amount with up to 6 decimals'),
88
86
  enableAutoRenew: z.boolean().default(false),
89
87
  });
90
88
  const EnableAutoRenewSchema = z.object({
@@ -108,8 +106,8 @@ const CreateDnsSchema = z
108
106
  priority: z.number().int().min(0).max(65_535).optional(),
109
107
  })
110
108
  .refine((record) => record.value !== undefined || record.data !== undefined, {
111
- message: "Provide structured data or the legacy value field",
112
- path: ["data"],
109
+ message: 'Provide structured data or the legacy value field',
110
+ path: ['data'],
113
111
  });
114
112
  const UpdateDnsSchema = z.object({
115
113
  agentId: z.string().min(1),
@@ -128,33 +126,31 @@ const DeleteDnsSchema = z.object({
128
126
  const ChangeDnsSchema = z.object({
129
127
  agentId: z.string().min(1),
130
128
  records: z.array(dnsRecordSchema).min(1).max(200),
131
- mode: z.enum(["merge", "replace"]).default("merge"),
129
+ mode: z.enum(['merge', 'replace']).default('merge'),
132
130
  dryRun: z.boolean().default(true),
133
131
  baseRevision: z.string().length(64).optional(),
134
132
  });
135
133
  const ImportDnsSchema = z.object({
136
134
  agentId: z.string().min(1),
137
135
  zoneFile: z.string().min(1).max(262_144),
138
- mode: z.enum(["merge", "replace"]).default("merge"),
136
+ mode: z.enum(['merge', 'replace']).default('merge'),
139
137
  dryRun: z.boolean().default(true),
140
138
  baseRevision: z.string().length(64).optional(),
141
139
  });
142
140
  const ExportDnsSchema = z.object({
143
141
  agentId: z.string().min(1),
144
- scope: z.enum(["user", "all"]).default("user"),
142
+ scope: z.enum(['user', 'all']).default('user'),
145
143
  });
146
144
  const WithdrawRenewalSchema = z.object({
147
145
  agentId: z.string().min(1),
148
- amountUsdc: z
149
- .string()
150
- .regex(/^\d+(\.\d{1,6})?$/, "Use a USDC amount with up to 6 decimals"),
146
+ amountUsdc: z.string().regex(/^\d+(\.\d{1,6})?$/, 'Use a USDC amount with up to 6 decimals'),
151
147
  });
152
148
  const ServicePlanStatusSchema = z.object({
153
149
  agentId: z.string().min(1),
154
150
  });
155
151
  const PurchaseServicePlanSchema = z.object({
156
152
  agentId: z.string().min(1),
157
- plan: z.enum(["starter", "pro", "enterprise"]),
153
+ plan: z.enum(['starter', 'pro', 'enterprise']),
158
154
  planSku: z.custom().optional(),
159
155
  });
160
156
  const SetRegistryVisibilitySchema = z.object({
@@ -163,7 +159,7 @@ const SetRegistryVisibilitySchema = z.object({
163
159
  });
164
160
  const ScheduleServicePlanRenewalSchema = z.object({
165
161
  agentId: z.string().uuid(),
166
- plan: z.enum(["included", "starter", "pro", "enterprise"]),
162
+ plan: z.enum(['included', 'starter', 'pro', 'enterprise']),
167
163
  planSku: z.custom(),
168
164
  });
169
165
  const UpdatePrimaryEmailSchema = z.object({
@@ -180,26 +176,25 @@ const DeleteEmailAliasSchema = z.object({
180
176
  emailAddress: z.string().email(),
181
177
  });
182
178
  export class AgentDomainActionProvider {
183
- name = "agentdomain";
179
+ name = 'agentdomain';
184
180
  apiUrl;
185
181
  apiKey;
186
182
  baseRpcUrl;
187
183
  renewalVaultAddress;
188
184
  network;
185
+ builderCode;
189
186
  constructor(opts = {}) {
190
187
  this.apiUrl = opts.apiUrl ?? AGENTDOMAIN_API_BASE_URL;
191
188
  this.apiKey = opts.apiKey;
192
- this.baseRpcUrl = opts.baseRpcUrl ?? "https://mainnet.base.org";
189
+ this.baseRpcUrl = opts.baseRpcUrl ?? 'https://mainnet.base.org';
193
190
  this.renewalVaultAddress = opts.renewalVaultAddress;
194
- this.network = opts.network ?? "base";
191
+ this.network = opts.network ?? 'base';
192
+ this.builderCode = opts.builderCode;
195
193
  }
196
194
  createAgentDomain(walletProvider) {
197
195
  const wallet = walletProvider.getAddress();
198
- const chain = this.network === "base-sepolia" ? baseSepolia : base;
199
- const publicClient = createPublicClient({
200
- chain,
201
- transport: http(this.baseRpcUrl),
202
- });
196
+ const chain = this.network === 'base-sepolia' ? baseSepolia : base;
197
+ const publicClient = createPublicClient({ chain, transport: http(this.baseRpcUrl) });
203
198
  const walletClient = createWalletClient({
204
199
  chain,
205
200
  transport: http(this.baseRpcUrl),
@@ -216,6 +211,7 @@ export class AgentDomainActionProvider {
216
211
  apiKey: this.apiKey,
217
212
  network: this.network,
218
213
  renewalVaultAddress: this.renewalVaultAddress,
214
+ builderCode: this.builderCode,
219
215
  walletClient: walletClient,
220
216
  publicClient: publicClient,
221
217
  });
@@ -224,215 +220,210 @@ export class AgentDomainActionProvider {
224
220
  getActions() {
225
221
  return [
226
222
  {
227
- name: "register_agent_identity",
228
- 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.",
223
+ name: 'register_agent_identity',
224
+ 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.',
229
225
  schema: RegisterSchema,
230
226
  invoke: this.register.bind(this),
231
227
  },
232
228
  {
233
- name: "quote_agent_registration",
234
- 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.",
229
+ name: 'quote_agent_registration',
230
+ 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.',
235
231
  schema: QuoteSchema,
236
232
  invoke: this.quote.bind(this),
237
233
  },
238
234
  {
239
- name: "search_agents",
240
- description: "Search the public AgentDomain registry.",
235
+ name: 'search_agents',
236
+ description: 'Search the public AgentDomain registry.',
241
237
  schema: SearchSchema,
242
238
  invoke: this.search.bind(this),
243
239
  },
244
240
  {
245
- name: "send_agent_email",
246
- description: "Send text-only email from an agent primary email or active alias via AWS SES.",
241
+ name: 'send_agent_email',
242
+ description: 'Send text-only email from an agent primary email or active alias.',
247
243
  schema: SendEmailSchema,
248
244
  invoke: this.sendEmail.bind(this),
249
245
  },
250
246
  {
251
- name: "list_agent_email",
252
- description: "Query text-only agent email and extracted verification codes.",
247
+ name: 'list_agent_email',
248
+ description: 'Query text-only agent email and extracted verification codes.',
253
249
  schema: ListEmailSchema,
254
250
  invoke: this.listEmail.bind(this),
255
251
  },
256
252
  {
257
- name: "delete_agent_email",
258
- description: "Permanently delete one email message from an agent inbox.",
253
+ name: 'delete_agent_email',
254
+ description: 'Permanently delete one email message from an agent inbox.',
259
255
  schema: DeleteEmailMessageSchema,
260
256
  invoke: this.deleteEmailMessage.bind(this),
261
257
  },
262
258
  {
263
- name: "send_agent_email_batch",
264
- description: "Queue up to 100 emails in one API request.",
259
+ name: 'send_agent_email_batch',
260
+ description: 'Queue up to 100 emails in one API request.',
265
261
  schema: BatchEmailSchema,
266
262
  invoke: this.sendEmailBatch.bind(this),
267
263
  },
268
264
  {
269
- name: "get_agent_email_usage",
270
- description: "Get combined monthly sent and received email usage.",
265
+ name: 'get_agent_email_usage',
266
+ description: 'Get combined monthly sent and received email usage.',
271
267
  schema: EmailUsageSchema,
272
268
  invoke: this.emailUsage.bind(this),
273
269
  },
274
270
  {
275
- name: "configure_email_webhook",
276
- description: "Configure signed inbound email events for this agent.",
271
+ name: 'configure_email_webhook',
272
+ description: 'Configure signed inbound email events for this agent.',
277
273
  schema: EmailWebhookSchema,
278
274
  invoke: this.configureEmailWebhook.bind(this),
279
275
  },
280
276
  {
281
- name: "get_renewal_status",
282
- description: "Get exact next renewal amount, shortfall, vault balance, expiry date, and auto-renew state for an AgentDomain identity.",
277
+ name: 'get_renewal_status',
278
+ description: 'Get exact next renewal amount, shortfall, vault balance, expiry date, and auto-renew state for an AgentDomain identity.',
283
279
  schema: RenewalStatusSchema,
284
280
  invoke: this.renewalStatus.bind(this),
285
281
  },
286
282
  {
287
- name: "fund_renewal_vault",
288
- 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.",
283
+ name: 'fund_renewal_vault',
284
+ 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.',
289
285
  schema: FundRenewalSchema,
290
286
  invoke: this.fundRenewal.bind(this),
291
287
  },
292
288
  {
293
- name: "enable_auto_renew",
294
- description: "Enable RenewalVault auto-renew. Requires the wallet provider to be the AgentID NFT owner and support sendTransaction.",
289
+ name: 'enable_auto_renew',
290
+ description: 'Enable RenewalVault auto-renew. Requires the wallet provider to be the AgentID NFT owner and support sendTransaction.',
295
291
  schema: EnableAutoRenewSchema,
296
292
  invoke: this.enableAutoRenew.bind(this),
297
293
  },
298
294
  {
299
- name: "reconfigure_ssl",
300
- description: "Rebuild the Cloudflare SaaS SSL hostname and sync the required Spaceship DNS validation records for an existing agent.",
295
+ name: 'reconfigure_ssl',
296
+ description: 'Rebuild the managed SSL hostname and sync the required DNS validation records for an existing agent.',
301
297
  schema: SslReconfigureSchema,
302
298
  invoke: this.reconfigureSsl.bind(this),
303
299
  },
304
300
  {
305
- name: "get_dns_capabilities",
306
- description: "Get machine-readable DNS types, fields, limits, and provider constraints.",
301
+ name: 'get_dns_capabilities',
302
+ description: 'Get machine-readable DNS types, fields, limits, and provider constraints.',
307
303
  schema: ListDnsSchema,
308
304
  invoke: this.getDnsCapabilities.bind(this),
309
305
  },
310
306
  {
311
- name: "list_dns_records",
312
- description: "List DNS records for an AgentDomain identity.",
307
+ name: 'list_dns_records',
308
+ description: 'List DNS records for an AgentDomain identity.',
313
309
  schema: ListDnsSchema,
314
310
  invoke: this.listDns.bind(this),
315
311
  },
316
312
  {
317
- name: "create_dns_record",
318
- description: "Create a user-managed DNS record and sync it to the domain provider.",
313
+ name: 'create_dns_record',
314
+ description: 'Create a user-managed DNS record and sync it to the domain provider.',
319
315
  schema: CreateDnsSchema,
320
316
  invoke: this.createDns.bind(this),
321
317
  },
322
318
  {
323
- name: "update_dns_record",
324
- description: "Update a user-managed DNS record and sync it to the domain provider.",
319
+ name: 'update_dns_record',
320
+ description: 'Update a user-managed DNS record and sync it to the domain provider.',
325
321
  schema: UpdateDnsSchema,
326
322
  invoke: this.updateDns.bind(this),
327
323
  },
328
324
  {
329
- name: "delete_dns_record",
330
- description: "Delete a user-managed DNS record and sync the domain provider state.",
325
+ name: 'delete_dns_record',
326
+ description: 'Delete a user-managed DNS record and sync the domain provider state.',
331
327
  schema: DeleteDnsSchema,
332
328
  invoke: this.deleteDns.bind(this),
333
329
  },
334
330
  {
335
- name: "change_dns_records",
336
- description: "Preview or apply a revision-protected DNS batch in merge or replace mode.",
331
+ name: 'change_dns_records',
332
+ description: 'Preview or apply a revision-protected DNS batch in merge or replace mode.',
337
333
  schema: ChangeDnsSchema,
338
334
  invoke: this.changeDns.bind(this),
339
335
  },
340
336
  {
341
- name: "import_dns_zone",
342
- description: "Preview or apply a validated BIND zone import without deleting system-managed records.",
337
+ name: 'import_dns_zone',
338
+ description: 'Preview or apply a validated BIND zone import without deleting system-managed records.',
343
339
  schema: ImportDnsSchema,
344
340
  invoke: this.importDns.bind(this),
345
341
  },
346
342
  {
347
- name: "export_dns_zone",
348
- description: "Export user or permitted complete DNS state as a BIND zone file.",
343
+ name: 'export_dns_zone',
344
+ description: 'Export user or permitted complete DNS state as a BIND zone file.',
349
345
  schema: ExportDnsSchema,
350
346
  invoke: this.exportDns.bind(this),
351
347
  },
352
348
  {
353
- name: "withdraw_renewal_vault",
354
- description: "Withdraw unused USDC from an AgentID renewal vault. Requires the AgentID NFT owner wallet.",
349
+ name: 'withdraw_renewal_vault',
350
+ description: 'Withdraw unused USDC from an AgentID renewal vault. Requires the AgentID NFT owner wallet.',
355
351
  schema: WithdrawRenewalSchema,
356
352
  invoke: this.withdrawRenewal.bind(this),
357
353
  },
358
354
  {
359
- name: "get_service_plan",
360
- description: "Get the current per-agent Premium Plan, limits, and billing state.",
355
+ name: 'get_service_plan',
356
+ description: 'Get the current per-agent Premium Plan, limits, and billing state.',
361
357
  schema: ServicePlanStatusSchema,
362
358
  invoke: this.getServicePlan.bind(this),
363
359
  },
364
360
  {
365
- name: "purchase_service_plan",
366
- description: "Upgrade one agent to an AgentDomain Starter, Pro, or Enterprise Premium Plan using x402 USDC payment.",
361
+ name: 'purchase_service_plan',
362
+ description: 'Upgrade one agent to an AgentDomain Starter, Pro, or Enterprise Premium Plan using x402 USDC payment.',
367
363
  schema: PurchaseServicePlanSchema,
368
364
  invoke: this.purchaseServicePlan.bind(this),
369
365
  },
370
366
  {
371
- name: "set_registry_visibility",
372
- description: "Hide or show one agent in the public AgentDomain registry. Hiding requires an active paid Premium Plan.",
367
+ name: 'set_registry_visibility',
368
+ description: 'Hide or show one agent in the public AgentDomain registry. Hiding requires an active paid Premium Plan.',
373
369
  schema: SetRegistryVisibilitySchema,
374
370
  invoke: this.setRegistryVisibility.bind(this),
375
371
  },
376
372
  {
377
- name: "schedule_service_plan_renewal",
378
- description: "Choose the exact Premium Plan SKU for the next identity renewal, including Enterprise tiers.",
373
+ name: 'schedule_service_plan_renewal',
374
+ description: 'Choose the exact Premium Plan SKU for the next identity renewal, including Enterprise tiers.',
379
375
  schema: ScheduleServicePlanRenewalSchema,
380
376
  invoke: this.scheduleServicePlanRenewal.bind(this),
381
377
  },
382
378
  {
383
- name: "update_primary_email",
384
- description: "Change one agent primary email username. The old primary address stops receiving new mail.",
379
+ name: 'update_primary_email',
380
+ description: 'Change one agent primary email username. The old primary address stops receiving new mail.',
385
381
  schema: UpdatePrimaryEmailSchema,
386
382
  invoke: this.updatePrimaryEmail.bind(this),
387
383
  },
388
384
  {
389
- name: "create_email_alias",
390
- description: "Create an extra receive-and-send alias for one agent. Requires available paid-plan alias capacity.",
385
+ name: 'create_email_alias',
386
+ description: 'Create an extra receive-and-send alias for one agent. Requires available paid-plan alias capacity.',
391
387
  schema: CreateEmailAliasSchema,
392
388
  invoke: this.createEmailAlias.bind(this),
393
389
  },
394
390
  {
395
- name: "delete_email_alias",
396
- description: "Delete one active email alias from an agent.",
391
+ name: 'delete_email_alias',
392
+ description: 'Delete one active email alias from an agent.',
397
393
  schema: DeleteEmailAliasSchema,
398
394
  invoke: this.deleteEmailAlias.bind(this),
399
395
  },
400
396
  ];
401
397
  }
402
398
  async register(walletProvider, args) {
403
- const { ad, wallet } = this.createAgentDomain(walletProvider);
404
- const result = await ad.register({
405
- ...args,
406
- emailEnabled: true,
407
- wallet,
408
- });
409
- let autoRenewMsg = "";
399
+ const { ad, wallet, publicClient } = this.createAgentDomain(walletProvider);
400
+ const result = await ad.register({ ...args, emailEnabled: true, wallet });
401
+ let autoRenewMsg = '';
410
402
  if (args.autoRenew && this.renewalVaultAddress) {
411
403
  try {
412
404
  if (walletProvider.sendTransaction) {
413
- const data = encodeFunctionData({
414
- abi: [
415
- {
416
- type: "function",
417
- name: "setAutoRenew",
418
- inputs: [
419
- { name: "tokenId", type: "uint256" },
420
- { name: "enabled", type: "bool" },
421
- ],
422
- },
423
- ],
424
- functionName: "setAutoRenew",
425
- args: [BigInt(result.nftTokenId), true],
426
- });
405
+ const data = encodeSetAutoRenewCalldata(BigInt(result.nftTokenId), true, this.requireBuilderCode('Registration auto-renew'));
427
406
  const txHash = await walletProvider.sendTransaction({
428
407
  to: this.renewalVaultAddress,
429
408
  data,
430
409
  });
410
+ let receipt;
411
+ try {
412
+ receipt = await publicClient.waitForTransactionReceipt({
413
+ hash: txHash,
414
+ });
415
+ }
416
+ catch (e) {
417
+ throw new Error(`Auto-renew transaction ${txHash} was submitted but confirmation failed or remained pending: ${String(e)}`);
418
+ }
419
+ if (receipt.status !== 'success') {
420
+ throw new Error(`Auto-renew transaction ${txHash} confirmed with status ${receipt.status}; auto-renew was not enabled.`);
421
+ }
431
422
  autoRenewMsg = ` Auto-renew enabled via tx ${txHash}.`;
432
423
  }
433
424
  else {
434
425
  autoRenewMsg =
435
- " (Cannot enable auto-renew because walletProvider lacks sendTransaction).";
426
+ ' (Cannot enable auto-renew because walletProvider lacks sendTransaction).';
436
427
  }
437
428
  }
438
429
  catch (e) {
@@ -444,7 +435,7 @@ export class AgentDomainActionProvider {
444
435
  async renewalStatus(walletProvider, args) {
445
436
  const { ad } = this.createAgentDomain(walletProvider);
446
437
  const status = await ad.getRenewalStatus(args.agentId);
447
- 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"}.`;
438
+ 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'}.`;
448
439
  }
449
440
  async fundRenewal(walletProvider, args) {
450
441
  const { ad } = this.createAgentDomain(walletProvider);
@@ -457,43 +448,35 @@ export class AgentDomainActionProvider {
457
448
  }
458
449
  async enableAutoRenew(walletProvider, args) {
459
450
  if (!this.renewalVaultAddress) {
460
- throw new Error("renewalVaultAddress is required to enable auto-renew.");
451
+ throw new Error('renewalVaultAddress is required to enable auto-renew.');
461
452
  }
462
453
  if (!walletProvider.sendTransaction) {
463
- throw new Error("walletProvider.sendTransaction is required to enable auto-renew.");
454
+ throw new Error('walletProvider.sendTransaction is required to enable auto-renew.');
464
455
  }
465
456
  const { ad, wallet } = this.createAgentDomain(walletProvider);
466
457
  const status = await ad.getRenewalStatus(args.agentId);
467
458
  if (!status.tokenId)
468
- throw new Error("AgentID NFT is not minted yet.");
469
- if (status.ownerAddress &&
470
- status.ownerAddress.toLowerCase() !== wallet.toLowerCase()) {
459
+ throw new Error('AgentID NFT is not minted yet.');
460
+ if (status.ownerAddress && status.ownerAddress.toLowerCase() !== wallet.toLowerCase()) {
471
461
  throw new Error(`Only the AgentID NFT owner (${status.ownerAddress}) can enable auto-renew.`);
472
462
  }
473
- const data = encodeFunctionData({
474
- abi: [
475
- {
476
- type: "function",
477
- name: "setAutoRenew",
478
- inputs: [
479
- { name: "tokenId", type: "uint256" },
480
- { name: "enabled", type: "bool" },
481
- ],
482
- },
483
- ],
484
- functionName: "setAutoRenew",
485
- args: [BigInt(status.tokenId), true],
486
- });
463
+ const data = encodeSetAutoRenewCalldata(BigInt(status.tokenId), true, this.requireBuilderCode('Auto-renew'));
487
464
  const txHash = await walletProvider.sendTransaction({
488
465
  to: this.renewalVaultAddress,
489
466
  data,
490
467
  });
491
- return `Auto-renew enabled via tx ${txHash}.`;
468
+ return `Auto-renew transaction submitted via tx ${txHash}.`;
469
+ }
470
+ requireBuilderCode(operation) {
471
+ if (!this.builderCode) {
472
+ throw new Error(`${operation} requires builderCode in AgentDomainActionProvider options so the direct Base transaction is attributed.`);
473
+ }
474
+ return this.builderCode;
492
475
  }
493
476
  async reconfigureSsl(walletProvider, args) {
494
477
  const { ad } = this.createAgentDomain(walletProvider);
495
478
  const result = await ad.reconfigureSsl(args.agentId);
496
- return `SSL reconfigured for ${result.domain}. Cloudflare hostname ${result.cloudflareCustomHostnameId} is ${result.sslStatus} and ${result.validationRecordsCount} validation record(s) were synced.`;
479
+ return `SSL reconfigured for ${result.domain}. Hostname ${result.cloudflareCustomHostnameId} is ${result.sslStatus} and ${result.validationRecordsCount} validation record(s) were synced.`;
497
480
  }
498
481
  async listDns(walletProvider, args) {
499
482
  const { ad } = this.createAgentDomain(walletProvider);
@@ -541,7 +524,7 @@ export class AgentDomainActionProvider {
541
524
  }
542
525
  async withdrawRenewal(walletProvider, args) {
543
526
  if (!walletProvider.sendTransaction) {
544
- throw new Error("walletProvider.sendTransaction is required to withdraw vault funds.");
527
+ throw new Error('walletProvider.sendTransaction is required to withdraw vault funds.');
545
528
  }
546
529
  const { ad } = this.createAgentDomain(walletProvider);
547
530
  const tx = await ad.withdrawFromVault(args.agentId, args.amountUsdc);
@@ -561,12 +544,12 @@ export class AgentDomainActionProvider {
561
544
  async purchaseServicePlan(walletProvider, args) {
562
545
  const { ad } = this.createAgentDomain(walletProvider);
563
546
  const result = await ad.purchaseServicePlan(args);
564
- return `Purchased ${result.entitlement.plan} Premium Plan for ${result.domain}. Current period ends ${result.entitlement.currentPeriodEnd ?? "unknown"}.`;
547
+ return `Purchased ${result.entitlement.plan} Premium Plan for ${result.domain}. Current period ends ${result.entitlement.currentPeriodEnd ?? 'unknown'}.`;
565
548
  }
566
549
  async setRegistryVisibility(walletProvider, args) {
567
550
  const { ad } = this.createAgentDomain(walletProvider);
568
551
  const result = await ad.setRegistryVisibility(args.agentId, args.registryHidden);
569
- return `${result.domain} is now ${result.registryVisibility.hidden ? "hidden from" : "visible in"} the public registry.`;
552
+ return `${result.domain} is now ${result.registryVisibility.hidden ? 'hidden from' : 'visible in'} the public registry.`;
570
553
  }
571
554
  async scheduleServicePlanRenewal(walletProvider, args) {
572
555
  const { ad } = this.createAgentDomain(walletProvider);
@@ -576,13 +559,11 @@ export class AgentDomainActionProvider {
576
559
  async quote(walletProvider, args) {
577
560
  const { ad } = this.createAgentDomain(walletProvider);
578
561
  const q = await ad.quote(args);
579
- const basenamePart = Number(q.basenameCostUsdc) > 0
580
- ? ` + Basename $${q.basenameCostUsdc}`
581
- : "";
582
- const ensPart = Number(q.ensCostUsdc) > 0 ? ` + ENS $${q.ensCostUsdc}` : "";
562
+ const basenamePart = Number(q.basenameCostUsdc) > 0 ? ` + Basename $${q.basenameCostUsdc}` : '';
563
+ const ensPart = Number(q.ensCostUsdc) > 0 ? ` + ENS $${q.ensCostUsdc}` : '';
583
564
  const planPart = Number(q.premiumPlanFeeUsdc ?? 0) > 0
584
565
  ? ` + ${q.premiumPlanLabel} $${q.premiumPlanFeeUsdc}`
585
- : "";
566
+ : '';
586
567
  return `Total: $${q.totalUsdc} USDC (domain $${q.domainCostUsdc} + platform $${q.platformFeeUsdc ?? q.serviceFeeUsdc}, email and SSL included${basenamePart}${ensPart}${planPart})`;
587
568
  }
588
569
  async search(walletProvider, args) {
@@ -590,7 +571,7 @@ export class AgentDomainActionProvider {
590
571
  const result = await ad.search(args);
591
572
  return `Found ${result.total} agents. First ${result.items.length}: ${result.items
592
573
  .map((a) => a.domain)
593
- .join(", ")}`;
574
+ .join(', ')}`;
594
575
  }
595
576
  async sendEmail(walletProvider, args) {
596
577
  const { ad } = this.createAgentDomain(walletProvider);
@@ -645,7 +626,7 @@ export class AgentDomainActionProvider {
645
626
  }
646
627
  function requireDnsRevision(value) {
647
628
  if (!value)
648
- throw new Error("Apply requires baseRevision from a fresh DNS dry-run preview.");
629
+ throw new Error('Apply requires baseRevision from a fresh DNS dry-run preview.');
649
630
  return value;
650
631
  }
651
632
  export default AgentDomainActionProvider;
package/package.json CHANGED
@@ -1,12 +1,27 @@
1
1
  {
2
2
  "name": "@agentdomain/agentkit-plugin",
3
- "version": "0.6.0",
4
- "description": "Coinbase AgentKit action provider for AgentDomain",
3
+ "version": "0.8.0",
4
+ "description": "Coinbase AgentKit action provider for AgentDomain identity infrastructure",
5
+ "keywords": [
6
+ "agentdomain",
7
+ "ai-agents",
8
+ "coinbase-agentkit",
9
+ "identity",
10
+ "x402",
11
+ "base"
12
+ ],
5
13
  "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",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/0xmdrakib/AgentDomain.git",
17
+ "directory": "packages/agentkit-plugin"
18
+ },
19
+ "homepage": "https://docs.agentdomain.app/frameworks/agentkit",
20
+ "bugs": {
21
+ "url": "https://github.com/0xmdrakib/AgentDomain/issues"
22
+ },
9
23
  "type": "module",
24
+ "sideEffects": false,
10
25
  "main": "./dist/index.js",
11
26
  "types": "./dist/index.d.ts",
12
27
  "exports": {
@@ -18,6 +33,8 @@
18
33
  "files": [
19
34
  "dist",
20
35
  "README.md",
36
+ "LICENSE",
37
+ "NOTICE",
21
38
  "package.json"
22
39
  ],
23
40
  "publishConfig": {
@@ -26,8 +43,8 @@
26
43
  "dependencies": {
27
44
  "viem": "^2.55.2",
28
45
  "zod": "^3.24.1",
29
- "@agentdomain/sdk": "^0.6.0",
30
- "@agentdomain/shared": "^0.6.0"
46
+ "@agentdomain/sdk": "^0.8.0",
47
+ "@agentdomain/shared": "^0.8.0"
31
48
  },
32
49
  "peerDependencies": {
33
50
  "@coinbase/agentkit": "^0.1.0"
@@ -37,6 +54,7 @@
37
54
  },
38
55
  "scripts": {
39
56
  "build": "tsc",
57
+ "test": "pnpm --filter @agentdomain/sdk build && pnpm run build && node --test test/*.test.mjs",
40
58
  "typecheck": "tsc --noEmit",
41
59
  "lint": "echo \"no lint\""
42
60
  }