@letterstory/cli 0.177.58 → 0.177.59
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 +12 -4
- package/lib/commands/models.mjs +16 -4
- package/package.json +1 -1
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.
|
|
93
|
+
export const VERSION = "0.177.59";
|
|
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;
|
|
@@ -474,6 +474,10 @@ export const BOOLEAN_FLAGS = new Set([
|
|
|
474
474
|
"keep-rest",
|
|
475
475
|
"no-train",
|
|
476
476
|
"baselines-only",
|
|
477
|
+
// models update: turn a model on or off for Letterpress. models train: price the run, start nothing.
|
|
478
|
+
"on",
|
|
479
|
+
"off",
|
|
480
|
+
"dry-run",
|
|
477
481
|
// usage case-study generate --named: name the companies (counts only without it).
|
|
478
482
|
"named",
|
|
479
483
|
]);
|
|
@@ -2141,14 +2145,18 @@ Models (your own writing models, each trained on writing you give it so it write
|
|
|
2141
2145
|
models confirm <id> [<link-id>…] [--keep-rest] [--no-train]
|
|
2142
2146
|
Confirm what was found (all, or the ids) and train on it
|
|
2143
2147
|
models remove <id> <link-id>… Take links out of the next version
|
|
2144
|
-
models train <id> [--retry] [--recipe <id>]
|
|
2148
|
+
models train <id> [--retry] [--recipe <id>] [--dry-run]
|
|
2149
|
+
Train the next version (rewrite_v1 by default), or try a stopped one again;
|
|
2150
|
+
--dry-run says what it may cost and starts nothing
|
|
2145
2151
|
models test <id> [--version <n>] [--units <n>] Test a version on held-out writing against Claude with examples
|
|
2146
2152
|
models activate <id> <version> Make a ready version live (a first version is live when it trains)
|
|
2147
2153
|
models stop <id> Stop what is training; what it spent is charged
|
|
2148
|
-
models rewrite <id> "<
|
|
2154
|
+
models rewrite <id-or-handle> "<finished text>" [--for "<what it is>"]
|
|
2155
|
+
Put finished words in its voice: the same piece, never an outline
|
|
2149
2156
|
models compare <id> "<source text>" Compare your model, Astra and Claude + Skill
|
|
2150
2157
|
models write <id> "<what to write>" [--words <n>] Legacy ask-based generation
|
|
2151
|
-
models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>]
|
|
2158
|
+
models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>] [--handle <h>] [--on] [--off]
|
|
2159
|
+
--on: Letterpress may write with it where its description fits
|
|
2152
2160
|
models archive <id> | models restore <id>
|
|
2153
2161
|
|
|
2154
2162
|
Bench (Benches: open-source benchmarks on their own domains, kept running; @letterstory.com only):
|
package/lib/commands/models.mjs
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
// letterstory models stop <id> stop what is training
|
|
21
21
|
// letterstory models write <id> "<what to write>" [--words <n>]
|
|
22
22
|
// letterstory models update <id> [--name <n>] [--budget <usd>] [--description <d>] [--base <base-id>]
|
|
23
|
+
// [--handle <h>] [--on] [--off] turn it on or off for Letterpress
|
|
23
24
|
// letterstory models archive <id> | models restore <id>
|
|
24
25
|
|
|
25
26
|
import { readFileSync, readdirSync, statSync } from "node:fs";
|
|
@@ -48,6 +49,8 @@ export const ARGS = {
|
|
|
48
49
|
description: "description",
|
|
49
50
|
budget_usd: { flag: "budget", type: "num" },
|
|
50
51
|
base_model: "base",
|
|
52
|
+
handle: "handle",
|
|
53
|
+
on: { value: (flags) => (flags.on ? true : flags.off ? false : undefined) },
|
|
51
54
|
archived: { internal: "models archive / models restore" },
|
|
52
55
|
},
|
|
53
56
|
add_writing_model_links: {
|
|
@@ -104,7 +107,13 @@ export const ARGS = {
|
|
|
104
107
|
train: { flag: "no-train", type: "bool", invert: true },
|
|
105
108
|
},
|
|
106
109
|
remove_writing_model_links: { model_id: modelId, source_ids: { value: rest(1) } },
|
|
107
|
-
train_writing_model: {
|
|
110
|
+
train_writing_model: {
|
|
111
|
+
model_id: modelId,
|
|
112
|
+
retry: { flag: "retry", type: "bool" },
|
|
113
|
+
recipe: "recipe",
|
|
114
|
+
dry_run: { flag: "dry-run", type: "bool" },
|
|
115
|
+
accepted_quote: { internal: "a conversation's: the CLI starts a run on the model's budget" },
|
|
116
|
+
},
|
|
108
117
|
activate_writing_model_version: {
|
|
109
118
|
model_id: modelId,
|
|
110
119
|
version: { value: (flags, positionals) => (positionals[1] ? Number(positionals[1]) : undefined) },
|
|
@@ -119,6 +128,7 @@ export const ARGS = {
|
|
|
119
128
|
model_id: modelId,
|
|
120
129
|
text: { value: (flags, positionals) => positionals.slice(1).join(" ").trim() || undefined },
|
|
121
130
|
version: { flag: "version", type: "num" },
|
|
131
|
+
for: "for",
|
|
122
132
|
},
|
|
123
133
|
compare_writing_model: {
|
|
124
134
|
model_id: modelId,
|
|
@@ -162,7 +172,7 @@ export async function cmdModels(ctx) {
|
|
|
162
172
|
return r.models
|
|
163
173
|
.map(
|
|
164
174
|
(m) =>
|
|
165
|
-
`${m.id} ${m.name.slice(0, 28).padEnd(28)} ${(STATE[m.state] ?? m.state).padEnd(17)} ${m.links.confirmed} links${m.version ? ` v${m.version.n}` : ""}`
|
|
175
|
+
`${m.id} ${m.name.slice(0, 28).padEnd(28)} ${(STATE[m.state] ?? m.state).padEnd(17)} ${m.links.confirmed} links${m.version ? ` v${m.version.n}` : ""}${m.handle ? ` letter/${m.handle}` : ""}${m.on ? " on" : ""}`
|
|
166
176
|
)
|
|
167
177
|
.join("\n");
|
|
168
178
|
});
|
|
@@ -295,7 +305,9 @@ export async function cmdModels(ctx) {
|
|
|
295
305
|
case "train": {
|
|
296
306
|
refuseUnknownFlags(next, ARGS.train_writing_model, []);
|
|
297
307
|
const result = await call(next, "train_writing_model");
|
|
298
|
-
printResult(next.io, next.flags, result, (r) =>
|
|
308
|
+
printResult(next.io, next.flags, result, (r) =>
|
|
309
|
+
r.dry_run ? `Would spend up to $${r.budget_usd} (${r.tokens} tokens). Nothing started.` : runLine(r.run)
|
|
310
|
+
);
|
|
299
311
|
return 0;
|
|
300
312
|
}
|
|
301
313
|
case "activate": {
|
|
@@ -345,7 +357,7 @@ export async function cmdModels(ctx) {
|
|
|
345
357
|
return 0;
|
|
346
358
|
}
|
|
347
359
|
case "update":
|
|
348
|
-
refuseUnknownFlags(next, ARGS.update_writing_model, []);
|
|
360
|
+
refuseUnknownFlags(next, ARGS.update_writing_model, ["on", "off"]);
|
|
349
361
|
return modelShow(next, await call(next, "update_writing_model"));
|
|
350
362
|
case "archive":
|
|
351
363
|
case "restore":
|