@hasna/contacts 0.6.27 → 0.6.28

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":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAy6B1D"}
1
+ {"version":3,"file":"crm.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/crm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAezC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA67B1D"}
package/dist/cli/index.js CHANGED
@@ -19330,6 +19330,9 @@ var {
19330
19330
  Help
19331
19331
  } = import__.default;
19332
19332
 
19333
+ // src/cli/index.tsx
19334
+ import chalk7 from "chalk";
19335
+
19333
19336
  // src/cli/commands/core.tsx
19334
19337
  init_store();
19335
19338
  init_paths();
@@ -20779,7 +20782,29 @@ ${items.length} upcoming item(s) in next ${opts.days} days
20779
20782
  `));
20780
20783
  });
20781
20784
  program2.command("stats").description("Network health dashboard").option("-j, --json", "Output JSON").action(async (opts) => {
20782
- const s = await getStore().getNetworkStats();
20785
+ const store = getStore();
20786
+ let s;
20787
+ try {
20788
+ s = await store.getNetworkStats();
20789
+ } catch (err2) {
20790
+ if (!(err2 instanceof Error && err2.name === "ApiUnavailableError"))
20791
+ throw err2;
20792
+ const basic = await store.stats();
20793
+ if (opts.json) {
20794
+ console.log(JSON.stringify({ total_contacts: basic.contacts, total_companies: basic.companies, total_tags: basic.tags, total_groups: basic.groups, extended_metrics: "unavailable_in_self_hosted_mode" }, null, 2));
20795
+ return;
20796
+ }
20797
+ console.log(chalk3.bold.blue(`
20798
+ \u2501\u2501\u2501 Network Health Dashboard \u2501\u2501\u2501
20799
+ `));
20800
+ console.log(chalk3.bold(" Network Size:"));
20801
+ console.log(` ${chalk3.cyan(String(basic.contacts))} contacts ${chalk3.cyan(String(basic.companies))} companies ${chalk3.cyan(String(basic.tags))} tags ${chalk3.cyan(String(basic.groups))} groups`);
20802
+ console.log(chalk3.gray(`
20803
+ (Cold/tasks/deals/pipeline metrics are computed on-box and are not
20804
+ available in self_hosted mode \u2014 run in local mode for the full dashboard.)
20805
+ `));
20806
+ return;
20807
+ }
20783
20808
  if (opts.json) {
20784
20809
  console.log(JSON.stringify(s, null, 2));
20785
20810
  return;
@@ -22204,4 +22229,11 @@ registerAudienceCommands(program);
22204
22229
  registerStorageCommands(program);
22205
22230
  registerWebhookCommands2?.(program, { source: "contacts" });
22206
22231
  registerEventCommands2(program, { source: "contacts", eventsCommandName: "hasna-events" });
22207
- program.parse(process.argv);
22232
+ program.parseAsync(process.argv).catch((err2) => {
22233
+ const message = err2 instanceof Error ? err2.message : String(err2);
22234
+ const isApiUnavailable = err2 instanceof Error && err2.name === "ApiUnavailableError";
22235
+ console.error(`
22236
+ ` + (isApiUnavailable ? chalk7.yellow(message) : chalk7.red(message)) + `
22237
+ `);
22238
+ process.exit(1);
22239
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hasna/contacts",
3
- "version": "0.6.27",
3
+ "version": "0.6.28",
4
4
  "description": "Contact management for AI coding agents — CLI + MCP + Web",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",