@letterstory/cli 0.177.32 → 0.177.34

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
@@ -88,7 +88,7 @@ import {
88
88
  import { fetchParkedSections, withoutParked } from "./parked.mjs";
89
89
 
90
90
  // Matches cli/package.json; publish-cli.yml rewrites both to the published version.
91
- export const VERSION = "0.177.32";
91
+ export const VERSION = "0.177.34";
92
92
 
93
93
  /** The exit code for a gate refusal (CARD_REQUIRED, PAYMENT_FAILED, OUT_OF_TOKENS): 1 is a plain error. */
94
94
  export const EXIT_PAYMENT_REQUIRED = 3;
@@ -5308,7 +5308,7 @@ const BUILD_FAILURES = "/api/superadmin/build-failures";
5308
5308
  const SUGGESTION_REVIEW = "/api/superadmin/suggestion-review";
5309
5309
  const TURN_ENDINGS = "/api/superadmin/turn-endings";
5310
5310
  const ENGINE_USAGE =
5311
- "Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
5311
+ "Usage: admin letterpress status | gaps | telemetry [--days N] [--harness h] [--all-orgs] | tokens [--days N] [--so-far] [--all-orgs] | prs [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--state merged|open|closed] [--top N] [--tz zone] [--all-orgs] | failures [--days N | --from YYYY-MM-DD [--to YYYY-MM-DD] | --all-time] [--day YYYY-MM-DD] [--org id] [--failure ours|agent|setup|undelivered] [--cause c] [--stopped-at step] [--repo owner/name] [--slow] [--tz zone] [--all-orgs] | blocked [--days N] [--org id] [--all-orgs] | endings [--days N | --since ISO] [--org id,id] [--no-model] [--top N] [--write-cases [--dir evals/letterpress]] | unblock <org-id> <host> <subject> | decisions <org-id> [--site host] [--surface plan|fix|build|site] | undo <org-id> <host> <decision-id> | runs [--status s] [--error-code c] [--first-review-cause agent|context|setup|unknown] [--pr merged|closed|open|none] [--harness h] [--days N] | beyond [--limit N] [--before ISO] | companies | company <org-id> [--site host] | ideas <org-id> [--site host] [--repo connected|none] | suggestions fix|idea [--day YYYY-MM-DD] [--type key [--org id]] [--all-orgs] | suggestions flag fix|idea <type-key> [--org id --item item-id] [--note …] | suggestions clear <flag-id> | facts <org-id> [--site host] | fits [--recipe id] [--org id] [--site host] [--fits yes|no|unknown|waiting] [--limit N] | replay <run-id> | mark <run-id> <item-id> <right|weak|wrong|lead|gap|recipe|clear> [--note …] | settings | set <weights.<ask>.<reading>|lenses.<lens>.bar.<reading>|lenses.<lens>.bar|lenses.<lens>.research.turns|lenses.<lens>.research.ms|asks.<lens>.ask|asks.<lens>.guidance|dismissals.block_days|preflight.off|explore.ask|explore.research.turns|explore.research.ms|explore.every_days> <value>";
5312
5312
 
5313
5313
  /** One number of the settings from a dotted path and a value: the PUT body save_engine_settings reads. */
5314
5314
  function engineSettingsPatch(path, value) {
@@ -5829,16 +5829,22 @@ async function cmdAdminLetterpress(ctx) {
5829
5829
  return 0;
5830
5830
  }
5831
5831
  case "ideas": {
5832
- // list_company_ideas: the rows the company's Ideas tab lists, with the recipe behind each.
5832
+ // list_company_ideas: the rows the company's Ideas tab lists, with the recipe behind each; --repo connected|none
5833
+ // for the what-if (as they would be with or without a repository, decided fresh, never recorded).
5833
5834
  const org = positionals[1];
5834
5835
  if (!org) throw new CliError(ENGINE_USAGE);
5835
5836
  const q = new URLSearchParams({ org_id: org });
5836
5837
  if (flags.site) q.set("domain", String(flags.site));
5838
+ if (flags.repo !== undefined) {
5839
+ if (!["connected", "none"].includes(String(flags.repo)))
5840
+ throw new CliError("--repo is connected or none.");
5841
+ q.set("repo", String(flags.repo));
5842
+ }
5837
5843
  const r = await staffRequest(ctx, "GET", `${LETTERPRESS}-companies/ideas?${q}`);
5838
5844
  printResult(io, flags, r, (x) =>
5839
5845
  x.ideas.length
5840
5846
  ? [
5841
- `${x.host}: ${x.ideas.length} idea${x.ideas.length === 1 ? "" : "s"}${x.status === "ready" ? "" : ` (${x.status})`}`,
5847
+ `${x.host}: ${x.ideas.length} idea${x.ideas.length === 1 ? "" : "s"}${x.status === "ready" ? "" : ` (${x.status})`}${x.repo ? ` [${x.repo.assumed === "connected" ? "with a repo" : "without a repo"}${x.repo.assumed === x.repo.now ? ", as now" : ""}]` : ""}`,
5842
5848
  ...x.ideas.map(
5843
5849
  (i, n) =>
5844
5850
  `${String(n + 1).padStart(2)}. ${i.title}${i.recipe ? ` [${i.recipe}]` : ""}${i.badge ? ` (${i.badge.label})` : ""}\n ${i.detail ?? i.why}`
@@ -8,6 +8,7 @@
8
8
  // letterstory models create "<name>" [--budget <usd>] [--description <d>]
9
9
  // letterstory models show <id>
10
10
  // letterstory models add <id> <url>… [--train]
11
+ // letterstory models material <id> "<material or request>"
11
12
  // letterstory models find <id> "<the writing to find>" [--max <n>]
12
13
  // letterstory models confirm <id> [<link-id>…] [--keep-rest] [--no-train] no link ids: all of them
13
14
  // letterstory models remove <id> <link-id>…
@@ -46,6 +47,11 @@ export const ARGS = {
46
47
  urls: { value: rest(1) },
47
48
  train: { flag: "train", type: "bool" },
48
49
  },
50
+ ingest_writing_model_material: {
51
+ model_id: modelId,
52
+ text: { value: (flags, positionals) => positionals.slice(1).join(" ") },
53
+ documents: { internal: "extract_document then generic mcp call" },
54
+ },
49
55
  add_writing_model_texts: {
50
56
  model_id: modelId,
51
57
  documents: {
@@ -125,6 +131,10 @@ export async function cmdModels(ctx) {
125
131
  }
126
132
  case "show":
127
133
  return modelShow(next, await call(next, "get_writing_model"));
134
+ case "material": {
135
+ refuseUnknownFlags(next, ARGS.ingest_writing_model_material, []);
136
+ return modelShow(next, await call(next, "ingest_writing_model_material"));
137
+ }
128
138
  case "add-text": {
129
139
  refuseUnknownFlags(next, ARGS.add_writing_model_texts, ["title"]);
130
140
  const result = await call(next, "add_writing_model_texts");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.32",
3
+ "version": "0.177.34",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",