-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathllms.txt
More file actions
101 lines (78 loc) · 2.78 KB
/
llms.txt
File metadata and controls
101 lines (78 loc) · 2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# Sherlock Domains TypeScript SDK
A TypeScript SDK for managing domain names and DNS records through the Sherlock API.
## Installation
```bash
npm install sherlock-domains
```
## Core Concepts
- The SDK provides a `Sherlock` class that handles authentication and API interactions
- Supports domain search, purchase, and DNS management
- Handles contact information required by ICANN
- Supports credit card and Lightning Network payments
## Key Methods
### Authentication & Setup
- `new Sherlock(accessToken)` - Initialize client with access token
- `me()` - Get authenticated user information
### Domain Management
- `search(query)` - Search for available domains
- `domains()` - List owned domains
- `purchaseDomain(searchId, domain, paymentMethod='credit_card')` - Purchase a domain
### Contact Information
- `setContactInformation(contact)` - Set ICANN contact info
- `getContactInformation()` - Get current contact information
### DNS Management
- `dnsRecords(domainId)` - Get DNS records for a domain
- `createDns(domainId, {type, name, value, ttl})` - Create DNS record
- `updateDns(domainId, recordId, {type, name, value, ttl})` - Update DNS record
- `deleteDns(domainId, recordId)` - Delete DNS record
## Common Patterns
1. Domain Search & Purchase:
```typescript
const sherlock = new Sherlock('your-token')
const results = await sherlock.search("example.com")
if (results.available) {
const purchase = await sherlock.purchaseDomain(
results.id,
"example.com",
'credit_card'
)
}
```
2. DNS Management:
```typescript
const sherlock = new Sherlock('your-token')
const domains = await sherlock.domains()
const domainId = domains[0].id
// Create DNS record
await sherlock.createDns(domainId, {
type: "A",
name: "www",
value: "1.2.3.4",
ttl: 3600
})
```
## Agent Integration
The SDK is designed to be easily integrated with AI agents through the `asTools()` method, which returns a collection of functions with Zod schemas ready to be used by LLM tools/functions implementations.
### Available Agent Tools
```typescript
const sherlock = new Sherlock()
const tools = sherlock.asTools()
// Returns: me, setContactInformation, getContactInformation, searchDomains,
// purchaseDomain, listDomains, getDnsRecords, createDnsRecord,
// updateDnsRecord, deleteDnsRecord
```
Each tool includes:
- Description
- Zod parameter schema
- Execute function
## Important Notes
1. Contact Information Requirements:
- All fields are required for domain registration
- Must be set before attempting domain purchases
- Validated by ICANN standards
2. Payment Methods:
- credit_card: Returns payment details
- lightning: Returns Lightning Network payment info
3. DNS Record Types:
- Supports standard record types: A, AAAA, CNAME, MX, TXT, etc.
- TTL is specified in seconds (default: 3600)