@hasna/domains 0.0.24 → 0.0.25

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @hasna/domains
2
2
 
3
- Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP server with SQLite.
3
+ Domain portfolio, registrar, marketplace, and DNS management for AI agents — CLI + MCP server with SQLite. Core registrar/DNS commands load by default; heavier integrations are optional command groups.
4
4
 
5
5
  ## Features
6
6
 
@@ -9,7 +9,8 @@ Domain portfolio, registrar, marketplace, and DNS management for AI agents — C
9
9
  - **Nameserver delegation** — Route 53 and Namecheap adapters can update registrar nameservers when the provider API supports it
10
10
  - **DNS provider management** — create or reuse Cloudflare or Route 53 zones and manage DNS records through the DNS provider layer
11
11
  - **DNS record CRUD** — A, AAAA, CNAME, MX, TXT, NS, SRV records
12
- - **Sedo marketplace tools** — search, portfolio/listing management, blacklist checks, and recorded Sedo purchases
12
+ - **DNS desired state** — plan/diff/apply provider DNS records from JSON with explicit delete opt-in and post-apply verification
13
+ - **Sedo marketplace tools** — optional search, portfolio/listing management, blacklist checks, and recorded Sedo purchases
13
14
  - **AWS diagnostics** — sync Route 53 registered domains and hosted zones without printing secret values
14
15
  - **Credential diagnostics** — redacted checks for Route 53, Cloudflare, Namecheap, GoDaddy, Brandsight, and Sedo
15
16
  - **Expiry alerts** — set alerts for domain expiry and SSL certificate expiry
@@ -20,9 +21,10 @@ Domain portfolio, registrar, marketplace, and DNS management for AI agents — C
20
21
  - **Subdomain discovery** — via crt.sh certificate transparency logs
21
22
  - **DNS validation** — detect CNAME conflicts, missing MX, and more
22
23
  - **Portfolio export** — CSV or JSON with all domain data
23
- - **Brand monitoring** — typosquat/threat detection via Brandsight API
24
+ - **Brand monitoring** — optional typosquat/threat detection via Brandsight API
24
25
  - **MCP server** — Model Context Protocol support for AI agents
25
- - **Interactive TUI** — browse the portfolio in the terminal with `domains interactive`
26
+ - **MCP safe mode** — expose read-only tools only with `DOMAINS_MCP_SAFE_MODE=1`
27
+ - **Interactive TUI** — optional portfolio browser in the terminal with `domains interactive`
26
28
 
27
29
  ## Installation
28
30
 
@@ -32,6 +34,18 @@ npm install -g @hasna/domains
32
34
 
33
35
  Data is stored in the local domains data directory (`$XDG_DATA_HOME/open-domains` or `~/.local/share/open-domains` for new installs; existing legacy installs continue using their current directory). Override with `DOMAINS_DB_PATH`, `DOMAINS_DIR`, or the legacy `HASNA_DOMAINS_DB_PATH` / `HASNA_DOMAINS_DIR` names.
34
36
 
37
+ ## Optional Command Groups
38
+
39
+ The default CLI keeps core portfolio, registrar, DNS, provider, Route 53, doctor, MCP, and server commands loaded. Optional groups are enabled per invocation:
40
+
41
+ ```bash
42
+ domains extras
43
+ DOMAINS_COMMAND_GROUPS=marketplace,storage domains --help
44
+ DOMAINS_ENABLE_EXTRAS=1 domains --help
45
+ ```
46
+
47
+ Available groups: `brandsight`, `events`, `history`, `interactive`, `marketplace`, `outreach`, `owner`, `provision`, `research`, `storage`, `wallet`.
48
+
35
49
  ## Quick Start
36
50
 
37
51
  ```bash
@@ -69,10 +83,6 @@ domains doctor
69
83
  ## CLI Usage
70
84
 
71
85
  ```bash
72
- # Interactive portfolio browser
73
- domains interactive
74
- domains interactive --status active
75
-
76
86
  # Portfolio management
77
87
  domains domain add --name example.com --registrar Namecheap --expires-at 2027-01-01
78
88
  domains domain list
@@ -136,23 +146,49 @@ domains dns validate <domain-id>
136
146
  domains dns pull example.com --provider cloudflare
137
147
  domains dns push <domain-id> --provider cloudflare
138
148
 
139
- # Sedo marketplace
140
- domains sedo search example
141
- domains sedo status example.com
142
- domains sedo portfolio --limit 25
143
- domains sedo add example.com --price 2500
144
- domains sedo edit example.com --price 3000
145
- domains sedo remove example.com
146
- domains sedo buy example.com --price 2500 --order-id SEDO-ORDER-ID
147
-
148
- # Brand monitoring
149
- domains monitor mybrand
150
- domains similar example.com
151
- domains threats example.com
149
+ # Desired DNS state against a provider zone
150
+ domains dns plan example.com --provider cloudflare --file dns.example.json
151
+ domains dns diff example.com --provider cloudflare --file dns.example.json
152
+ domains dns apply example.com --provider cloudflare --file dns.example.json --yes
153
+ # Delete plans require --allow-delete and may still be refused before writes
154
+ # when the provider path cannot guarantee safe convergence.
155
+
156
+ # Optional Sedo marketplace
157
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo search example
158
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo status example.com
159
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo portfolio --limit 25
160
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo add example.com --price 2500
161
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo edit example.com --price 3000
162
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo remove example.com
163
+ DOMAINS_COMMAND_GROUPS=marketplace domains sedo buy example.com --price 2500 --order-id SEDO-ORDER-ID
164
+
165
+ # Optional brand monitoring
166
+ DOMAINS_COMMAND_GROUPS=brandsight domains monitor watch mybrand
167
+ DOMAINS_COMMAND_GROUPS=brandsight domains monitor similar example.com
168
+ DOMAINS_COMMAND_GROUPS=brandsight domains monitor threats example.com
169
+
170
+ # Optional interactive portfolio browser
171
+ DOMAINS_COMMAND_GROUPS=interactive domains interactive
172
+ DOMAINS_COMMAND_GROUPS=interactive domains interactive --status active
152
173
  ```
153
174
 
154
175
  Prefer the `domains` CLI over raw registrar CLIs for Route 53 availability, registration status, local portfolio updates, and DNS delegation. The CLI applies configured defaults, records outcomes in the local portfolio DB, and keeps behavior consistent across providers.
155
176
 
177
+ Desired DNS state files are JSON:
178
+
179
+ ```json
180
+ {
181
+ "domain": "example.com",
182
+ "records": [
183
+ { "type": "A", "name": "@", "value": "192.0.2.10", "ttl": 300 },
184
+ { "type": "MX", "name": "@", "value": "mail.example.com", "ttl": 300, "priority": 10 },
185
+ { "type": "TXT", "name": "@", "value": "v=spf1 -all", "ttl": 300 }
186
+ ]
187
+ }
188
+ ```
189
+
190
+ `dns apply` refuses to run without `--yes`. If the plan includes deletes, it also requires `--allow-delete`, then refuses before writing unless the provider path can guarantee delete convergence without partial mutation. Non-delete applies re-read provider records after writing and fail if the live zone still differs from the desired file.
191
+
156
192
  ## AWS Domain Discovery
157
193
 
158
194
  ```bash
@@ -174,9 +210,9 @@ Set one of these environment variables to sync with a remote PostgreSQL storage
174
210
  ```bash
175
211
  export DOMAINS_DATABASE_URL="postgres://..."
176
212
 
177
- domains storage status
178
- domains storage push
179
- domains storage pull
213
+ DOMAINS_COMMAND_GROUPS=storage domains storage status
214
+ DOMAINS_COMMAND_GROUPS=storage domains storage push
215
+ DOMAINS_COMMAND_GROUPS=storage domains storage pull
180
216
  ```
181
217
 
182
218
  ## MCP Server
@@ -212,6 +248,15 @@ MCP_HTTP=1 MCP_HTTP_PORT=8814 domains-mcp
212
248
 
213
249
  Stdio remains the default transport for gradual rollout.
214
250
 
251
+ For read-only agent sessions:
252
+
253
+ ```bash
254
+ DOMAINS_MCP_SAFE_MODE=1 domains-mcp
255
+ DOMAINS_MCP_SAFE_MODE=1 domains-mcp --http
256
+ ```
257
+
258
+ Safe mode registers only read-only/list/check/export tools. Mutating tools such as domain creation, DNS writes, provider sync, Route 53 registration, and storage push/pull are withheld.
259
+
215
260
  ## Environment Variables
216
261
 
217
262
  | Variable | Description |
@@ -222,6 +267,9 @@ Stdio remains the default transport for gradual rollout.
222
267
  | `DOMAINS_CONFIG_DIR` | Override config directory |
223
268
  | `HASNA_DOMAINS_DIR` | Override database directory |
224
269
  | `DOMAINS_DIR` | Override database directory fallback |
270
+ | `DOMAINS_COMMAND_GROUPS` | Comma-separated optional command groups to load, or `all` |
271
+ | `DOMAINS_ENABLE_EXTRAS` | Set to `1` to load all optional command groups |
272
+ | `DOMAINS_MCP_SAFE_MODE` | Set to `1` to expose only read-only MCP tools |
225
273
  | `DOMAINS_DATABASE_URL` | Remote storage PostgreSQL database URL |
226
274
  | `HASNA_DOMAINS_DATABASE_URL` | Legacy remote storage PostgreSQL database URL fallback |
227
275
  | `DOMAINS_STORAGE_MODE` | Storage mode: `local`, `remote`, or `hybrid` |
@@ -238,6 +286,7 @@ Stdio remains the default transport for gradual rollout.
238
286
  | `NAMECHEAP_SANDBOX` | Use Namecheap sandbox API |
239
287
  | `GODADDY_API_KEY`, `GODADDY_API_SECRET` | GoDaddy API credentials |
240
288
  | `BRANDSIGHT_API_KEY`, `BRANDSIGHT_API_SECRET`, `BRANDSIGHT_CUSTOMER_ID` | Brandsight / GoDaddy Corporate Domains credentials |
289
+ | `BRANDSIGHT_DEMO_STUBS`, `BRANDSIGHT_ALLOW_STUBS` | Set either to `1` to allow demo stub responses when the Brandsight API is unreachable |
241
290
  | `SEDO_PARTNER_ID`, `SEDO_API_KEY`, `SEDO_USERNAME`, `SEDO_PASSWORD` | Sedo marketplace API credentials |
242
291
 
243
292
  ## License
@@ -1 +1 @@
1
- {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAsR1D"}
1
+ {"version":3,"file":"dns.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dns.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuCzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgX1D"}
@@ -1 +1 @@
1
- {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA8DzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA00B5D"}
1
+ {"version":3,"file":"domain.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/domain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA+DzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAq1B5D"}