@letterstory/cli 0.177.160 → 0.177.161

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/lib/cli.mjs CHANGED
@@ -93,7 +93,7 @@ import {
93
93
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
94
94
 
95
95
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
96
- export const VERSION = "0.177.160";
96
+ export const VERSION = "0.177.161";
97
97
 
98
98
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
99
99
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -2126,6 +2126,7 @@ Visits (Visitors: AI agents reading your site, and AI answers sending people to
2126
2126
  visits citations [--since 30d] [--site <id>] Visits that clicked through from ChatGPT, Claude, Perplexity…
2127
2127
  visits who [--icp|--not-icp] [--category <group>] [--path <p>] [--since 30d] [--limit <n>]
2128
2128
  Who was identified, and who fits your ICP
2129
+ visits path <person-id> [--since 30d] [--site <id>] One person's visits, their pages in order, and each one's replay
2129
2130
  visits compare <agent-a> <agent-b> [--since 7d] [--path '/docs/*'] [--purpose <p>]
2130
2131
  Pages one agent read that the other didn't
2131
2132
  visits export [--since 30d] [--format json|csv] [--table agent_visits|citations] [--include agents|people|companies] [--icp|--not-icp]
@@ -10,6 +10,7 @@
10
10
  // letterstory visits citations --since 30d
11
11
  // letterstory visits people --since 30d [--path /pricing] people who read the site, and how many were identified
12
12
  // letterstory visits who --icp [--category Investors] [--path /pricing] who was identified (--icp: who fits your ICP)
13
+ // letterstory visits path <person-id> [--since 30d] one person's visits, their pages in order, and each one's replay
13
14
  // letterstory visits converts [--event signup] [--days 30] which pages lead to a conversion, by lift
14
15
  // letterstory visits retention [--days 90] which features new people used early and came back
15
16
  // letterstory visits export --since 30d --format csv
@@ -80,6 +81,11 @@ export const ARGS = {
80
81
  limit: { flag: "limit", type: "num" },
81
82
  icp: { flag: "icp", type: "bool", negate: "not-icp" },
82
83
  },
84
+ visitors_get_person_path: {
85
+ site_id: "site",
86
+ person_id: { positional: 0, label: "person id (from visits who --json)", required: true },
87
+ days,
88
+ },
83
89
  visitors_admin_coverage: { site_id: "site" },
84
90
  visitors_add_connector: {
85
91
  site_id: "site",
@@ -231,6 +237,8 @@ export async function cmdVisits(ctx) {
231
237
  return visitsPeople(rest);
232
238
  case "who":
233
239
  return visitsWho(rest);
240
+ case "path":
241
+ return visitsPath(rest);
234
242
  case "converts":
235
243
  return visitsConverts(rest);
236
244
  case "retention":
@@ -259,7 +267,7 @@ export async function cmdVisits(ctx) {
259
267
  return visitsTransact(rest);
260
268
  default:
261
269
  throw new CliError(
262
- "Usage: visits [list|requests|citations|people|who|compare|export|sites|domain|pages|health|connect|connectors|disconnect|shortcut|transact]"
270
+ "Usage: visits [list|requests|citations|people|who|path|compare|export|sites|domain|pages|health|connect|connectors|disconnect|shortcut|transact]"
263
271
  );
264
272
  }
265
273
  }
@@ -590,6 +598,24 @@ async function visitsWho(ctx) {
590
598
  return 0;
591
599
  }
592
600
 
601
+ async function visitsPath(ctx) {
602
+ const { flags, io } = ctx;
603
+ const result = await call(ctx, "visitors_get_person_path");
604
+ printResult(io, flags, result, (r) => {
605
+ const lines = [`${r.total} visits in the last ${r.days} days`];
606
+ for (const v of r.visits) {
607
+ const from = v.source ? ` from ${v.source}` : "";
608
+ const replay = v.replay
609
+ ? ` replay ${v.replay.id}${v.replay.confidence === "likely" ? " (likely)" : ""}`
610
+ : "";
611
+ lines.push(` ${v.started_at.slice(0, 16).replace("T", " ")}${from}${replay}`);
612
+ lines.push(` ${v.pages.map((p) => p.path).join(" → ")}`);
613
+ }
614
+ return lines.join("\n");
615
+ });
616
+ return 0;
617
+ }
618
+
593
619
  async function visitsConverts(ctx) {
594
620
  const { flags, io } = ctx;
595
621
  const result = await call(ctx, "visitors_get_conversions");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.160",
3
+ "version": "0.177.161",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",