@hasna/domains 0.0.5 → 0.0.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqE5D"}
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2G5D"}
@@ -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;AAWzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAgZ5D"}
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;AAWzC,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoc5D"}
package/dist/cli/index.js CHANGED
@@ -33944,11 +33944,14 @@ function listDomains(options = {}) {
33944
33944
  sql += " WHERE " + conditions.join(" AND ");
33945
33945
  }
33946
33946
  sql += " ORDER BY name";
33947
- if (options.limit) {
33947
+ if (options.limit !== undefined) {
33948
33948
  sql += " LIMIT ?";
33949
33949
  params.push(options.limit);
33950
33950
  }
33951
- if (options.offset) {
33951
+ if (options.offset !== undefined && options.offset > 0) {
33952
+ if (options.limit === undefined) {
33953
+ sql += " LIMIT -1";
33954
+ }
33952
33955
  sql += " OFFSET ?";
33953
33956
  params.push(options.offset);
33954
33957
  }
@@ -42353,10 +42356,25 @@ function resolveContact(opts) {
42353
42356
  // src/cli/commands/domain.ts
42354
42357
  function registerDomainCommand(program2) {
42355
42358
  const domain = program2.command("domain").description("Domain portfolio management");
42356
- domain.command("list").description("List all domains in the portfolio").option("--status <status>", "Filter by status (active/expired/transferring/redemption)").option("--registrar <name>", "Filter by registrar").option("--json", "Output JSON").action((opts) => {
42357
- const domains = listDomains({ status: opts.status, registrar: opts.registrar });
42359
+ domain.command("list").description("List all domains in the portfolio").option("--status <status>", "Filter by status (active/expired/transferring/redemption)").option("--registrar <name>", "Filter by registrar").option("--limit <n>", "Limit number of returned domains").option("--offset <n>", "Skip first N domains", "0").option("-j, --json", "Output JSON").action((opts) => {
42360
+ const limit = opts.limit ? parseInt(opts.limit, 10) : undefined;
42361
+ const offset = opts.offset ? parseInt(opts.offset, 10) : 0;
42362
+ if (limit !== undefined && (!Number.isInteger(limit) || limit < 0)) {
42363
+ console.error("--limit must be a non-negative integer");
42364
+ process.exit(1);
42365
+ }
42366
+ if (!Number.isInteger(offset) || offset < 0) {
42367
+ console.error("--offset must be a non-negative integer");
42368
+ process.exit(1);
42369
+ }
42370
+ const domains = listDomains({
42371
+ status: opts.status,
42372
+ registrar: opts.registrar,
42373
+ limit,
42374
+ offset
42375
+ });
42358
42376
  if (opts.json) {
42359
- console.log(JSON.stringify({ domains, count: domains.length }, null, 2));
42377
+ console.log(JSON.stringify({ domains, count: domains.length, limit: limit ?? null, offset }, null, 2));
42360
42378
  return;
42361
42379
  }
42362
42380
  if (domains.length === 0) {
@@ -42369,8 +42387,11 @@ function registerDomainCommand(program2) {
42369
42387
  }
42370
42388
  console.log(`
42371
42389
  ${domains.length} domain(s)`);
42390
+ if (limit !== undefined || offset > 0) {
42391
+ console.log(`Page: limit=${limit ?? "all"}, offset=${offset}`);
42392
+ }
42372
42393
  });
42373
- domain.command("get <id>").description("Get a domain by ID").option("--json", "Output JSON").action((id, opts) => {
42394
+ domain.command("get <id>").description("Get a domain by ID").option("-j, --json", "Output JSON").action((id, opts) => {
42374
42395
  const d3 = getDomain(id);
42375
42396
  if (!d3) {
42376
42397
  console.error(`Domain '${id}' not found.`);
@@ -42391,7 +42412,7 @@ ${d3.name} [${d3.status}]`);
42391
42412
  console.log(` Notes: ${d3.notes}`);
42392
42413
  console.log();
42393
42414
  });
42394
- domain.command("add").description("Add a domain to the portfolio").requiredOption("--name <name>", "Domain name").option("--registrar <name>", "Registrar name").option("--status <s>", "Status (active/expired/transferring/redemption)", "active").option("--expires <date>", "Expiry date (YYYY-MM-DD)").option("--notes <text>", "Notes").option("--json", "Output JSON").action((opts) => {
42415
+ domain.command("add").description("Add a domain to the portfolio").requiredOption("--name <name>", "Domain name").option("--registrar <name>", "Registrar name").option("--status <s>", "Status (active/expired/transferring/redemption)", "active").option("--expires <date>", "Expiry date (YYYY-MM-DD)").option("--notes <text>", "Notes").option("-j, --json", "Output JSON").action((opts) => {
42395
42416
  const d3 = createDomain({
42396
42417
  name: opts.name,
42397
42418
  registrar: opts.registrar,
@@ -42405,7 +42426,7 @@ ${d3.name} [${d3.status}]`);
42405
42426
  }
42406
42427
  console.log(`Created domain: ${d3.name} (${d3.id})`);
42407
42428
  });
42408
- domain.command("update <id>").description("Update a domain").option("--registrar <name>", "Registrar").option("--status <s>", "Status").option("--expires <date>", "Expiry date").option("--notes <text>", "Notes").option("--json", "Output JSON").action((id, opts) => {
42429
+ domain.command("update <id>").description("Update a domain").option("--registrar <name>", "Registrar").option("--status <s>", "Status").option("--expires <date>", "Expiry date").option("--notes <text>", "Notes").option("-j, --json", "Output JSON").action((id, opts) => {
42409
42430
  const d3 = updateDomain(id, {
42410
42431
  registrar: opts.registrar,
42411
42432
  status: opts.status,
@@ -42422,16 +42443,34 @@ ${d3.name} [${d3.status}]`);
42422
42443
  }
42423
42444
  console.log(`Updated: ${d3.name}`);
42424
42445
  });
42425
- domain.command("delete <id>").description("Delete a domain from the portfolio").action((id) => {
42446
+ domain.command("delete <id>").description("Delete a domain from the portfolio").option("-f, --force", "Required confirmation for destructive delete").option("-j, --json", "Output JSON").action((id, opts) => {
42447
+ if (!opts.force) {
42448
+ const message = `Refusing to delete domain '${id}' without --force.`;
42449
+ if (opts.json) {
42450
+ console.log(JSON.stringify({ deleted: false, id, error: message }, null, 2));
42451
+ } else {
42452
+ console.error(message);
42453
+ console.error("Re-run with --force to confirm deletion.");
42454
+ }
42455
+ process.exit(1);
42456
+ }
42426
42457
  const deleted = deleteDomain(id);
42427
- if (deleted)
42428
- console.log(`Deleted domain ${id}`);
42429
- else {
42430
- console.error(`Domain '${id}' not found.`);
42458
+ if (!deleted) {
42459
+ const message = `Domain '${id}' not found.`;
42460
+ if (opts.json) {
42461
+ console.log(JSON.stringify({ deleted: false, id, error: message }, null, 2));
42462
+ } else {
42463
+ console.error(message);
42464
+ }
42431
42465
  process.exit(1);
42432
42466
  }
42467
+ if (opts.json) {
42468
+ console.log(JSON.stringify({ deleted: true, id }, null, 2));
42469
+ return;
42470
+ }
42471
+ console.log(`Deleted domain ${id}`);
42433
42472
  });
42434
- domain.command("search <query>").description("Search domains by name, registrar, or notes").option("--json", "Output JSON").action((query, opts) => {
42473
+ domain.command("search <query>").description("Search domains by name, registrar, or notes").option("-j, --json", "Output JSON").action((query, opts) => {
42435
42474
  const results = searchDomains(query);
42436
42475
  if (opts.json) {
42437
42476
  console.log(JSON.stringify({ results, count: results.length }, null, 2));
@@ -42442,7 +42481,7 @@ ${d3.name} [${d3.status}]`);
42442
42481
  if (results.length === 0)
42443
42482
  console.log("No results.");
42444
42483
  });
42445
- domain.command("expiring").description("List domains expiring soon").option("--days <n>", "Days threshold", "30").option("--json", "Output JSON").action((opts) => {
42484
+ domain.command("expiring").description("List domains expiring soon").option("--days <n>", "Days threshold", "30").option("-j, --json", "Output JSON").action((opts) => {
42446
42485
  const domains = listExpiring(parseInt(opts.days));
42447
42486
  if (opts.json) {
42448
42487
  console.log(JSON.stringify(domains, null, 2));
@@ -42458,7 +42497,7 @@ Expiring within ${opts.days} days:`);
42458
42497
  console.log(` ${d3.name.padEnd(40)} expires ${(d3.expires_at ?? "").split("T")[0]}`);
42459
42498
  console.log();
42460
42499
  });
42461
- domain.command("stats").description("Show portfolio statistics").option("--json", "Output JSON").action((opts) => {
42500
+ domain.command("stats").description("Show portfolio statistics").option("-j, --json", "Output JSON").action((opts) => {
42462
42501
  const stats = getDomainStats();
42463
42502
  if (opts.json) {
42464
42503
  console.log(JSON.stringify(stats, null, 2));
@@ -42469,7 +42508,7 @@ Expiring within ${opts.days} days:`);
42469
42508
  console.log(` ${k3.replace(/_/g, " ")}: ${v3}`);
42470
42509
  }
42471
42510
  });
42472
- domain.command("whois <name>").description("Run WHOIS lookup and update local DB record").option("--json", "Output JSON").action((name, opts) => {
42511
+ domain.command("whois <name>").description("Run WHOIS lookup and update local DB record").option("-j, --json", "Output JSON").action((name, opts) => {
42473
42512
  const result = whoisLookup(name);
42474
42513
  if (opts.json) {
42475
42514
  console.log(JSON.stringify(result, null, 2));
@@ -43256,29 +43295,41 @@ Configuration (~/.hasna/domains/config.json):`);
43256
43295
  // src/cli/commands/doctor.ts
43257
43296
  import { execSync as execSync2 } from "child_process";
43258
43297
  function registerDoctorCommand(program2) {
43259
- program2.command("doctor").description("Run diagnostics \u2014 check credentials, DB, and provider connectivity").action(async () => {
43298
+ program2.command("doctor").description("Run diagnostics \u2014 check credentials, DB, and provider connectivity").option("--json", "Output structured JSON").action(async (opts) => {
43260
43299
  let passed = 0;
43261
43300
  let failed = 0;
43301
+ const checks = [];
43302
+ let currentSection = "general";
43303
+ function section(name) {
43304
+ currentSection = name;
43305
+ if (!opts.json) {
43306
+ console.log(`
43307
+ \u2500\u2500 ${name} \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
43308
+ }
43309
+ }
43262
43310
  function ok(msg) {
43263
- console.log(` \u2713 ${msg}`);
43311
+ checks.push({ section: currentSection, status: "pass", message: msg });
43312
+ if (!opts.json)
43313
+ console.log(` \u2713 ${msg}`);
43264
43314
  passed++;
43265
43315
  }
43266
43316
  function fail(msg, fix) {
43267
- console.log(` \u2717 ${msg}`);
43268
- if (fix)
43269
- console.log(` \u2192 ${fix}`);
43317
+ checks.push({ section: currentSection, status: "fail", message: msg, fix });
43318
+ if (!opts.json) {
43319
+ console.log(` \u2717 ${msg}`);
43320
+ if (fix)
43321
+ console.log(` \u2192 ${fix}`);
43322
+ }
43270
43323
  failed++;
43271
43324
  }
43272
- console.log(`
43273
- \u2500\u2500 Database \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
43325
+ section("Database");
43274
43326
  try {
43275
43327
  const count = countDomains();
43276
43328
  ok(`Local DB accessible (${count} domain${count !== 1 ? "s" : ""})`);
43277
- } catch (e3) {
43278
- fail("Local DB not accessible", `Check ~/.hasna/domains/domains.db`);
43329
+ } catch {
43330
+ fail("Local DB not accessible", "Check ~/.hasna/domains/domains.db");
43279
43331
  }
43280
- console.log(`
43281
- \u2500\u2500 Config \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
43332
+ section("Config");
43282
43333
  const cfg = loadConfig3();
43283
43334
  if (cfg.default_registrar)
43284
43335
  ok(`default-registrar: ${cfg.default_registrar}`);
@@ -43294,8 +43345,7 @@ function registerDoctorCommand(program2) {
43294
43345
  ok("Registrant contact info complete");
43295
43346
  else
43296
43347
  fail(`Missing contact fields: ${missingContact.join(", ")}`, "domains config set contact.<field> <value>");
43297
- console.log(`
43298
- \u2500\u2500 Providers \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
43348
+ section("Providers");
43299
43349
  const providers = getAvailableProviders().filter((p3) => p3.name !== "brandsight");
43300
43350
  for (const p3 of providers) {
43301
43351
  if (!p3.configured) {
@@ -43320,18 +43370,26 @@ function registerDoctorCommand(program2) {
43320
43370
  }
43321
43371
  }
43322
43372
  }
43323
- console.log(`
43324
- \u2500\u2500 Tools \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500`);
43373
+ section("Tools");
43325
43374
  try {
43326
43375
  execSync2("whois --version 2>/dev/null || whois example.com 2>/dev/null", { timeout: 3000 });
43327
43376
  ok("whois binary found");
43328
43377
  } catch {
43329
43378
  fail("whois not installed", "apt install whois / brew install whois");
43330
43379
  }
43331
- console.log(`
43380
+ if (opts.json) {
43381
+ console.log(JSON.stringify({
43382
+ passed,
43383
+ failed,
43384
+ healthy: failed === 0,
43385
+ checks
43386
+ }, null, 2));
43387
+ } else {
43388
+ console.log(`
43332
43389
  ${"\u2500".repeat(45)}`);
43333
- console.log(` ${passed} passed / ${failed} failed
43390
+ console.log(` ${passed} passed / ${failed} failed
43334
43391
  `);
43392
+ }
43335
43393
  if (failed > 0)
43336
43394
  process.exit(1);
43337
43395
  });
@@ -1 +1 @@
1
- {"version":3,"file":"domain-records.d.ts","sourceRoot":"","sources":["../../src/db/domain-records.ts"],"names":[],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AED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAI3D"}
package/dist/index.js CHANGED
@@ -31899,11 +31899,14 @@ function listDomains(options = {}) {
31899
31899
  sql += " WHERE " + conditions.join(" AND ");
31900
31900
  }
31901
31901
  sql += " ORDER BY name";
31902
- if (options.limit) {
31902
+ if (options.limit !== undefined) {
31903
31903
  sql += " LIMIT ?";
31904
31904
  params.push(options.limit);
31905
31905
  }
31906
- if (options.offset) {
31906
+ if (options.offset !== undefined && options.offset > 0) {
31907
+ if (options.limit === undefined) {
31908
+ sql += " LIMIT -1";
31909
+ }
31907
31910
  sql += " OFFSET ?";
31908
31911
  params.push(options.offset);
31909
31912
  }
package/dist/mcp/index.js CHANGED
@@ -44845,11 +44845,14 @@ function listDomains(options = {}) {
44845
44845
  sql += " WHERE " + conditions.join(" AND ");
44846
44846
  }
44847
44847
  sql += " ORDER BY name";
44848
- if (options.limit) {
44848
+ if (options.limit !== undefined) {
44849
44849
  sql += " LIMIT ?";
44850
44850
  params.push(options.limit);
44851
44851
  }
44852
- if (options.offset) {
44852
+ if (options.offset !== undefined && options.offset > 0) {
44853
+ if (options.limit === undefined) {
44854
+ sql += " LIMIT -1";
44855
+ }
44853
44856
  sql += " OFFSET ?";
44854
44857
  params.push(options.offset);
44855
44858
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/domains",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "Domain portfolio and DNS management for AI agents — CLI + MCP server with SQLite",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",