@letterstory/cli 0.177.53 → 0.177.54

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.53";
93
+ export const VERSION = "0.177.54";
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;
@@ -2133,6 +2133,7 @@ Models (your own writing models, each trained on writing you give it so it write
2133
2133
  models material-review <id> <request-id> [<selection-id>…] [--cancel]
2134
2134
  Accept this request, or cancel it; never trains
2135
2135
  models material-history <id> [--offset <n>] Earlier material requests
2136
+ models preview <id> [--offset <n>] The training rows a run would build
2136
2137
  models add <id> <url>… [--train] Links to pieces of your writing; --train starts training
2137
2138
  models find <id> "<the writing to find>" [--max <n>] Letter finds the links and proposes them
2138
2139
  models confirm <id> [<link-id>…] [--keep-rest] [--no-train]
@@ -10,6 +10,7 @@
10
10
  // letterstory models add <id> <url>… [--train]
11
11
  // letterstory models upload <id> <file-or-folder>…
12
12
  // letterstory models material <id> "<material or request>"
13
+ // letterstory models preview <id> [--offset <n>] the training set a run would build
13
14
  // letterstory models find <id> "<the writing to find>" [--max <n>]
14
15
  // letterstory models confirm <id> [<link-id>…] [--keep-rest] [--no-train] no link ids: all of them
15
16
  // letterstory models remove <id> <link-id>…
@@ -73,6 +74,7 @@ export const ARGS = {
73
74
  selection_id: "selection",
74
75
  statuses: { flag: "status", type: "list" },
75
76
  },
77
+ preview_writing_model_training: { model_id: modelId, offset: { flag: "offset", type: "num" } },
76
78
  review_writing_model_material: {
77
79
  model_id: modelId,
78
80
  request_id: { positional: 1, required: true, label: "request-id" },
@@ -212,6 +214,21 @@ export async function cmdModels(ctx) {
212
214
  case "material-show":
213
215
  printResult(next.io, next.flags, await call(next, "get_writing_model_material"), (r) => JSON.stringify(r));
214
216
  return 0;
217
+ case "preview": {
218
+ refuseUnknownFlags(next, ARGS.preview_writing_model_training, []);
219
+ printResult(next.io, next.flags, await call(next, "preview_writing_model_training"), (r) =>
220
+ [
221
+ `${r.sources} sources, ${r.pieces} pieces (${r.repeatedPieces} repeated, kept once), ${r.passages} rows, ${r.words} words`,
222
+ `${r.trainRows} to train on, ${r.heldOutRows} held out${r.blockedOn ? `; ${r.blockedOn}` : ""}`,
223
+ ...r.rows.map(
224
+ (row) =>
225
+ `\n--- ${row.title ?? row.sourceId}${row.parts > 1 ? ` (part ${row.part} of ${row.parts})` : ""}, ${row.words} words${row.heldOut ? ", held out" : ""}\n${row.text}${row.truncated ? "\n…" : ""}`
226
+ ),
227
+ ...(r.hasMore ? ["\nMore: --offset"] : []),
228
+ ].join("\n")
229
+ );
230
+ return 0;
231
+ }
215
232
  case "material": {
216
233
  refuseUnknownFlags(next, ARGS.ingest_writing_model_material, []);
217
234
  return modelShow(next, await call(next, "ingest_writing_model_material"));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@letterstory/cli",
3
- "version": "0.177.53",
3
+ "version": "0.177.54",
4
4
  "description": "Spin up and manage Letter phantom blogs from your terminal.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",