@letterstory/cli 0.177.176 → 0.177.178

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.176";
96
+ export const VERSION = "0.177.178";
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,8 @@ 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
+ "background",
106
+ "approve",
105
107
  "update",
106
108
  // repo list: open changes past --limit are listed unless --newest-only.
107
109
  "include-open",
@@ -51,6 +51,28 @@ const paymentScopeArgs = {
51
51
  };
52
52
 
53
53
  export const ARGS = {
54
+ list_evidence_snapshots: { site_id: { flag: "site" } },
55
+ draft_evidence_snapshot: {
56
+ background: { flag: "background", type: "bool" },
57
+ reply: {
58
+ value: (flags) => {
59
+ if (!flags["reply-to"] && !flags.answer) return undefined;
60
+ if (!flags["reply-to"] || !flags.answer) throw new CliError("Use --reply-to and --answer together");
61
+ return { id: flags["reply-to"], answer: flags.answer };
62
+ },
63
+ },
64
+ fresh: { flag: "fresh", type: "bool" },
65
+ choice_id: { flag: "choice" },
66
+ days: { flag: "days", type: "num" },
67
+ site_id: { flag: "site" },
68
+ prompt: { positional: 0, required: true, label: "prompt" },
69
+ },
70
+ calculate_evidence_snapshot: { id: { positional: 0, required: true, label: "draft id" } },
71
+ publish_evidence_snapshot: {
72
+ id: { positional: 0, required: true, label: "reviewed draft id" },
73
+ approve: { value: (flags) => flags.approve === true },
74
+ },
75
+
54
76
  connect_usage_payments: {
55
77
  host: { flag: "host" },
56
78
  restricted_key: {
@@ -364,6 +386,17 @@ export async function cmdUsage(ctx) {
364
386
  printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
365
387
  return 0;
366
388
  }
389
+ if (ctx.positionals[0] === "evidence") {
390
+ const tool = {
391
+ list: "list_evidence_snapshots",
392
+ draft: "draft_evidence_snapshot",
393
+ calculate: "calculate_evidence_snapshot",
394
+ publish: "publish_evidence_snapshot",
395
+ }[ctx.positionals[1] || "list"];
396
+ if (!tool) throw new CliError("Use evidence list, draft, calculate or publish");
397
+ printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, ctx.positionals.slice(2))));
398
+ return 0;
399
+ }
367
400
  if (ctx.positionals[0] === "shown") {
368
401
  const sub = ctx.positionals[1] ?? "status";
369
402
  const rest = ctx.positionals.slice(2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.176",
3
+ "version": "0.177.178",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",