@letterstory/cli 0.38.0 → 0.39.0

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
@@ -590,6 +590,20 @@ letterstory insights post <article-id> [--period 14d|30d|90d]
590
590
  letterstory insights top [--period 14d|30d|90d] [--collection <uuid>] [--limit <n>] [--sort clicks|impressions]
591
591
  ```
592
592
 
593
+ AI visibility and page access — the Measure tabs' reads, for scripts and agents:
594
+
595
+ ```bash
596
+ # The AI Visibility Bank: which questions named you, cited your pages, or both (a
597
+ # breakthrough). All time unless --period; --source picks the phantom network
598
+ # (default), your marketing site, or the whole portfolio; --phantom narrows to
599
+ # specific phantom sites (repeatable); --answers caps receipts per question.
600
+ letterstory insights bank [--source phantoms|marketing|all] [--phantom <uuid>]... [--period 14d|30d|90d] [--answers <n>]
601
+
602
+ # Page access: AI answer engines, search crawlers and confirmed human readers on
603
+ # your phantom sites; --collection narrows to the site(s) a collection publishes.
604
+ letterstory insights access [--period 14d|30d|90d] [--collection <uuid>]
605
+ ```
606
+
593
607
  ## Anything else
594
608
 
595
609
  Every Letterstory tool is reachable, not just the ones with a dedicated command group:
package/lib/cli.mjs CHANGED
@@ -50,7 +50,7 @@ import {
50
50
  } from "./commands.mjs";
51
51
 
52
52
  // Keep in sync with cli/package.json.
53
- export const VERSION = "0.38.0";
53
+ export const VERSION = "0.39.0";
54
54
 
55
55
  // Flags that never take a value. Listing them explicitly means `deploy get --json <id>`
56
56
  // can't accidentally swallow the id as --json's value.
@@ -746,6 +746,10 @@ Insights:
746
746
  insights site [--period 14d|30d|90d] [--collection <uuid>]
747
747
  insights post <article-id> [--period 14d|30d|90d]
748
748
  insights top [--period 14d|30d|90d] [--collection <uuid>] [--limit <n>] [--sort clicks|impressions]
749
+ insights bank [--source phantoms|marketing|all] [--phantom <uuid>]... [--period 14d|30d|90d] [--answers <n>]
750
+ AI Visibility Bank: named / cited / breakthrough evidence (all time by default)
751
+ insights access [--period 14d|30d|90d] [--collection <uuid>]
752
+ Page access: who's reading your phantom sites
749
753
 
750
754
  Feedback (tell us what's broken, missing, unclear, or wanted):
751
755
  feedback submit --category bug|missing_feature|unclear|feature_request|praise|other
@@ -1,9 +1,25 @@
1
1
  // `insights` — Search Console impressions/clicks across the phantom network, at the
2
- // network, single-post, and top-posts levels. Ported from phantomstory-cli's
3
- // insights.ts.
2
+ // network, single-post, and top-posts levels (ported from phantomstory-cli's
3
+ // insights.ts); plus Measure's AI Visibility Bank (`bank`) and phantom Page
4
+ // Access (`access`) — the same reads the web app's Measure tabs render.
4
5
 
5
6
  import { CliError } from "../client.mjs";
6
- import { flagStr, flagNum, requirePositional, printResult, compact } from "./shared.mjs";
7
+ import { flagStr, flagNum, requirePositional, printResult, compact, argsFromFlags } from "./shared.mjs";
8
+
9
+ const PERIODS = ["14d", "30d", "90d"];
10
+
11
+ export const ARGS = {
12
+ get_ai_visibility_bank: {
13
+ source: { flag: "source", enum: ["phantoms", "marketing", "all"] },
14
+ phantom_ids: { flag: "phantom", type: "list" },
15
+ period: { flag: "period", enum: PERIODS },
16
+ answers_per_prompt: { flag: "answers", type: "num" },
17
+ },
18
+ get_page_access: {
19
+ period: { flag: "period", enum: PERIODS },
20
+ collection_id: { flag: "collection" },
21
+ },
22
+ };
7
23
 
8
24
  export async function cmdInsights(ctx) {
9
25
  const sub = ctx.positionals[0];
@@ -15,8 +31,12 @@ export async function cmdInsights(ctx) {
15
31
  return insightsPost(rest);
16
32
  case "top":
17
33
  return insightsTop(rest);
34
+ case "bank":
35
+ return call(rest, "get_ai_visibility_bank");
36
+ case "access":
37
+ return call(rest, "get_page_access");
18
38
  default:
19
- throw new CliError(`Unknown insights subcommand: ${sub ?? "(none)"}. Try: site, post, top`);
39
+ throw new CliError(`Unknown insights subcommand: ${sub ?? "(none)"}. Try: site, post, top, bank, access`);
20
40
  }
21
41
  }
22
42
 
@@ -49,3 +69,9 @@ async function insightsTop(ctx) {
49
69
  printResult(io, flags, result);
50
70
  return 0;
51
71
  }
72
+
73
+ async function call(ctx, tool) {
74
+ const result = await ctx.client.callTool(tool, argsFromFlags(ARGS[tool], ctx.flags, ctx.positionals));
75
+ printResult(ctx.io, ctx.flags, result);
76
+ return 0;
77
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "description": "Spin up and manage Letterstory phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",