@letterstory/cli 0.177.184 → 0.177.186

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.184";
96
+ export const VERSION = "0.177.186";
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;
@@ -102,6 +102,7 @@ export const EXIT_PAYMENT_REQUIRED = 3;
102
102
  // can't accidentally swallow the id as --json's value. Every `type: "bool"` flag (and its
103
103
  // `negate` spelling) in a command's ARGS map must be listed; boolean-flags.test.ts enforces it.
104
104
  export const BOOLEAN_FLAGS = new Set([
105
+ "share-website",
105
106
  "background",
106
107
  "directed",
107
108
  "approve",
@@ -12,8 +12,8 @@
12
12
  // letterstory usage database connect (--project <ref> --key <sbp_…> | --url postgres://… | --existing)
13
13
  // --host app.acme.com --schemas public --since … --until … Supabase or any Postgres
14
14
  // letterstory usage shown [--days 1-90] statistics shown to agents, what agents get, who read them
15
- // letterstory usage shown show|hide <choice_id> show a tracked action to agents, or take it off
16
- // letterstory usage shown pr [--repo <owner/name>] [--base <branch>] put them on the website: one build, one pull request
15
+ // letterstory usage shown hide <choice_id> [--snapshot <snapshot_id>] withdraw the current website placement
16
+ // letterstory usage shown pr [--snapshot <id>] [--repo <owner/name>] [--base <branch>] put them on the website: one build, one pull request
17
17
  // letterstory usage shown check [--url <page>] check a page serves them as the data says
18
18
  // letterstory usage case-study [--days 7|30|90] the patterns and the latest case study
19
19
  // letterstory usage case-study generate [--days] [--patterns a,b] [--named [--companies x.com,y.com]]
@@ -51,7 +51,24 @@ const paymentScopeArgs = {
51
51
  };
52
52
 
53
53
  export const ARGS = {
54
- list_evidence_snapshots: { site_id: { flag: "site" } },
54
+ list_evidence_snapshots: {
55
+ site_id: { flag: "site" },
56
+ activity: {
57
+ // Every flag is read up front so the write allowlist sees them, not only after --snapshot.
58
+ value: (flags) => {
59
+ const { snapshot, days, offset } = flags,
60
+ agentSite = flags["agent-site"];
61
+ return snapshot
62
+ ? {
63
+ snapshot_id: snapshot,
64
+ agent_site_id: agentSite,
65
+ days: days ? Number(days) : 30,
66
+ offset: offset ? Number(offset) : 0,
67
+ }
68
+ : undefined;
69
+ },
70
+ },
71
+ },
55
72
  draft_evidence_snapshot: {
56
73
  tracking_from: { flag: "tracking-from" },
57
74
  background: { flag: "background", type: "bool" },
@@ -70,6 +87,8 @@ export const ARGS = {
70
87
  },
71
88
  calculate_evidence_snapshot: { id: { positional: 0, required: true, label: "draft id" } },
72
89
  publish_evidence_snapshot: {
90
+ website: { flag: "share-website", type: "bool" },
91
+ agent_site_id: { flag: "agent-site" },
73
92
  id: { positional: 0, required: true, label: "reviewed draft id" },
74
93
  approve: { value: (flags) => flags.approve === true },
75
94
  },
@@ -112,11 +131,16 @@ export const ARGS = {
112
131
  stop_agent_test: { test_id: { positional: 0, required: true, label: "test_id" } },
113
132
  get_shown_statistics: { days: { flag: "days", type: "num" } },
114
133
  set_shown_statistic: {
134
+ snapshot_id: { flag: "snapshot" },
115
135
  choice_id: { positional: 0, required: true, label: "choice_id" },
116
136
  shown: { value: (_flags, _positionals, extra) => extra.shown === true },
117
137
  },
118
- open_shown_statistics_pr: { repo: { flag: "repo" }, base_branch: { flag: "base" } },
119
- check_shown_statistics_on_site: { url: { flag: "url" } },
138
+ open_shown_statistics_pr: {
139
+ snapshot_id: { flag: "snapshot" },
140
+ repo: { flag: "repo" },
141
+ base_branch: { flag: "base" },
142
+ },
143
+ check_shown_statistics_on_site: { snapshot_id: { flag: "snapshot" }, url: { flag: "url" } },
120
144
  disconnect_usage_payments: {},
121
145
  get_usage_sources: { host: { flag: "host" }, site_id: { flag: "site" } },
122
146
  choose_product_repo: {
@@ -395,8 +419,9 @@ export async function cmdUsage(ctx) {
395
419
  draft: "draft_evidence_snapshot",
396
420
  calculate: "calculate_evidence_snapshot",
397
421
  publish: "publish_evidence_snapshot",
422
+ share: "publish_evidence_snapshot",
398
423
  }[ctx.positionals[1] || "list"];
399
- if (!tool) throw new CliError("Use evidence list, draft, calculate or publish");
424
+ if (!tool) throw new CliError("Use evidence list, draft, calculate or share");
400
425
  printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, ctx.positionals.slice(2))));
401
426
  return 0;
402
427
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.184",
3
+ "version": "0.177.186",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",