@letterstory/cli 0.177.218 → 0.177.220

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.218";
96
+ export const VERSION = "0.177.220";
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;
@@ -671,7 +671,7 @@ Auth:
671
671
  login [--url <url>] Sign in via your browser; a link over SSH (default url: https://app.letterstory.com)
672
672
  login --device [--url <url>] Sign in with one link, opened in any browser (for agents and remote shells)
673
673
  login --key <ls_…> [--url <url>] Save a static API key instead (for CI/automation)
674
- signup --email <work email> [--agent <name>] [--url <url>]
674
+ signup --email <work email> [--agent <name>] [--site <domain>] [--url <url>]
675
675
  Sign someone up with no account yet: Letter emails them a link,
676
676
  they confirm in a browser, and this saves the new account's session
677
677
  logout Forget saved credentials (revokes an OAuth session, if any)
@@ -2165,6 +2165,7 @@ Repo changes (Claude Code edits your repo in a sandbox; the Letter GitHub App op
2165
2165
  [--detail full] one row per run by default; full: every field
2166
2166
  repo publish <run-id> Make PR on a preview in review
2167
2167
  repo merge <run-id> Merge its open PR (a squash; the repo's branch rules decide)
2168
+ repo keep-open <run-id> Take back a merge asked for; its PR stays open for Merge
2168
2169
  repo revise <run-id> --instructions <text>|--instructions-file <path|->|--review-issues [--copy-edits-file <path|->] [--letter-writes]
2169
2170
  [--attach <path>]… [--attach-ref <path>]… [--attach-url name=url]… [--attach-url-ref name=url]…
2170
2171
  Ask for more on a preview (it takes over the preview's link) or an
@@ -79,6 +79,7 @@ export const ARGS = {
79
79
  start_signup: {
80
80
  email: { flag: "email", required: true },
81
81
  agent: "agent",
82
+ site: "site",
82
83
  },
83
84
  };
84
85
 
@@ -91,6 +92,7 @@ export async function cmdSignup(ctx) {
91
92
  const client = new LetterstoryClient({ url });
92
93
  const start = await client.callTool("start_signup", argsFromFlags(ARGS.start_signup, flags), { keyless: true });
93
94
  io.log(`Letter emailed ${start.email} a link to create their account.`);
95
+ if (start.site) io.log(`Script tag for ${start.site.domain}, counting page views from now:\n${start.site.tag}`);
94
96
  io.log(`Ask them to open it and confirm. Code: ${start.user_code} (the page shows the same one)`);
95
97
  io.log(`${start.free_tokens.note} The confirmation page shows what this account gets.`);
96
98
  io.log("Waiting for them to confirm…");
@@ -6,6 +6,7 @@
6
6
  // repo list → list_repo_changes repo cancel → cancel_repo_change
7
7
  // repo publish → publish_repo_change (Make PR on a preview)
8
8
  // repo merge → merge_repo_change (merge its open PR, as a squash)
9
+ // repo keep-open → keep_repo_change_open (take back a merge asked for; its PR stays open)
9
10
  // repo retry → retry_repo_change (try a failed change again: same ask, fresh run)
10
11
  // repo revise → revise_repo_change (ask for more on a preview or an open PR; --copy-edits-file for exact copy)
11
12
  // repo address-reviews → address_pr_review (answer the review comments on its open PR: fix, reply, resolve)
@@ -316,6 +317,7 @@ const ARGS = {
316
317
  },
317
318
  publish_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
318
319
  merge_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
320
+ keep_repo_change_open: { run_id: { positional: 0, required: true, label: "run-id" } },
319
321
  retry_repo_change: { run_id: { positional: 0, required: true, label: "run-id" } },
320
322
  revise_repo_change: {
321
323
  run_id: { positional: 0, required: true, label: "run-id" },
@@ -446,6 +448,8 @@ export async function cmdRepo(ctx) {
446
448
  return repoPublish(rest);
447
449
  case "merge":
448
450
  return repoMerge(rest);
451
+ case "keep-open":
452
+ return repoKeepOpen(rest);
449
453
  case "retry":
450
454
  return repoRetry(rest);
451
455
  case "revise":
@@ -874,6 +878,18 @@ async function repoMerge(ctx) {
874
878
  return 0;
875
879
  }
876
880
 
881
+ /** `repo keep-open <run-id>`: take back a merge asked for on a change that hasn't merged; its PR waits for Merge. */
882
+ async function repoKeepOpen(ctx) {
883
+ const { client, flags, io } = ctx;
884
+ const result = await client.callTool(
885
+ "keep_repo_change_open",
886
+ argsFromFlags(ARGS.keep_repo_change_open, flags, ctx.positionals)
887
+ );
888
+ ok(ctx, result.message);
889
+ printResult(io, flags, result.run, describe);
890
+ return 0;
891
+ }
892
+
877
893
  /** `repo retry <run-id>`: try a failed change again, as a fresh run with the same ask and options. */
878
894
  async function repoRetry(ctx) {
879
895
  const { client, flags, io } = ctx;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.218",
3
+ "version": "0.177.220",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",