@ens-node-metadata/agent 0.3.2 → 0.3.3

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.
@@ -31,19 +31,41 @@ var EmailServiceSchema = z.object({
31
31
  name: z.literal("email"),
32
32
  endpoint: z.string().email().describe("Support email address")
33
33
  });
34
+ var EnsServiceSchema = z.object({
35
+ name: z.literal("ENS"),
36
+ endpoint: z.string().describe("ENS name (e.g. myagent.eth)"),
37
+ version: z.string().optional().describe("ENS version (e.g. v1)")
38
+ });
39
+ var DidServiceSchema = z.object({
40
+ name: z.literal("DID"),
41
+ endpoint: z.string().describe("Decentralized identifier (e.g. did:ethr:0x... or did:web:example.com)"),
42
+ version: z.string().optional().describe("DID version")
43
+ });
44
+ var KNOWN_SERVICE_NAMES = ["MCP", "A2A", "OASF", "agentWallet", "web", "email", "ENS", "DID"];
45
+ var UnknownServiceSchema = z.object({
46
+ name: z.string().refine(
47
+ (n) => !KNOWN_SERVICE_NAMES.includes(n),
48
+ { message: "Use the typed schema for known service names" }
49
+ ).describe("Custom service type name"),
50
+ endpoint: z.string().describe("Service endpoint")
51
+ }).passthrough();
34
52
  var SCHEMA_8004_V2 = z.object({
35
53
  type: z.literal("https://eips.ethereum.org/EIPS/eip-8004#registration-v1").describe("ERC-8004 registration type identifier \u2014 must be this exact URI"),
36
54
  name: z.string().min(3).max(200).describe("Agent display name (3\u2013200 characters)"),
37
55
  description: z.string().min(10).describe("Natural language explanation of what the agent does and its capabilities"),
38
56
  image: z.string().url().optional().describe("Avatar or logo URI \u2014 PNG, SVG, WebP, or JPG; 512\xD7512px minimum recommended"),
39
- services: z.array(z.discriminatedUnion("name", [
40
- McpServiceSchema,
41
- A2AServiceSchema,
42
- OasfServiceSchema,
43
- AgentWalletServiceSchema,
44
- WebServiceSchema,
45
- EmailServiceSchema
46
- ])).describe("Communication endpoints \u2014 MCP, A2A, OASF, agentWallet, web, or email"),
57
+ services: z.array(
58
+ z.discriminatedUnion("name", [
59
+ McpServiceSchema,
60
+ A2AServiceSchema,
61
+ OasfServiceSchema,
62
+ AgentWalletServiceSchema,
63
+ WebServiceSchema,
64
+ EmailServiceSchema,
65
+ EnsServiceSchema,
66
+ DidServiceSchema
67
+ ]).or(UnknownServiceSchema)
68
+ ).describe("Communication endpoints \u2014 MCP, A2A, OASF, agentWallet, web, email, ENS, DID, or any custom type"),
47
69
  registrations: z.array(z.object({
48
70
  agentId: z.union([z.number().int(), z.string()]).describe("Agent token ID in the on-chain registry"),
49
71
  agentRegistry: z.string().describe("CAIP-10 formatted registry contract address (e.g. eip155:1:0x...)")
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateRegistrationFile
3
- } from "../../chunk-UDZL55XF.js";
3
+ } from "../../chunk-BPAT5BZR.js";
4
4
  import "../../chunk-YZFATT7X.js";
5
5
 
6
6
  // src/commands/registration-file/publish.tsx
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  validateRegistrationFile
3
- } from "../../chunk-UDZL55XF.js";
3
+ } from "../../chunk-BPAT5BZR.js";
4
4
  import "../../chunk-YZFATT7X.js";
5
5
 
6
6
  // src/commands/registration-file/validate.tsx
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ declare const SCHEMA_8004_V2: z.ZodObject<{
11
11
  name: z.ZodString;
12
12
  description: z.ZodString;
13
13
  image: z.ZodOptional<z.ZodString>;
14
- services: z.ZodArray<z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
14
+ services: z.ZodArray<z.ZodUnion<[z.ZodDiscriminatedUnion<"name", [z.ZodObject<{
15
15
  name: z.ZodLiteral<"MCP">;
16
16
  endpoint: z.ZodString;
17
17
  version: z.ZodString;
@@ -86,7 +86,40 @@ declare const SCHEMA_8004_V2: z.ZodObject<{
86
86
  }, {
87
87
  name: "email";
88
88
  endpoint: string;
89
- }>]>, "many">;
89
+ }>, z.ZodObject<{
90
+ name: z.ZodLiteral<"ENS">;
91
+ endpoint: z.ZodString;
92
+ version: z.ZodOptional<z.ZodString>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ name: "ENS";
95
+ endpoint: string;
96
+ version?: string | undefined;
97
+ }, {
98
+ name: "ENS";
99
+ endpoint: string;
100
+ version?: string | undefined;
101
+ }>, z.ZodObject<{
102
+ name: z.ZodLiteral<"DID">;
103
+ endpoint: z.ZodString;
104
+ version: z.ZodOptional<z.ZodString>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ name: "DID";
107
+ endpoint: string;
108
+ version?: string | undefined;
109
+ }, {
110
+ name: "DID";
111
+ endpoint: string;
112
+ version?: string | undefined;
113
+ }>]>, z.ZodObject<{
114
+ name: z.ZodEffects<z.ZodString, string, string>;
115
+ endpoint: z.ZodString;
116
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
117
+ name: z.ZodEffects<z.ZodString, string, string>;
118
+ endpoint: z.ZodString;
119
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
120
+ name: z.ZodEffects<z.ZodString, string, string>;
121
+ endpoint: z.ZodString;
122
+ }, z.ZodTypeAny, "passthrough">>]>, "many">;
90
123
  registrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
91
124
  agentId: z.ZodUnion<[z.ZodNumber, z.ZodString]>;
92
125
  agentRegistry: z.ZodString;
@@ -130,7 +163,18 @@ declare const SCHEMA_8004_V2: z.ZodObject<{
130
163
  } | {
131
164
  name: "email";
132
165
  endpoint: string;
133
- })[];
166
+ } | {
167
+ name: "ENS";
168
+ endpoint: string;
169
+ version?: string | undefined;
170
+ } | {
171
+ name: "DID";
172
+ endpoint: string;
173
+ version?: string | undefined;
174
+ } | z.objectOutputType<{
175
+ name: z.ZodEffects<z.ZodString, string, string>;
176
+ endpoint: z.ZodString;
177
+ }, z.ZodTypeAny, "passthrough">)[];
134
178
  active: boolean;
135
179
  x402Support: boolean;
136
180
  image?: string | undefined;
@@ -169,7 +213,18 @@ declare const SCHEMA_8004_V2: z.ZodObject<{
169
213
  } | {
170
214
  name: "email";
171
215
  endpoint: string;
172
- })[];
216
+ } | {
217
+ name: "ENS";
218
+ endpoint: string;
219
+ version?: string | undefined;
220
+ } | {
221
+ name: "DID";
222
+ endpoint: string;
223
+ version?: string | undefined;
224
+ } | z.objectInputType<{
225
+ name: z.ZodEffects<z.ZodString, string, string>;
226
+ endpoint: z.ZodString;
227
+ }, z.ZodTypeAny, "passthrough">)[];
173
228
  image?: string | undefined;
174
229
  registrations?: {
175
230
  agentId: string | number;
@@ -211,7 +266,18 @@ declare function validateRegistrationFile(file: unknown): zod.SafeParseReturnTyp
211
266
  } | {
212
267
  name: "email";
213
268
  endpoint: string;
214
- })[];
269
+ } | {
270
+ name: "ENS";
271
+ endpoint: string;
272
+ version?: string | undefined;
273
+ } | {
274
+ name: "DID";
275
+ endpoint: string;
276
+ version?: string | undefined;
277
+ } | zod.objectInputType<{
278
+ name: zod.ZodEffects<zod.ZodString, string, string>;
279
+ endpoint: zod.ZodString;
280
+ }, zod.ZodTypeAny, "passthrough">)[];
215
281
  image?: string | undefined;
216
282
  registrations?: {
217
283
  agentId: string | number;
@@ -250,7 +316,18 @@ declare function validateRegistrationFile(file: unknown): zod.SafeParseReturnTyp
250
316
  } | {
251
317
  name: "email";
252
318
  endpoint: string;
253
- })[];
319
+ } | {
320
+ name: "ENS";
321
+ endpoint: string;
322
+ version?: string | undefined;
323
+ } | {
324
+ name: "DID";
325
+ endpoint: string;
326
+ version?: string | undefined;
327
+ } | zod.objectOutputType<{
328
+ name: zod.ZodEffects<zod.ZodString, string, string>;
329
+ endpoint: zod.ZodString;
330
+ }, zod.ZodTypeAny, "passthrough">)[];
254
331
  active: boolean;
255
332
  x402Support: boolean;
256
333
  image?: string | undefined;
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  SCHEMA_8004_V2,
3
3
  validateRegistrationFile
4
- } from "./chunk-UDZL55XF.js";
4
+ } from "./chunk-BPAT5BZR.js";
5
5
  import "./chunk-YZFATT7X.js";
6
6
  export {
7
7
  SCHEMA_8004_V2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ens-node-metadata/agent",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "CLI for registering AI agents on ENS using ERC-8004",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,8 +34,8 @@
34
34
  "@types/react": "^19.2.14",
35
35
  "tsup": "^8.5.1",
36
36
  "typescript": "^5",
37
- "@ens-node-metadata/shared": "0.1.0",
38
37
  "@ens-node-metadata/schemas": "0.1.0",
38
+ "@ens-node-metadata/shared": "0.1.0",
39
39
  "tsconfig": "0.0.0"
40
40
  },
41
41
  "scripts": {
@@ -43,6 +43,7 @@
43
43
  "version:minor": "pnpm version minor --no-git-tag-version",
44
44
  "agent": "bun src/cli.ts",
45
45
  "build": "tsup",
46
- "lint": "biome check ."
46
+ "lint": "biome check .",
47
+ "test": "vitest run"
47
48
  }
48
49
  }