@letterstory/cli 0.177.74 → 0.177.75

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.75";
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
@@ -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])))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.74",
3
+ "version": "0.177.75",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",