@letterstory/cli 0.176.67 → 0.176.68

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
@@ -85,7 +85,7 @@ import {
85
85
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
86
86
 
87
87
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
88
- export const VERSION = "0.176.67";
88
+ export const VERSION = "0.176.68";
89
89
 
90
90
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
91
91
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -2146,7 +2146,13 @@ export async function run(argv, io = defaultIo()) {
2146
2146
  }
2147
2147
 
2148
2148
  try {
2149
- const config = resolveConfig({ url: str(flags.url), key: str(flags.key) });
2149
+ // A subcommand that declares its own `--key`/`--url` (`automate send --key <event id> --url <page>`) keeps them;
2150
+ // they never become the API key or the API's URL (2026-11-08 E2E: a 401 and a "path not found").
2151
+ const owns = handler.ownFlags?.(positionals[1]) ?? [];
2152
+ const config = resolveConfig({
2153
+ url: owns.includes("url") ? undefined : str(flags.url),
2154
+ key: owns.includes("key") ? undefined : str(flags.key),
2155
+ });
2150
2156
  // A silent refresh mid-command should persist the new tokens so the next
2151
2157
  // invocation doesn't have to refresh again — but only when the config we
2152
2158
  // resolved actually came from a saved OAuth session (a --key/env override
@@ -31,7 +31,7 @@ const TEMPLATES = [
31
31
  "monthly_page_refresh",
32
32
  ];
33
33
  const UNITS = ["hours", "days", "weeks", "months"];
34
- const STATUSES = ["pending", "proposed", "acting", "acted", "skipped", "failed", "rejected"];
34
+ const STATUSES = ["pending", "proposed", "acting", "acted", "answered", "skipped", "failed", "rejected"];
35
35
 
36
36
  const triggerParams = {
37
37
  object: {
@@ -211,6 +211,9 @@ export async function cmdAutomate(ctx) {
211
211
  }
212
212
  }
213
213
 
214
+ /** The global flags a subcommand reads as its own arguments, so the CLI never takes them as its key or URL. */
215
+ cmdAutomate.ownFlags = (sub) => (sub === "send" ? ["key", "url"] : []);
216
+
214
217
  async function run(ctx, tool, said, extra = {}) {
215
218
  const { client, flags, io } = ctx;
216
219
  const result = await client.callTool(tool, { ...argsFromFlags(ARGS[tool], flags, ctx.positionals), ...extra });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.176.67",
3
+ "version": "0.176.68",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",