@letterstory/cli 0.177.186 → 0.177.188

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.186";
96
+ export const VERSION = "0.177.188";
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;
@@ -131,6 +131,8 @@ export const BOOLEAN_FLAGS = new Set([
131
131
  // visits export: only the people or companies who fit the ICP, or only those who don't.
132
132
  "icp",
133
133
  "not-icp",
134
+ "project-is-one-app",
135
+ "shared-project",
134
136
  // visits sites: also return each site's script.
135
137
  "install",
136
138
  // org mcp add: the server signs in with OAuth instead of a header value.
@@ -535,6 +537,8 @@ export const BOOLEAN_FLAGS = new Set([
535
537
  "existing",
536
538
  // usage case-study generate --named: name the companies (counts only without it).
537
539
  "named",
540
+ // visits transact site --check-link: read the site for its link to the Agent Site now.
541
+ "check-link",
538
542
  ]);
539
543
 
540
544
  // Tiny argv parser: `--flag value`, `--flag=value`, boolean `--flag`, and positionals.
@@ -2244,7 +2248,8 @@ Evidence (what signed-in people do in your own app):
2244
2248
  usage evaluate-action --since <ISO> --until <ISO> --definition <file.json>
2245
2249
  usage [--days 7|30|90] [--site <id>] [--limit <n>] People, companies and the features they use
2246
2250
  usage --host <app host> What to add to the app before anyone signed in
2247
- usage posthog connect --project <id> --key <phx_…> [--posthog-host <h>] [--host <app host>]
2251
+ usage posthog connect --project <id> --key <phx_…> [--posthog-host <h>] [--host <app host>] [--project-is-one-app]
2252
+ usage posthog connect --project <id> --site <id> --host <app host> [--posthog-host <h>] (--project-is-one-app|--shared-project)
2248
2253
  Connect your PostHog: 90 days now, then every day
2249
2254
  usage posthog [status] | sync [--days 7] | disconnect
2250
2255
  The connection, a sync now, or remove it
@@ -260,6 +260,7 @@ export const ARGS = {
260
260
  dry_run: { flag: "dry-run", type: "bool" },
261
261
  },
262
262
  connect_posthog_usage: {
263
+ project_is_one_app: { flag: "project-is-one-app", negate: "shared-project", type: "bool" },
263
264
  known_internal_accounts: {
264
265
  value: (flags) =>
265
266
  flags["internal-accounts"]
@@ -270,7 +271,10 @@ export const ARGS = {
270
271
  // --key, or POSTHOG_PERSONAL_API_KEY so the key stays out of the shell's history.
271
272
  personal_api_key: {
272
273
  value: (flags) => {
273
- const key = typeof flags.key === "string" ? flags.key : process.env.POSTHOG_PERSONAL_API_KEY;
274
+ if (typeof flags.key === "string") return flags.key;
275
+ if (flags.site && flags.host && (flags["project-is-one-app"] || flags["shared-project"]))
276
+ return undefined;
277
+ const key = process.env.POSTHOG_PERSONAL_API_KEY;
274
278
  if (!key) throw new CliError("posthog connect needs --key (or POSTHOG_PERSONAL_API_KEY).");
275
279
  return key;
276
280
  },
@@ -32,7 +32,7 @@
32
32
  // letterstory visits transact prebuild <site-id>... [--dry-run] staff: build customers' agent sites, Letter paying
33
33
  // letterstory visits transact asks [--since 7d] [--limit 50]
34
34
  // letterstory visits transact learnings [--since 7d]
35
- // letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] [--forget <address>] the Agent Site tab
35
+ // letterstory visits transact site [publish|unpublish] [--domain ask.acme.com | --domain none] [--remove <slug>] [--dismiss "<question>"] [--forget <address>] [--check-link] the Agent Site tab
36
36
 
37
37
  import { CliError } from "../client.mjs";
38
38
  import { flagBool, flagStr, printResult, argsFromFlags } from "./shared.mjs";
@@ -194,7 +194,11 @@ export const ARGS = {
194
194
  tests: { value: (flags) => (flagBool(flags.tests) ? true : undefined) },
195
195
  },
196
196
  visitors_get_transact_learnings: { site_id: "site", host: "host", days },
197
- visitors_get_agent_site: { site_id: "site", host: "host" },
197
+ visitors_get_agent_site: {
198
+ site_id: "site",
199
+ host: "host",
200
+ check_link: { value: (flags) => (flagBool(flags["check-link"]) ? true : undefined) },
201
+ },
198
202
  visitors_prebuild_agent_sites: {
199
203
  site_ids: { value: (flags, positionals) => (positionals.length ? positionals : undefined) },
200
204
  dry_run: { value: (flags) => (flagBool(flags["dry-run"]) ? true : undefined) },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.186",
3
+ "version": "0.177.188",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",