@letterstory/cli 0.177.74 → 0.177.76

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
@@ -90,7 +90,7 @@ import {
90
90
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
91
91
 
92
92
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
93
- export const VERSION = "0.177.74";
93
+ export const VERSION = "0.177.76";
94
94
 
95
95
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
96
96
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -1913,6 +1913,7 @@ Build (a change to your site, or launching what isn't code; the Build box's own
1913
1913
  Staff only. The same prompt on Letterpress-1 (as Build runs it) and on
1914
1914
  stock Claude Code and stock Codex, each a preview to compare
1915
1915
  build benchmarks [--id <uuid>] [--limit <n>] Staff only. Benchmarks, each arm's state, preview, cost and agent time
1916
+ build capacity [--root <ref>] [--hours n] [--json] Resource limits, active work and queue waits
1916
1917
  build list [--limit <n>] [--site <host>] [--kind build|fix] [--open|--archived] [--from-plan]
1917
1918
  Your builds, newest first, with where each stands
1918
1919
  build status <build-id> One build: each change's state, its preview and pull request
@@ -2127,6 +2128,7 @@ Usage data (what signed-in people do in your own app):
2127
2128
  usage proofs [--id <id>] Read saved proof analysis
2128
2129
  usage find-proofs --since <ISO> --until <ISO> [--focus <text>] Analyze actions
2129
2130
  usage review-proof --analysis-id <id> --card-id <id> --decision approved|dismissed
2131
+ usage instrument --action <words> [--event <name>] [--owner <o> --repo <r>] PR that records an action
2130
2132
  usage discover-actions --since <ISO> --until <ISO> Event inventory from connected PostHog
2131
2133
  usage evaluate-action --since <ISO> --until <ISO> --definition <file.json>
2132
2134
  usage [--days 7|30|90] [--site <id>] [--limit <n>] People, companies and the features they use
@@ -170,6 +170,11 @@ const ARGS = {
170
170
  limit: { flag: "limit", type: "num" },
171
171
  },
172
172
  // `build list` and `build status <id>` / `build follow <id>` (the id positional).
173
+ get_execution_capacity: {
174
+ root_ref: "root",
175
+ hours: { flag: "hours", type: "num" },
176
+ limit: { flag: "limit", type: "num" },
177
+ },
173
178
  list_growth_builds: {
174
179
  id: { positional: 0, label: "build-id" },
175
180
  limit: { flag: "limit", type: "num" },
@@ -354,6 +359,19 @@ export function buildLines(b) {
354
359
  }
355
360
 
356
361
  /** One build by id, or a plain refusal. */
362
+ async function buildCapacity(ctx) {
363
+ const { client, flags, io } = ctx;
364
+ refuseUnknownFlags(ctx, ["root", "hours", "limit"]);
365
+ const result = await client.callTool(
366
+ "get_execution_capacity",
367
+ argsFromFlags(ARGS.get_execution_capacity, flags, [])
368
+ );
369
+ printResult(io, flags, result, (r) =>
370
+ r.pools.map((p) => `${p.resource}: ${p.own_active} active, ${p.own_waiting} waiting`).join("\n")
371
+ );
372
+ return 0;
373
+ }
374
+
357
375
  async function readBuild(client, args) {
358
376
  const result = await client.callTool("list_growth_builds", args);
359
377
  const build = result?.builds?.[0] ?? null;
@@ -508,6 +526,7 @@ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
508
526
  */
509
527
  export function readCommand(positionals) {
510
528
  const [verb, ...rest] = positionals;
529
+ if (verb === "capacity" && rest.length === 0) return buildCapacity;
511
530
  if ((verb === "list" || verb === "conversations") && rest.length === 0)
512
531
  return verb === "list" ? buildList : buildConversations;
513
532
  if (verb === "conversation" && rest.length <= 1 && (rest.length === 0 || UUID.test(rest[0])))
@@ -44,6 +44,15 @@ export const ARGS = {
44
44
  card_id: { flag: "card-id" },
45
45
  decision: { flag: "decision" },
46
46
  },
47
+ instrument_proof_action: {
48
+ action: { flag: "action" },
49
+ event: { flag: "event" },
50
+ repo_owner: { flag: "owner" },
51
+ repo_name: { flag: "repo" },
52
+ provider: { flag: "provider" },
53
+ base_branch: { flag: "base" },
54
+ mode: { flag: "mode" },
55
+ },
47
56
  discover_action_events: { window: { value: (flags) => ({ since: flags.since, until: flags.until }) } },
48
57
  evaluate_action: {
49
58
  window: { value: (flags) => ({ since: flags.since, until: flags.until }) },
@@ -237,6 +246,16 @@ export async function cmdUsage(ctx) {
237
246
  printResult(io, flags, await client.callTool(tool, argsFromFlags(ARGS[tool], flags, [])));
238
247
  return 0;
239
248
  }
249
+ if (ctx.positionals[0] === "instrument") {
250
+ if (!flags.action)
251
+ throw new CliError('Use --action with what the product should record ("a report is delivered").');
252
+ printResult(
253
+ io,
254
+ flags,
255
+ await client.callTool("instrument_proof_action", argsFromFlags(ARGS.instrument_proof_action, flags, []))
256
+ );
257
+ return 0;
258
+ }
240
259
  if (["discover-actions", "evaluate-action"].includes(ctx.positionals[0])) {
241
260
  const tool = ctx.positionals[0] === "discover-actions" ? "discover_action_events" : "evaluate_action";
242
261
  if (!flags.since || !flags.until) throw new CliError("Use --since and --until with ISO timestamps.");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.74",
3
+ "version": "0.177.76",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",