domani 1.0.3 → 1.0.4

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/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@ export interface Error {
18
18
  /** Human-readable error message */
19
19
  error: string;
20
20
  /** Machine-readable error code */
21
- code: "MISSING_API_KEY" | "INVALID_API_KEY" | "EXPIRED_API_KEY" | "MISSING_PARAMETER" | "INVALID_DOMAIN" | "PAYMENT_REQUIRED" | "DOMAIN_UNAVAILABLE" | "RATE_LIMIT_EXCEEDED" | "USER_EXISTS" | "NOT_FOUND" | "UNKNOWN_PROVIDER" | "UNKNOWN_METHOD" | "TARGET_REQUIRED" | "INVALID_PARAMETER" | "CONTACT_REQUIRED" | "INVALID_CONTACT" | "INSUFFICIENT_SCOPE" | "SCOPE_ESCALATION" | "DOMAIN_EXISTS" | "DOMAIN_NOT_ACTIVE" | "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE" | "ALREADY_LISTED" | "LISTING_SOLD" | "SELF_PURCHASE" | "DESCRIPTION_TOO_LONG" | "DEAL_NOT_FOUND" | "INVALID_DEAL_STATE" | "EPP_ATTEMPTS_EXCEEDED" | "ACTIVE_DEAL_EXISTS" | "AGENT_IDENTITY_NOT_FOUND" | "AGENT_IDENTITY_ESCALATION" | "CREDENTIAL_REVOKE_FAILED" | "INVALID_IDEMPOTENCY_KEY" | "IDEMPOTENCY_KEY_MISMATCH" | "IDEMPOTENCY_KEY_REUSED" | "OPERATION_IN_PROGRESS" | "OPERATION_SUPERSEDED" | "INVALID_OPERATION_RECEIPT" | "WORKSPACE_ADMIN_REQUIRED" | "PRINCIPAL_NOT_IN_WORKSPACE" | "MAILBOX_NOT_IN_WORKSPACE" | "GROUP_NOT_IN_WORKSPACE" | "COLLECTION_NOT_IN_WORKSPACE" | "ACCESS_VERSION_CONFLICT" | "ACCESS_OFFER_INVALID" | "ACCESS_OFFER_EMAIL_MISMATCH";
21
+ code: "MISSING_API_KEY" | "INVALID_API_KEY" | "EXPIRED_API_KEY" | "MISSING_PARAMETER" | "INVALID_DOMAIN" | "PAYMENT_REQUIRED" | "DOMAIN_UNAVAILABLE" | "RATE_LIMIT_EXCEEDED" | "USER_EXISTS" | "NOT_FOUND" | "UNKNOWN_PROVIDER" | "UNKNOWN_METHOD" | "TARGET_REQUIRED" | "INVALID_PARAMETER" | "CONTACT_REQUIRED" | "INVALID_CONTACT" | "INSUFFICIENT_SCOPE" | "SCOPE_ESCALATION" | "DOMAIN_EXISTS" | "DOMAIN_NOT_ACTIVE" | "UNSUPPORTED_TLD" | "NOT_AVAILABLE" | "ALREADY_REGISTERED" | "TRANSFER_NOT_ELIGIBLE" | "ALREADY_LISTED" | "LISTING_SOLD" | "SELF_PURCHASE" | "DESCRIPTION_TOO_LONG" | "DEAL_NOT_FOUND" | "INVALID_DEAL_STATE" | "EPP_ATTEMPTS_EXCEEDED" | "ACTIVE_DEAL_EXISTS" | "AGENT_IDENTITY_NOT_FOUND" | "AGENT_IDENTITY_ESCALATION" | "CREDENTIAL_REVOKE_FAILED" | "INVALID_IDEMPOTENCY_KEY" | "IDEMPOTENCY_KEY_MISMATCH" | "IDEMPOTENCY_KEY_REUSED" | "OPERATION_IN_PROGRESS" | "OPERATION_SUPERSEDED" | "INVALID_OPERATION_RECEIPT" | "WORKSPACE_ADMIN_REQUIRED" | "PRINCIPAL_NOT_IN_WORKSPACE" | "MAILBOX_NOT_IN_WORKSPACE" | "GROUP_NOT_IN_WORKSPACE" | "COLLECTION_NOT_IN_WORKSPACE" | "ACCESS_VERSION_CONFLICT" | "ACCESS_OFFER_INVALID" | "ACCESS_OFFER_EMAIL_MISMATCH" | "MAIL_DOMAIN_CAPACITY_EXHAUSTED" | "MAIL_PROVIDER_ERROR";
22
22
  /** Actionable recovery guidance for the caller */
23
23
  hint?: string;
24
24
  /** CLI command to resolve the error (e.g. 'domani login', 'domani billing'). Present in CLI --json output. */
@@ -31,6 +31,8 @@ export interface Error {
31
31
  fix_url?: string;
32
32
  /** Seconds until retry is allowed (present on 429 responses) */
33
33
  retry_after?: number;
34
+ /** Whether retrying after the external condition changes is safe */
35
+ retryable?: boolean;
34
36
  }
35
37
  export interface SearchResult {
36
38
  /** Whether the domain is available for registration */
@@ -121,6 +123,23 @@ export interface DomainRecord {
121
123
  /** Number of mailboxes configured for this domain */
122
124
  mailboxCount: number;
123
125
  }
126
+ export interface ProvisionAgentResult {
127
+ domain: string;
128
+ domain_status: "registered" | "owned";
129
+ mailbox: {
130
+ address: string;
131
+ status: "created" | "existing";
132
+ } | null;
133
+ webhook: {
134
+ id: string;
135
+ url: string;
136
+ secret?: string;
137
+ header_names: string[];
138
+ } | null;
139
+ warnings: string[];
140
+ hint: string;
141
+ next_steps: string[];
142
+ }
124
143
  export interface MailRule {
125
144
  id?: string;
126
145
  /** Lower runs first */
@@ -381,8 +400,67 @@ export interface DomainBrief {
381
400
  depth: "instant" | "deep";
382
401
  status: "ready" | "degraded" | "failed";
383
402
  summary: string;
384
- registration: Record<string, unknown>;
385
- website: Record<string, unknown>;
403
+ registration: {
404
+ state: "available" | "registered" | "reserved" | "unknown";
405
+ registrar: string | null;
406
+ createdAt: string | null;
407
+ expiresAt: string | null;
408
+ daysUntilExpiry: number | null;
409
+ };
410
+ website: {
411
+ state: "active_business" | "active_noncommercial" | "parked_for_sale" | "parked" | "redirected" | "dormant" | "holding_page" | "protected" | "unreachable" | "unknown";
412
+ title: string | null;
413
+ description: string | null;
414
+ finalUrl: string | null;
415
+ favicon: string | null;
416
+ canonicalUrl: string | null;
417
+ };
418
+ /** Public identity inferred from the current site. Associated operators do not imply registration ownership. */
419
+ identity: {
420
+ name: string | null;
421
+ legalName: string | null;
422
+ pitch: string | null;
423
+ category: string | null;
424
+ audience: string | null;
425
+ language: string | null;
426
+ logo: string | null;
427
+ entities: ({
428
+ name: string;
429
+ legalName: string | null;
430
+ type: "company" | "brand" | "organization" | "public_person" | "unknown";
431
+ relationship: "presented_brand" | "current_operator" | "redirect_destination" | "historical_operator" | "registrant";
432
+ confidence: "high" | "medium" | "low";
433
+ website: string | null;
434
+ sameAs: string[];
435
+ evidenceIds: string[];
436
+ })[];
437
+ };
438
+ activity: {
439
+ state: "active" | "operational" | "dormant" | "inactive" | "unknown";
440
+ rationale: string;
441
+ observedAt: string;
442
+ evidenceIds: string[];
443
+ };
444
+ history: {
445
+ registeredAt: string | null;
446
+ registrationUpdatedAt: string | null;
447
+ firstArchiveAt: string | null;
448
+ latestArchiveAt: string | null;
449
+ currentIdentityFirstSeenAt: string | null;
450
+ snapshots: ({
451
+ capturedAt: string;
452
+ url: string;
453
+ title: string | null;
454
+ description: string | null;
455
+ evidenceIds: string[];
456
+ })[];
457
+ changes: ({
458
+ detectedAt: string;
459
+ type: "identity" | "content" | "redirect" | "registration";
460
+ summary: string;
461
+ evidenceIds: string[];
462
+ })[];
463
+ };
386
464
  infrastructure: {
387
465
  nameservers: string[];
388
466
  mailProviders: string[];
@@ -400,7 +478,12 @@ export interface DomainBrief {
400
478
  bimi: boolean | null;
401
479
  };
402
480
  };
403
- market: Record<string, unknown>;
481
+ market: {
482
+ listed: boolean;
483
+ marketplace: string | null;
484
+ listingUrl: string | null;
485
+ askingPriceUsd: number | null;
486
+ };
404
487
  /** Redacted contact-channel metadata. Raw addresses are never returned. */
405
488
  contactability: {
406
489
  state: "direct" | "indirect" | "none_found" | "unknown";
@@ -416,13 +499,28 @@ export interface DomainBrief {
416
499
  action: "register" | "buy_now" | "negotiate_listing" | "private_broker" | "backorder" | "watch" | "choose_alternative";
417
500
  rationale: string;
418
501
  };
502
+ /** Legacy aggregate. Use coverage instead. */
419
503
  completeness: number;
504
+ /** Evidence coverage, separate from confidence and freshness. */
505
+ coverage: {
506
+ score: number;
507
+ sections: {
508
+ registration: "complete" | "partial" | "missing";
509
+ currentUse: "complete" | "partial" | "missing";
510
+ identity: "complete" | "partial" | "missing";
511
+ infrastructure: "complete" | "partial" | "missing";
512
+ history: "complete" | "partial" | "missing";
513
+ market: "complete" | "partial" | "missing";
514
+ };
515
+ missing: string[];
516
+ };
420
517
  analyzedAt: string;
421
518
  staleAt: string;
422
519
  analysisVersion: string;
423
520
  evidence: ({
424
521
  id: string;
425
- kind: string;
522
+ kind: "registry" | "dns" | "website" | "content" | "archive" | "entity" | "market" | "contact";
523
+ claimKey: string;
426
524
  label: string;
427
525
  value: string;
428
526
  source: string;
@@ -435,6 +533,16 @@ export interface DomainBrief {
435
533
  createdAt: string;
436
534
  updatedAt: string;
437
535
  }
536
+ export interface PublicDomainProfile {
537
+ domain: string;
538
+ canonicalPath: string;
539
+ brief: DomainBrief;
540
+ freshness: "fresh" | "stale";
541
+ qualityScore: number;
542
+ /** True only for fresh, deep, substantive profiles with sufficient public evidence. */
543
+ indexable: boolean;
544
+ indexabilityReasons: ("needs_deep_analysis" | "analysis_not_ready" | "stale_analysis" | "insufficient_coverage" | "insufficient_public_evidence" | "thin_domain_identity")[];
545
+ }
438
546
  export interface Backorder {
439
547
  id?: string;
440
548
  domain?: string;
@@ -626,6 +734,10 @@ export interface RegistrantContact {
626
734
  export interface AccountInfo {
627
735
  id: string;
628
736
  email: string;
737
+ /** Active personal Domani plan key */
738
+ plan: string;
739
+ /** Distinct active Mailzero plan keys on workspaces the user can access */
740
+ workspace_plans: string[];
629
741
  /** Whether the user has a card on file (required before buying domains) */
630
742
  has_payment_method: boolean;
631
743
  /** Whether the user has set WHOIS contact info (required before purchasing domains) */
@@ -645,7 +757,7 @@ export interface AccountInfo {
645
757
  created_at: string;
646
758
  }
647
759
  export interface ActivationProjection {
648
- version: 1;
760
+ version: 2;
649
761
  account_created_at: string;
650
762
  entry: {
651
763
  brand: string;
@@ -658,6 +770,7 @@ export interface ActivationProjection {
658
770
  first_message_received_at: string | null;
659
771
  custom_domain_activated_at: string | null;
660
772
  programmatic_action_completed_at: string | null;
773
+ first_webhook_delivery_succeeded_at: string | null;
661
774
  };
662
775
  status: "first_run" | "setup_active" | "mail_active" | "mail_loop_complete" | "domain_active" | "programmatic_active" | "multi_surface_active";
663
776
  recommended_actions: ({
@@ -997,6 +1110,7 @@ export declare class Domani {
997
1110
  collaboration_enabled: boolean;
998
1111
  message_count: number;
999
1112
  webhook_url: string | null;
1113
+ header_names: string[];
1000
1114
  forward_to: string | null;
1001
1115
  signing_secret?: string | null;
1002
1116
  created_at: string;
@@ -1012,19 +1126,36 @@ export declare class Domani {
1012
1126
  }): Promise<{
1013
1127
  id: string;
1014
1128
  address: string;
1015
- name: string | null;
1016
- domain: string;
1017
- slug: string;
1129
+ name?: string | null;
1130
+ domain?: string;
1131
+ slug?: string;
1018
1132
  kind: string;
1019
1133
  workspace_id: string | null;
1020
- access_role: "viewer" | "responder" | "manager";
1021
- effective_capabilities: MailboxEffectiveCapabilities;
1022
- collaboration_enabled: boolean;
1023
- message_count: number;
1024
- webhook_url: string | null;
1025
- forward_to: string | null;
1134
+ access_role?: "viewer" | "responder" | "manager";
1135
+ effective_capabilities?: MailboxEffectiveCapabilities;
1136
+ collaboration_enabled?: boolean;
1137
+ message_count?: number;
1138
+ webhook_url?: string | null;
1139
+ header_names?: string[];
1140
+ forward_to?: string | null;
1026
1141
  signing_secret?: string | null;
1027
- created_at: string;
1142
+ host_id?: string;
1143
+ dns_records?: DnsRecord[];
1144
+ dns_status?: "published" | "manual";
1145
+ receiving_status?: "pending";
1146
+ sending_status?: "pending" | "unavailable";
1147
+ sending_error?: {
1148
+ code?: "MAIL_DOMAIN_CAPACITY_EXHAUSTED" | "MAIL_PROVIDER_ERROR";
1149
+ retryable?: boolean;
1150
+ };
1151
+ client_settings?: Record<string, unknown>;
1152
+ credential?: {
1153
+ id?: string;
1154
+ label?: string;
1155
+ password?: string;
1156
+ };
1157
+ storage_quota_bytes?: number;
1158
+ created_at?: string;
1028
1159
  hint: string;
1029
1160
  }>;
1030
1161
  /** Create an app password (hosted) (POST /api/emails/{address}/credentials) */
@@ -1065,12 +1196,14 @@ export declare class Domani {
1065
1196
  createWebhook(body: {
1066
1197
  url: string;
1067
1198
  events: string[];
1199
+ headers?: Record<string, unknown>;
1068
1200
  }): Promise<{
1069
1201
  id?: string;
1070
1202
  url?: string;
1071
1203
  events?: string[];
1072
1204
  secret?: string;
1073
1205
  active?: boolean;
1206
+ header_names?: string[];
1074
1207
  created_at?: string;
1075
1208
  hint?: string;
1076
1209
  }>;
@@ -1243,9 +1376,14 @@ export declare class Domani {
1243
1376
  /** Check email DNS status (GET /api/domains/{domain}/email/status) */
1244
1377
  getDomainEmailStatus(domain: string): Promise<{
1245
1378
  domain?: string;
1379
+ enabled?: boolean;
1246
1380
  verified?: boolean;
1381
+ receiving_verified?: boolean;
1382
+ sending_configured?: boolean;
1383
+ sending_verified?: boolean;
1247
1384
  records?: DnsRecord[];
1248
1385
  mailbox_count?: number;
1386
+ hint?: string;
1249
1387
  }>;
1250
1388
  /** Get detailed information about a domain you own (GET /api/domains/{domain}) */
1251
1389
  getDomainInfo(domain: string): Promise<DomainDetail>;
@@ -1374,6 +1512,7 @@ export declare class Domani {
1374
1512
  webhook_url?: string | null;
1375
1513
  signing_secret?: string | null;
1376
1514
  has_webhook?: boolean;
1515
+ header_names?: string[];
1377
1516
  hint?: string;
1378
1517
  }>;
1379
1518
  /** Get a message (GET /api/emails/{address}/messages/{id}) */
@@ -1456,6 +1595,10 @@ export declare class Domani {
1456
1595
  details_submitted?: boolean;
1457
1596
  balance_cents?: number;
1458
1597
  }>;
1598
+ /** Get a public domain profile (GET /api/domains/{domain}/profile) */
1599
+ getPublicDomainProfile(domain: string): Promise<{
1600
+ profile: PublicDomainProfile;
1601
+ }>;
1459
1602
  /** Get referral earnings and history (GET /api/referrals) */
1460
1603
  getReferrals(): Promise<{
1461
1604
  referral_code?: string;
@@ -1770,6 +1913,7 @@ export declare class Domani {
1770
1913
  domain?: string;
1771
1914
  message_count?: number;
1772
1915
  webhook_url?: string | null;
1916
+ header_names?: string[];
1773
1917
  forward_to?: string | null;
1774
1918
  workspace_id?: string | null;
1775
1919
  access_role?: "viewer" | "responder" | "manager";
@@ -1881,6 +2025,7 @@ export declare class Domani {
1881
2025
  id?: string;
1882
2026
  url?: string;
1883
2027
  events?: string[];
2028
+ header_names?: string[];
1884
2029
  active?: boolean;
1885
2030
  created_at?: string;
1886
2031
  }[];
@@ -1985,12 +2130,16 @@ export declare class Domani {
1985
2130
  slug?: string;
1986
2131
  name?: string;
1987
2132
  webhook_url?: string;
2133
+ webhook_headers?: {
2134
+ Authorization?: string;
2135
+ "X-API-Key"?: string;
2136
+ };
1988
2137
  webhook_events?: string[];
1989
2138
  payment_method?: "card" | "usdc" | "balance";
1990
2139
  payment_tx?: string;
1991
2140
  payment_chain?: "base" | "ethereum";
1992
2141
  years?: number;
1993
- }): Promise<unknown>;
2142
+ }): Promise<ProvisionAgentResult>;
1994
2143
  /** Refresh a domain brief from live sources (POST /api/domain-briefs/{id}/refresh) */
1995
2144
  refreshDomainBrief(id: string): Promise<{
1996
2145
  brief: DomainBrief;
@@ -2043,6 +2192,7 @@ export declare class Domani {
2043
2192
  webhook_url?: string | null;
2044
2193
  signing_secret?: string | null;
2045
2194
  has_webhook?: boolean;
2195
+ header_names?: string[];
2046
2196
  hint?: string;
2047
2197
  }>;
2048
2198
  /** Remove an inbound mail rule (DELETE /api/emails/{address}/rules/{ruleId}) */
@@ -2115,6 +2265,12 @@ export declare class Domani {
2115
2265
  requestWorkspaceOwnershipTransfer(id: string, body: {
2116
2266
  membership_id: string;
2117
2267
  }): Promise<unknown>;
2268
+ /** Research or refresh a public domain profile (POST /api/domains/{domain}/profile) */
2269
+ researchPublicDomainProfile(domain: string, query?: {
2270
+ depth?: "instant" | "deep";
2271
+ }): Promise<{
2272
+ profile: PublicDomainProfile;
2273
+ }>;
2118
2274
  /** Resend contact email verification (POST /api/me/resend-verification) */
2119
2275
  resendEmailVerification(body?: {
2120
2276
  email?: string;
@@ -2291,11 +2447,13 @@ export declare class Domani {
2291
2447
  /** Set mailbox webhook (PUT /api/emails/{address}/webhook) */
2292
2448
  setMailboxWebhook(address: string, body: {
2293
2449
  url: string;
2450
+ headers?: Record<string, unknown>;
2294
2451
  }): Promise<{
2295
2452
  address?: string;
2296
2453
  webhook_url?: string;
2297
2454
  signing_secret?: string;
2298
2455
  has_webhook?: boolean;
2456
+ header_names?: string[];
2299
2457
  hint?: string;
2300
2458
  }>;
2301
2459
  /** Set nameservers for a domain (PUT /api/domains/{domain}/nameservers) */
@@ -2322,6 +2480,9 @@ export declare class Domani {
2322
2480
  domain?: string;
2323
2481
  status?: "configured" | "already_configured";
2324
2482
  verified_at?: string | null;
2483
+ receiving_verified?: boolean;
2484
+ sending_configured?: boolean;
2485
+ sending_verified?: boolean;
2325
2486
  records?: DnsRecord[];
2326
2487
  hint?: string;
2327
2488
  }>;
@@ -2523,11 +2684,13 @@ export declare class Domani {
2523
2684
  url?: string;
2524
2685
  events?: string[];
2525
2686
  active?: boolean;
2687
+ headers?: Record<string, unknown>;
2526
2688
  }): Promise<{
2527
2689
  id?: string;
2528
2690
  url?: string;
2529
2691
  events?: string[];
2530
2692
  active?: boolean;
2693
+ header_names?: string[];
2531
2694
  hint?: string;
2532
2695
  }>;
2533
2696
  /** Rename a workspace (PATCH /api/workspaces/{id}) */
package/dist/index.js CHANGED
@@ -372,6 +372,10 @@ class Domani {
372
372
  getPayoutStatus() {
373
373
  return this.request("GET", `/api/billing/connect`, undefined);
374
374
  }
375
+ /** Get a public domain profile (GET /api/domains/{domain}/profile) */
376
+ getPublicDomainProfile(domain) {
377
+ return this.request("GET", `/api/domains/${enc(domain)}/profile`, undefined);
378
+ }
375
379
  /** Get referral earnings and history (GET /api/referrals) */
376
380
  getReferrals() {
377
381
  return this.request("GET", `/api/referrals`, undefined);
@@ -628,6 +632,10 @@ class Domani {
628
632
  requestWorkspaceOwnershipTransfer(id, body) {
629
633
  return this.request("POST", `/api/workspaces/${enc(id)}/ownership-transfer`, { body });
630
634
  }
635
+ /** Research or refresh a public domain profile (POST /api/domains/{domain}/profile) */
636
+ researchPublicDomainProfile(domain, query) {
637
+ return this.request("POST", `/api/domains/${enc(domain)}/profile`, { query });
638
+ }
631
639
  /** Resend contact email verification (POST /api/me/resend-verification) */
632
640
  resendEmailVerification(body) {
633
641
  return this.request("POST", `/api/me/resend-verification`, { body });
package/package.json CHANGED
@@ -1,23 +1,13 @@
1
1
  {
2
2
  "name": "domani",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Official TypeScript SDK for the domani API - domains, email, and identity for AI agents.",
5
- "main": "./src/index.ts",
6
- "types": "./src/index.ts",
5
+ "main": "./dist/index.js",
6
+ "types": "./dist/index.d.ts",
7
7
  "exports": {
8
8
  ".": {
9
- "types": "./src/index.ts",
10
- "default": "./src/index.ts"
11
- }
12
- },
13
- "publishConfig": {
14
- "main": "./dist/index.js",
15
- "types": "./dist/index.d.ts",
16
- "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "default": "./dist/index.js"
20
- }
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
21
11
  }
22
12
  },
23
13
  "files": [
@@ -26,7 +16,9 @@
26
16
  "scripts": {
27
17
  "build": "tsc -p tsconfig.json",
28
18
  "check": "tsc --noEmit",
19
+ "prepare": "npm run build",
29
20
  "test": "vitest run",
21
+ "test:package": "npm run build && node scripts/package-smoke.mjs",
30
22
  "prepublishOnly": "npm run build"
31
23
  },
32
24
  "devDependencies": {