@ens-node-metadata/agent 0.2.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.
Files changed (50) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +126 -0
  3. package/SKILL.md +104 -0
  4. package/dist/cli.d.ts +3 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +29 -0
  7. package/dist/commands/metadata/set.d.ts +21 -0
  8. package/dist/commands/metadata/set.d.ts.map +1 -0
  9. package/dist/commands/metadata/set.js +75 -0
  10. package/dist/commands/metadata/template.d.ts +4 -0
  11. package/dist/commands/metadata/template.d.ts.map +1 -0
  12. package/dist/commands/metadata/template.js +7 -0
  13. package/dist/commands/metadata/validate.d.ts +10 -0
  14. package/dist/commands/metadata/validate.d.ts.map +1 -0
  15. package/dist/commands/metadata/validate.js +44 -0
  16. package/dist/commands/register.d.ts +21 -0
  17. package/dist/commands/register.d.ts.map +1 -0
  18. package/dist/commands/register.js +76 -0
  19. package/dist/commands/registration-file/publish.d.ts +10 -0
  20. package/dist/commands/registration-file/publish.d.ts.map +1 -0
  21. package/dist/commands/registration-file/publish.js +79 -0
  22. package/dist/commands/registration-file/template.d.ts +3 -0
  23. package/dist/commands/registration-file/template.d.ts.map +1 -0
  24. package/dist/commands/registration-file/template.js +48 -0
  25. package/dist/commands/registration-file/validate.d.ts +10 -0
  26. package/dist/commands/registration-file/validate.d.ts.map +1 -0
  27. package/dist/commands/registration-file/validate.js +35 -0
  28. package/dist/commands/registry/identity.d.ts +18 -0
  29. package/dist/commands/registry/identity.d.ts.map +1 -0
  30. package/dist/commands/registry/identity.js +115 -0
  31. package/dist/commands/skill.d.ts +16 -0
  32. package/dist/commands/skill.d.ts.map +1 -0
  33. package/dist/commands/skill.js +53 -0
  34. package/dist/commands/update.d.ts +21 -0
  35. package/dist/commands/update.d.ts.map +1 -0
  36. package/dist/commands/update.js +76 -0
  37. package/dist/index.d.ts +82 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +5 -0
  40. package/dist/lib/ens-write.d.ts +6 -0
  41. package/dist/lib/ens-write.d.ts.map +1 -0
  42. package/dist/lib/ens-write.js +23 -0
  43. package/dist/lib/ui.d.ts +6 -0
  44. package/dist/lib/ui.d.ts.map +1 -0
  45. package/dist/lib/ui.js +14 -0
  46. package/dist/types.d.ts +181 -0
  47. package/dist/types.d.ts.map +1 -0
  48. package/dist/types.js +84 -0
  49. package/package.json +44 -0
  50. package/src/index.ts +8 -0
@@ -0,0 +1,48 @@
1
+ import { useApp } from 'ink';
2
+ import React from 'react';
3
+ export const description = 'Generate empty ERC-8004 v2.0 registration file template';
4
+ /**
5
+ * Derived from <https://best-practices.8004scan.io/docs/01-agent-metadata-standard.html>
6
+ */
7
+ const TEMPLATE = {
8
+ type: 'https://eips.ethereum.org/EIPS/eip-8004#registration-v1',
9
+ name: 'My Agent',
10
+ description: 'A short description of what this agent does and its capabilities.',
11
+ image: 'https://example.com/agent-avatar.png',
12
+ services: [
13
+ {
14
+ name: 'MCP',
15
+ endpoint: 'https://api.example.com/mcp',
16
+ version: '2025-11-25',
17
+ mcpTools: [],
18
+ capabilities: [],
19
+ },
20
+ {
21
+ name: 'A2A',
22
+ endpoint: 'https://example.com/.well-known/agent-card.json',
23
+ version: '0.3.0',
24
+ },
25
+ {
26
+ name: 'agentWallet',
27
+ endpoint: 'eip155:1:0x0000000000000000000000000000000000000000',
28
+ },
29
+ ],
30
+ registrations: [
31
+ {
32
+ agentId: 0,
33
+ agentRegistry: 'eip155:1:0x8004a6090Cd10A7288092483047B097295Fb8847',
34
+ },
35
+ ],
36
+ supportedTrust: ['reputation'],
37
+ active: false,
38
+ x402Support: false,
39
+ updatedAt: Math.floor(Date.now() / 1000),
40
+ };
41
+ export default function RegistrationFileTemplate() {
42
+ const { exit } = useApp();
43
+ React.useEffect(() => {
44
+ process.stdout.write(`${JSON.stringify(TEMPLATE, null, 2)}\n`);
45
+ exit();
46
+ }, [exit]);
47
+ return null;
48
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { z } from 'zod';
3
+ export declare const description = "Validate registration file against ERC-8004 v2.0 schema";
4
+ export declare const args: z.ZodTuple<[z.ZodString], null>;
5
+ type Props = {
6
+ args: z.infer<typeof args>;
7
+ };
8
+ export default function RegistrationFileValidate({ args: [file] }: Props): React.JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=validate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/commands/registration-file/validate.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW,4DAA4D,CAAA;AAEpF,eAAO,MAAM,IAAI,iCAA2D,CAAA;AAE5E,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;CAC3B,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,qBAkCvE"}
@@ -0,0 +1,35 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { Box, Text, useApp } from 'ink';
3
+ import React from 'react';
4
+ import { z } from 'zod';
5
+ import { validateRegistrationFile } from '../../index.js';
6
+ import { ZodIssueList } from '../../lib/ui.js';
7
+ export const description = 'Validate registration file against ERC-8004 v2.0 schema';
8
+ export const args = z.tuple([z.string().describe('registration-file.json')]);
9
+ export default function RegistrationFileValidate({ args: [file] }) {
10
+ const { exit } = useApp();
11
+ let fileError = null;
12
+ let result = null;
13
+ try {
14
+ const raw = JSON.parse(readFileSync(file, 'utf8'));
15
+ result = validateRegistrationFile(raw);
16
+ }
17
+ catch (err) {
18
+ fileError = err.message;
19
+ }
20
+ React.useEffect(() => {
21
+ exit(fileError || (result && !result.success) ? new Error('validation failed') : undefined);
22
+ }, [exit, fileError, result]);
23
+ if (fileError) {
24
+ return React.createElement(Text, { color: "red" },
25
+ "\u274C Error reading file: ",
26
+ fileError);
27
+ }
28
+ if (result.success) {
29
+ return (React.createElement(Box, { flexDirection: "column" },
30
+ React.createElement(Text, { color: "green" }, "\u2705 Valid ERC-8004 v2.0 AgentRegistrationFile")));
31
+ }
32
+ return (React.createElement(Box, { flexDirection: "column" },
33
+ React.createElement(Text, { color: "red" }, "\u274C Invalid AgentRegistrationFile"),
34
+ React.createElement(ZodIssueList, { issues: result.error.issues })));
35
+ }
@@ -0,0 +1,18 @@
1
+ import React from 'react';
2
+ import { z } from 'zod';
3
+ export declare const description = "Query ERC-8004 registry for agent identity";
4
+ export declare const options: z.ZodObject<{
5
+ chainName: z.ZodDefault<z.ZodEnum<["base", "mainnet"]>>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ chainName: "base" | "mainnet";
8
+ }, {
9
+ chainName?: "base" | "mainnet" | undefined;
10
+ }>;
11
+ export declare const args: z.ZodTuple<[z.ZodString], null>;
12
+ type Props = {
13
+ options: z.infer<typeof options>;
14
+ args: z.infer<typeof args>;
15
+ };
16
+ export default function RegistryIdentity({ options: { chainName }, args: [agentUri] }: Props): React.JSX.Element;
17
+ export {};
18
+ //# sourceMappingURL=identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/commands/registry/identity.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,WAAW,+CAA+C,CAAA;AAEvE,eAAO,MAAM,OAAO;;;;;;EAKlB,CAAA;AAEF,eAAO,MAAM,IAAI,iCAA8C,CAAA;AAE/D,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;CAC3B,CAAA;AA+CD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE,KAAK,qBAuE3F"}
@@ -0,0 +1,115 @@
1
+ import { Box, Text, useApp } from 'ink';
2
+ import React from 'react';
3
+ import { http, createPublicClient } from 'viem';
4
+ import { base, mainnet } from 'viem/chains';
5
+ import { z } from 'zod';
6
+ export const description = 'Query ERC-8004 registry for agent identity';
7
+ export const options = z.object({
8
+ chainName: z
9
+ .enum(['base', 'mainnet'])
10
+ .default('mainnet')
11
+ .describe('Chain to query (base | mainnet)'),
12
+ });
13
+ export const args = z.tuple([z.string().describe('agent-uri')]);
14
+ /**
15
+ * Known ERC-8004 Identity Registry contract addresses.
16
+ * Override via ERC8004_REGISTRY_BASE / ERC8004_REGISTRY_MAINNET env vars.
17
+ */
18
+ const REGISTRY_ADDRESSES = {
19
+ mainnet: (process.env.ERC8004_REGISTRY_MAINNET ??
20
+ '0x0000000000000000000000000000000000000000'),
21
+ base: (process.env.ERC8004_REGISTRY_BASE ??
22
+ '0x0000000000000000000000000000000000000000'),
23
+ };
24
+ const ERC8004_REGISTRY_ABI = [
25
+ {
26
+ name: 'agentOf',
27
+ type: 'function',
28
+ stateMutability: 'view',
29
+ inputs: [{ name: 'agentUri', type: 'string' }],
30
+ outputs: [
31
+ { name: 'owner', type: 'address' },
32
+ { name: 'tokenId', type: 'uint256' },
33
+ { name: 'agentUri', type: 'string' },
34
+ ],
35
+ },
36
+ {
37
+ name: 'balanceOf',
38
+ type: 'function',
39
+ stateMutability: 'view',
40
+ inputs: [{ name: 'owner', type: 'address' }],
41
+ outputs: [{ name: '', type: 'uint256' }],
42
+ },
43
+ ];
44
+ export default function RegistryIdentity({ options: { chainName }, args: [agentUri] }) {
45
+ const { exit } = useApp();
46
+ const [state, setState] = React.useState({ status: 'loading' });
47
+ React.useEffect(() => {
48
+ async function run() {
49
+ const chain = chainName === 'base' ? base : mainnet;
50
+ const registryAddress = REGISTRY_ADDRESSES[chainName];
51
+ if (registryAddress === '0x0000000000000000000000000000000000000000') {
52
+ setState({
53
+ status: 'error',
54
+ message: `No registry address configured for ${chainName}.\n` +
55
+ `Set ERC8004_REGISTRY_${chainName.toUpperCase()} env var to the contract address.`,
56
+ });
57
+ exit(new Error('no registry address'));
58
+ return;
59
+ }
60
+ try {
61
+ const client = createPublicClient({
62
+ chain,
63
+ transport: http(),
64
+ });
65
+ const result = await client.readContract({
66
+ address: registryAddress,
67
+ abi: ERC8004_REGISTRY_ABI,
68
+ functionName: 'agentOf',
69
+ args: [agentUri],
70
+ });
71
+ setState({
72
+ status: 'done',
73
+ identity: {
74
+ owner: result[0],
75
+ tokenId: result[1],
76
+ agentUri: result[2],
77
+ chain: chainName,
78
+ registryAddress,
79
+ },
80
+ });
81
+ exit();
82
+ }
83
+ catch (err) {
84
+ setState({
85
+ status: 'error',
86
+ message: `Registry read failed: ${err.message}`,
87
+ });
88
+ exit(new Error('registry read failed'));
89
+ }
90
+ }
91
+ run();
92
+ }, [exit, chainName, agentUri]);
93
+ return (React.createElement(Box, { flexDirection: "column" },
94
+ state.status === 'loading' && React.createElement(Text, { color: "cyan" }, "Querying ERC-8004 registry\u2026"),
95
+ state.status === 'done' && (React.createElement(Box, { flexDirection: "column" },
96
+ React.createElement(Text, { color: "green" },
97
+ "\u2705 Agent Identity (",
98
+ state.identity.chain,
99
+ ")"),
100
+ React.createElement(Text, null,
101
+ " Agent URI: ",
102
+ state.identity.agentUri),
103
+ React.createElement(Text, null,
104
+ " Owner: ",
105
+ state.identity.owner),
106
+ React.createElement(Text, null,
107
+ " Token ID: ",
108
+ state.identity.tokenId.toString()),
109
+ React.createElement(Text, null,
110
+ " Registry: ",
111
+ state.identity.registryAddress))),
112
+ state.status === 'error' && React.createElement(Text, { color: "red" },
113
+ "\u274C ",
114
+ state.message)));
115
+ }
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { z } from 'zod';
3
+ export declare const description = "Print or install SKILL.md guide";
4
+ export declare const options: z.ZodObject<{
5
+ install: z.ZodDefault<z.ZodBoolean>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ install: boolean;
8
+ }, {
9
+ install?: boolean | undefined;
10
+ }>;
11
+ type Props = {
12
+ options: z.infer<typeof options>;
13
+ };
14
+ export default function Skill({ options: { install } }: Props): React.JSX.Element;
15
+ export {};
16
+ //# sourceMappingURL=skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../src/commands/skill.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,WAAW,oCAAoC,CAAA;AAE5D,eAAO,MAAM,OAAO;;;;;;EAElB,CAAA;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;CACjC,CAAA;AAiBD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,qBA2B5D"}
@@ -0,0 +1,53 @@
1
+ import { copyFileSync, existsSync, readFileSync } from 'node:fs';
2
+ import { dirname, join, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { Text, useApp } from 'ink';
5
+ import React from 'react';
6
+ import { z } from 'zod';
7
+ export const description = 'Print or install SKILL.md guide';
8
+ export const options = z.object({
9
+ install: z.boolean().default(false).describe('Copy SKILL.md to the current working directory'),
10
+ });
11
+ const __dirname = dirname(fileURLToPath(import.meta.url));
12
+ function getSkillMdPath() {
13
+ // When built: dist/commands/skill.js → root is ../../
14
+ const candidates = [
15
+ join(__dirname, '../../SKILL.md'),
16
+ join(__dirname, '../SKILL.md'),
17
+ join(__dirname, 'SKILL.md'),
18
+ ];
19
+ for (const p of candidates) {
20
+ if (existsSync(p))
21
+ return p;
22
+ }
23
+ throw new Error('SKILL.md not found in package');
24
+ }
25
+ export default function Skill({ options: { install } }) {
26
+ const { exit } = useApp();
27
+ const [output, setOutput] = React.useState('');
28
+ const [error, setError] = React.useState(null);
29
+ React.useEffect(() => {
30
+ try {
31
+ const skillPath = getSkillMdPath();
32
+ const content = readFileSync(skillPath, 'utf8');
33
+ if (install) {
34
+ const dest = resolve(process.cwd(), 'SKILL.md');
35
+ copyFileSync(skillPath, dest);
36
+ setOutput(`✅ SKILL.md copied to ${dest}`);
37
+ }
38
+ else {
39
+ setOutput(content);
40
+ }
41
+ }
42
+ catch (err) {
43
+ setError(err.message);
44
+ }
45
+ exit();
46
+ }, [exit, install]);
47
+ if (error) {
48
+ return React.createElement(Text, { color: "red" },
49
+ "\u274C ",
50
+ error);
51
+ }
52
+ return React.createElement(Text, null, output);
53
+ }
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { z } from 'zod';
3
+ export declare const description = "Update existing agent's ENS metadata records";
4
+ export declare const args: z.ZodTuple<[z.ZodString, z.ZodString], null>;
5
+ export declare const options: z.ZodObject<{
6
+ privateKey: z.ZodString;
7
+ broadcast: z.ZodDefault<z.ZodBoolean>;
8
+ }, "strip", z.ZodTypeAny, {
9
+ privateKey: string;
10
+ broadcast: boolean;
11
+ }, {
12
+ privateKey: string;
13
+ broadcast?: boolean | undefined;
14
+ }>;
15
+ type Props = {
16
+ args: z.infer<typeof args>;
17
+ options: z.infer<typeof options>;
18
+ };
19
+ export default function Update({ args: [ensName, payloadFile], options }: Props): React.JSX.Element;
20
+ export {};
21
+ //# sourceMappingURL=update.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../src/commands/update.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAIvB,eAAO,MAAM,WAAW,iDAAiD,CAAA;AAEzE,eAAO,MAAM,IAAI,8CAGf,CAAA;AAEF,eAAO,MAAM,OAAO;;;;;;;;;EAMlB,CAAA;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,IAAI,CAAC,CAAA;IAC1B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,OAAO,CAAC,CAAA;CACjC,CAAA;AAQD,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,KAAK,qBA8D9E"}
@@ -0,0 +1,76 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { Box, Text, useApp } from 'ink';
3
+ import React from 'react';
4
+ import { z } from 'zod';
5
+ import { AgentMetadataPayloadSchema } from '../index.js';
6
+ import { setEnsTextRecords } from '../lib/ens-write.js';
7
+ export const description = "Update existing agent's ENS metadata records";
8
+ export const args = z.tuple([
9
+ z.string().describe('ENS name (e.g. myagent.eth)'),
10
+ z.string().describe('payload.json — flat ENS text-record object'),
11
+ ]);
12
+ export const options = z.object({
13
+ privateKey: z.string().describe('Private key for signing (hex, prefixed with 0x)'),
14
+ broadcast: z
15
+ .boolean()
16
+ .default(false)
17
+ .describe('Broadcast the transaction on-chain (default: dry run)'),
18
+ });
19
+ export default function Update({ args: [ensName, payloadFile], options }) {
20
+ const { exit } = useApp();
21
+ const [state, setState] = React.useState({ status: 'idle' });
22
+ React.useEffect(() => {
23
+ async function run() {
24
+ let payload;
25
+ try {
26
+ const raw = JSON.parse(readFileSync(payloadFile, 'utf8'));
27
+ const result = AgentMetadataPayloadSchema.safeParse(raw);
28
+ if (!result.success) {
29
+ const issues = result.error.issues
30
+ .map((i) => `[${i.path.join('.') || 'root'}] ${i.message}`)
31
+ .join('\n');
32
+ setState({ status: 'error', message: `Invalid payload:\n${issues}` });
33
+ exit(new Error('validation failed'));
34
+ return;
35
+ }
36
+ payload = result.data;
37
+ }
38
+ catch (err) {
39
+ setState({ status: 'error', message: `Error reading payload: ${err.message}` });
40
+ exit(new Error('read error'));
41
+ return;
42
+ }
43
+ const texts = Object.entries(payload).map(([key, value]) => ({ key, value }));
44
+ if (!options.broadcast) {
45
+ const lines = [
46
+ `Dry run — would update ${texts.length} text records on ${ensName}:`,
47
+ '',
48
+ ...texts.map((t) => ` setText("${t.key}", "${t.value}")`),
49
+ '',
50
+ 'Run with --broadcast to submit on-chain.',
51
+ ];
52
+ setState({ status: 'done', message: lines.join('\n') });
53
+ exit();
54
+ return;
55
+ }
56
+ setState({ status: 'working', message: `Updating ${texts.length} text records on ${ensName}…` });
57
+ try {
58
+ const hash = await setEnsTextRecords(ensName, texts, options.privateKey);
59
+ setState({ status: 'done', message: `✅ Transaction submitted: ${hash}` });
60
+ exit();
61
+ }
62
+ catch (err) {
63
+ setState({ status: 'error', message: `Transaction failed: ${err.message}` });
64
+ exit(new Error('tx failed'));
65
+ }
66
+ }
67
+ run();
68
+ }, [exit, ensName, payloadFile, options]);
69
+ return (React.createElement(Box, { flexDirection: "column" },
70
+ state.status === 'idle' && React.createElement(Text, { color: "gray" }, "Preparing\u2026"),
71
+ state.status === 'working' && React.createElement(Text, { color: "cyan" }, state.message),
72
+ state.status === 'done' && React.createElement(Text, { color: "green" }, state.message),
73
+ state.status === 'error' && React.createElement(Text, { color: "red" },
74
+ "\u274C ",
75
+ state.message)));
76
+ }
@@ -0,0 +1,82 @@
1
+ export type { AgentRegistrationFile } from './types.js';
2
+ export { SCHEMA_8004_V2 } from './types.js';
3
+ export declare function validateRegistrationFile(file: unknown): import("zod").SafeParseReturnType<{
4
+ name: string;
5
+ type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
6
+ description: string;
7
+ services: ({
8
+ name: "MCP";
9
+ endpoint: string;
10
+ version: string;
11
+ mcpTools?: string[] | undefined;
12
+ capabilities?: string[] | undefined;
13
+ } | {
14
+ name: "A2A";
15
+ endpoint: string;
16
+ version: string;
17
+ } | {
18
+ name: "OASF";
19
+ endpoint: string;
20
+ version: string;
21
+ skills?: string[] | undefined;
22
+ domains?: string[] | undefined;
23
+ } | {
24
+ name: "agentWallet";
25
+ endpoint: string;
26
+ } | {
27
+ name: "web";
28
+ endpoint: string;
29
+ } | {
30
+ name: "email";
31
+ endpoint: string;
32
+ })[];
33
+ image?: string | undefined;
34
+ registrations?: {
35
+ agentId: string | number;
36
+ agentRegistry: string;
37
+ }[] | undefined;
38
+ supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
39
+ active?: boolean | undefined;
40
+ x402Support?: boolean | undefined;
41
+ updatedAt?: number | undefined;
42
+ }, {
43
+ name: string;
44
+ type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
45
+ description: string;
46
+ services: ({
47
+ name: "MCP";
48
+ endpoint: string;
49
+ version: string;
50
+ mcpTools?: string[] | undefined;
51
+ capabilities?: string[] | undefined;
52
+ } | {
53
+ name: "A2A";
54
+ endpoint: string;
55
+ version: string;
56
+ } | {
57
+ name: "OASF";
58
+ endpoint: string;
59
+ version: string;
60
+ skills?: string[] | undefined;
61
+ domains?: string[] | undefined;
62
+ } | {
63
+ name: "agentWallet";
64
+ endpoint: string;
65
+ } | {
66
+ name: "web";
67
+ endpoint: string;
68
+ } | {
69
+ name: "email";
70
+ endpoint: string;
71
+ })[];
72
+ active: boolean;
73
+ x402Support: boolean;
74
+ image?: string | undefined;
75
+ registrations?: {
76
+ agentId: string | number;
77
+ agentRegistry: string;
78
+ }[] | undefined;
79
+ supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
80
+ updatedAt?: number | undefined;
81
+ }>;
82
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,YAAY,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAE3C,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAErD"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import { SCHEMA_8004_V2 } from './types.js';
2
+ export { SCHEMA_8004_V2 } from './types.js';
3
+ export function validateRegistrationFile(file) {
4
+ return SCHEMA_8004_V2.safeParse(file);
5
+ }
@@ -0,0 +1,6 @@
1
+ export type TextRecord = {
2
+ key: string;
3
+ value: string;
4
+ };
5
+ export declare function setEnsTextRecords(ensName: string, texts: TextRecord[], privateKey: string): Promise<string>;
6
+ //# sourceMappingURL=ens-write.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ens-write.d.ts","sourceRoot":"","sources":["../../src/lib/ens-write.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvD,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,UAAU,EAAE,EACnB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,CAwBjB"}
@@ -0,0 +1,23 @@
1
+ import { http, createPublicClient, createWalletClient } from 'viem';
2
+ import { privateKeyToAccount } from 'viem/accounts';
3
+ import { mainnet } from 'viem/chains';
4
+ export async function setEnsTextRecords(ensName, texts, privateKey) {
5
+ const { addEnsContracts } = await import('@ensdomains/ensjs');
6
+ const { setRecords } = await import('@ensdomains/ensjs/wallet');
7
+ const { getResolver } = await import('@ensdomains/ensjs/public');
8
+ const account = privateKeyToAccount(privateKey);
9
+ const chain = addEnsContracts(mainnet);
10
+ const publicClient = createPublicClient({ chain, transport: http() });
11
+ const walletClient = createWalletClient({ account, chain, transport: http() });
12
+ const resolverAddress = await getResolver(publicClient, { name: ensName });
13
+ if (!resolverAddress) {
14
+ throw new Error(`No resolver found for ${ensName}. Set a resolver first.`);
15
+ }
16
+ const hash = await setRecords(walletClient, {
17
+ name: ensName,
18
+ texts,
19
+ coins: [],
20
+ resolverAddress,
21
+ });
22
+ return hash;
23
+ }
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import type { ZodIssue } from 'zod';
3
+ export declare function ZodIssueList({ issues }: {
4
+ issues: ZodIssue[];
5
+ }): React.JSX.Element;
6
+ //# sourceMappingURL=ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../src/lib/ui.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AAEnC,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;CAAE,qBAe9D"}
package/dist/lib/ui.js ADDED
@@ -0,0 +1,14 @@
1
+ import { Box, Text } from 'ink';
2
+ import React from 'react';
3
+ export function ZodIssueList({ issues }) {
4
+ return (React.createElement(React.Fragment, null, issues.map((issue) => {
5
+ const path = issue.path.length > 0 ? issue.path.join('.') : '(root)';
6
+ return (React.createElement(Box, { key: `${path}.${issue.message}` },
7
+ React.createElement(Text, { color: "red" },
8
+ ' ',
9
+ "[",
10
+ path,
11
+ "] ",
12
+ issue.message)));
13
+ })));
14
+ }