Resolver SDK

@agt/resolver is a standalone TypeScript library for resolving .agt agent manifests. Zero dependencies. Works in Node.js, Deno, Bun, and browsers.

Package Info

FieldValue
Package@agt/resolver
Version0.1.0
DependenciesNone (zero-dep)
OutputESM — dist/index.js + dist/index.d.ts
RuntimesNode.js, Deno, Bun, browsers

API

resolveAgent

Resolve a single .agt domain to its manifest. Returns AgentManifest | null.

import { resolveAgent } from '@agt/resolver'

const agent = await resolveAgent('exampleagent.agt')

if (agent) {
  agent.domain        // 'exampleagent.agt'
  agent.protocols     // ['mcp', 'http']
  agent.capabilities  // ['research', 'summarization']
  agent.endpoints[0]  // { protocol: 'mcp', url: 'https://...' }
}

resolveAgents

Resolve multiple .agt domains in parallel.

import { resolveAgents } from '@agt/resolver'

const agents = await resolveAgents(['a.agt', 'b.agt', 'c.agt'])
// Returns (AgentManifest | null)[]

isAgent

Check whether a domain has a valid agent configuration.

import { isAgent } from '@agt/resolver'

const hasConfig = await isAgent('exampleagent.agt')
// Returns boolean

TypeScript Types

AgentManifest

interface AgentManifest {
  domain: string;           // "exampleagent.agt"
  version: number;          // 1
  name: string | null;      // "Example Agent"
  description: string | null;
  icon: string | null;      // URL to image
  protocols: string[];      // ["mcp", "a2a"]
  capabilities: string[];   // ["research", "summarization"]
  endpoints: AgentEndpoint[];
  pricing: string | null;   // "free" | "paid" | "freemium" | "contact"
  owner: string | null;     // "0x..."
}

AgentEndpoint

interface AgentEndpoint {
  protocol: string;   // "mcp"
  url: string;        // "https://..."
}

ResolveOptions

interface ResolveOptions {
  resolverUrl?: string;  // Default: the public .agt resolver
  timeout?: number;      // Default: 10000ms
}

Pass options as the second argument to any resolve function:

const agent = await resolveAgent('exampleagent.agt', {
  timeout: 5000,
})

Resolution Mechanism

The SDK queries the public .agt resolver. No authentication is required. The resolver endpoint is configurable via resolverUrl for self-hosted or alternative resolvers.

The resolution process (per the v1 spec):

  1. Fetch TXT records from the public resolver for the given domain.
  2. If agt-manifest=ipfs://{cid} present → fetch JSON from an IPFS gateway, verify the bytes hash to the declared CID, recover the signer from the EIP-191 signature and verify it matches the manifest owner and the on-chain NFT holder.
  3. Else if agt-version=1 present → parse legacy v0 TXT records into a v1-shaped manifest with legacy: true and no signature verification.
  4. Else → return null.

Versions

SDK 0.x reads only legacy v0 (TXT-record) manifests. SDK 1.0 adds full v1 support: IPFS-first resolution, CID hash verification, signature recovery, and on-chain owner check. v1 SDK release is tracked alongside the manifest GA work in #110 and the SDK release-decision issue #119.